2012-10-02 18:23:25 +05:30
!--------------------------------------------------------------------------------------------------
2013-03-06 20:11:15 +05:30
! $Id$
2012-10-02 18:23:25 +05:30
!--------------------------------------------------------------------------------------------------
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
2013-03-06 20:11:15 +05:30
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
2012-10-02 18:23:25 +05:30
!> @brief elasticity, plasticity, internal microstructure state
!--------------------------------------------------------------------------------------------------
module constitutive
2013-01-16 15:44:57 +05:30
use prec , only : &
2014-07-02 17:57:39 +05:30
pInt
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
implicit none
private
2014-05-27 20:16:03 +05:30
integer ( pInt ) , public , protected :: &
2015-05-28 22:32:23 +05:30
constitutive_plasticity_maxSizePostResults , &
constitutive_plasticity_maxSizeDotState , &
constitutive_source_maxSizePostResults , &
constitutive_source_maxSizeDotState
2014-06-26 19:23:12 +05:30
2015-10-14 00:22:01 +05:30
public :: &
2013-01-16 15:44:57 +05:30
constitutive_init , &
constitutive_homogenizedC , &
constitutive_microstructure , &
constitutive_LpAndItsTangent , &
2014-11-01 00:33:08 +05:30
constitutive_LiAndItsTangent , &
2015-07-24 20:17:18 +05:30
constitutive_initialFi , &
2013-01-16 15:44:57 +05:30
constitutive_TandItsTangent , &
constitutive_collectDotState , &
constitutive_collectDeltaState , &
constitutive_postResults
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
private :: &
2015-01-05 00:56:33 +05:30
constitutive_hooke_TandItsTangent
2015-10-14 00:22:01 +05:30
2012-03-09 01:55:28 +05:30
contains
2012-10-02 18:23:25 +05:30
!--------------------------------------------------------------------------------------------------
!> @brief allocates arrays pointing to array of the various constitutive modules
!--------------------------------------------------------------------------------------------------
2015-05-28 22:32:23 +05:30
subroutine constitutive_init ( )
2012-10-02 18:23:25 +05:30
use , intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
2014-07-02 17:57:39 +05:30
use prec , only : &
pReal
2013-01-16 15:44:57 +05:30
use debug , only : &
debug_constitutive , &
debug_levelBasic
use numerics , only : &
2015-04-21 21:41:30 +05:30
worldrank
2013-01-16 15:44:57 +05:30
use IO , only : &
IO_error , &
IO_open_file , &
2016-01-16 22:57:19 +05:30
IO_checkAndRewind , &
2013-01-16 15:44:57 +05:30
IO_open_jobFile_stat , &
IO_write_jobFile , &
2013-09-18 19:37:55 +05:30
IO_write_jobIntFile , &
2013-02-25 22:04:59 +05:30
IO_timeStamp
2013-01-16 15:44:57 +05:30
use mesh , only : &
FE_geomtype
use material , only : &
material_phase , &
material_Nphase , &
2015-10-14 00:22:01 +05:30
material_localFileExt , &
material_configFile , &
2013-01-16 15:44:57 +05:30
phase_name , &
phase_plasticity , &
phase_plasticityInstance , &
2015-05-28 22:32:23 +05:30
phase_Nsources , &
phase_source , &
phase_kinematics , &
2014-10-09 19:38:32 +05:30
ELASTICITY_hooke_ID , &
PLASTICITY_none_ID , &
2016-01-09 01:15:20 +05:30
PLASTICITY_isotropic_ID , &
2014-10-09 19:38:32 +05:30
PLASTICITY_j2_ID , &
PLASTICITY_phenopowerlaw_ID , &
2015-10-14 00:22:01 +05:30
PLASTICITY_phenoplus_ID , &
2014-10-09 19:38:32 +05:30
PLASTICITY_dislotwin_ID , &
2015-01-15 16:26:15 +05:30
PLASTICITY_disloucla_ID , &
2014-10-09 19:38:32 +05:30
PLASTICITY_titanmod_ID , &
PLASTICITY_nonlocal_ID , &
2015-05-28 22:32:23 +05:30
SOURCE_thermal_dissipation_ID , &
2015-07-27 16:39:37 +05:30
SOURCE_thermal_externalheat_ID , &
2015-05-28 22:32:23 +05:30
SOURCE_damage_isoBrittle_ID , &
SOURCE_damage_isoDuctile_ID , &
SOURCE_damage_anisoBrittle_ID , &
SOURCE_damage_anisoDuctile_ID , &
SOURCE_vacancy_phenoplasticity_ID , &
SOURCE_vacancy_irradiation_ID , &
SOURCE_vacancy_thermalfluc_ID , &
KINEMATICS_cleavage_opening_ID , &
KINEMATICS_slipplane_opening_ID , &
KINEMATICS_thermal_expansion_ID , &
KINEMATICS_vacancy_strain_ID , &
KINEMATICS_hydrogen_strain_ID , &
2013-11-27 13:34:05 +05:30
ELASTICITY_HOOKE_label , &
PLASTICITY_NONE_label , &
2016-01-09 01:15:20 +05:30
PLASTICITY_ISOTROPIC_label , &
2013-11-27 13:34:05 +05:30
PLASTICITY_J2_label , &
PLASTICITY_PHENOPOWERLAW_label , &
2015-10-14 00:22:01 +05:30
PLASTICITY_PHENOPLUS_label , &
2013-11-27 13:34:05 +05:30
PLASTICITY_DISLOTWIN_label , &
2015-01-15 16:26:15 +05:30
PLASTICITY_DISLOUCLA_label , &
2013-11-27 13:34:05 +05:30
PLASTICITY_TITANMOD_label , &
2014-08-08 16:34:40 +05:30
PLASTICITY_NONLOCAL_label , &
2015-05-28 22:32:23 +05:30
SOURCE_thermal_dissipation_label , &
2015-07-27 16:39:37 +05:30
SOURCE_thermal_externalheat_label , &
2015-05-28 22:32:23 +05:30
SOURCE_damage_isoBrittle_label , &
SOURCE_damage_isoDuctile_label , &
SOURCE_damage_anisoBrittle_label , &
SOURCE_damage_anisoDuctile_label , &
SOURCE_vacancy_phenoplasticity_label , &
SOURCE_vacancy_irradiation_label , &
SOURCE_vacancy_thermalfluc_label , &
2014-05-08 20:25:19 +05:30
plasticState , &
2015-10-14 00:22:01 +05:30
sourceState
2014-08-08 16:34:40 +05:30
2014-12-08 21:25:30 +05:30
use plastic_none
2016-01-09 01:15:20 +05:30
use plastic_isotropic
2014-12-08 21:25:30 +05:30
use plastic_j2
use plastic_phenopowerlaw
2015-10-14 00:22:01 +05:30
use plastic_phenoplus
2014-12-08 21:25:30 +05:30
use plastic_dislotwin
2015-01-15 16:26:15 +05:30
use plastic_disloucla
2014-12-08 21:25:30 +05:30
use plastic_titanmod
use plastic_nonlocal
2015-05-28 22:32:23 +05:30
use source_thermal_dissipation
2015-07-27 16:39:37 +05:30
use source_thermal_externalheat
2015-05-28 22:32:23 +05:30
use source_damage_isoBrittle
use source_damage_isoDuctile
use source_damage_anisoBrittle
use source_damage_anisoDuctile
use source_vacancy_phenoplasticity
use source_vacancy_irradiation
use source_vacancy_thermalfluc
use kinematics_cleavage_opening
use kinematics_slipplane_opening
use kinematics_thermal_expansion
use kinematics_vacancy_strain
use kinematics_hydrogen_strain
2014-10-11 02:25:09 +05:30
2013-01-16 15:44:57 +05:30
implicit none
2013-12-12 22:39:59 +05:30
integer ( pInt ) , parameter :: FILEUNIT = 200_pInt
2013-01-16 15:44:57 +05:30
integer ( pInt ) :: &
2016-01-16 22:57:19 +05:30
o , & !< counter in output loop
p , & !< counter in phase loop
s , & !< counter in source loop
ins !< instance of plasticity/source
2014-05-08 20:25:19 +05:30
2013-01-16 15:44:57 +05:30
integer ( pInt ) , dimension ( : , : ) , pointer :: thisSize
2014-09-26 15:55:26 +05:30
integer ( pInt ) , dimension ( : ) , pointer :: thisNoutput
2013-01-16 15:44:57 +05:30
character ( len = 64 ) , dimension ( : , : ) , pointer :: thisOutput
2013-11-27 13:34:05 +05:30
character ( len = 32 ) :: outputName !< name of output, intermediate fix until HDF5 output is ready
2015-05-28 22:32:23 +05:30
logical :: knownPlasticity , knownSource , nonlocalConstitutionPresent
2013-05-24 19:13:44 +05:30
nonlocalConstitutionPresent = . false .
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2016-01-16 22:57:19 +05:30
! open material.config
2013-12-12 22:39:59 +05:30
if ( . not . IO_open_jobFile_stat ( FILEUNIT , material_localFileExt ) ) & ! no local material configuration present...
call IO_open_file ( FILEUNIT , material_configFile ) ! ... open material.config file
2016-01-16 22:57:19 +05:30
!--------------------------------------------------------------------------------------------------
! parse plasticities from config file
2014-12-08 21:25:30 +05:30
if ( any ( phase_plasticity == PLASTICITY_NONE_ID ) ) call plastic_none_init
2016-01-09 01:15:20 +05:30
if ( any ( phase_plasticity == PLASTICITY_ISOTROPIC_ID ) ) call plastic_isotropic_init ( FILEUNIT )
2014-12-08 21:25:30 +05:30
if ( any ( phase_plasticity == PLASTICITY_J2_ID ) ) call plastic_j2_init ( FILEUNIT )
if ( any ( phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID ) ) call plastic_phenopowerlaw_init ( FILEUNIT )
2015-10-14 00:22:01 +05:30
if ( any ( phase_plasticity == PLASTICITY_PHENOPLUS_ID ) ) call plastic_phenoplus_init ( FILEUNIT )
2014-12-08 21:25:30 +05:30
if ( any ( phase_plasticity == PLASTICITY_DISLOTWIN_ID ) ) call plastic_dislotwin_init ( FILEUNIT )
2015-01-15 16:26:15 +05:30
if ( any ( phase_plasticity == PLASTICITY_DISLOUCLA_ID ) ) call plastic_disloucla_init ( FILEUNIT )
2014-12-08 21:25:30 +05:30
if ( any ( phase_plasticity == PLASTICITY_TITANMOD_ID ) ) call plastic_titanmod_init ( FILEUNIT )
2014-07-08 20:28:23 +05:30
if ( any ( phase_plasticity == PLASTICITY_NONLOCAL_ID ) ) then
2014-12-08 21:25:30 +05:30
call plastic_nonlocal_init ( FILEUNIT )
call plastic_nonlocal_stateInit ( )
2014-07-08 20:28:23 +05:30
endif
2014-09-23 16:08:20 +05:30
!--------------------------------------------------------------------------------------------------
2015-05-28 22:32:23 +05:30
! parse source mechanisms from config file
2016-01-16 22:57:19 +05:30
call IO_checkAndRewind ( FILEUNIT )
2015-05-28 22:32:23 +05:30
if ( any ( phase_source == SOURCE_thermal_dissipation_ID ) ) call source_thermal_dissipation_init ( FILEUNIT )
2015-07-27 16:39:37 +05:30
if ( any ( phase_source == SOURCE_thermal_externalheat_ID ) ) call source_thermal_externalheat_init ( FILEUNIT )
2015-05-28 22:32:23 +05:30
if ( any ( phase_source == SOURCE_damage_isoBrittle_ID ) ) call source_damage_isoBrittle_init ( FILEUNIT )
if ( any ( phase_source == SOURCE_damage_isoDuctile_ID ) ) call source_damage_isoDuctile_init ( FILEUNIT )
if ( any ( phase_source == SOURCE_damage_anisoBrittle_ID ) ) call source_damage_anisoBrittle_init ( FILEUNIT )
if ( any ( phase_source == SOURCE_damage_anisoDuctile_ID ) ) call source_damage_anisoDuctile_init ( FILEUNIT )
if ( any ( phase_source == SOURCE_vacancy_phenoplasticity_ID ) ) call source_vacancy_phenoplasticity_init ( FILEUNIT )
if ( any ( phase_source == SOURCE_vacancy_irradiation_ID ) ) call source_vacancy_irradiation_init ( FILEUNIT )
if ( any ( phase_source == SOURCE_vacancy_thermalfluc_ID ) ) call source_vacancy_thermalfluc_init ( FILEUNIT )
2015-10-14 00:22:01 +05:30
2014-09-23 16:08:20 +05:30
!--------------------------------------------------------------------------------------------------
2015-05-28 22:32:23 +05:30
! parse kinematic mechanisms from config file
2016-01-16 22:57:19 +05:30
call IO_checkAndRewind ( FILEUNIT )
2015-05-28 22:32:23 +05:30
if ( any ( phase_kinematics == KINEMATICS_cleavage_opening_ID ) ) call kinematics_cleavage_opening_init ( FILEUNIT )
if ( any ( phase_kinematics == KINEMATICS_slipplane_opening_ID ) ) call kinematics_slipplane_opening_init ( FILEUNIT )
if ( any ( phase_kinematics == KINEMATICS_thermal_expansion_ID ) ) call kinematics_thermal_expansion_init ( FILEUNIT )
if ( any ( phase_kinematics == KINEMATICS_vacancy_strain_ID ) ) call kinematics_vacancy_strain_init ( FILEUNIT )
if ( any ( phase_kinematics == KINEMATICS_hydrogen_strain_ID ) ) call kinematics_hydrogen_strain_init ( FILEUNIT )
2014-09-23 16:08:20 +05:30
close ( FILEUNIT )
2015-10-14 00:22:01 +05:30
mainProcess : if ( worldrank == 0 ) then
2014-10-10 22:15:14 +05:30
write ( 6 , '(/,a)' ) ' <<<+- constitutive init -+>>>'
write ( 6 , '(a)' ) ' $Id$'
write ( 6 , '(a15,a)' ) ' Current time: ' , IO_timeStamp ( )
2012-10-09 18:04:57 +05:30
#include "compilation_info.f90"
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2016-01-16 22:57:19 +05:30
! write description file for constitutive output
2015-10-14 00:22:01 +05:30
call IO_write_jobFile ( FILEUNIT , 'outputConstitutive' )
2016-01-16 22:57:19 +05:30
PhaseLoop : do p = 1_pInt , material_Nphase
activePhase : if ( any ( material_phase == p ) ) then
ins = phase_plasticityInstance ( p )
knownPlasticity = . true . ! assume valid
plasticityType : select case ( phase_plasticity ( p ) )
case ( PLASTICITY_NONE_ID ) plasticityType
2015-04-21 21:41:30 +05:30
outputName = PLASTICITY_NONE_label
thisNoutput = > null ( )
2016-01-16 22:57:19 +05:30
thisOutput = > null ( )
thisSize = > null ( )
case ( PLASTICITY_ISOTROPIC_ID ) plasticityType
2016-01-09 01:15:20 +05:30
outputName = PLASTICITY_ISOTROPIC_label
thisNoutput = > plastic_isotropic_Noutput
thisOutput = > plastic_isotropic_output
thisSize = > plastic_isotropic_sizePostResult
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_J2_ID ) plasticityType
2015-04-21 21:41:30 +05:30
outputName = PLASTICITY_J2_label
thisNoutput = > plastic_j2_Noutput
thisOutput = > plastic_j2_output
thisSize = > plastic_j2_sizePostResult
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPOWERLAW_ID ) plasticityType
2015-04-21 21:41:30 +05:30
outputName = PLASTICITY_PHENOPOWERLAW_label
thisNoutput = > plastic_phenopowerlaw_Noutput
thisOutput = > plastic_phenopowerlaw_output
thisSize = > plastic_phenopowerlaw_sizePostResult
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPLUS_ID ) plasticityType
2015-10-14 00:22:01 +05:30
outputName = PLASTICITY_PHENOPLUS_label
thisNoutput = > plastic_phenoplus_Noutput
thisOutput = > plastic_phenoplus_output
thisSize = > plastic_phenoplus_sizePostResult
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_DISLOTWIN_ID ) plasticityType
2015-04-21 21:41:30 +05:30
outputName = PLASTICITY_DISLOTWIN_label
thisNoutput = > plastic_dislotwin_Noutput
thisOutput = > plastic_dislotwin_output
thisSize = > plastic_dislotwin_sizePostResult
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_DISLOUCLA_ID ) plasticityType
2015-04-21 21:41:30 +05:30
outputName = PLASTICITY_DISLOUCLA_label
thisNoutput = > plastic_disloucla_Noutput
thisOutput = > plastic_disloucla_output
2015-10-14 00:22:01 +05:30
thisSize = > plastic_disloucla_sizePostResult
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_TITANMOD_ID ) plasticityType
2015-04-21 21:41:30 +05:30
outputName = PLASTICITY_TITANMOD_label
thisNoutput = > plastic_titanmod_Noutput
thisOutput = > plastic_titanmod_output
thisSize = > plastic_titanmod_sizePostResult
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_NONLOCAL_ID ) plasticityType
2015-04-21 21:41:30 +05:30
outputName = PLASTICITY_NONLOCAL_label
thisNoutput = > plastic_nonlocal_Noutput
thisOutput = > plastic_nonlocal_output
thisSize = > plastic_nonlocal_sizePostResult
2016-01-16 22:57:19 +05:30
case default plasticityType
2015-04-21 21:41:30 +05:30
knownPlasticity = . false .
2016-01-16 22:57:19 +05:30
end select plasticityType
write ( FILEUNIT , '(/,a,/)' ) '[' / / trim ( phase_name ( p ) ) / / ']'
2015-04-21 21:41:30 +05:30
if ( knownPlasticity ) then
2016-01-16 22:57:19 +05:30
2015-04-21 21:41:30 +05:30
write ( FILEUNIT , '(a)' ) '(plasticity)' / / char ( 9 ) / / trim ( outputName )
2016-01-16 22:57:19 +05:30
if ( phase_plasticity ( p ) / = PLASTICITY_NONE_ID ) then
OutputPlasticityLoop : do o = 1_pInt , thisNoutput ( ins )
write ( FILEUNIT , '(a,i4)' ) trim ( thisOutput ( o , ins ) ) / / char ( 9 ) , thisSize ( o , ins )
enddo OutputPlasticityLoop
2015-04-21 21:41:30 +05:30
endif
2015-03-25 21:32:30 +05:30
endif
2016-01-16 22:57:19 +05:30
SourceLoop : do s = 1_pInt , phase_Nsources ( p )
knownSource = . true . ! assume valid
sourceType : select case ( phase_source ( s , p ) )
case ( SOURCE_thermal_dissipation_ID ) sourceType
ins = source_thermal_dissipation_instance ( p )
2015-05-28 22:32:23 +05:30
outputName = SOURCE_thermal_dissipation_label
thisNoutput = > source_thermal_dissipation_Noutput
thisOutput = > source_thermal_dissipation_output
thisSize = > source_thermal_dissipation_sizePostResult
2016-01-16 22:57:19 +05:30
case ( SOURCE_thermal_externalheat_ID ) sourceType
ins = source_thermal_externalheat_instance ( p )
2015-07-27 16:39:37 +05:30
outputName = SOURCE_thermal_externalheat_label
thisNoutput = > source_thermal_externalheat_Noutput
thisOutput = > source_thermal_externalheat_output
thisSize = > source_thermal_externalheat_sizePostResult
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_isoBrittle_ID ) sourceType
ins = source_damage_isoBrittle_instance ( p )
2015-05-28 22:32:23 +05:30
outputName = SOURCE_damage_isoBrittle_label
thisNoutput = > source_damage_isoBrittle_Noutput
thisOutput = > source_damage_isoBrittle_output
thisSize = > source_damage_isoBrittle_sizePostResult
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_isoDuctile_ID ) sourceType
ins = source_damage_isoDuctile_instance ( p )
2015-05-28 22:32:23 +05:30
outputName = SOURCE_damage_isoDuctile_label
thisNoutput = > source_damage_isoDuctile_Noutput
thisOutput = > source_damage_isoDuctile_output
thisSize = > source_damage_isoDuctile_sizePostResult
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_anisoBrittle_ID ) sourceType
ins = source_damage_anisoBrittle_instance ( p )
2015-05-28 22:32:23 +05:30
outputName = SOURCE_damage_anisoBrittle_label
thisNoutput = > source_damage_anisoBrittle_Noutput
thisOutput = > source_damage_anisoBrittle_output
thisSize = > source_damage_anisoBrittle_sizePostResult
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_anisoDuctile_ID ) sourceType
ins = source_damage_anisoDuctile_instance ( p )
2015-05-28 22:32:23 +05:30
outputName = SOURCE_damage_anisoDuctile_label
thisNoutput = > source_damage_anisoDuctile_Noutput
thisOutput = > source_damage_anisoDuctile_output
thisSize = > source_damage_anisoDuctile_sizePostResult
2016-01-16 22:57:19 +05:30
case ( SOURCE_vacancy_phenoplasticity_ID ) sourceType
ins = source_vacancy_phenoplasticity_instance ( p )
2015-05-28 22:32:23 +05:30
outputName = SOURCE_vacancy_phenoplasticity_label
thisNoutput = > source_vacancy_phenoplasticity_Noutput
thisOutput = > source_vacancy_phenoplasticity_output
thisSize = > source_vacancy_phenoplasticity_sizePostResult
2016-01-16 22:57:19 +05:30
case ( SOURCE_vacancy_irradiation_ID ) sourceType
ins = source_vacancy_irradiation_instance ( p )
2015-05-28 22:32:23 +05:30
outputName = SOURCE_vacancy_irradiation_label
thisNoutput = > source_vacancy_irradiation_Noutput
thisOutput = > source_vacancy_irradiation_output
thisSize = > source_vacancy_irradiation_sizePostResult
2016-01-16 22:57:19 +05:30
case ( SOURCE_vacancy_thermalfluc_ID ) sourceType
ins = source_vacancy_thermalfluc_instance ( p )
2015-05-28 22:32:23 +05:30
outputName = SOURCE_vacancy_thermalfluc_label
thisNoutput = > source_vacancy_thermalfluc_Noutput
thisOutput = > source_vacancy_thermalfluc_output
thisSize = > source_vacancy_thermalfluc_sizePostResult
2016-01-16 22:57:19 +05:30
case default sourceType
2015-05-28 22:32:23 +05:30
knownSource = . false .
2016-01-16 22:57:19 +05:30
end select sourceType
2015-05-28 22:32:23 +05:30
if ( knownSource ) then
write ( FILEUNIT , '(a)' ) '(source)' / / char ( 9 ) / / trim ( outputName )
2016-01-16 22:57:19 +05:30
OutputSourceLoop : do o = 1_pInt , thisNoutput ( ins )
write ( FILEUNIT , '(a,i4)' ) trim ( thisOutput ( o , ins ) ) / / char ( 9 ) , thisSize ( o , ins )
enddo OutputSourceLoop
2015-04-21 21:41:30 +05:30
endif
2016-01-16 22:57:19 +05:30
enddo SourceLoop
endif activePhase
enddo PhaseLoop
2015-03-25 21:32:30 +05:30
close ( FILEUNIT )
2016-01-16 22:57:19 +05:30
endif mainProcess
2015-10-14 00:22:01 +05:30
2015-05-28 22:32:23 +05:30
constitutive_plasticity_maxSizeDotState = 0_pInt
constitutive_plasticity_maxSizePostResults = 0_pInt
constitutive_source_maxSizeDotState = 0_pInt
constitutive_source_maxSizePostResults = 0_pInt
2014-07-03 18:47:29 +05:30
2016-01-16 22:57:19 +05:30
PhaseLoop2 : do p = 1_pInt , material_Nphase
!--------------------------------------------------------------------------------------------------
! partition and inititalize state
plasticState ( p ) % partionedState0 = plasticState ( p ) % State0
plasticState ( p ) % State = plasticState ( p ) % State0
forall ( s = 1_pInt : phase_Nsources ( p ) )
sourceState ( p ) % p ( s ) % partionedState0 = sourceState ( p ) % p ( s ) % State0
sourceState ( p ) % p ( s ) % State = sourceState ( p ) % p ( s ) % State0
end forall
!--------------------------------------------------------------------------------------------------
! determine max size of state and output
2015-05-28 22:32:23 +05:30
constitutive_plasticity_maxSizeDotState = max ( constitutive_plasticity_maxSizeDotState , &
2016-01-16 22:57:19 +05:30
plasticState ( p ) % sizeDotState )
2015-05-28 22:32:23 +05:30
constitutive_plasticity_maxSizePostResults = max ( constitutive_plasticity_maxSizePostResults , &
2016-01-16 22:57:19 +05:30
plasticState ( p ) % sizePostResults )
2015-05-28 22:32:23 +05:30
constitutive_source_maxSizeDotState = max ( constitutive_source_maxSizeDotState , &
2016-01-16 22:57:19 +05:30
maxval ( sourceState ( p ) % p ( : ) % sizeDotState ) )
2015-05-28 22:32:23 +05:30
constitutive_source_maxSizePostResults = max ( constitutive_source_maxSizePostResults , &
2016-01-16 22:57:19 +05:30
maxval ( sourceState ( p ) % p ( : ) % sizePostResults ) )
2014-07-03 18:47:29 +05:30
enddo PhaseLoop2
2014-06-24 14:54:59 +05:30
2014-05-08 20:25:19 +05:30
2014-07-02 17:57:39 +05:30
#ifdef TODO
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
! report
constitutive_maxSizeState = maxval ( constitutive_sizeState )
2015-05-28 22:32:23 +05:30
constitutive_plasticity_maxSizeDotState = maxval ( constitutive_sizeDotState )
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
if ( iand ( debug_level ( debug_constitutive ) , debug_levelBasic ) / = 0_pInt ) then
2013-11-27 13:34:05 +05:30
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_state0: ' , shape ( constitutive_state0 )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_partionedState0: ' , shape ( constitutive_partionedState0 )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_subState0: ' , shape ( constitutive_subState0 )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_state: ' , shape ( constitutive_state )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_aTolState: ' , shape ( constitutive_aTolState )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_dotState: ' , shape ( constitutive_dotState )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_deltaState: ' , shape ( constitutive_deltaState )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_sizeState: ' , shape ( constitutive_sizeState )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'constitutive_sizeDotState: ' , shape ( constitutive_sizeDotState )
write ( 6 , '(a32,1x,7(i8,1x),/)' ) 'constitutive_sizePostResults: ' , shape ( constitutive_sizePostResults )
write ( 6 , '(a32,1x,7(i8,1x))' ) 'maxSizeState: ' , constitutive_maxSizeState
2015-05-28 22:32:23 +05:30
write ( 6 , '(a32,1x,7(i8,1x))' ) 'maxSizeDotState: ' , constitutive_plasticity_maxSizeDotState
write ( 6 , '(a32,1x,7(i8,1x))' ) 'maxSizePostResults: ' , constitutive_plasticity_maxSizePostResults
2013-01-16 15:44:57 +05:30
endif
flush ( 6 )
2014-07-02 17:57:39 +05:30
#endif
2012-10-02 18:23:25 +05:30
end subroutine constitutive_init
2009-03-06 15:32:36 +05:30
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
!> @brief returns the homogenize elasticity matrix
!--------------------------------------------------------------------------------------------------
2014-07-02 17:57:39 +05:30
function constitutive_homogenizedC ( ipc , ip , el )
use prec , only : &
2015-10-14 00:22:01 +05:30
pReal
2013-01-16 15:44:57 +05:30
use material , only : &
phase_plasticity , &
2013-11-27 13:34:05 +05:30
material_phase , &
PLASTICITY_TITANMOD_ID , &
2014-08-08 16:34:40 +05:30
PLASTICITY_DISLOTWIN_ID , &
2015-04-21 21:41:30 +05:30
PLASTICITY_DISLOUCLA_ID
2014-12-08 21:25:30 +05:30
use plastic_titanmod , only : &
plastic_titanmod_homogenizedC
use plastic_dislotwin , only : &
plastic_dislotwin_homogenizedC
2015-01-15 16:26:15 +05:30
use plastic_disloucla , only : &
plastic_disloucla_homogenizedC
2014-03-09 02:20:31 +05:30
use lattice , only : &
lattice_C66
2009-03-04 19:31:36 +05:30
implicit none
real ( pReal ) , dimension ( 6 , 6 ) :: constitutive_homogenizedC
2013-01-16 15:44:57 +05:30
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2009-03-06 15:32:36 +05:30
2016-01-16 22:57:19 +05:30
plasticityType : select case ( phase_plasticity ( material_phase ( ipc , ip , el ) ) )
case ( PLASTICITY_DISLOTWIN_ID ) plasticityType
2014-12-08 21:25:30 +05:30
constitutive_homogenizedC = plastic_dislotwin_homogenizedC ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_DISLOUCLA_ID ) plasticityType
2015-10-14 00:22:01 +05:30
constitutive_homogenizedC = plastic_disloucla_homogenizedC ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_TITANMOD_ID ) plasticityType
2014-12-08 21:25:30 +05:30
constitutive_homogenizedC = plastic_titanmod_homogenizedC ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case default plasticityType
2014-07-02 17:57:39 +05:30
constitutive_homogenizedC = lattice_C66 ( 1 : 6 , 1 : 6 , material_phase ( ipc , ip , el ) )
2016-01-16 22:57:19 +05:30
end select plasticityType
2009-03-06 15:32:36 +05:30
2012-10-02 18:23:25 +05:30
end function constitutive_homogenizedC
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
!> @brief calls microstructure function of the different constitutive models
!--------------------------------------------------------------------------------------------------
2015-10-14 00:22:01 +05:30
subroutine constitutive_microstructure ( orientations , Fe , Fp , ipc , ip , el )
2014-07-02 17:57:39 +05:30
use prec , only : &
2015-10-14 00:22:01 +05:30
pReal
2013-01-16 15:44:57 +05:30
use material , only : &
phase_plasticity , &
2013-11-27 13:34:05 +05:30
material_phase , &
2015-05-28 22:32:23 +05:30
material_homog , &
temperature , &
thermalMapping , &
2014-10-10 18:12:12 +05:30
PLASTICITY_dislotwin_ID , &
2015-01-15 16:26:15 +05:30
PLASTICITY_disloucla_ID , &
2014-10-10 18:12:12 +05:30
PLASTICITY_titanmod_ID , &
2015-10-14 00:22:01 +05:30
PLASTICITY_nonlocal_ID , &
PLASTICITY_phenoplus_ID
2014-12-08 21:25:30 +05:30
use plastic_titanmod , only : &
plastic_titanmod_microstructure
use plastic_nonlocal , only : &
plastic_nonlocal_microstructure
use plastic_dislotwin , only : &
plastic_dislotwin_microstructure
2015-01-15 16:26:15 +05:30
use plastic_disloucla , only : &
plastic_disloucla_microstructure
2015-10-14 00:22:01 +05:30
use plastic_phenoplus , only : &
plastic_phenoplus_microstructure
2014-06-03 19:16:42 +05:30
2013-01-16 15:44:57 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 3 , 3 ) :: &
Fe , & !< elastic deformation gradient
2015-05-28 22:32:23 +05:30
Fp !< plastic deformation gradient
integer ( pInt ) :: &
2016-01-16 22:57:19 +05:30
ho , & !< homogenization
tme !< thermal member position
2015-10-14 00:22:01 +05:30
real ( pReal ) , intent ( in ) , dimension ( : , : , : , : ) :: &
2016-01-16 22:57:19 +05:30
orientations !< crystal orientations as quaternions
ho = material_homog ( ip , el )
tme = thermalMapping ( ho ) % p ( ip , el )
plasticityType : select case ( phase_plasticity ( material_phase ( ipc , ip , el ) ) )
case ( PLASTICITY_DISLOTWIN_ID ) plasticityType
call plastic_dislotwin_microstructure ( temperature ( ho ) % p ( tme ) , ipc , ip , el )
case ( PLASTICITY_DISLOUCLA_ID ) plasticityType
call plastic_disloucla_microstructure ( temperature ( ho ) % p ( tme ) , ipc , ip , el )
case ( PLASTICITY_TITANMOD_ID ) plasticityType
call plastic_titanmod_microstructure ( temperature ( ho ) % p ( tme ) , ipc , ip , el )
case ( PLASTICITY_NONLOCAL_ID ) plasticityType
2015-05-28 22:32:23 +05:30
call plastic_nonlocal_microstructure ( Fe , Fp , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPLUS_ID ) plasticityType
2015-10-14 00:22:01 +05:30
call plastic_phenoplus_microstructure ( orientations , ipc , ip , el )
2016-01-16 22:57:19 +05:30
end select plasticityType
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
end subroutine constitutive_microstructure
openmp parallelization working again (at least for j2 and nonlocal constitutive model).
In order to keep it like that, please follow these simple rules:
DON'T use implicit array subscripts:
example: real, dimension(3,3) :: A,B
A(:,2) = B(:,1) <--- DON'T USE
A(1:3,2) = B(1:3,1) <--- BETTER USE
In many cases the use of explicit array subscripts is inevitable for parallelization. Additionally, it is an easy means to prevent memory leaks.
Enclose all write statements with the following:
!$OMP CRITICAL (write2out)
<your write statement>
!$OMP END CRITICAL (write2out)
Whenever you change something in the code and are not sure if it affects parallelization and leads to nonconforming behavior, please ask me and/or Franz to check this.
2011-03-17 16:16:17 +05:30
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-10-14 00:22:01 +05:30
!> @brief contains the constitutive equation for calculating the velocity gradient
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-03-06 18:39:00 +05:30
subroutine constitutive_LpAndItsTangent ( Lp , dLp_dTstar3333 , dLp_dFi3333 , Tstar_v , Fi , ipc , ip , el )
2014-07-02 17:57:39 +05:30
use prec , only : &
2015-10-14 00:22:01 +05:30
pReal
2013-10-16 18:34:59 +05:30
use math , only : &
2015-03-06 18:39:00 +05:30
math_mul33x33 , &
math_Mandel6to33 , &
math_Mandel33to6 , &
math_Plain99to3333
2013-01-16 15:44:57 +05:30
use material , only : &
phase_plasticity , &
2013-11-27 13:34:05 +05:30
material_phase , &
2015-05-28 22:32:23 +05:30
material_homog , &
temperature , &
thermalMapping , &
2013-11-27 13:34:05 +05:30
PLASTICITY_NONE_ID , &
2016-01-09 01:15:20 +05:30
PLASTICITY_ISOTROPIC_ID , &
2013-11-27 13:34:05 +05:30
PLASTICITY_J2_ID , &
PLASTICITY_PHENOPOWERLAW_ID , &
2015-10-14 00:22:01 +05:30
PLASTICITY_PHENOPLUS_ID , &
2013-11-27 13:34:05 +05:30
PLASTICITY_DISLOTWIN_ID , &
2015-01-15 16:26:15 +05:30
PLASTICITY_DISLOUCLA_ID , &
2013-11-27 13:34:05 +05:30
PLASTICITY_TITANMOD_ID , &
PLASTICITY_NONLOCAL_ID
2016-01-09 01:15:20 +05:30
use plastic_isotropic , only : &
plastic_isotropic_LpAndItsTangent
2014-12-08 21:25:30 +05:30
use plastic_j2 , only : &
plastic_j2_LpAndItsTangent
use plastic_phenopowerlaw , only : &
2015-01-29 19:26:09 +05:30
plastic_phenopowerlaw_LpAndItsTangent
2015-10-14 00:22:01 +05:30
use plastic_phenoplus , only : &
plastic_phenoplus_LpAndItsTangent
2014-12-08 21:25:30 +05:30
use plastic_dislotwin , only : &
2015-01-29 19:26:09 +05:30
plastic_dislotwin_LpAndItsTangent
2015-01-15 16:26:15 +05:30
use plastic_disloucla , only : &
2015-01-29 19:26:09 +05:30
plastic_disloucla_LpAndItsTangent
2014-12-08 21:25:30 +05:30
use plastic_titanmod , only : &
2015-01-29 19:26:09 +05:30
plastic_titanmod_LpAndItsTangent
2014-12-08 21:25:30 +05:30
use plastic_nonlocal , only : &
2015-01-29 19:26:09 +05:30
plastic_nonlocal_LpAndItsTangent
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 6 ) :: &
Tstar_v !< 2nd Piola-Kirchhoff stress
2015-03-06 18:39:00 +05:30
real ( pReal ) , intent ( in ) , dimension ( 3 , 3 ) :: &
Fi !< intermediate deformation gradient
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( out ) , dimension ( 3 , 3 ) :: &
Lp !< plastic velocity gradient
2015-03-06 18:39:00 +05:30
real ( pReal ) , intent ( out ) , dimension ( 3 , 3 , 3 , 3 ) :: &
dLp_dTstar3333 , & !< derivative of Lp with respect to Tstar (4th-order tensor)
dLp_dFi3333 !< derivative of Lp with respect to Fi (4th-order tensor)
2015-10-14 00:22:01 +05:30
real ( pReal ) , dimension ( 6 ) :: &
2015-03-06 18:39:00 +05:30
Mstar_v !< Mandel stress work conjugate with Lp
real ( pReal ) , dimension ( 9 , 9 ) :: &
dLp_dMstar !< derivative of Lp with respect to Mstar (4th-order tensor)
real ( pReal ) , dimension ( 3 , 3 ) :: &
temp_33
integer ( pInt ) :: &
2016-01-16 22:57:19 +05:30
ho , & !< homogenization
tme !< thermal member position
integer ( pInt ) :: &
i , j
ho = material_homog ( ip , el )
tme = thermalMapping ( ho ) % p ( ip , el )
2014-10-28 08:12:25 +05:30
2016-01-16 22:57:19 +05:30
Mstar_v = math_Mandel33to6 ( math_mul33x33 ( math_mul33x33 ( transpose ( Fi ) , Fi ) , math_Mandel6to33 ( Tstar_v ) ) )
2015-10-14 00:22:01 +05:30
2016-01-16 22:57:19 +05:30
plasticityType : select case ( phase_plasticity ( material_phase ( ipc , ip , el ) ) )
case ( PLASTICITY_NONE_ID ) plasticityType
2013-10-16 18:34:59 +05:30
Lp = 0.0_pReal
2015-03-06 18:39:00 +05:30
dLp_dMstar = 0.0_pReal
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_ISOTROPIC_ID ) plasticityType
2016-01-09 01:15:20 +05:30
call plastic_isotropic_LpAndItsTangent ( Lp , dLp_dMstar , Mstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_J2_ID ) plasticityType
2015-03-06 18:39:00 +05:30
call plastic_j2_LpAndItsTangent ( Lp , dLp_dMstar , Mstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPOWERLAW_ID ) plasticityType
2015-03-06 18:39:00 +05:30
call plastic_phenopowerlaw_LpAndItsTangent ( Lp , dLp_dMstar , Mstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPLUS_ID ) plasticityType
2015-10-14 00:22:01 +05:30
call plastic_phenoplus_LpAndItsTangent ( Lp , dLp_dMstar , Mstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_NONLOCAL_ID ) plasticityType
2015-03-06 18:39:00 +05:30
call plastic_nonlocal_LpAndItsTangent ( Lp , dLp_dMstar , Mstar_v , &
2016-01-16 22:57:19 +05:30
temperature ( ho ) % p ( tme ) , ip , el )
case ( PLASTICITY_DISLOTWIN_ID ) plasticityType
2015-03-06 18:39:00 +05:30
call plastic_dislotwin_LpAndItsTangent ( Lp , dLp_dMstar , Mstar_v , &
2016-01-16 22:57:19 +05:30
temperature ( ho ) % p ( tme ) , ipc , ip , el )
case ( PLASTICITY_DISLOUCLA_ID ) plasticityType
2015-03-06 18:39:00 +05:30
call plastic_disloucla_LpAndItsTangent ( Lp , dLp_dMstar , Mstar_v , &
2016-01-16 22:57:19 +05:30
temperature ( ho ) % p ( tme ) , ipc , ip , el )
case ( PLASTICITY_TITANMOD_ID ) plasticityType
2015-03-06 18:39:00 +05:30
call plastic_titanmod_LpAndItsTangent ( Lp , dLp_dMstar , Mstar_v , &
2016-01-16 22:57:19 +05:30
temperature ( ho ) % p ( tme ) , ipc , ip , el )
end select plasticityType
2015-03-06 18:39:00 +05:30
dLp_dTstar3333 = math_Plain99to3333 ( dLp_dMstar )
temp_33 = math_mul33x33 ( Fi , math_Mandel6to33 ( Tstar_v ) )
2016-01-16 22:57:19 +05:30
forall ( i = 1_pInt : 3_pInt , j = 1_pInt : 3_pInt ) &
dLp_dFi3333 ( i , j , 1 : 3 , 1 : 3 ) = math_mul33x33 ( temp_33 , transpose ( dLp_dTstar3333 ( i , j , 1 : 3 , 1 : 3 ) ) ) + &
2015-03-06 18:39:00 +05:30
math_mul33x33 ( math_mul33x33 ( Fi , dLp_dTstar3333 ( i , j , 1 : 3 , 1 : 3 ) ) , math_Mandel6to33 ( Tstar_v ) )
2016-01-16 22:57:19 +05:30
temp_33 = math_mul33x33 ( transpose ( Fi ) , Fi )
forall ( i = 1_pInt : 3_pInt , j = 1_pInt : 3_pInt ) &
2015-03-06 18:39:00 +05:30
dLp_dTstar3333 ( i , j , 1 : 3 , 1 : 3 ) = math_mul33x33 ( temp_33 , dLp_dTstar3333 ( i , j , 1 : 3 , 1 : 3 ) )
2015-10-14 00:22:01 +05:30
2012-10-02 18:23:25 +05:30
end subroutine constitutive_LpAndItsTangent
2009-03-06 15:32:36 +05:30
2014-11-01 00:33:08 +05:30
!--------------------------------------------------------------------------------------------------
2015-10-14 00:22:01 +05:30
!> @brief contains the constitutive equation for calculating the velocity gradient
2014-11-01 00:33:08 +05:30
!--------------------------------------------------------------------------------------------------
2015-05-28 22:32:23 +05:30
subroutine constitutive_LiAndItsTangent ( Li , dLi_dTstar3333 , dLi_dFi3333 , Tstar_v , Fi , ipc , ip , el )
2014-11-01 00:33:08 +05:30
use prec , only : &
2015-10-14 00:22:01 +05:30
pReal
2015-03-06 18:39:00 +05:30
use math , only : &
math_I3 , &
math_inv33 , &
math_det33 , &
math_mul33x33
2014-11-01 00:33:08 +05:30
use material , only : &
2016-01-09 01:15:20 +05:30
phase_plasticity , &
material_phase , &
material_homog , &
2016-01-15 05:49:44 +05:30
phaseAt , phasememberAt , &
2015-05-28 22:32:23 +05:30
phase_kinematics , &
phase_Nkinematics , &
2016-01-09 01:15:20 +05:30
PLASTICITY_isotropic_ID , &
2015-05-28 22:32:23 +05:30
KINEMATICS_cleavage_opening_ID , &
KINEMATICS_slipplane_opening_ID , &
KINEMATICS_thermal_expansion_ID , &
KINEMATICS_vacancy_strain_ID , &
KINEMATICS_hydrogen_strain_ID
2016-01-09 01:15:20 +05:30
use plastic_isotropic , only : &
plastic_isotropic_LiAndItsTangent
2015-05-28 22:32:23 +05:30
use kinematics_cleavage_opening , only : &
kinematics_cleavage_opening_LiAndItsTangent
use kinematics_slipplane_opening , only : &
kinematics_slipplane_opening_LiAndItsTangent
use kinematics_thermal_expansion , only : &
kinematics_thermal_expansion_LiAndItsTangent
use kinematics_vacancy_strain , only : &
kinematics_vacancy_strain_LiAndItsTangent
use kinematics_hydrogen_strain , only : &
kinematics_hydrogen_strain_LiAndItsTangent
2015-10-14 00:22:01 +05:30
2014-11-01 00:33:08 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2014-11-01 00:33:08 +05:30
real ( pReal ) , intent ( in ) , dimension ( 6 ) :: &
Tstar_v !< 2nd Piola-Kirchhoff stress
real ( pReal ) , intent ( in ) , dimension ( 3 , 3 ) :: &
2015-05-28 22:32:23 +05:30
Fi !< intermediate deformation gradient
2014-11-01 00:33:08 +05:30
real ( pReal ) , intent ( out ) , dimension ( 3 , 3 ) :: &
Li !< intermediate velocity gradient
2015-03-06 18:39:00 +05:30
real ( pReal ) , intent ( out ) , dimension ( 3 , 3 , 3 , 3 ) :: &
dLi_dTstar3333 , & !< derivative of Li with respect to Tstar (4th-order tensor)
dLi_dFi3333
2014-11-01 00:33:08 +05:30
real ( pReal ) , dimension ( 3 , 3 ) :: &
2015-05-28 22:32:23 +05:30
my_Li !< intermediate velocity gradient
2015-03-06 18:39:00 +05:30
real ( pReal ) , dimension ( 3 , 3 , 3 , 3 ) :: &
2015-10-14 00:22:01 +05:30
my_dLi_dTstar
2015-03-06 18:39:00 +05:30
real ( pReal ) , dimension ( 3 , 3 ) :: &
FiInv , &
temp_33
real ( pReal ) :: &
detFi
integer ( pInt ) :: &
2016-01-16 22:57:19 +05:30
k !< counter in kinematics loop
integer ( pInt ) :: &
i , j
2014-11-01 00:33:08 +05:30
Li = 0.0_pReal
2015-03-06 18:39:00 +05:30
dLi_dTstar3333 = 0.0_pReal
dLi_dFi3333 = 0.0_pReal
2015-10-14 00:22:01 +05:30
2016-01-16 22:57:19 +05:30
plasticityType : select case ( phase_plasticity ( material_phase ( ipc , ip , el ) ) )
case ( PLASTICITY_isotropic_ID ) plasticityType
2016-01-09 01:15:20 +05:30
call plastic_isotropic_LiAndItsTangent ( my_Li , my_dLi_dTstar , Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case default plasticityType
2016-01-09 01:15:20 +05:30
my_Li = 0.0_pReal
my_dLi_dTstar = 0.0_pReal
2016-01-16 22:57:19 +05:30
end select plasticityType
2016-01-09 01:15:20 +05:30
Li = Li + my_Li
dLi_dTstar3333 = dLi_dTstar3333 + my_dLi_dTstar
2016-01-16 22:57:19 +05:30
KinematicsLoop : do k = 1_pInt , phase_Nkinematics ( material_phase ( ipc , ip , el ) )
kinematicsType : select case ( phase_kinematics ( k , material_phase ( ipc , ip , el ) ) )
case ( KINEMATICS_cleavage_opening_ID ) kinematicsType
2015-05-28 22:32:23 +05:30
call kinematics_cleavage_opening_LiAndItsTangent ( my_Li , my_dLi_dTstar , Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( KINEMATICS_slipplane_opening_ID ) kinematicsType
2015-05-28 22:32:23 +05:30
call kinematics_slipplane_opening_LiAndItsTangent ( my_Li , my_dLi_dTstar , Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( KINEMATICS_thermal_expansion_ID ) kinematicsType
2015-05-28 22:32:23 +05:30
call kinematics_thermal_expansion_LiAndItsTangent ( my_Li , my_dLi_dTstar , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( KINEMATICS_vacancy_strain_ID ) kinematicsType
2015-05-28 22:32:23 +05:30
call kinematics_vacancy_strain_LiAndItsTangent ( my_Li , my_dLi_dTstar , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( KINEMATICS_hydrogen_strain_ID ) kinematicsType
2015-05-28 22:32:23 +05:30
call kinematics_hydrogen_strain_LiAndItsTangent ( my_Li , my_dLi_dTstar , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case default kinematicsType
2015-05-28 22:32:23 +05:30
my_Li = 0.0_pReal
my_dLi_dTstar = 0.0_pReal
2016-01-16 22:57:19 +05:30
end select kinematicsType
2015-05-28 22:32:23 +05:30
Li = Li + my_Li
dLi_dTstar3333 = dLi_dTstar3333 + my_dLi_dTstar
2016-01-16 22:57:19 +05:30
enddo KinematicsLoop
2014-11-01 00:33:08 +05:30
2015-03-06 18:39:00 +05:30
FiInv = math_inv33 ( Fi )
detFi = math_det33 ( Fi )
Li = math_mul33x33 ( math_mul33x33 ( Fi , Li ) , FiInv ) * detFi !< push forward to intermediate configuration
temp_33 = math_mul33x33 ( FiInv , Li )
2016-01-16 22:57:19 +05:30
forall ( i = 1_pInt : 3_pInt , j = 1_pInt : 3_pInt )
2015-03-06 18:39:00 +05:30
dLi_dTstar3333 ( 1 : 3 , 1 : 3 , i , j ) = math_mul33x33 ( math_mul33x33 ( Fi , dLi_dTstar3333 ( 1 : 3 , 1 : 3 , i , j ) ) , FiInv ) * detFi
dLi_dFi3333 ( 1 : 3 , 1 : 3 , i , j ) = dLi_dFi3333 ( 1 : 3 , 1 : 3 , i , j ) + Li * FiInv ( j , i )
dLi_dFi3333 ( 1 : 3 , i , 1 : 3 , j ) = dLi_dFi3333 ( 1 : 3 , i , 1 : 3 , j ) + math_I3 * temp_33 ( j , i ) + Li * FiInv ( j , i )
2016-01-16 22:57:19 +05:30
end forall
2015-10-14 00:22:01 +05:30
2015-03-06 18:39:00 +05:30
end subroutine constitutive_LiAndItsTangent
2014-11-01 00:33:08 +05:30
openmp parallelization working again (at least for j2 and nonlocal constitutive model).
In order to keep it like that, please follow these simple rules:
DON'T use implicit array subscripts:
example: real, dimension(3,3) :: A,B
A(:,2) = B(:,1) <--- DON'T USE
A(1:3,2) = B(1:3,1) <--- BETTER USE
In many cases the use of explicit array subscripts is inevitable for parallelization. Additionally, it is an easy means to prevent memory leaks.
Enclose all write statements with the following:
!$OMP CRITICAL (write2out)
<your write statement>
!$OMP END CRITICAL (write2out)
Whenever you change something in the code and are not sure if it affects parallelization and leads to nonconforming behavior, please ask me and/or Franz to check this.
2011-03-17 16:16:17 +05:30
2015-07-24 20:17:18 +05:30
!--------------------------------------------------------------------------------------------------
2015-10-14 00:22:01 +05:30
!> @brief collects initial intermediate deformation gradient
2015-07-24 20:17:18 +05:30
!--------------------------------------------------------------------------------------------------
pure function constitutive_initialFi ( ipc , ip , el )
use prec , only : &
2015-10-14 00:22:01 +05:30
pReal
2015-07-24 20:17:18 +05:30
use math , only : &
math_I3 , &
math_inv33 , &
math_mul33x33
use material , only : &
phase_kinematics , &
phase_Nkinematics , &
material_phase , &
KINEMATICS_thermal_expansion_ID , &
KINEMATICS_vacancy_strain_ID , &
KINEMATICS_hydrogen_strain_ID
use kinematics_thermal_expansion , only : &
kinematics_thermal_expansion_initialStrain
use kinematics_vacancy_strain , only : &
kinematics_vacancy_strain_initialStrain
use kinematics_hydrogen_strain , only : &
kinematics_hydrogen_strain_initialStrain
2015-10-14 00:22:01 +05:30
2015-07-24 20:17:18 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2015-07-24 20:17:18 +05:30
real ( pReal ) , dimension ( 3 , 3 ) :: &
constitutive_initialFi !< composite initial intermediate deformation gradient
integer ( pInt ) :: &
2016-01-16 22:57:19 +05:30
k !< counter in kinematics loop
2015-07-24 20:17:18 +05:30
constitutive_initialFi = math_I3
2015-10-14 00:22:01 +05:30
2016-01-16 22:57:19 +05:30
KinematicsLoop : do k = 1_pInt , phase_Nkinematics ( material_phase ( ipc , ip , el ) ) !< Warning: small initial strain assumption
kinematicsType : select case ( phase_kinematics ( k , material_phase ( ipc , ip , el ) ) )
case ( KINEMATICS_thermal_expansion_ID ) kinematicsType
2015-07-24 20:17:18 +05:30
constitutive_initialFi = &
constitutive_initialFi + kinematics_thermal_expansion_initialStrain ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( KINEMATICS_vacancy_strain_ID ) kinematicsType
2015-07-24 20:17:18 +05:30
constitutive_initialFi = &
constitutive_initialFi + kinematics_vacancy_strain_initialStrain ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( KINEMATICS_hydrogen_strain_ID ) kinematicsType
2015-07-24 20:17:18 +05:30
constitutive_initialFi = &
constitutive_initialFi + kinematics_hydrogen_strain_initialStrain ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
end select kinematicsType
enddo KinematicsLoop
2015-10-14 00:22:01 +05:30
2015-07-24 20:17:18 +05:30
end function constitutive_initialFi
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-10-14 00:22:01 +05:30
!> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to
2013-10-14 16:24:45 +05:30
!> the elastic deformation gradient depending on the selected elastic law (so far no case switch
!! because only hooke is implemented
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-03-06 18:39:00 +05:30
subroutine constitutive_TandItsTangent ( T , dT_dFe , dT_dFi , Fe , Fi , ipc , ip , el )
2014-07-02 17:57:39 +05:30
use prec , only : &
pReal
2013-01-16 15:44:57 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 3 , 3 ) :: &
2015-03-06 18:39:00 +05:30
Fe , & !< elastic deformation gradient
Fi !< intermediate deformation gradient
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( out ) , dimension ( 3 , 3 ) :: &
T !< 2nd Piola-Kirchhoff stress tensor
real ( pReal ) , intent ( out ) , dimension ( 3 , 3 , 3 , 3 ) :: &
2015-03-06 18:39:00 +05:30
dT_dFe , & !< derivative of 2nd P-K stress with respect to elastic deformation gradient
dT_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient
2015-10-14 00:22:01 +05:30
2015-03-06 18:39:00 +05:30
call constitutive_hooke_TandItsTangent ( T , dT_dFe , dT_dFi , Fe , Fi , ipc , ip , el )
2013-10-14 16:24:45 +05:30
2015-10-14 00:22:01 +05:30
2012-10-02 18:23:25 +05:30
end subroutine constitutive_TandItsTangent
2012-03-15 15:21:33 +05:30
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-10-14 00:22:01 +05:30
!> @brief returns the 2nd Piola-Kirchhoff stress tensor and its tangent with respect to
2013-10-14 20:05:41 +05:30
!> the elastic deformation gradient using hookes law
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-03-06 18:39:00 +05:30
subroutine constitutive_hooke_TandItsTangent ( T , dT_dFe , dT_dFi , Fe , Fi , ipc , ip , el )
2014-07-02 17:57:39 +05:30
use prec , only : &
pReal
use math , only : &
math_mul3x3 , &
math_mul33x33 , &
math_mul3333xx33 , &
math_Mandel66to3333 , &
2014-08-09 03:59:38 +05:30
math_trace33 , &
math_I3
2015-05-28 22:32:23 +05:30
use material , only : &
material_phase , &
material_homog , &
phase_NstiffnessDegradations , &
phase_stiffnessDegradation , &
damage , &
damageMapping , &
porosity , &
2015-10-14 00:22:01 +05:30
porosityMapping , &
2015-05-28 22:32:23 +05:30
STIFFNESS_DEGRADATION_damage_ID , &
STIFFNESS_DEGRADATION_porosity_ID
2012-11-07 21:13:29 +05:30
2013-01-16 15:44:57 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 3 , 3 ) :: &
2015-03-06 18:39:00 +05:30
Fe , & !< elastic deformation gradient
Fi !< intermediate deformation gradient
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( out ) , dimension ( 3 , 3 ) :: &
2015-03-06 18:39:00 +05:30
T !< 2nd Piola-Kirchhoff stress tensor in lattice configuration
real ( pReal ) , intent ( out ) , dimension ( 3 , 3 , 3 , 3 ) :: &
dT_dFe , & !< derivative of 2nd P-K stress with respect to elastic deformation gradient
dT_dFi !< derivative of 2nd P-K stress with respect to intermediate deformation gradient
real ( pReal ) , dimension ( 3 , 3 ) :: E
2014-08-09 03:59:38 +05:30
real ( pReal ) , dimension ( 3 , 3 , 3 , 3 ) :: C
2016-01-16 22:57:19 +05:30
integer ( pInt ) :: &
ho , & !< homogenization
d !< counter in degradation loop
integer ( pInt ) :: &
i , j
ho = material_homog ( ip , el )
2014-08-09 03:59:38 +05:30
2015-05-28 22:32:23 +05:30
C = math_Mandel66to3333 ( constitutive_homogenizedC ( ipc , ip , el ) )
2016-01-16 22:57:19 +05:30
DegradationLoop : do d = 1_pInt , phase_NstiffnessDegradations ( material_phase ( ipc , ip , el ) )
degradationType : select case ( phase_stiffnessDegradation ( d , material_phase ( ipc , ip , el ) ) )
case ( STIFFNESS_DEGRADATION_damage_ID ) degradationType
C = C * damage ( ho ) % p ( damageMapping ( ho ) % p ( ip , el ) ) ** 2_pInt
case ( STIFFNESS_DEGRADATION_porosity_ID ) degradationType
C = C * porosity ( ho ) % p ( porosityMapping ( ho ) % p ( ip , el ) ) ** 2_pInt
end select degradationType
enddo DegradationLoop
E = 0.5_pReal * ( math_mul33x33 ( transpose ( Fe ) , Fe ) - math_I3 ) !< Green-Lagrange strain in unloaded configuration
T = math_mul3333xx33 ( C , math_mul33x33 ( math_mul33x33 ( transpose ( Fi ) , E ) , Fi ) ) !< 2PK stress in lattice configuration in work conjugate with GL strain pulled back to lattice configuration
2015-10-14 00:22:01 +05:30
2014-09-23 02:08:19 +05:30
dT_dFe = 0.0_pReal
2015-03-06 18:39:00 +05:30
forall ( i = 1_pInt : 3_pInt , j = 1_pInt : 3_pInt )
dT_dFe ( i , j , 1 : 3 , 1 : 3 ) = &
2016-01-16 22:57:19 +05:30
math_mul33x33 ( Fe , math_mul33x33 ( math_mul33x33 ( Fi , C ( i , j , 1 : 3 , 1 : 3 ) ) , transpose ( Fi ) ) ) !< dT_ij/dFe_kl = C_ijmn * Fi_lm * Fi_on * Fe_ko
2015-10-14 00:22:01 +05:30
dT_dFi ( i , j , 1 : 3 , 1 : 3 ) = 2.0_pReal * math_mul33x33 ( math_mul33x33 ( E , Fi ) , C ( i , j , 1 : 3 , 1 : 3 ) ) !< dT_ij/dFi_kl = C_ijln * E_km * Fe_mn
2015-03-06 18:39:00 +05:30
end forall
2015-10-14 00:22:01 +05:30
2012-03-15 15:21:33 +05:30
end subroutine constitutive_hooke_TandItsTangent
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-10-14 00:22:01 +05:30
!> @brief contains the constitutive equation for calculating the rate of change of microstructure
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-05-28 22:32:23 +05:30
subroutine constitutive_collectDotState ( Tstar_v , FeArray , FpArray , subdt , subfracArray , ipc , ip , el )
2013-01-16 15:44:57 +05:30
use prec , only : &
2014-07-02 17:57:39 +05:30
pReal , &
2013-01-16 15:44:57 +05:30
pLongInt
use debug , only : &
debug_cumDotStateCalls , &
debug_cumDotStateTicks , &
debug_level , &
debug_constitutive , &
debug_levelBasic
use mesh , only : &
mesh_NcpElems , &
2013-05-08 14:53:47 +05:30
mesh_maxNips
2013-01-16 15:44:57 +05:30
use material , only : &
phase_plasticity , &
2015-05-28 22:32:23 +05:30
phase_source , &
phase_Nsources , &
2013-01-16 15:44:57 +05:30
material_phase , &
2015-05-28 22:32:23 +05:30
material_homog , &
temperature , &
thermalMapping , &
2013-11-27 13:34:05 +05:30
homogenization_maxNgrains , &
2014-10-09 19:38:32 +05:30
PLASTICITY_none_ID , &
2016-01-09 01:15:20 +05:30
PLASTICITY_isotropic_ID , &
2014-10-09 19:38:32 +05:30
PLASTICITY_j2_ID , &
PLASTICITY_phenopowerlaw_ID , &
2015-10-14 00:22:01 +05:30
PLASTICITY_phenoplus_ID , &
2014-10-09 19:38:32 +05:30
PLASTICITY_dislotwin_ID , &
2015-01-15 16:26:15 +05:30
PLASTICITY_disloucla_ID , &
2014-10-09 19:38:32 +05:30
PLASTICITY_titanmod_ID , &
PLASTICITY_nonlocal_ID , &
2015-05-28 22:32:23 +05:30
SOURCE_damage_isoDuctile_ID , &
SOURCE_damage_anisoBrittle_ID , &
2015-07-27 16:39:37 +05:30
SOURCE_damage_anisoDuctile_ID , &
SOURCE_thermal_externalheat_ID
2016-01-09 01:15:20 +05:30
use plastic_isotropic , only : &
plastic_isotropic_dotState
2014-12-08 21:25:30 +05:30
use plastic_j2 , only : &
plastic_j2_dotState
use plastic_phenopowerlaw , only : &
2015-01-29 19:26:09 +05:30
plastic_phenopowerlaw_dotState
2015-10-14 00:22:01 +05:30
use plastic_phenoplus , only : &
plastic_phenoplus_dotState
2014-12-08 21:25:30 +05:30
use plastic_dislotwin , only : &
2015-01-29 19:26:09 +05:30
plastic_dislotwin_dotState
2015-01-15 16:26:15 +05:30
use plastic_disloucla , only : &
2015-01-29 19:26:09 +05:30
plastic_disloucla_dotState
2014-12-08 21:25:30 +05:30
use plastic_titanmod , only : &
2015-01-29 19:26:09 +05:30
plastic_titanmod_dotState
2014-12-08 21:25:30 +05:30
use plastic_nonlocal , only : &
2015-01-29 19:26:09 +05:30
plastic_nonlocal_dotState
2015-05-28 22:32:23 +05:30
use source_damage_isoDuctile , only : &
source_damage_isoDuctile_dotState
use source_damage_anisoBrittle , only : &
source_damage_anisoBrittle_dotState
use source_damage_anisoDuctile , only : &
source_damage_anisoDuctile_dotState
2015-07-27 16:39:37 +05:30
use source_thermal_externalheat , only : &
source_thermal_externalheat_dotState
2014-06-14 02:23:17 +05:30
2013-01-16 15:44:57 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) :: &
subdt !< timestep
real ( pReal ) , intent ( in ) , dimension ( homogenization_maxNgrains , mesh_maxNips , mesh_NcpElems ) :: &
2014-03-13 12:13:49 +05:30
subfracArray !< subfraction of timestep
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 3 , 3 , homogenization_maxNgrains , mesh_maxNips , mesh_NcpElems ) :: &
2014-03-13 12:13:49 +05:30
FeArray , & !< elastic deformation gradient
FpArray !< plastic deformation gradient
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 6 ) :: &
Tstar_v !< 2nd Piola Kirchhoff stress tensor (Mandel)
integer ( pLongInt ) :: &
2015-10-14 00:22:01 +05:30
tick , tock , &
2013-01-16 15:44:57 +05:30
tickrate , &
maxticks
2015-05-28 22:32:23 +05:30
integer ( pInt ) :: &
2016-01-16 22:57:19 +05:30
ho , & !< homogenization
tme , & !< thermal member position
s !< counter in source loop
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
if ( iand ( debug_level ( debug_constitutive ) , debug_levelBasic ) / = 0_pInt ) &
call system_clock ( count = tick , count_rate = tickrate , count_max = maxticks )
2015-10-14 00:22:01 +05:30
2016-01-16 22:57:19 +05:30
ho = material_homog ( ip , el )
tme = thermalMapping ( ho ) % p ( ip , el )
plasticityType : select case ( phase_plasticity ( material_phase ( ipc , ip , el ) ) )
case ( PLASTICITY_ISOTROPIC_ID ) plasticityType
call plastic_isotropic_dotState ( Tstar_v , ipc , ip , el )
case ( PLASTICITY_J2_ID ) plasticityType
2015-01-29 19:26:09 +05:30
call plastic_j2_dotState ( Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPOWERLAW_ID ) plasticityType
2015-01-29 19:26:09 +05:30
call plastic_phenopowerlaw_dotState ( Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPLUS_ID ) plasticityType
call plastic_phenoplus_dotState ( Tstar_v , ipc , ip , el )
case ( PLASTICITY_DISLOTWIN_ID ) plasticityType
call plastic_dislotwin_dotState ( Tstar_v , temperature ( ho ) % p ( tme ) , &
2015-01-29 19:26:09 +05:30
ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_DISLOUCLA_ID ) plasticityType
call plastic_disloucla_dotState ( Tstar_v , temperature ( ho ) % p ( tme ) , &
2015-01-29 19:26:09 +05:30
ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_TITANMOD_ID ) plasticityType
call plastic_titanmod_dotState ( Tstar_v , temperature ( ho ) % p ( tme ) , &
2014-12-09 23:53:48 +05:30
ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_NONLOCAL_ID ) plasticityType
call plastic_nonlocal_dotState ( Tstar_v , FeArray , FpArray , temperature ( ho ) % p ( tme ) , &
2015-01-29 19:26:09 +05:30
subdt , subfracArray , ip , el )
2016-01-16 22:57:19 +05:30
end select plasticityType
2015-10-14 00:22:01 +05:30
2016-01-16 22:57:19 +05:30
SourceLoop : do s = 1_pInt , phase_Nsources ( material_phase ( ipc , ip , el ) )
sourceType : select case ( phase_source ( s , material_phase ( ipc , ip , el ) ) )
case ( SOURCE_damage_anisoBrittle_ID ) sourceType
2015-07-27 16:39:37 +05:30
call source_damage_anisoBrittle_dotState ( Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_isoDuctile_ID ) sourceType
2015-07-27 16:39:37 +05:30
call source_damage_isoDuctile_dotState ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_anisoDuctile_ID ) sourceType
2015-07-27 16:39:37 +05:30
call source_damage_anisoDuctile_dotState ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( SOURCE_thermal_externalheat_ID ) sourceType
2015-07-27 16:39:37 +05:30
call source_thermal_externalheat_dotState ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
end select sourceType
enddo SourceLoop
2014-09-23 16:08:20 +05:30
2013-01-16 15:44:57 +05:30
if ( iand ( debug_level ( debug_constitutive ) , debug_levelBasic ) / = 0_pInt ) then
call system_clock ( count = tock , count_rate = tickrate , count_max = maxticks )
!$OMP CRITICAL (debugTimingDotState)
2016-01-16 22:57:19 +05:30
debug_cumDotStateCalls = debug_cumDotStateCalls + 1_pInt
debug_cumDotStateTicks = debug_cumDotStateTicks + tock - tick
!$OMP FLUSH (debug_cumDotStateTicks)
if ( tock < tick ) debug_cumDotStateTicks = debug_cumDotStateTicks + maxticks
2013-01-16 15:44:57 +05:30
!$OMP END CRITICAL (debugTimingDotState)
endif
2012-10-02 18:23:25 +05:30
end subroutine constitutive_collectDotState
2009-03-06 15:32:36 +05:30
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2016-01-16 22:57:19 +05:30
!> @brief for constitutive models having an instantaneous change of state
2014-06-17 12:24:49 +05:30
!> will return false if delta state is not needed/supported by the constitutive model
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
2015-06-01 21:32:27 +05:30
subroutine constitutive_collectDeltaState ( Tstar_v , Fe , ipc , ip , el )
2013-01-16 15:44:57 +05:30
use prec , only : &
2014-07-02 17:57:39 +05:30
pReal , &
2013-01-16 15:44:57 +05:30
pLongInt
use debug , only : &
debug_cumDeltaStateCalls , &
debug_cumDeltaStateTicks , &
debug_level , &
debug_constitutive , &
debug_levelBasic
use material , only : &
phase_plasticity , &
2015-05-28 22:32:23 +05:30
phase_source , &
phase_Nsources , &
2013-11-27 13:34:05 +05:30
material_phase , &
2015-05-28 22:32:23 +05:30
PLASTICITY_NONLOCAL_ID , &
SOURCE_damage_isoBrittle_ID , &
SOURCE_vacancy_irradiation_ID , &
2015-10-14 00:22:01 +05:30
SOURCE_vacancy_thermalfluc_ID
2014-12-08 21:25:30 +05:30
use plastic_nonlocal , only : &
plastic_nonlocal_deltaState
2015-05-28 22:32:23 +05:30
use source_damage_isoBrittle , only : &
source_damage_isoBrittle_deltaState
use source_vacancy_irradiation , only : &
source_vacancy_irradiation_deltaState
use source_vacancy_thermalfluc , only : &
source_vacancy_thermalfluc_deltaState
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 6 ) :: &
2015-10-14 00:22:01 +05:30
Tstar_v !< 2nd Piola-Kirchhoff stress
2015-05-28 22:32:23 +05:30
real ( pReal ) , intent ( in ) , dimension ( 3 , 3 ) :: &
Fe !< elastic deformation gradient
integer ( pInt ) :: &
2016-01-16 22:57:19 +05:30
s !< counter in source loop
2013-01-16 15:44:57 +05:30
integer ( pLongInt ) :: &
2015-10-14 00:22:01 +05:30
tick , tock , &
2013-01-16 15:44:57 +05:30
tickrate , &
maxticks
if ( iand ( debug_level ( debug_constitutive ) , debug_levelBasic ) / = 0_pInt ) &
call system_clock ( count = tick , count_rate = tickrate , count_max = maxticks )
2016-01-16 22:57:19 +05:30
if ( phase_plasticity ( material_phase ( ipc , ip , el ) ) == PLASTICITY_NONLOCAL_ID ) &
call plastic_nonlocal_deltaState ( Tstar_v , ip , el )
2014-07-02 17:57:39 +05:30
2012-05-16 20:13:26 +05:30
2016-01-16 22:57:19 +05:30
SourceLoop : do s = 1_pInt , phase_Nsources ( material_phase ( ipc , ip , el ) )
sourceType : select case ( phase_source ( s , material_phase ( ipc , ip , el ) ) )
case ( SOURCE_damage_isoBrittle_ID ) sourceType
2015-05-28 22:32:23 +05:30
call source_damage_isoBrittle_deltaState ( constitutive_homogenizedC ( ipc , ip , el ) , Fe , &
ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( SOURCE_vacancy_irradiation_ID ) sourceType
2015-05-28 22:32:23 +05:30
call source_vacancy_irradiation_deltaState ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( SOURCE_vacancy_thermalfluc_ID ) sourceType
2015-05-28 22:32:23 +05:30
call source_vacancy_thermalfluc_deltaState ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
end select sourceType
enddo SourceLoop
2015-05-28 22:32:23 +05:30
2013-01-16 15:44:57 +05:30
if ( iand ( debug_level ( debug_constitutive ) , debug_levelBasic ) / = 0_pInt ) then
call system_clock ( count = tock , count_rate = tickrate , count_max = maxticks )
!$OMP CRITICAL (debugTimingDeltaState)
debug_cumDeltaStateCalls = debug_cumDeltaStateCalls + 1_pInt
debug_cumDeltaStateTicks = debug_cumDeltaStateTicks + tock - tick
!$OMP FLUSH (debug_cumDeltaStateTicks)
if ( tock < tick ) debug_cumDeltaStateTicks = debug_cumDeltaStateTicks + maxticks
!$OMP END CRITICAL (debugTimingDeltaState)
endif
2012-05-16 20:13:26 +05:30
2015-06-01 21:32:27 +05:30
end subroutine constitutive_collectDeltaState
2014-09-10 23:56:12 +05:30
2014-09-22 23:45:19 +05:30
2013-01-16 15:44:57 +05:30
!--------------------------------------------------------------------------------------------------
!> @brief returns array of constitutive results
!--------------------------------------------------------------------------------------------------
2014-10-10 17:58:57 +05:30
function constitutive_postResults ( Tstar_v , FeArray , ipc , ip , el )
2014-07-02 17:57:39 +05:30
use prec , only : &
2015-10-14 00:22:01 +05:30
pReal
2013-01-16 15:44:57 +05:30
use mesh , only : &
mesh_NcpElems , &
mesh_maxNips
use material , only : &
2014-05-22 20:54:12 +05:30
plasticState , &
2015-05-28 22:32:23 +05:30
sourceState , &
2013-01-16 15:44:57 +05:30
phase_plasticity , &
2015-05-28 22:32:23 +05:30
phase_source , &
phase_Nsources , &
2013-01-16 15:44:57 +05:30
material_phase , &
2015-05-28 22:32:23 +05:30
material_homog , &
temperature , &
thermalMapping , &
2013-11-27 13:34:05 +05:30
homogenization_maxNgrains , &
PLASTICITY_NONE_ID , &
2016-01-09 01:15:20 +05:30
PLASTICITY_ISOTROPIC_ID , &
2013-11-27 13:34:05 +05:30
PLASTICITY_J2_ID , &
PLASTICITY_PHENOPOWERLAW_ID , &
2015-10-14 00:22:01 +05:30
PLASTICITY_PHENOPLUS_ID , &
2013-11-27 13:34:05 +05:30
PLASTICITY_DISLOTWIN_ID , &
2015-01-15 16:26:15 +05:30
PLASTICITY_DISLOUCLA_ID , &
2013-11-27 13:34:05 +05:30
PLASTICITY_TITANMOD_ID , &
2014-09-23 16:08:20 +05:30
PLASTICITY_NONLOCAL_ID , &
2015-05-28 22:32:23 +05:30
SOURCE_damage_isoBrittle_ID , &
SOURCE_damage_isoDuctile_ID , &
SOURCE_damage_anisoBrittle_ID , &
SOURCE_damage_anisoDuctile_ID
2016-01-09 01:15:20 +05:30
use plastic_isotropic , only : &
plastic_isotropic_postResults
2014-12-08 21:25:30 +05:30
use plastic_j2 , only : &
plastic_j2_postResults
use plastic_phenopowerlaw , only : &
plastic_phenopowerlaw_postResults
2015-10-14 00:22:01 +05:30
use plastic_phenoplus , only : &
plastic_phenoplus_postResults
2014-12-08 21:25:30 +05:30
use plastic_dislotwin , only : &
plastic_dislotwin_postResults
2015-01-15 16:26:15 +05:30
use plastic_disloucla , only : &
plastic_disloucla_postResults
2014-12-08 21:25:30 +05:30
use plastic_titanmod , only : &
plastic_titanmod_postResults
use plastic_nonlocal , only : &
plastic_nonlocal_postResults
2015-05-28 22:32:23 +05:30
use source_damage_isoBrittle , only : &
source_damage_isoBrittle_postResults
use source_damage_isoDuctile , only : &
source_damage_isoDuctile_postResults
use source_damage_anisoBrittle , only : &
source_damage_anisoBrittle_postResults
use source_damage_anisoDuctile , only : &
source_damage_anisoDuctile_postResults
2014-09-23 16:08:20 +05:30
2013-01-16 15:44:57 +05:30
implicit none
integer ( pInt ) , intent ( in ) :: &
2016-01-16 22:57:19 +05:30
ipc , & !< component-ID of integration point
ip , & !< integration point
el !< element
2014-09-23 16:08:20 +05:30
real ( pReal ) , dimension ( plasticState ( material_phase ( ipc , ip , el ) ) % sizePostResults + &
2015-10-14 00:22:01 +05:30
sum ( sourceState ( material_phase ( ipc , ip , el ) ) % p ( : ) % sizePostResults ) ) :: &
2014-09-23 16:08:20 +05:30
constitutive_postResults
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 3 , 3 , homogenization_maxNgrains , mesh_maxNips , mesh_NcpElems ) :: &
2014-03-13 12:13:49 +05:30
FeArray !< elastic deformation gradient
2013-01-16 15:44:57 +05:30
real ( pReal ) , intent ( in ) , dimension ( 6 ) :: &
Tstar_v !< 2nd Piola Kirchhoff stress tensor (Mandel)
2014-10-28 08:12:25 +05:30
integer ( pInt ) :: &
2016-01-16 22:57:19 +05:30
startPos , endPos
integer ( pInt ) :: &
ho , & !< homogenization
tme , & !< thermal member position
s !< counter in source loop
2015-10-14 00:22:01 +05:30
2013-01-16 15:44:57 +05:30
constitutive_postResults = 0.0_pReal
2015-10-14 00:22:01 +05:30
2016-01-16 22:57:19 +05:30
ho = material_homog ( ip , el )
tme = thermalMapping ( ho ) % p ( ip , el )
2015-05-28 22:32:23 +05:30
2014-09-23 16:08:20 +05:30
startPos = 1_pInt
endPos = plasticState ( material_phase ( ipc , ip , el ) ) % sizePostResults
2016-01-16 22:57:19 +05:30
plasticityType : select case ( phase_plasticity ( material_phase ( ipc , ip , el ) ) )
case ( PLASTICITY_TITANMOD_ID ) plasticityType
2014-12-08 21:25:30 +05:30
constitutive_postResults ( startPos : endPos ) = plastic_titanmod_postResults ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_ISOTROPIC_ID ) plasticityType
2016-01-09 01:15:20 +05:30
constitutive_postResults ( startPos : endPos ) = plastic_isotropic_postResults ( Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_J2_ID ) plasticityType
2014-12-08 21:25:30 +05:30
constitutive_postResults ( startPos : endPos ) = plastic_j2_postResults ( Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPOWERLAW_ID ) plasticityType
2014-09-23 16:08:20 +05:30
constitutive_postResults ( startPos : endPos ) = &
2014-12-08 21:25:30 +05:30
plastic_phenopowerlaw_postResults ( Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_PHENOPLUS_ID ) plasticityType
2015-10-14 00:22:01 +05:30
constitutive_postResults ( startPos : endPos ) = &
plastic_phenoplus_postResults ( Tstar_v , ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( PLASTICITY_DISLOTWIN_ID ) plasticityType
2014-09-23 16:08:20 +05:30
constitutive_postResults ( startPos : endPos ) = &
2016-01-16 22:57:19 +05:30
plastic_dislotwin_postResults ( Tstar_v , temperature ( ho ) % p ( tme ) , ipc , ip , el )
case ( PLASTICITY_DISLOUCLA_ID ) plasticityType
2015-01-15 16:26:15 +05:30
constitutive_postResults ( startPos : endPos ) = &
2016-01-16 22:57:19 +05:30
plastic_disloucla_postResults ( Tstar_v , temperature ( ho ) % p ( tme ) , ipc , ip , el )
case ( PLASTICITY_NONLOCAL_ID ) plasticityType
2014-09-23 16:08:20 +05:30
constitutive_postResults ( startPos : endPos ) = &
2014-12-08 21:25:30 +05:30
plastic_nonlocal_postResults ( Tstar_v , FeArray , ip , el )
2016-01-16 22:57:19 +05:30
end select plasticityType
2014-09-23 16:08:20 +05:30
2016-01-16 22:57:19 +05:30
SourceLoop : do s = 1_pInt , phase_Nsources ( material_phase ( ipc , ip , el ) )
2015-05-28 22:32:23 +05:30
startPos = endPos + 1_pInt
2016-01-16 22:57:19 +05:30
endPos = endPos + sourceState ( material_phase ( ipc , ip , el ) ) % p ( s ) % sizePostResults
sourceType : select case ( phase_source ( s , material_phase ( ipc , ip , el ) ) )
case ( SOURCE_damage_isoBrittle_ID ) sourceType
2015-05-28 22:32:23 +05:30
constitutive_postResults ( startPos : endPos ) = source_damage_isoBrittle_postResults ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_isoDuctile_ID ) sourceType
2015-05-28 22:32:23 +05:30
constitutive_postResults ( startPos : endPos ) = source_damage_isoDuctile_postResults ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_anisoBrittle_ID ) sourceType
2015-05-28 22:32:23 +05:30
constitutive_postResults ( startPos : endPos ) = source_damage_anisoBrittle_postResults ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
case ( SOURCE_damage_anisoDuctile_ID ) sourceType
2015-05-28 22:32:23 +05:30
constitutive_postResults ( startPos : endPos ) = source_damage_anisoDuctile_postResults ( ipc , ip , el )
2016-01-16 22:57:19 +05:30
end select sourceType
enddo SourceLoop
2014-10-11 02:25:09 +05:30
2012-10-02 18:23:25 +05:30
end function constitutive_postResults
2009-03-06 15:32:36 +05:30
2013-02-11 16:13:45 +05:30
end module constitutive