simplifying

This commit is contained in:
Sharan Roongta 2020-07-01 20:46:26 +02:00
parent a7d26cd1c3
commit 8627739963
13 changed files with 51 additions and 107 deletions

View File

@ -35,9 +35,7 @@ module constitutive
interface
module subroutine plastic_none_init(debug_constitutive)
class(tNode), pointer , intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
module subroutine plastic_none_init
end subroutine plastic_none_init
module subroutine plastic_isotropic_init(debug_constitutive)
@ -53,14 +51,10 @@ module constitutive
debug_constitutive !< pointer to constitutive debug options
end subroutine plastic_kinehardening_init
module subroutine plastic_dislotwin_init(debug_constitutive)
class(tNode), pointer , intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
module subroutine plastic_dislotwin_init
end subroutine plastic_dislotwin_init
module subroutine plastic_disloUCLA_init(debug_constitutive)
class(tNode), pointer , intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
module subroutine plastic_disloUCLA_init
end subroutine plastic_disloUCLA_init
module subroutine plastic_nonlocal_init(debug_constitutive)
@ -374,12 +368,12 @@ subroutine constitutive_init
debug_constitutive => debug_root%get('constitutuve',defaultVal=emptyList)
!--------------------------------------------------------------------------------------------------
! initialized plasticity
if (any(phase_plasticity == PLASTICITY_NONE_ID)) call plastic_none_init(debug_constitutive)
if (any(phase_plasticity == PLASTICITY_NONE_ID)) call plastic_none_init
if (any(phase_plasticity == PLASTICITY_ISOTROPIC_ID)) call plastic_isotropic_init(debug_constitutive)
if (any(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID)) call plastic_phenopowerlaw_init
if (any(phase_plasticity == PLASTICITY_KINEHARDENING_ID)) call plastic_kinehardening_init(debug_constitutive)
if (any(phase_plasticity == PLASTICITY_DISLOTWIN_ID)) call plastic_dislotwin_init(debug_constitutive)
if (any(phase_plasticity == PLASTICITY_DISLOUCLA_ID)) call plastic_disloucla_init(debug_constitutive)
if (any(phase_plasticity == PLASTICITY_DISLOTWIN_ID)) call plastic_dislotwin_init
if (any(phase_plasticity == PLASTICITY_DISLOUCLA_ID)) call plastic_disloucla_init
if (any(phase_plasticity == PLASTICITY_NONLOCAL_ID)) then
call plastic_nonlocal_init(debug_constitutive)
else
@ -387,18 +381,18 @@ subroutine constitutive_init
endif
!--------------------------------------------------------------------------------------------------
! initialize source mechanisms
if (any(phase_source == SOURCE_thermal_dissipation_ID)) call source_thermal_dissipation_init(debug_constitutive)
if (any(phase_source == SOURCE_thermal_externalheat_ID)) call source_thermal_externalheat_init(debug_constitutive)
if (any(phase_source == SOURCE_damage_isoBrittle_ID)) call source_damage_isoBrittle_init(debug_constitutive)
if (any(phase_source == SOURCE_damage_isoDuctile_ID)) call source_damage_isoDuctile_init(debug_constitutive)
if (any(phase_source == SOURCE_damage_anisoBrittle_ID)) call source_damage_anisoBrittle_init(debug_constitutive)
if (any(phase_source == SOURCE_damage_anisoDuctile_ID)) call source_damage_anisoDuctile_init(debug_constitutive)
if (any(phase_source == SOURCE_thermal_dissipation_ID)) call source_thermal_dissipation_init
if (any(phase_source == SOURCE_thermal_externalheat_ID)) call source_thermal_externalheat_init
if (any(phase_source == SOURCE_damage_isoBrittle_ID)) call source_damage_isoBrittle_init
if (any(phase_source == SOURCE_damage_isoDuctile_ID)) call source_damage_isoDuctile_init
if (any(phase_source == SOURCE_damage_anisoBrittle_ID)) call source_damage_anisoBrittle_init
if (any(phase_source == SOURCE_damage_anisoDuctile_ID)) call source_damage_anisoDuctile_init
!--------------------------------------------------------------------------------------------------
! initialize kinematic mechanisms
if (any(phase_kinematics == KINEMATICS_cleavage_opening_ID)) call kinematics_cleavage_opening_init(debug_constitutive)
if (any(phase_kinematics == KINEMATICS_slipplane_opening_ID)) call kinematics_slipplane_opening_init(debug_constitutive)
if (any(phase_kinematics == KINEMATICS_thermal_expansion_ID)) call kinematics_thermal_expansion_init(debug_constitutive)
if (any(phase_kinematics == KINEMATICS_cleavage_opening_ID)) call kinematics_cleavage_opening_init
if (any(phase_kinematics == KINEMATICS_slipplane_opening_ID)) call kinematics_slipplane_opening_init
if (any(phase_kinematics == KINEMATICS_thermal_expansion_ID)) call kinematics_thermal_expansion_init
write(6,'(/,a)') ' <<<+- constitutive init -+>>>'; flush(6)

