polishing

RGC numerics is still annoying (and was probably never used in the last
10 years)
This commit is contained in:
Martin Diehl 2022-02-19 13:56:24 +01:00
parent 5cc64fc958
commit d97f515b77
3 changed files with 39 additions and 49 deletions

View File

@ -66,15 +66,13 @@ module homogenization
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
interface interface
module subroutine mechanical_init(num_homog) module subroutine mechanical_init()
class(tNode), pointer, intent(in) :: &
num_homog !< pointer to mechanical homogenization numerics data
end subroutine mechanical_init end subroutine mechanical_init
module subroutine thermal_init module subroutine thermal_init()
end subroutine thermal_init end subroutine thermal_init
module subroutine damage_init module subroutine damage_init()
end subroutine damage_init end subroutine damage_init
module subroutine mechanical_partition(subF,ce) module subroutine mechanical_partition(subF,ce)
@ -204,7 +202,7 @@ subroutine homogenization_init()
allocate(homogState (size(material_name_homogenization))) allocate(homogState (size(material_name_homogenization)))
allocate(damageState_h (size(material_name_homogenization))) allocate(damageState_h (size(material_name_homogenization)))
call material_parseHomogenization() call parseHomogenization()
num_homog => config_numerics%get('homogenization',defaultVal=emptyDict) num_homog => config_numerics%get('homogenization',defaultVal=emptyDict)
num_homogGeneric => num_homog%get('generic',defaultVal=emptyDict) num_homogGeneric => num_homog%get('generic',defaultVal=emptyDict)
@ -212,7 +210,7 @@ subroutine homogenization_init()
num%nMPstate = num_homogGeneric%get_asInt('nMPstate',defaultVal=10) num%nMPstate = num_homogGeneric%get_asInt('nMPstate',defaultVal=10)
if (num%nMPstate < 1) call IO_error(301,ext_msg='nMPstate') if (num%nMPstate < 1) call IO_error(301,ext_msg='nMPstate')
call mechanical_init(num_homog) call mechanical_init()
call thermal_init() call thermal_init()
call damage_init() call damage_init()
@ -447,7 +445,7 @@ end subroutine homogenization_restartRead
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief parses the homogenization part from the material configuration !> @brief parses the homogenization part from the material configuration
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_parseHomogenization subroutine parseHomogenization
class(tNode), pointer :: & class(tNode), pointer :: &
material_homogenization, & material_homogenization, &
@ -486,7 +484,7 @@ subroutine material_parseHomogenization
endif endif
enddo enddo
end subroutine material_parseHomogenization end subroutine parseHomogenization
end module homogenization end module homogenization

View File

@ -7,15 +7,13 @@ submodule(homogenization) mechanical
interface interface
module subroutine pass_init module subroutine pass_init()
end subroutine pass_init end subroutine pass_init
module subroutine isostrain_init module subroutine isostrain_init()
end subroutine isostrain_init end subroutine isostrain_init
module subroutine RGC_init(num_homogMech) module subroutine RGC_init()
class(tNode), pointer, intent(in) :: &
num_homogMech !< pointer to mechanical homogenization numerics data
end subroutine RGC_init end subroutine RGC_init
@ -60,27 +58,20 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Allocate variables and set parameters. !> @brief Allocate variables and set parameters.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine mechanical_init(num_homog) module subroutine mechanical_init()
class(tNode), pointer, intent(in) :: &
num_homog
class(tNode), pointer :: &
num_homogMech
print'(/,1x,a)', '<<<+- homogenization:mechanical init -+>>>' print'(/,1x,a)', '<<<+- homogenization:mechanical init -+>>>'
call material_parseHomogenization2() call parseMechanical()
allocate(homogenization_dPdF(3,3,3,3,discretization_nIPs*discretization_Nelems), source=0.0_pReal) allocate(homogenization_dPdF(3,3,3,3,discretization_Ncells), source=0.0_pReal)
homogenization_F0 = spread(math_I3,3,discretization_nIPs*discretization_Nelems) ! initialize to identity homogenization_F0 = spread(math_I3,3,discretization_Ncells)
homogenization_F = homogenization_F0 ! initialize to identity homogenization_F = homogenization_F0
allocate(homogenization_P(3,3,discretization_nIPs*discretization_Nelems), source=0.0_pReal) allocate(homogenization_P(3,3,discretization_Ncells),source=0.0_pReal)
num_homogMech => num_homog%get('mech',defaultVal=emptyDict) if (any(homogenization_type == HOMOGENIZATION_NONE_ID)) call pass_init()
if (any(homogenization_type == HOMOGENIZATION_NONE_ID)) call pass_init if (any(homogenization_type == HOMOGENIZATION_ISOSTRAIN_ID)) call isostrain_init()
if (any(homogenization_type == HOMOGENIZATION_ISOSTRAIN_ID)) call isostrain_init if (any(homogenization_type == HOMOGENIZATION_RGC_ID)) call RGC_init()
if (any(homogenization_type == HOMOGENIZATION_RGC_ID)) call RGC_init(num_homogMech)
end subroutine mechanical_init end subroutine mechanical_init
@ -210,7 +201,7 @@ end subroutine mechanical_results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief parses the homogenization part from the material configuration !> @brief parses the homogenization part from the material configuration
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine material_parseHomogenization2() subroutine parseMechanical()
class(tNode), pointer :: & class(tNode), pointer :: &
material_homogenization, & material_homogenization, &
@ -238,7 +229,7 @@ subroutine material_parseHomogenization2()
end select end select
end do end do
end subroutine material_parseHomogenization2 end subroutine parseMechanical
end submodule mechanical end submodule mechanical

View File

@ -71,10 +71,7 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief allocates all necessary fields, reads information from material configuration file !> @brief allocates all necessary fields, reads information from material configuration file
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine RGC_init(num_homogMech) module subroutine RGC_init()
class(tNode), pointer, intent(in) :: &
num_homogMech !< pointer to mechanical homogenization numerics data
integer :: & integer :: &
ho, & ho, &
@ -82,6 +79,8 @@ module subroutine RGC_init(num_homogMech)
sizeState, nIntFaceTot sizeState, nIntFaceTot
class (tNode), pointer :: & class (tNode), pointer :: &
num_homogenization, &
num_mechanical, &
num_RGC, & ! pointer to RGC numerics data num_RGC, & ! pointer to RGC numerics data
material_homogenization, & material_homogenization, &
homog, & homog, &
@ -105,7 +104,9 @@ module subroutine RGC_init(num_homogMech)
allocate(state0(material_homogenization%length)) allocate(state0(material_homogenization%length))
allocate(dependentState(material_homogenization%length)) allocate(dependentState(material_homogenization%length))
num_RGC => num_homogMech%get('RGC',defaultVal=emptyDict) num_homogenization => config_numerics%get('homogenization',defaultVal=emptyDict)
num_mechanical => num_homogenization%get('mechanical',defaultVal=emptyDict)
num_RGC => num_mechanical%get('RGC',defaultVal=emptyDict)
num%atol = num_RGC%get_asFloat('atol', defaultVal=1.0e+4_pReal) num%atol = num_RGC%get_asFloat('atol', defaultVal=1.0e+4_pReal)
num%rtol = num_RGC%get_asFloat('rtol', defaultVal=1.0e-3_pReal) num%rtol = num_RGC%get_asFloat('rtol', defaultVal=1.0e-3_pReal)