View File

@ -74,10 +74,7 @@ contains
!> @brief Perform module initialization.
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_disloUCLA_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
module subroutine plastic_disloUCLA_init
integer :: &
Ninstance, &
@ -94,14 +91,13 @@ module subroutine plastic_disloUCLA_init(debug_constitutive)
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_DISLOUCLA_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_DISLOUCLA_LABEL//' init -+>>>'
write(6,'(/,a)') ' Cereceda et al., International Journal of Plasticity 78:242256, 2016'
write(6,'(a)') ' https://dx.doi.org/10.1016/j.ijplas.2015.09.002'
Ninstance = count(phase_plasticity == PLASTICITY_DISLOUCLA_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(param(Ninstance))
allocate(state(Ninstance))

View File

@ -122,10 +122,7 @@ contains
!> @brief Perform module initialization.
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_dislotwin_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
module subroutine plastic_dislotwin_init
integer :: &
Ninstance, &
@ -141,7 +138,7 @@ module subroutine plastic_dislotwin_init(debug_constitutive)
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_LABEL//' init -+>>>'
write(6,'(/,a)') ' Ma and Roters, Acta Materialia 52(12):36033612, 2004'
write(6,'(a)') ' https://doi.org/10.1016/j.actamat.2004.04.012'
@ -153,9 +150,7 @@ module subroutine plastic_dislotwin_init(debug_constitutive)
write(6,'(a,/)') ' https://doi.org/10.1016/j.actamat.2016.07.032'
Ninstance = count(phase_plasticity == PLASTICITY_DISLOTWIN_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(param(Ninstance))
allocate(state(Ninstance))

View File

@ -12,21 +12,17 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
module subroutine plastic_none_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
module subroutine plastic_none_init
integer :: &
Ninstance, &
p, &
NipcMyPhase
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_NONE_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_NONE_LABEL//' init -+>>>'
Ninstance = count(phase_plasticity == PLASTICITY_NONE_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
do p = 1, size(phase_plasticity)
if (phase_plasticity(p) /= PLASTICITY_NONE_ID) cycle

View File

@ -43,20 +43,16 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine kinematics_cleavage_opening_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine kinematics_cleavage_opening_init
integer :: Ninstance,p
integer, dimension(:), allocatable :: N_cl !< active number of cleavage systems per family
character(len=pStringLen) :: extmsg = ''
write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_CLEAVAGE_OPENING_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_CLEAVAGE_OPENING_LABEL//' init -+>>>'
Ninstance = count(phase_kinematics == KINEMATICS_CLEAVAGE_OPENING_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(kinematics_cleavage_opening_instance(size(config_phase)), source=0)
allocate(param(Ninstance))

View File

@ -45,21 +45,17 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine kinematics_slipplane_opening_init(debug_constitutive)
class(tNode), pointer , intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine kinematics_slipplane_opening_init
integer :: Ninstance,p,i
character(len=pStringLen) :: extmsg = ''
integer, dimension(:), allocatable :: N_sl
real(pReal), dimension(:,:), allocatable :: d,n,t
write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_SLIPPLANE_OPENING_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_SLIPPLANE_OPENING_LABEL//' init -+>>>'
Ninstance = count(phase_kinematics == KINEMATICS_SLIPPLANE_OPENING_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(kinematics_slipplane_opening_instance(size(config_phase)), source=0)
allocate(param(Ninstance))

View File

@ -38,19 +38,15 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine kinematics_thermal_expansion_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine kinematics_thermal_expansion_init
integer :: Ninstance,p,i
real(pReal), dimension(:), allocatable :: temp
write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_thermal_expansion_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- kinematics_'//KINEMATICS_thermal_expansion_LABEL//' init -+>>>'
Ninstance = count(phase_kinematics == KINEMATICS_thermal_expansion_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(kinematics_thermal_expansion_instance(size(config_phase)), source=0)
allocate(param(Ninstance))

View File

@ -6,7 +6,6 @@
!--------------------------------------------------------------------------------------------------
module source_damage_anisoBrittle
use prec
use debug
use IO
use math
use discretization
@ -53,20 +52,16 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine source_damage_anisoBrittle_init(debug_constitutive)
class(tNode), pointer , intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine source_damage_anisoBrittle_init
integer :: Ninstance,sourceOffset,NipcMyPhase,p
integer, dimension(:), allocatable :: N_cl
character(len=pStringLen) :: extmsg = ''
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ANISOBRITTLE_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ANISOBRITTLE_LABEL//' init -+>>>'
Ninstance = count(phase_source == SOURCE_DAMAGE_ANISOBRITTLE_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(source_damage_anisoBrittle_offset (size(config_phase)), source=0)
allocate(source_damage_anisoBrittle_instance(size(config_phase)), source=0)

View File

@ -46,20 +46,16 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine source_damage_anisoDuctile_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine source_damage_anisoDuctile_init
integer :: Ninstance,sourceOffset,NipcMyPhase,p
integer, dimension(:), allocatable :: N_sl
character(len=pStringLen) :: extmsg = ''
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ANISODUCTILE_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ANISODUCTILE_LABEL//' init -+>>>'
Ninstance = count(phase_source == SOURCE_DAMAGE_ANISODUCTILE_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(source_damage_anisoDuctile_offset (size(config_phase)), source=0)
allocate(source_damage_anisoDuctile_instance(size(config_phase)), source=0)

View File

@ -45,19 +45,15 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine source_damage_isoBrittle_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine source_damage_isoBrittle_init
integer :: Ninstance,sourceOffset,NipcMyPhase,p
character(len=pStringLen) :: extmsg = ''
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ISOBRITTLE_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ISOBRITTLE_LABEL//' init -+>>>'
Ninstance = count(phase_source == SOURCE_DAMAGE_ISOBRITTLE_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(source_damage_isoBrittle_offset (size(config_phase)), source=0)
allocate(source_damage_isoBrittle_instance(size(config_phase)), source=0)

View File

@ -45,19 +45,15 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine source_damage_isoDuctile_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine source_damage_isoDuctile_init
integer :: Ninstance,sourceOffset,NipcMyPhase,p
character(len=pStringLen) :: extmsg = ''
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ISODUCTILE_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- source_'//SOURCE_DAMAGE_ISODUCTILE_LABEL//' init -+>>>'
Ninstance = count(phase_source == SOURCE_DAMAGE_ISODUCTILE_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(source_damage_isoDuctile_offset (size(config_phase)), source=0)
allocate(source_damage_isoDuctile_instance(size(config_phase)), source=0)

View File

@ -38,18 +38,14 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine source_thermal_dissipation_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine source_thermal_dissipation_init
integer :: Ninstance,sourceOffset,NipcMyPhase,p
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_dissipation_label//' init -+>>>'
Ninstance = count(phase_source == SOURCE_THERMAL_DISSIPATION_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(source_thermal_dissipation_offset (size(config_phase)), source=0)
allocate(source_thermal_dissipation_instance(size(config_phase)), source=0)

View File

@ -42,18 +42,14 @@ contains
!> @brief module initialization
!> @details reads in material parameters, allocates arrays, and does sanity checks
!--------------------------------------------------------------------------------------------------
subroutine source_thermal_externalheat_init(debug_constitutive)
class(tNode), pointer, intent(in) :: &
debug_constitutive !< pointer to constitutive debug options
subroutine source_thermal_externalheat_init
integer :: Ninstance,sourceOffset,NipcMyPhase,p
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- source_'//SOURCE_thermal_externalheat_label//' init -+>>>'
Ninstance = count(phase_source == SOURCE_thermal_externalheat_ID)
if (debug_constitutive%contains('basic')) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(source_thermal_externalheat_offset (size(config_phase)), source=0)
allocate(source_thermal_externalheat_instance(size(config_phase)), source=0)