Merge branch 'cleaning-YAML' into 'development'

Re-written YAML types

See merge request damask/DAMASK!637
This commit is contained in:
Daniel Otto de Mentock 2022-10-25 16:09:36 +00:00
commit 4e5567fce1
45 changed files with 1405 additions and 1418 deletions

View File

@ -14,8 +14,8 @@ if (OPTIMIZATION STREQUAL "OFF" OR OPTIMIZATION STREQUAL "DEBUG")
elseif (OPTIMIZATION STREQUAL "DEFENSIVE") elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
set (OPTIMIZATION_FLAGS "-O2") set (OPTIMIZATION_FLAGS "-O2")
elseif (OPTIMIZATION STREQUAL "AGGRESSIVE") elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
set (OPTIMIZATION_FLAGS "-ipo -O3 -fp-model fast=2 -xHost") #set (OPTIMIZATION_FLAGS "-ipo -O3 -fp-model fast=2 -xHost") # ifx 2022.0 has problems with YAML types and IPO
# -fast = -ipo, -O3, -no-prec-div, -static, -fp-model fast=2, and -xHost" set (OPTIMIZATION_FLAGS "-O3 -fp-model fast=2 -xHost")
endif () endif ()
# -assume std_mod_proc_name (included in -standard-semantics) causes problems if other modules # -assume std_mod_proc_name (included in -standard-semantics) causes problems if other modules

View File

@ -283,7 +283,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
outdatedByNewInc = .false., & !< needs description outdatedByNewInc = .false., & !< needs description
materialpoint_init_done = .false., & !< remember whether init has been done already materialpoint_init_done = .false., & !< remember whether init has been done already
debug_basic = .true. debug_basic = .true.
class(tNode), pointer :: & type(tList), pointer :: &
debug_Marc ! pointer to Marc debug options debug_Marc ! pointer to Marc debug options
if(debug_basic) then if(debug_basic) then
@ -307,7 +307,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
if (.not. materialpoint_init_done) then if (.not. materialpoint_init_done) then
materialpoint_init_done = .true. materialpoint_init_done = .true.
call materialpoint_initAll call materialpoint_initAll
debug_Marc => config_debug%get('Marc',defaultVal=emptyList) debug_Marc => config_debug%get_list('Marc',defaultVal=emptyList)
debug_basic = debug_Marc%contains('basic') debug_basic = debug_Marc%contains('basic')
endif endif

View File

@ -69,7 +69,7 @@ subroutine discretization_Marc_init
real(pReal), dimension(:,:,:,:), allocatable :: & real(pReal), dimension(:,:,:,:), allocatable :: &
unscaledNormals unscaledNormals
class(tNode), pointer :: & type(tDict), pointer :: &
num_commercialFEM num_commercialFEM
@ -78,7 +78,7 @@ subroutine discretization_Marc_init
debug_e = config_debug%get_asInt('element',defaultVal=1) debug_e = config_debug%get_asInt('element',defaultVal=1)
debug_i = config_debug%get_asInt('integrationpoint',defaultVal=1) debug_i = config_debug%get_asInt('integrationpoint',defaultVal=1)
num_commercialFEM => config_numerics%get('commercialFEM',defaultVal = emptyDict) num_commercialFEM => config_numerics%get_dict('commercialFEM',defaultVal = emptyDict)
mesh_unitlength = num_commercialFEM%get_asFloat('unitlength',defaultVal=1.0_pReal) ! set physical extent of a length unit in mesh mesh_unitlength = num_commercialFEM%get_asFloat('unitlength',defaultVal=1.0_pReal) ! set physical extent of a length unit in mesh
if (mesh_unitlength <= 0.0_pReal) call IO_error(301,'unitlength') if (mesh_unitlength <= 0.0_pReal) call IO_error(301,'unitlength')

View File

@ -101,9 +101,10 @@ end subroutine materialpoint_initAll
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine materialpoint_init subroutine materialpoint_init
class(tNode), pointer :: & type(tList), pointer :: &
debug_materialpoint debug_materialpoint
print'(/,1x,a)', '<<<+- materialpoint init -+>>>'; flush(IO_STDOUT) print'(/,1x,a)', '<<<+- materialpoint init -+>>>'; flush(IO_STDOUT)
allocate(materialpoint_cs( 6,discretization_nIPs,discretization_Nelems), source= 0.0_pReal) allocate(materialpoint_cs( 6,discretization_nIPs,discretization_Nelems), source= 0.0_pReal)
@ -113,7 +114,7 @@ subroutine materialpoint_init
!------------------------------------------------------------------------------ !------------------------------------------------------------------------------
! read debug options ! read debug options
debug_materialpoint => config_debug%get('materialpoint',defaultVal=emptyList) debug_materialpoint => config_debug%get_list('materialpoint',defaultVal=emptyList)
debugmaterialpoint%basic = debug_materialpoint%contains('basic') debugmaterialpoint%basic = debug_materialpoint%contains('basic')
debugmaterialpoint%extensive = debug_materialpoint%contains('extensive') debugmaterialpoint%extensive = debug_materialpoint%contains('extensive')
debugmaterialpoint%selective = debug_materialpoint%contains('selective') debugmaterialpoint%selective = debug_materialpoint%contains('selective')

View File

@ -17,7 +17,8 @@ module YAML_parse
public :: & public :: &
YAML_parse_init, & YAML_parse_init, &
YAML_parse_str YAML_parse_str_asList, &
YAML_parse_str_asDict
#ifdef FYAML #ifdef FYAML
interface interface
@ -53,16 +54,37 @@ end subroutine YAML_parse_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Parse a YAML string into a a structure of nodes. !> @brief Parse a YAML string with list as root into a a structure of nodes.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function YAML_parse_str(str) result(node) function YAML_parse_str_asList(str) result(list)
character(len=*), intent(in) :: str character(len=*), intent(in) :: str
class (tNode), pointer :: node type(tList), pointer :: list
class(tNode), pointer :: node
node => parse_flow(to_flow(str)) node => parse_flow(to_flow(str))
list => node%asList()
end function YAML_parse_str end function YAML_parse_str_asList
!--------------------------------------------------------------------------------------------------
!> @brief Parse a YAML string with dict as root into a a structure of nodes.
!--------------------------------------------------------------------------------------------------
function YAML_parse_str_asDict(str) result(dict)
character(len=*), intent(in) :: str
type(tDict), pointer :: dict
class(tNode), pointer :: node
node => parse_flow(to_flow(str))
dict => node%asDict()
end function YAML_parse_str_asDict
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -72,9 +94,9 @@ end function YAML_parse_str
recursive function parse_flow(YAML_flow) result(node) recursive function parse_flow(YAML_flow) result(node)
character(len=*), intent(in) :: YAML_flow !< YAML file in flow style character(len=*), intent(in) :: YAML_flow !< YAML file in flow style
class (tNode), pointer :: node class(tNode), pointer :: node
class (tNode), pointer :: & class(tNode), pointer :: &
myVal myVal
character(len=:), allocatable :: & character(len=:), allocatable :: &
flow_string, & flow_string, &

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ module config
implicit none(type,external) implicit none(type,external)
private private
class(tNode), pointer, public :: & type(tDict), pointer, public :: &
config_material, & config_material, &
config_numerics, & config_numerics, &
config_debug config_debug
@ -58,7 +58,7 @@ subroutine parse_material()
end if end if
call parallelization_bcast_str(fileContent) call parallelization_bcast_str(fileContent)
config_material => YAML_parse_str(fileContent) config_material => YAML_parse_str_asDict(fileContent)
end subroutine parse_material end subroutine parse_material
@ -88,7 +88,7 @@ subroutine parse_numerics()
end if end if
call parallelization_bcast_str(fileContent) call parallelization_bcast_str(fileContent)
config_numerics => YAML_parse_str(fileContent) config_numerics => YAML_parse_str_asDict(fileContent)
end if end if
@ -120,7 +120,7 @@ subroutine parse_debug()
end if end if
call parallelization_bcast_str(fileContent) call parallelization_bcast_str(fileContent)
config_debug => YAML_parse_str(fileContent) config_debug => YAML_parse_str_asDict(fileContent)
end if end if

View File

@ -106,15 +106,21 @@ program DAMASK_grid
external :: & external :: &
quit quit
class (tNode), pointer :: & class(tNode), pointer :: &
num_grid, & tmp
type(tDict), pointer :: &
config_load, & config_load, &
load_steps, & num_grid, &
load_step, & load_step, &
solver, & solver, &
step_bc, & step_bc, &
step_mech, & step_mech, &
step_discretization step_discretization
type(tList), pointer :: &
#ifdef __INTEL_LLVM_COMPILER
tensor, &
#endif
load_steps
character(len=:), allocatable :: & character(len=:), allocatable :: &
fileContent, fname fileContent, fname
@ -130,7 +136,7 @@ program DAMASK_grid
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! reading field paramters from numerics file and do sanity checks ! reading field paramters from numerics file and do sanity checks
num_grid => config_numerics%get('grid', defaultVal=emptyDict) num_grid => config_numerics%get_dict('grid', defaultVal=emptyDict)
stagItMax = num_grid%get_asInt('maxStaggeredIter',defaultVal=10) stagItMax = num_grid%get_asInt('maxStaggeredIter',defaultVal=10)
maxCutBack = num_grid%get_asInt('maxCutBack',defaultVal=3) maxCutBack = num_grid%get_asInt('maxCutBack',defaultVal=3)
@ -147,8 +153,8 @@ program DAMASK_grid
endif endif
call parallelization_bcast_str(fileContent) call parallelization_bcast_str(fileContent)
config_load => YAML_parse_str(fileContent) config_load => YAML_parse_str_asDict(fileContent)
solver => config_load%get('solver') solver => config_load%get_dict('solver')
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! assign mechanics solver depending on selected type ! assign mechanics solver depending on selected type
@ -202,34 +208,42 @@ program DAMASK_grid
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
load_steps => config_load%get('loadstep') load_steps => config_load%get_list('loadstep')
allocate(loadCases(load_steps%length)) ! array of load cases allocate(loadCases(load_steps%length)) ! array of load cases
do l = 1, load_steps%length do l = 1, load_steps%length
load_step => load_steps%get(l) load_step => load_steps%get_dict(l)
step_bc => load_step%get('boundary_conditions') step_bc => load_step%get_dict('boundary_conditions')
step_mech => step_bc%get('mechanical') step_mech => step_bc%get_dict('mechanical')
loadCases(l)%stress%myType='' loadCases(l)%stress%myType=''
readMech: do m = 1, step_mech%length readMech: do m = 1, step_mech%length
select case (step_mech%getKey(m)) select case (step_mech%key(m))
case ('L','dot_F','F') ! assign values for the deformation BC matrix case ('L','dot_F','F') ! assign values for the deformation BC matrix
loadCases(l)%deformation%myType = step_mech%getKey(m) loadCases(l)%deformation%myType = step_mech%key(m)
call getMaskedTensor(loadCases(l)%deformation%values,loadCases(l)%deformation%mask,step_mech%get(m)) #ifdef __INTEL_LLVM_COMPILER
tensor => step_mech%get_list(m)
call getMaskedTensor(loadCases(l)%deformation%values,loadCases(l)%deformation%mask,tensor)
#else
call getMaskedTensor(loadCases(l)%deformation%values,loadCases(l)%deformation%mask,step_mech%get_list(m))
#endif
case ('dot_P','P') case ('dot_P','P')
loadCases(l)%stress%myType = step_mech%getKey(m) loadCases(l)%stress%myType = step_mech%key(m)
call getMaskedTensor(loadCases(l)%stress%values,loadCases(l)%stress%mask,step_mech%get(m)) #ifdef __INTEL_LLVM_COMPILER
tensor => step_mech%get_list(m)
call getMaskedTensor(loadCases(l)%stress%values,loadCases(l)%stress%mask,tensor)
#else
call getMaskedTensor(loadCases(l)%stress%values,loadCases(l)%stress%mask,step_mech%get_list(m))
#endif
end select end select
call loadCases(l)%rot%fromAxisAngle(step_mech%get_as1dFloat('R',defaultVal = real([0.0,0.0,1.0,0.0],pReal)),degrees=.true.) call loadCases(l)%rot%fromAxisAngle(step_mech%get_as1dFloat('R',defaultVal = real([0.0,0.0,1.0,0.0],pReal)),degrees=.true.)
enddo readMech enddo readMech
if (.not. allocated(loadCases(l)%deformation%myType)) call IO_error(error_ID=837,ext_msg = 'L/dot_F/F missing') if (.not. allocated(loadCases(l)%deformation%myType)) call IO_error(error_ID=837,ext_msg = 'L/dot_F/F missing')
step_discretization => load_step%get('discretization') step_discretization => load_step%get_dict('discretization')
if (.not. step_discretization%contains('t')) call IO_error(error_ID=837,ext_msg = 't missing') loadCases(l)%t = step_discretization%get_asFloat('t')
if (.not. step_discretization%contains('N')) call IO_error(error_ID=837,ext_msg = 'N missing') loadCases(l)%N = step_discretization%get_asInt ('N')
loadCases(l)%t = step_discretization%get_asFloat('t') loadCases(l)%r = step_discretization%get_asFloat('r',defaultVal= 1.0_pReal)
loadCases(l)%N = step_discretization%get_asInt ('N')
loadCases(l)%r = step_discretization%get_asFloat('r', defaultVal= 1.0_pReal)
loadCases(l)%f_restart = load_step%get_asInt('f_restart', defaultVal=huge(0)) loadCases(l)%f_restart = load_step%get_asInt('f_restart', defaultVal=huge(0))
if (load_step%get_asString('f_out',defaultVal='n/a') == 'none') then if (load_step%get_asString('f_out',defaultVal='n/a') == 'none') then
@ -499,15 +513,15 @@ subroutine getMaskedTensor(values,mask,tensor)
real(pReal), intent(out), dimension(3,3) :: values real(pReal), intent(out), dimension(3,3) :: values
logical, intent(out), dimension(3,3) :: mask logical, intent(out), dimension(3,3) :: mask
class (tNode), pointer :: tensor type(tList), pointer :: tensor
class (tNode), pointer :: row type(tList), pointer :: row
integer :: i,j integer :: i,j
values = 0.0_pReal values = 0.0_pReal
do i = 1,3 do i = 1,3
row => tensor%get(i) row => tensor%get_list(i)
do j = 1,3 do j = 1,3
mask(i,j) = row%get_asString(j) == 'x' mask(i,j) = row%get_asString(j) == 'x'
if (.not. mask(i,j)) values(i,j) = row%get_asFloat(j) if (.not. mask(i,j)) values(i,j) = row%get_asFloat(j)

View File

@ -76,7 +76,7 @@ subroutine grid_damage_spectral_init()
Vec :: uBound, lBound Vec :: uBound, lBound
integer(MPI_INTEGER_KIND) :: err_MPI integer(MPI_INTEGER_KIND) :: err_MPI
PetscErrorCode :: err_PETSc PetscErrorCode :: err_PETSc
class(tNode), pointer :: & type(tDict), pointer :: &
num_grid, & num_grid, &
num_generic num_generic
character(len=pStringLen) :: & character(len=pStringLen) :: &
@ -89,12 +89,12 @@ subroutine grid_damage_spectral_init()
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! read numerical parameters and do sanity checks ! read numerical parameters and do sanity checks
num_grid => config_numerics%get('grid',defaultVal=emptyDict) num_grid => config_numerics%get_dict('grid',defaultVal=emptyDict)
num%itmax = num_grid%get_asInt ('itmax',defaultVal=250) num%itmax = num_grid%get_asInt ('itmax',defaultVal=250)
num%eps_damage_atol = num_grid%get_asFloat ('eps_damage_atol',defaultVal=1.0e-2_pReal) num%eps_damage_atol = num_grid%get_asFloat ('eps_damage_atol',defaultVal=1.0e-2_pReal)
num%eps_damage_rtol = num_grid%get_asFloat ('eps_damage_rtol',defaultVal=1.0e-6_pReal) num%eps_damage_rtol = num_grid%get_asFloat ('eps_damage_rtol',defaultVal=1.0e-6_pReal)
num_generic => config_numerics%get('generic',defaultVal=emptyDict) num_generic => config_numerics%get_dict('generic',defaultVal=emptyDict)
num%residualStiffness = num_generic%get_asFloat('residualStiffness', defaultVal=1.0e-6_pReal) num%residualStiffness = num_generic%get_asFloat('residualStiffness', defaultVal=1.0e-6_pReal)
if (num%residualStiffness < 0.0_pReal) call IO_error(301,ext_msg='residualStiffness') if (num%residualStiffness < 0.0_pReal) call IO_error(301,ext_msg='residualStiffness')

View File

@ -117,22 +117,24 @@ subroutine grid_mechanical_FEM_init
u_current,u_lastInc u_current,u_lastInc
PetscInt, dimension(0:worldsize-1) :: localK PetscInt, dimension(0:worldsize-1) :: localK
integer(HID_T) :: fileHandle, groupHandle integer(HID_T) :: fileHandle, groupHandle
class(tNode), pointer :: & type(tDict), pointer :: &
num_grid, & num_grid
type(tList), pointer :: &
debug_grid debug_grid
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
print'(/,1x,a)', '<<<+- grid_mechanical_FEM init -+>>>'; flush(IO_STDOUT) print'(/,1x,a)', '<<<+- grid_mechanical_FEM init -+>>>'; flush(IO_STDOUT)
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! debugging options ! debugging options
debug_grid => config_debug%get('grid',defaultVal=emptyList) debug_grid => config_debug%get_list('grid',defaultVal=emptyList)
debugRotation = debug_grid%contains('rotation') debugRotation = debug_grid%contains('rotation')
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! read numerical parameters and do sanity checks ! read numerical parameters and do sanity checks
num_grid => config_numerics%get('grid',defaultVal=emptyDict) num_grid => config_numerics%get_dict('grid',defaultVal=emptyDict)
num%eps_div_atol = num_grid%get_asFloat('eps_div_atol', defaultVal=1.0e-4_pReal) num%eps_div_atol = num_grid%get_asFloat('eps_div_atol', defaultVal=1.0e-4_pReal)
num%eps_div_rtol = num_grid%get_asFloat('eps_div_rtol', defaultVal=5.0e-4_pReal) num%eps_div_rtol = num_grid%get_asFloat('eps_div_rtol', defaultVal=5.0e-4_pReal)

View File

@ -118,12 +118,14 @@ subroutine grid_mechanical_spectral_basic_init
#else #else
integer :: fileUnit integer :: fileUnit
#endif #endif
class (tNode), pointer :: & type(tDict), pointer :: &
num_grid, & num_grid
type(tList), pointer :: &
debug_grid debug_grid
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
print'(/,1x,a)', '<<<+- grid_mechanical_spectral_basic init -+>>>'; flush(IO_STDOUT) print'(/,1x,a)', '<<<+- grid_mechanical_spectral_basic init -+>>>'; flush(IO_STDOUT)
print'(/,1x,a)', 'P. Eisenlohr et al., International Journal of Plasticity 46:3753, 2013' print'(/,1x,a)', 'P. Eisenlohr et al., International Journal of Plasticity 46:3753, 2013'
@ -134,12 +136,12 @@ subroutine grid_mechanical_spectral_basic_init
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! debugging options ! debugging options
debug_grid => config_debug%get('grid',defaultVal=emptyList) debug_grid => config_debug%get_list('grid',defaultVal=emptyList)
debugRotation = debug_grid%contains('rotation') debugRotation = debug_grid%contains('rotation')
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! read numerical parameters and do sanity checks ! read numerical parameters and do sanity checks
num_grid => config_numerics%get('grid',defaultVal=emptyDict) num_grid => config_numerics%get_dict('grid',defaultVal=emptyDict)
num%update_gamma = num_grid%get_asBool ('update_gamma', defaultVal=.false.) num%update_gamma = num_grid%get_asBool ('update_gamma', defaultVal=.false.)
num%eps_div_atol = num_grid%get_asFloat('eps_div_atol', defaultVal=1.0e-4_pReal) num%eps_div_atol = num_grid%get_asFloat('eps_div_atol', defaultVal=1.0e-4_pReal)

View File

@ -131,8 +131,9 @@ subroutine grid_mechanical_spectral_polarisation_init
#else #else
integer :: fileUnit integer :: fileUnit
#endif #endif
class (tNode), pointer :: & type(tDict), pointer :: &
num_grid, & num_grid
type(tList), pointer :: &
debug_grid debug_grid
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
@ -144,12 +145,12 @@ subroutine grid_mechanical_spectral_polarisation_init
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! debugging options ! debugging options
debug_grid => config_debug%get('grid',defaultVal=emptyList) debug_grid => config_debug%get_list('grid',defaultVal=emptyList)
debugRotation = debug_grid%contains('rotation') debugRotation = debug_grid%contains('rotation')
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! read numerical parameters and do sanity checks ! read numerical parameters and do sanity checks
num_grid => config_numerics%get('grid',defaultVal=emptyDict) num_grid => config_numerics%get_dict('grid',defaultVal=emptyDict)
num%update_gamma = num_grid%get_asBool ('update_gamma', defaultVal=.false.) num%update_gamma = num_grid%get_asBool ('update_gamma', defaultVal=.false.)
num%eps_div_atol = num_grid%get_asFloat('eps_div_atol', defaultVal=1.0e-4_pReal) num%eps_div_atol = num_grid%get_asFloat('eps_div_atol', defaultVal=1.0e-4_pReal)

View File

@ -78,7 +78,7 @@ subroutine grid_thermal_spectral_init()
integer(MPI_INTEGER_KIND) :: err_MPI integer(MPI_INTEGER_KIND) :: err_MPI
PetscErrorCode :: err_PETSc PetscErrorCode :: err_PETSc
integer(HID_T) :: fileHandle, groupHandle integer(HID_T) :: fileHandle, groupHandle
class(tNode), pointer :: & type(tDict), pointer :: &
num_grid num_grid
print'(/,1x,a)', '<<<+- grid_thermal_spectral init -+>>>' print'(/,1x,a)', '<<<+- grid_thermal_spectral init -+>>>'
@ -88,7 +88,7 @@ subroutine grid_thermal_spectral_init()
!------------------------------------------------------------------------------------------------- !-------------------------------------------------------------------------------------------------
! read numerical parameters and do sanity checks ! read numerical parameters and do sanity checks
num_grid => config_numerics%get('grid',defaultVal=emptyDict) num_grid => config_numerics%get_dict('grid',defaultVal=emptyDict)
num%itmax = num_grid%get_asInt ('itmax', defaultVal=250) num%itmax = num_grid%get_asInt ('itmax', defaultVal=250)
num%eps_thermal_atol = num_grid%get_asFloat ('eps_thermal_atol',defaultVal=1.0e-2_pReal) num%eps_thermal_atol = num_grid%get_asFloat ('eps_thermal_atol',defaultVal=1.0e-2_pReal)
num%eps_thermal_rtol = num_grid%get_asFloat ('eps_thermal_rtol',defaultVal=1.0e-6_pReal) num%eps_thermal_rtol = num_grid%get_asFloat ('eps_thermal_rtol',defaultVal=1.0e-6_pReal)

View File

@ -166,9 +166,11 @@ subroutine spectral_utilities_init()
tensorSize = 9_C_INTPTR_T tensorSize = 9_C_INTPTR_T
character(len=*), parameter :: & character(len=*), parameter :: &
PETSCDEBUG = ' -snes_view -snes_monitor ' PETSCDEBUG = ' -snes_view -snes_monitor '
class(tNode) , pointer :: & type(tDict) , pointer :: &
num_grid, & num_grid
debug_grid ! pointer to grid debug options type(tList) , pointer :: &
debug_grid
print'(/,1x,a)', '<<<+- spectral_utilities init -+>>>' print'(/,1x,a)', '<<<+- spectral_utilities init -+>>>'
@ -186,9 +188,9 @@ subroutine spectral_utilities_init()
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! set debugging parameters ! set debugging parameters
num_grid => config_numerics%get('grid',defaultVal=emptyDict) num_grid => config_numerics%get_dict('grid',defaultVal=emptyDict)
debug_grid => config_debug%get('grid',defaultVal=emptyList) debug_grid => config_debug%get_List('grid',defaultVal=emptyList)
debugGeneral = debug_grid%contains('basic') debugGeneral = debug_grid%contains('basic')
debugRotation = debug_grid%contains('rotation') debugRotation = debug_grid%contains('rotation')
debugPETSc = debug_grid%contains('PETSc') debugPETSc = debug_grid%contains('PETSc')

View File

@ -196,7 +196,7 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine homogenization_init() subroutine homogenization_init()
class (tNode) , pointer :: & type(tDict) , pointer :: &
num_homog, & num_homog, &
num_homogGeneric num_homogGeneric
@ -207,8 +207,8 @@ subroutine homogenization_init()
allocate(damageState_h (size(material_name_homogenization))) allocate(damageState_h (size(material_name_homogenization)))
call parseHomogenization() call parseHomogenization()
num_homog => config_numerics%get('homogenization',defaultVal=emptyDict) num_homog => config_numerics%get_dict('homogenization',defaultVal=emptyDict)
num_homogGeneric => num_homog%get('generic',defaultVal=emptyDict) num_homogGeneric => num_homog%get_dict('generic',defaultVal=emptyDict)
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')
@ -447,7 +447,7 @@ end subroutine homogenization_restartRead
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine parseHomogenization subroutine parseHomogenization
class(tNode), pointer :: & type(tDict), pointer :: &
material_homogenization, & material_homogenization, &
homog, & homog, &
homogThermal, & homogThermal, &
@ -455,17 +455,17 @@ subroutine parseHomogenization
integer :: h integer :: h
material_homogenization => config_material%get('homogenization') material_homogenization => config_material%get_dict('homogenization')
allocate(thermal_type(size(material_name_homogenization)),source=THERMAL_UNDEFINED_ID) allocate(thermal_type(size(material_name_homogenization)),source=THERMAL_UNDEFINED_ID)
allocate(thermal_active(size(material_name_homogenization)),source=.false.) allocate(thermal_active(size(material_name_homogenization)),source=.false.)
allocate(damage_active(size(material_name_homogenization)),source=.false.) allocate(damage_active(size(material_name_homogenization)),source=.false.)
do h=1, size(material_name_homogenization) do h=1, size(material_name_homogenization)
homog => material_homogenization%get(h) homog => material_homogenization%get_dict(h)
if (homog%contains('thermal')) then if (homog%contains('thermal')) then
homogThermal => homog%get('thermal') homogThermal => homog%get_dict('thermal')
select case (homogThermal%get_asString('type')) select case (homogThermal%get_asString('type'))
case('pass') case('pass')
thermal_type(h) = THERMAL_PASS_ID thermal_type(h) = THERMAL_PASS_ID
@ -479,7 +479,7 @@ subroutine parseHomogenization
end if end if
if (homog%contains('damage')) then if (homog%contains('damage')) then
homogDamage => homog%get('damage') homogDamage => homog%get_dict('damage')
select case (homogDamage%get_asString('type')) select case (homogDamage%get_asString('type'))
case('pass') case('pass')
damage_active(h) = .true. damage_active(h) = .true.

View File

@ -32,7 +32,7 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine damage_init() module subroutine damage_init()
class(tNode), pointer :: & type(tDict), pointer :: &
configHomogenizations, & configHomogenizations, &
configHomogenization, & configHomogenization, &
configHomogenizationDamage configHomogenizationDamage
@ -42,17 +42,17 @@ module subroutine damage_init()
print'(/,1x,a)', '<<<+- homogenization:damage init -+>>>' print'(/,1x,a)', '<<<+- homogenization:damage init -+>>>'
configHomogenizations => config_material%get('homogenization') configHomogenizations => config_material%get_dict('homogenization')
allocate(param(configHomogenizations%length)) allocate(param(configHomogenizations%length))
allocate(current(configHomogenizations%length)) allocate(current(configHomogenizations%length))
do ho = 1, configHomogenizations%length do ho = 1, configHomogenizations%length
Nmembers = count(material_homogenizationID == ho) Nmembers = count(material_homogenizationID == ho)
allocate(current(ho)%phi(Nmembers), source=1.0_pReal) allocate(current(ho)%phi(Nmembers), source=1.0_pReal)
configHomogenization => configHomogenizations%get(ho) configHomogenization => configHomogenizations%get_dict(ho)
associate(prm => param(ho)) associate(prm => param(ho))
if (configHomogenization%contains('damage')) then if (configHomogenization%contains('damage')) then
configHomogenizationDamage => configHomogenization%get('damage') configHomogenizationDamage => configHomogenization%get_dict('damage')
#if defined (__GFORTRAN__) #if defined (__GFORTRAN__)
prm%output = output_as1dString(configHomogenizationDamage) prm%output = output_as1dString(configHomogenizationDamage)
#else #else

View File

@ -222,7 +222,7 @@ end subroutine mechanical_results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine parseMechanical() subroutine parseMechanical()
class(tNode), pointer :: & type(tDict), pointer :: &
material_homogenization, & material_homogenization, &
homog, & homog, &
mechanical mechanical
@ -230,14 +230,14 @@ subroutine parseMechanical()
integer :: ho integer :: ho
material_homogenization => config_material%get('homogenization') material_homogenization => config_material%get_dict('homogenization')
allocate(mechanical_type(size(material_name_homogenization)), source=MECHANICAL_UNDEFINED_ID) allocate(mechanical_type(size(material_name_homogenization)), source=MECHANICAL_UNDEFINED_ID)
allocate(output_mechanical(size(material_name_homogenization))) allocate(output_mechanical(size(material_name_homogenization)))
do ho=1, size(material_name_homogenization) do ho=1, size(material_name_homogenization)
homog => material_homogenization%get(ho) homog => material_homogenization%get_dict(ho)
mechanical => homog%get('mechanical') mechanical => homog%get_dict('mechanical')
#if defined(__GFORTRAN__) #if defined(__GFORTRAN__)
output_mechanical(ho)%label = output_as1dString(mechanical) output_mechanical(ho)%label = output_as1dString(mechanical)
#else #else

View File

@ -78,7 +78,7 @@ module subroutine RGC_init()
Nmembers, & Nmembers, &
sizeState, nIntFaceTot sizeState, nIntFaceTot
class (tNode), pointer :: & class(tDict), pointer :: &
num_homogenization, & num_homogenization, &
num_mechanical, & num_mechanical, &
num_RGC, & ! pointer to RGC numerics data num_RGC, & ! pointer to RGC numerics data
@ -98,15 +98,15 @@ module subroutine RGC_init()
print'( 1x,a)', 'https://doi.org/10.1088/0965-0393/18/1/015006'//IO_EOL print'( 1x,a)', 'https://doi.org/10.1088/0965-0393/18/1/015006'//IO_EOL
material_homogenization => config_material%get('homogenization') material_homogenization => config_material%get_dict('homogenization')
allocate(param(material_homogenization%length)) allocate(param(material_homogenization%length))
allocate(state(material_homogenization%length)) allocate(state(material_homogenization%length))
allocate(state0(material_homogenization%length)) allocate(state0(material_homogenization%length))
allocate(dependentState(material_homogenization%length)) allocate(dependentState(material_homogenization%length))
num_homogenization => config_numerics%get('homogenization',defaultVal=emptyDict) num_homogenization => config_numerics%get_dict('homogenization',defaultVal=emptyDict)
num_mechanical => num_homogenization%get('mechanical',defaultVal=emptyDict) num_mechanical => num_homogenization%get_dict('mechanical',defaultVal=emptyDict)
num_RGC => num_mechanical%get('RGC',defaultVal=emptyDict) num_RGC => num_mechanical%get_dict('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)
@ -139,8 +139,8 @@ module subroutine RGC_init()
do ho = 1, size(mechanical_type) do ho = 1, size(mechanical_type)
if (mechanical_type(ho) /= MECHANICAL_RGC_ID) cycle if (mechanical_type(ho) /= MECHANICAL_RGC_ID) cycle
homog => material_homogenization%get(ho) homog => material_homogenization%get_dict(ho)
homogMech => homog%get('mechanical') homogMech => homog%get_dict('mechanical')
associate(prm => param(ho), & associate(prm => param(ho), &
stt => state(ho), & stt => state(ho), &
st0 => state0(ho), & st0 => state0(ho), &

View File

@ -35,7 +35,7 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine thermal_init() module subroutine thermal_init()
class(tNode), pointer :: & type(tDict), pointer :: &
configHomogenizations, & configHomogenizations, &
configHomogenization, & configHomogenization, &
configHomogenizationThermal configHomogenizationThermal
@ -45,18 +45,18 @@ module subroutine thermal_init()
print'(/,1x,a)', '<<<+- homogenization:thermal init -+>>>' print'(/,1x,a)', '<<<+- homogenization:thermal init -+>>>'
configHomogenizations => config_material%get('homogenization') configHomogenizations => config_material%get_dict('homogenization')
allocate(param(configHomogenizations%length)) allocate(param(configHomogenizations%length))
allocate(current(configHomogenizations%length)) allocate(current(configHomogenizations%length))
do ho = 1, configHomogenizations%length do ho = 1, configHomogenizations%length
allocate(current(ho)%T(count(material_homogenizationID==ho)), source=T_ROOM) allocate(current(ho)%T(count(material_homogenizationID==ho)), source=T_ROOM)
allocate(current(ho)%dot_T(count(material_homogenizationID==ho)), source=0.0_pReal) allocate(current(ho)%dot_T(count(material_homogenizationID==ho)), source=0.0_pReal)
configHomogenization => configHomogenizations%get(ho) configHomogenization => configHomogenizations%get_dict(ho)
associate(prm => param(ho)) associate(prm => param(ho))
if (configHomogenization%contains('thermal')) then if (configHomogenization%contains('thermal')) then
configHomogenizationThermal => configHomogenization%get('thermal') configHomogenizationThermal => configHomogenization%get_dict('thermal')
#if defined (__GFORTRAN__) #if defined (__GFORTRAN__)
prm%output = output_as1dString(configHomogenizationThermal) prm%output = output_as1dString(configHomogenizationThermal)
#else #else

View File

@ -83,13 +83,13 @@ end subroutine material_init
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine parse() subroutine parse()
class(tNode), pointer :: materials, & !> list of materials type(tList), pointer :: materials, & !> all materials
material, & !> material definition constituents !> all constituents of a material
constituents, & !> list of constituents type(tDict), pointer :: phases, & !> all phases
constituent, & !> constituent definition homogenizations, & !> all homogenizations
phases, & material, & !> material definition
homogenizations, & constituent, & !> constituent definition
homogenization homogenization
class(tItem), pointer :: item class(tItem), pointer :: item
integer, dimension(:), allocatable :: & integer, dimension(:), allocatable :: &
@ -107,25 +107,20 @@ subroutine parse()
ma ma
materials => config_material%get('material') materials => config_material%get_list('material')
phases => config_material%get('phase') phases => config_material%get_dict('phase')
homogenizations => config_material%get('homogenization') homogenizations => config_material%get_dict('homogenization')
if (maxval(discretization_materialAt) > materials%length) & if (maxval(discretization_materialAt) > materials%length) &
call IO_error(155,ext_msg='More materials requested than found in material.yaml') call IO_error(155,ext_msg='More materials requested than found in material.yaml')
#if defined (__GFORTRAN__) material_name_phase = phases%keys()
material_name_phase = getKeys(phases) material_name_homogenization = homogenizations%keys()
material_name_homogenization = getKeys(homogenizations)
#else
material_name_phase = phases%Keys()
material_name_homogenization = homogenizations%Keys()
#endif
allocate(homogenization_Nconstituents(homogenizations%length)) allocate(homogenization_Nconstituents(homogenizations%length))
do ho=1, homogenizations%length do ho=1, homogenizations%length
homogenization => homogenizations%get(ho) homogenization => homogenizations%get_dict(ho)
homogenization_Nconstituents(ho) = homogenization%get_asInt('N_constituents') homogenization_Nconstituents(ho) = homogenization%get_asInt('N_constituents')
end do end do
homogenization_maxNconstituents = maxval(homogenization_Nconstituents) homogenization_maxNconstituents = maxval(homogenization_Nconstituents)
@ -140,40 +135,33 @@ subroutine parse()
allocate( v_of(materials%length,homogenization_maxNconstituents),source=0.0_pReal) allocate( v_of(materials%length,homogenization_maxNconstituents),source=0.0_pReal)
! parse YAML structure ! parse YAML structure
select type(materials) item => materials%first
do ma = 1, materials%length
material => item%node%asDict()
ho_of(ma) = homogenizations%index(material%get_asString('homogenization'))
constituents => material%get_list('constituents')
class is(tList) homogenization => homogenizations%get_dict(ho_of(ma))
if (constituents%length /= homogenization%get_asInt('N_constituents')) call IO_error(148)
item => materials%first allocate(material_O_0(ma)%data(constituents%length))
do ma = 1, materials%length allocate(material_V_e_0(ma)%data(1:3,1:3,constituents%length))
material => item%node
ho_of(ma) = homogenizations%getIndex(material%get_asString('homogenization'))
constituents => material%get('constituents')
homogenization => homogenizations%get(ho_of(ma)) do co = 1, constituents%length
if (constituents%length /= homogenization%get_asInt('N_constituents')) call IO_error(148) constituent => constituents%get_dict(co)
v_of(ma,co) = constituent%get_asFloat('v')
ph_of(ma,co) = phases%index(constituent%get_asString('phase'))
allocate(material_O_0(ma)%data(constituents%length)) call material_O_0(ma)%data(co)%fromQuaternion(constituent%get_as1dFloat('O',requiredSize=4))
allocate(material_V_e_0(ma)%data(1:3,1:3,constituents%length)) material_V_e_0(ma)%data(1:3,1:3,co) = constituent%get_as2dFloat('V_e',defaultVal=math_I3,requiredShape=[3,3])
if (any(dNeq(material_V_e_0(ma)%data(1:3,1:3,co),transpose(material_V_e_0(ma)%data(1:3,1:3,co))))) &
call IO_error(147)
do co = 1, constituents%length end do
constituent => constituents%get(co) if (dNeq(sum(v_of(ma,:)),1.0_pReal,1.e-9_pReal)) call IO_error(153,ext_msg='constituent')
v_of(ma,co) = constituent%get_asFloat('v')
ph_of(ma,co) = phases%getIndex(constituent%get_asString('phase'))
call material_O_0(ma)%data(co)%fromQuaternion(constituent%get_as1dFloat('O',requiredSize=4))
material_V_e_0(ma)%data(1:3,1:3,co) = constituent%get_as2dFloat('V_e',defaultVal=math_I3,requiredShape=[3,3])
if (any(dNeq(material_V_e_0(ma)%data(1:3,1:3,co),transpose(material_V_e_0(ma)%data(1:3,1:3,co))))) &
call IO_error(147)
end do
if (dNeq(sum(v_of(ma,:)),1.0_pReal,1.e-9_pReal)) call IO_error(153,ext_msg='constituent')
item => item%next
end do
end select
item => item%next
end do
allocate(counterPhase(phases%length),source=0) allocate(counterPhase(phases%length),source=0)
allocate(counterHomogenization(homogenizations%length),source=0) allocate(counterHomogenization(homogenizations%length),source=0)
@ -223,7 +211,7 @@ end subroutine parse
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
function getKeys(dict) function getKeys(dict)
class(tNode), intent(in) :: dict type(tDict), intent(in) :: dict
character(len=:), dimension(:), allocatable :: getKeys character(len=:), dimension(:), allocatable :: getKeys
character(len=pStringLen), dimension(:), allocatable :: temp character(len=pStringLen), dimension(:), allocatable :: temp
@ -232,7 +220,7 @@ function getKeys(dict)
allocate(temp(dict%length)) allocate(temp(dict%length))
l = 0 l = 0
do i=1, dict%length do i=1, dict%length
temp(i) = dict%getKey(i) temp(i) = dict%key(i)
l = max(len_trim(temp(i)),l) l = max(len_trim(temp(i)),l)
end do end do

View File

@ -87,13 +87,13 @@ subroutine math_init()
real(pReal), dimension(4) :: randTest real(pReal), dimension(4) :: randTest
integer :: randSize integer :: randSize
integer, dimension(:), allocatable :: seed integer, dimension(:), allocatable :: seed
class(tNode), pointer :: & type(tDict), pointer :: &
num_generic num_generic
print'(/,1x,a)', '<<<+- math init -+>>>'; flush(IO_STDOUT) print'(/,1x,a)', '<<<+- math init -+>>>'; flush(IO_STDOUT)
num_generic => config_numerics%get('generic',defaultVal=emptyDict) num_generic => config_numerics%get_dict('generic',defaultVal=emptyDict)
call random_seed(size=randSize) call random_seed(size=randSize)
allocate(seed(randSize)) allocate(seed(randSize))

View File

@ -65,7 +65,7 @@ program DAMASK_mesh
statUnit = 0, & !< file unit for statistics output statUnit = 0, & !< file unit for statistics output
stagIter, & stagIter, &
component component
class(tNode), pointer :: & type(tDict), pointer :: &
num_mesh num_mesh
character(len=pStringLen), dimension(:), allocatable :: fileContent character(len=pStringLen), dimension(:), allocatable :: fileContent
character(len=pStringLen) :: & character(len=pStringLen) :: &
@ -90,7 +90,7 @@ program DAMASK_mesh
!--------------------------------------------------------------------- !---------------------------------------------------------------------
! reading field information from numerics file and do sanity checks ! reading field information from numerics file and do sanity checks
num_mesh => config_numerics%get('mesh', defaultVal=emptyDict) num_mesh => config_numerics%get_dict('mesh', defaultVal=emptyDict)
stagItMax = num_mesh%get_asInt('maxStaggeredIter',defaultVal=10) stagItMax = num_mesh%get_asInt('maxStaggeredIter',defaultVal=10)
maxCutBack = num_mesh%get_asInt('maxCutBack',defaultVal=3) maxCutBack = num_mesh%get_asInt('maxCutBack',defaultVal=3)

View File

@ -93,7 +93,7 @@ contains
subroutine FEM_utilities_init subroutine FEM_utilities_init
character(len=pStringLen) :: petsc_optionsOrder character(len=pStringLen) :: petsc_optionsOrder
class(tNode), pointer :: & type(tDict), pointer :: &
num_mesh, & num_mesh, &
debug_mesh ! pointer to mesh debug options debug_mesh ! pointer to mesh debug options
integer :: & integer :: &
@ -107,7 +107,7 @@ subroutine FEM_utilities_init
print'(/,1x,a)', '<<<+- FEM_utilities init -+>>>' print'(/,1x,a)', '<<<+- FEM_utilities init -+>>>'
num_mesh => config_numerics%get('mesh',defaultVal=emptyDict) num_mesh => config_numerics%get_dict('mesh',defaultVal=emptyDict)
p_s = num_mesh%get_asInt('p_s',defaultVal = 2) p_s = num_mesh%get_asInt('p_s',defaultVal = 2)
p_i = num_mesh%get_asInt('p_i',defaultVal = p_s) p_i = num_mesh%get_asInt('p_i',defaultVal = p_s)
@ -117,8 +117,8 @@ subroutine FEM_utilities_init
if (p_i < max(1,p_s-1) .or. p_i > p_s) & if (p_i < max(1,p_s-1) .or. p_i > p_s) &
call IO_error(821,ext_msg='integration order (p_i) out of bounds') call IO_error(821,ext_msg='integration order (p_i) out of bounds')
debug_mesh => config_debug%get('mesh',defaultVal=emptyList) debug_mesh => config_debug%get_dict('mesh',defaultVal=emptyDict)
debugPETSc = debug_mesh%contains('PETSc') debugPETSc = debug_mesh%contains('PETSc')
if(debugPETSc) print'(3(/,1x,a),/)', & if(debugPETSc) print'(3(/,1x,a),/)', &
'Initializing PETSc with debug options: ', & 'Initializing PETSc with debug options: ', &

View File

@ -90,7 +90,7 @@ subroutine discretization_mesh_init(restart)
integer(MPI_INTEGER_KIND) :: err_MPI integer(MPI_INTEGER_KIND) :: err_MPI
PetscInt, dimension(:), allocatable :: & PetscInt, dimension(:), allocatable :: &
materialAt materialAt
class(tNode), pointer :: & type(tDict), pointer :: &
num_mesh num_mesh
integer :: p_i, dim !< integration order (quadrature rule) integer :: p_i, dim !< integration order (quadrature rule)
type(tvec) :: coords_node0 type(tvec) :: coords_node0
@ -101,7 +101,7 @@ subroutine discretization_mesh_init(restart)
!-------------------------------------------------------------------------------- !--------------------------------------------------------------------------------
! read numerics parameter ! read numerics parameter
num_mesh => config_numerics%get('mesh',defaultVal=emptyDict) num_mesh => config_numerics%get_dict('mesh',defaultVal=emptyDict)
p_i = num_mesh%get_asInt('p_i',defaultVal = 2) p_i = num_mesh%get_asInt('p_i',defaultVal = 2)
!--------------------------------------------------------------------------------- !---------------------------------------------------------------------------------

View File

@ -126,14 +126,14 @@ subroutine FEM_mechanical_init(fieldBC)
character(len=*), parameter :: prefix = 'mechFE_' character(len=*), parameter :: prefix = 'mechFE_'
PetscErrorCode :: err_PETSc PetscErrorCode :: err_PETSc
real(pReal), dimension(3,3) :: devNull real(pReal), dimension(3,3) :: devNull
class(tNode), pointer :: & type(tDict), pointer :: &
num_mesh num_mesh
print'(/,1x,a)', '<<<+- FEM_mech init -+>>>'; flush(IO_STDOUT) print'(/,1x,a)', '<<<+- FEM_mech init -+>>>'; flush(IO_STDOUT)
!----------------------------------------------------------------------------- !-----------------------------------------------------------------------------
! read numerical parametes and do sanity checks ! read numerical parametes and do sanity checks
num_mesh => config_numerics%get('mesh',defaultVal=emptyDict) num_mesh => config_numerics%get_dict('mesh',defaultVal=emptyDict)
num%p_i = int(num_mesh%get_asInt('p_i',defaultVal = 2),pPETSCINT) num%p_i = int(num_mesh%get_asInt('p_i',defaultVal = 2),pPETSCINT)
num%itmax = int(num_mesh%get_asInt('itmax',defaultVal=250),pPETSCINT) num%itmax = int(num_mesh%get_asInt('itmax',defaultVal=250),pPETSCINT)
num%BBarStabilisation = num_mesh%get_asBool('bbarstabilisation',defaultVal = .false.) num%BBarStabilisation = num_mesh%get_asBool('bbarstabilisation',defaultVal = .false.)

View File

@ -96,14 +96,14 @@ module phase
! == cleaned:begin ================================================================================= ! == cleaned:begin =================================================================================
module subroutine mechanical_init(phases) module subroutine mechanical_init(phases)
class(tNode), pointer :: phases type(tDict), pointer :: phases
end subroutine mechanical_init end subroutine mechanical_init
module subroutine damage_init module subroutine damage_init
end subroutine damage_init end subroutine damage_init
module subroutine thermal_init(phases) module subroutine thermal_init(phases)
class(tNode), pointer :: phases type(tDict), pointer :: phases
end subroutine thermal_init end subroutine thermal_init
@ -376,16 +376,16 @@ subroutine phase_init
integer :: & integer :: &
ph, ce, co, ma ph, ce, co, ma
class (tNode), pointer :: & type(tDict), pointer :: &
debug_constitutive, &
materials, &
phases, & phases, &
phase phase
type(tList), pointer :: &
debug_constitutive
print'(/,1x,a)', '<<<+- phase init -+>>>'; flush(IO_STDOUT) print'(/,1x,a)', '<<<+- phase init -+>>>'; flush(IO_STDOUT)
debug_constitutive => config_debug%get('phase', defaultVal=emptyList) debug_constitutive => config_debug%get_list('phase', defaultVal=emptyList)
debugConstitutive%basic = debug_constitutive%contains('basic') debugConstitutive%basic = debug_constitutive%contains('basic')
debugConstitutive%extensive = debug_constitutive%contains('extensive') debugConstitutive%extensive = debug_constitutive%contains('extensive')
debugConstitutive%selective = debug_constitutive%contains('selective') debugConstitutive%selective = debug_constitutive%contains('selective')
@ -394,8 +394,7 @@ subroutine phase_init
debugConstitutive%grain = config_debug%get_asInt('constituent', defaultVal = 1) debugConstitutive%grain = config_debug%get_asInt('constituent', defaultVal = 1)
materials => config_material%get('material') phases => config_material%get_dict('phase')
phases => config_material%get('phase')
allocate(phase_lattice(phases%length)) allocate(phase_lattice(phases%length))
allocate(phase_cOverA(phases%length),source=-1.0_pReal) allocate(phase_cOverA(phases%length),source=-1.0_pReal)
@ -403,7 +402,7 @@ subroutine phase_init
allocate(phase_O_0(phases%length)) allocate(phase_O_0(phases%length))
do ph = 1,phases%length do ph = 1,phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
phase_lattice(ph) = phase%get_asString('lattice') phase_lattice(ph) = phase%get_asString('lattice')
if (all(phase_lattice(ph) /= ['cF','cI','hP','tI'])) & if (all(phase_lattice(ph) /= ['cF','cI','hP','tI'])) &
call IO_error(130,ext_msg='phase_init: '//phase%get_asString('lattice')) call IO_error(130,ext_msg='phase_init: '//phase%get_asString('lattice'))
@ -536,13 +535,13 @@ subroutine crystallite_init()
ip, & !< counter in integration point loop ip, & !< counter in integration point loop
el, & !< counter in element loop el, & !< counter in element loop
en, ph en, ph
class(tNode), pointer :: & type(tDict), pointer :: &
num_crystallite, & num_crystallite, &
phases phases
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
num_crystallite => config_numerics%get('crystallite',defaultVal=emptyDict) num_crystallite => config_numerics%get_dict('crystallite',defaultVal=emptyDict)
num%subStepMinCryst = num_crystallite%get_asFloat ('subStepMin', defaultVal=1.0e-3_pReal) num%subStepMinCryst = num_crystallite%get_asFloat ('subStepMin', defaultVal=1.0e-3_pReal)
num%subStepSizeCryst = num_crystallite%get_asFloat ('subStepSize', defaultVal=0.25_pReal) num%subStepSizeCryst = num_crystallite%get_asFloat ('subStepSize', defaultVal=0.25_pReal)
@ -570,7 +569,7 @@ subroutine crystallite_init()
if (extmsg /= '') call IO_error(301,ext_msg=trim(extmsg)) if (extmsg /= '') call IO_error(301,ext_msg=trim(extmsg))
phases => config_material%get('phase') phases => config_material%get_dict('phase')
!$OMP PARALLEL DO PRIVATE(ce,ph,en) !$OMP PARALLEL DO PRIVATE(ce,ph,en)
do el = 1, discretization_Nelems do el = 1, discretization_Nelems

View File

@ -77,19 +77,20 @@ module subroutine damage_init
integer :: & integer :: &
ph, & ph, &
Nmembers Nmembers
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
sources, &
source source
type(tList), pointer :: &
sources
logical:: damage_active logical:: damage_active
print'(/,1x,a)', '<<<+- phase:damage init -+>>>' print'(/,1x,a)', '<<<+- phase:damage init -+>>>'
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(current(phases%length)) allocate(current(phases%length))
allocate(damageState (phases%length)) allocate(damageState(phases%length))
allocate(param(phases%length)) allocate(param(phases%length))
damage_active = .false. damage_active = .false.
@ -99,12 +100,12 @@ module subroutine damage_init
allocate(current(ph)%phi(Nmembers),source=1.0_pReal) allocate(current(ph)%phi(Nmembers),source=1.0_pReal)
phase => phases%get(ph) phase => phases%get_dict(ph)
sources => phase%get('damage',defaultVal=emptyList) sources => phase%get_list('damage',defaultVal=emptyList)
if (sources%length > 1) error stop if (sources%length > 1) error stop
if (sources%length == 1) then if (sources%length == 1) then
damage_active = .true. damage_active = .true.
source => sources%get(1) source => sources%get_dict(1)
param(ph)%mu = source%get_asFloat('mu') param(ph)%mu = source%get_asFloat('mu')
param(ph)%l_c = source%get_asFloat('l_c') param(ph)%l_c = source%get_asFloat('l_c')
end if end if
@ -440,19 +441,20 @@ function source_active(source_label) result(active_source)
character(len=*), intent(in) :: source_label !< name of source mechanism character(len=*), intent(in) :: source_label !< name of source mechanism
logical, dimension(:), allocatable :: active_source logical, dimension(:), allocatable :: active_source
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
sources, &
src src
type(tList), pointer :: &
sources
integer :: ph integer :: ph
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(active_source(phases%length)) allocate(active_source(phases%length))
do ph = 1, phases%length do ph = 1, phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
sources => phase%get('damage',defaultVal=emptyList) sources => phase%get_list('damage',defaultVal=emptyList)
src => sources%get(1) src => sources%get_dict(1)
active_source(ph) = src%get_asString('type',defaultVal = 'x') == source_label active_source(ph) = src%get_asString('type',defaultVal = 'x') == source_label
end do end do

View File

@ -35,11 +35,12 @@ module function anisobrittle_init() result(mySources)
logical, dimension(:), allocatable :: mySources logical, dimension(:), allocatable :: mySources
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
sources, &
src src
type(tList), pointer :: &
sources
integer :: Nmembers,ph integer :: Nmembers,ph
integer, dimension(:), allocatable :: N_cl integer, dimension(:), allocatable :: N_cl
character(len=pStringLen) :: extmsg = '' character(len=pStringLen) :: extmsg = ''
@ -52,17 +53,17 @@ module function anisobrittle_init() result(mySources)
print'(/,a,i0)', ' # phases: ',count(mySources); flush(IO_STDOUT) print'(/,a,i0)', ' # phases: ',count(mySources); flush(IO_STDOUT)
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
do ph = 1, phases%length do ph = 1, phases%length
if (mySources(ph)) then if (mySources(ph)) then
phase => phases%get(ph) phase => phases%get_dict(ph)
sources => phase%get('damage') sources => phase%get_list('damage')
associate(prm => param(ph)) associate(prm => param(ph))
src => sources%get(1) src => sources%get_dict(1)
N_cl = src%get_as1dInt('N_cl',defaultVal=emptyIntArray) N_cl = src%get_as1dInt('N_cl',defaultVal=emptyIntArray)
prm%sum_N_cl = sum(abs(N_cl)) prm%sum_N_cl = sum(abs(N_cl))

View File

@ -34,11 +34,12 @@ module function isobrittle_init() result(mySources)
logical, dimension(:), allocatable :: mySources logical, dimension(:), allocatable :: mySources
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
sources, &
src src
type(tList), pointer :: &
sources
integer :: Nmembers,ph integer :: Nmembers,ph
character(len=pStringLen) :: extmsg = '' character(len=pStringLen) :: extmsg = ''
@ -50,18 +51,18 @@ module function isobrittle_init() result(mySources)
print'(/,a,i0)', ' # phases: ',count(mySources); flush(IO_STDOUT) print'(/,a,i0)', ' # phases: ',count(mySources); flush(IO_STDOUT)
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
allocate(deltaState(phases%length)) allocate(deltaState(phases%length))
do ph = 1, phases%length do ph = 1, phases%length
if (mySources(ph)) then if (mySources(ph)) then
phase => phases%get(ph) phase => phases%get_dict(ph)
sources => phase%get('damage') sources => phase%get_list('damage')
associate(prm => param(ph), dlt => deltaState(ph), stt => state(ph)) associate(prm => param(ph), dlt => deltaState(ph), stt => state(ph))
src => sources%get(1) src => sources%get_dict(1)
prm%W_crit = src%get_asFloat('G_crit')/src%get_asFloat('l_c') prm%W_crit = src%get_asFloat('G_crit')/src%get_asFloat('l_c')

View File

@ -43,11 +43,11 @@ submodule(phase) mechanical
interface interface
module subroutine eigen_init(phases) module subroutine eigen_init(phases)
class(tNode), pointer :: phases type(tDict), pointer :: phases
end subroutine eigen_init end subroutine eigen_init
module subroutine elastic_init(phases) module subroutine elastic_init(phases)
class(tNode), pointer :: phases type(tDict), pointer :: phases
end subroutine elastic_init end subroutine elastic_init
module subroutine plastic_init module subroutine plastic_init
@ -198,7 +198,7 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine mechanical_init(phases) module subroutine mechanical_init(phases)
class(tNode), pointer :: & type(tDict), pointer :: &
phases phases
integer :: & integer :: &
@ -208,7 +208,7 @@ module subroutine mechanical_init(phases)
ph, & ph, &
en, & en, &
Nmembers Nmembers
class(tNode), pointer :: & type(tDict), pointer :: &
num_crystallite, & num_crystallite, &
phase, & phase, &
mech mech
@ -248,8 +248,8 @@ module subroutine mechanical_init(phases)
allocate(phase_mechanical_P(ph)%data(3,3,Nmembers),source=0.0_pReal) allocate(phase_mechanical_P(ph)%data(3,3,Nmembers),source=0.0_pReal)
allocate(phase_mechanical_S0(ph)%data(3,3,Nmembers),source=0.0_pReal) allocate(phase_mechanical_S0(ph)%data(3,3,Nmembers),source=0.0_pReal)
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
#if defined(__GFORTRAN__) #if defined(__GFORTRAN__)
output_mechanical(ph)%label = output_as1dString(mech) output_mechanical(ph)%label = output_as1dString(mech)
#else #else
@ -286,7 +286,7 @@ module subroutine mechanical_init(phases)
plasticState(ph)%state0 = plasticState(ph)%state plasticState(ph)%state0 = plasticState(ph)%state
end do end do
num_crystallite => config_numerics%get('crystallite',defaultVal=emptyDict) num_crystallite => config_numerics%get_dict('crystallite',defaultVal=emptyDict)
select case(num_crystallite%get_asString('integrator',defaultVal='FPI')) select case(num_crystallite%get_asString('integrator',defaultVal='FPI'))

View File

@ -34,15 +34,16 @@ contains
module subroutine eigen_init(phases) module subroutine eigen_init(phases)
class(tNode), pointer :: & type(tDict), pointer :: &
phases phases
integer :: & integer :: &
ph ph
class(tNode), pointer :: & type(tDict), pointer :: &
phase, & phase, &
kinematics, &
mechanics mechanics
type(tList), pointer :: &
kinematics
print'(/,1x,a)', '<<<+- phase:mechanical:eigen init -+>>>' print'(/,1x,a)', '<<<+- phase:mechanical:eigen init -+>>>'
@ -51,9 +52,9 @@ module subroutine eigen_init(phases)
allocate(Nmodels(phases%length),source = 0) allocate(Nmodels(phases%length),source = 0)
do ph = 1,phases%length do ph = 1,phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
mechanics => phase%get('mechanical') mechanics => phase%get_dict('mechanical')
kinematics => mechanics%get('eigen',defaultVal=emptyList) kinematics => mechanics%get_list('eigen',defaultVal=emptyList)
Nmodels(ph) = kinematics%length Nmodels(ph) = kinematics%length
end do end do
@ -80,27 +81,28 @@ function kinematics_active(kinematics_label,kinematics_length) result(active_ki
integer, intent(in) :: kinematics_length !< max. number of kinematics in system integer, intent(in) :: kinematics_length !< max. number of kinematics in system
logical, dimension(:,:), allocatable :: active_kinematics logical, dimension(:,:), allocatable :: active_kinematics
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
kinematics, & mechanics, &
kinematics_type, & kinematic
mechanics type(tList), pointer :: &
kinematics
integer :: ph,k integer :: ph,k
phases => config_material%get('phase')
phases => config_material%get_dict('phase')
allocate(active_kinematics(kinematics_length,phases%length), source = .false. ) allocate(active_kinematics(kinematics_length,phases%length), source = .false. )
do ph = 1, phases%length do ph = 1, phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
mechanics => phase%get('mechanical') mechanics => phase%get_dict('mechanical')
kinematics => mechanics%get('eigen',defaultVal=emptyList) kinematics => mechanics%get_list('eigen',defaultVal=emptyList)
do k = 1, kinematics%length do k = 1, kinematics%length
kinematics_type => kinematics%get(k) kinematic => kinematics%get_dict(k)
active_kinematics(k,ph) = kinematics_type%get_asString('type') == kinematics_label active_kinematics(k,ph) = kinematic%get_asString('type') == kinematics_label
end do end do
end do end do
end function kinematics_active end function kinematics_active
@ -113,20 +115,21 @@ function kinematics_active2(kinematics_label) result(active_kinematics)
character(len=*), intent(in) :: kinematics_label !< name of kinematic mechanism character(len=*), intent(in) :: kinematics_label !< name of kinematic mechanism
logical, dimension(:), allocatable :: active_kinematics logical, dimension(:), allocatable :: active_kinematics
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
kinematics, &
kinematics_type kinematics_type
type(tList), pointer :: &
kinematics
integer :: ph integer :: ph
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(active_kinematics(phases%length), source = .false.) allocate(active_kinematics(phases%length), source = .false.)
do ph = 1, phases%length do ph = 1, phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
kinematics => phase%get('damage',defaultVal=emptyList) kinematics => phase%get_list('damage',defaultVal=emptyList)
if (kinematics%length < 1) return if (kinematics%length < 1) return
kinematics_type => kinematics%get(1) kinematics_type => kinematics%get_dict(1)
if (.not. kinematics_type%contains('type')) continue if (.not. kinematics_type%contains('type')) continue
active_kinematics(ph) = kinematics_type%get_asString('type',defaultVal='n/a') == kinematics_label active_kinematics(ph) = kinematics_type%get_asString('type',defaultVal='n/a') == kinematics_label
end do end do

View File

@ -28,12 +28,13 @@ module function thermalexpansion_init(kinematics_length) result(myKinematics)
logical, dimension(:,:), allocatable :: myKinematics logical, dimension(:,:), allocatable :: myKinematics
integer :: Ninstances, p, k integer :: Ninstances, p, k
class(tNode), pointer :: & type(tList), pointer :: &
kinematics
type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
mech, & mech
kinematics, &
myConfig
print'(/,1x,a)', '<<<+- phase:mechanical:eigen:thermalexpansion init -+>>>' print'(/,1x,a)', '<<<+- phase:mechanical:eigen:thermalexpansion init -+>>>'
@ -42,26 +43,23 @@ module function thermalexpansion_init(kinematics_length) result(myKinematics)
print'(/,a,i2)', ' # phases: ',Ninstances; flush(IO_STDOUT) print'(/,a,i2)', ' # phases: ',Ninstances; flush(IO_STDOUT)
if (Ninstances == 0) return if (Ninstances == 0) return
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(Ninstances)) allocate(param(Ninstances))
allocate(kinematics_thermal_expansion_instance(phases%length), source=0) allocate(kinematics_thermal_expansion_instance(phases%length), source=0)
do p = 1, phases%length do p = 1, phases%length
if (any(myKinematics(:,p))) kinematics_thermal_expansion_instance(p) = count(myKinematics(:,1:p)) if (any(myKinematics(:,p))) kinematics_thermal_expansion_instance(p) = count(myKinematics(:,1:p))
phase => phases%get(p) phase => phases%get_dict(p)
if (count(myKinematics(:,p)) == 0) cycle if (count(myKinematics(:,p)) == 0) cycle
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
kinematics => mech%get('eigen') kinematics => mech%get_list('eigen')
do k = 1, kinematics%length do k = 1, kinematics%length
if (myKinematics(k,p)) then if (myKinematics(k,p)) then
associate(prm => param(kinematics_thermal_expansion_instance(p))) associate(prm => param(kinematics_thermal_expansion_instance(p)))
myConfig => kinematics%get(k) prm%A_11 = polynomial(kinematics%get_dict(k),'A_11','T')
prm%A_11 = polynomial(myConfig%asDict(),'A_11','T')
if (any(phase_lattice(p) == ['hP','tI'])) & if (any(phase_lattice(p) == ['hP','tI'])) &
prm%A_33 = polynomial(myConfig%asDict(),'A_33','T') prm%A_33 = polynomial(kinematics%get_dict(k),'A_33','T')
end associate end associate
end if end if
end do end do

View File

@ -19,12 +19,12 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module subroutine elastic_init(phases) module subroutine elastic_init(phases)
class(tNode), pointer :: & type(tDict), pointer :: &
phases phases
integer :: & integer :: &
ph ph
class(tNode), pointer :: & type(tDict), pointer :: &
phase, & phase, &
mech, & mech, &
elastic elastic
@ -38,9 +38,9 @@ module subroutine elastic_init(phases)
allocate(param(phases%length)) allocate(param(phases%length))
do ph = 1, phases%length do ph = 1, phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
elastic => mech%get('elastic') elastic => mech%get_dict('elastic')
if (elastic%get_asString('type') /= 'Hooke') call IO_error(200,ext_msg=elastic%get_asString('type')) if (elastic%get_asString('type') /= 'Hooke') call IO_error(200,ext_msg=elastic%get_asString('type'))
associate(prm => param(ph)) associate(prm => param(ph))

View File

@ -421,19 +421,19 @@ function plastic_active(plastic_label) result(active_plastic)
character(len=*), intent(in) :: plastic_label !< type of plasticity model character(len=*), intent(in) :: plastic_label !< type of plasticity model
logical, dimension(:), allocatable :: active_plastic logical, dimension(:), allocatable :: active_plastic
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
mech, & mech, &
pl pl
integer :: ph integer :: ph
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(active_plastic(phases%length), source = .false. ) allocate(active_plastic(phases%length), source = .false. )
do ph = 1, phases%length do ph = 1, phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
pl => mech%get('plastic',defaultVal = emptyDict) pl => mech%get_dict('plastic',defaultVal = emptyDict)
active_plastic(ph) = pl%get_asString('type',defaultVal='none') == plastic_label active_plastic(ph) = pl%get_asString('type',defaultVal='none') == plastic_label
end do end do

View File

@ -93,7 +93,7 @@ module function plastic_dislotungsten_init() result(myPlasticity)
a !< non-Schmid coefficients a !< non-Schmid coefficients
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
mech, & mech, &
@ -109,7 +109,7 @@ module function plastic_dislotungsten_init() result(myPlasticity)
print'(/,1x,a)', 'D. Cereceda et al., International Journal of Plasticity 78:242256, 2016' print'(/,1x,a)', 'D. Cereceda et al., International Journal of Plasticity 78:242256, 2016'
print'( 1x,a)', 'https://doi.org/10.1016/j.ijplas.2015.09.002' print'( 1x,a)', 'https://doi.org/10.1016/j.ijplas.2015.09.002'
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
allocate(indexDotState(phases%length)) allocate(indexDotState(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
@ -121,9 +121,9 @@ module function plastic_dislotungsten_init() result(myPlasticity)
associate(prm => param(ph), stt => state(ph), dst => dependentState(ph), & associate(prm => param(ph), stt => state(ph), dst => dependentState(ph), &
idx_dot => indexDotState(ph)) idx_dot => indexDotState(ph))
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
pl => mech%get('plastic') pl => mech%get_dict('plastic')
#if defined (__GFORTRAN__) #if defined (__GFORTRAN__)
prm%output = output_as1dString(pl) prm%output = output_as1dString(pl)

View File

@ -142,7 +142,7 @@ module function plastic_dislotwin_init() result(myPlasticity)
rho_dip_0 !< initial dipole dislocation density per slip system rho_dip_0 !< initial dipole dislocation density per slip system
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
mech, & mech, &
@ -165,7 +165,7 @@ module function plastic_dislotwin_init() result(myPlasticity)
print'( 1x,a)', 'https://doi.org/10.1016/j.actamat.2016.07.032' print'( 1x,a)', 'https://doi.org/10.1016/j.actamat.2016.07.032'
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
allocate(indexDotState(phases%length)) allocate(indexDotState(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
@ -177,9 +177,9 @@ module function plastic_dislotwin_init() result(myPlasticity)
associate(prm => param(ph), stt => state(ph), dst => dependentState(ph), & associate(prm => param(ph), stt => state(ph), dst => dependentState(ph), &
idx_dot => indexDotState(ph)) idx_dot => indexDotState(ph))
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
pl => mech%get('plastic') pl => mech%get_dict('plastic')
#if defined (__GFORTRAN__) #if defined (__GFORTRAN__)
prm%output = output_as1dString(pl) prm%output = output_as1dString(pl)

View File

@ -56,7 +56,7 @@ module function plastic_isotropic_init() result(myPlasticity)
xi_0 !< initial critical stress xi_0 !< initial critical stress
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
mech, & mech, &
@ -72,7 +72,7 @@ module function plastic_isotropic_init() result(myPlasticity)
print'(/,1x,a)', 'T. Maiti and P. Eisenlohr, Scripta Materialia 145:3740, 2018' print'(/,1x,a)', 'T. Maiti and P. Eisenlohr, Scripta Materialia 145:3740, 2018'
print'( 1x,a)', 'https://doi.org/10.1016/j.scriptamat.2017.09.047' print'( 1x,a)', 'https://doi.org/10.1016/j.scriptamat.2017.09.047'
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
@ -81,9 +81,9 @@ module function plastic_isotropic_init() result(myPlasticity)
associate(prm => param(ph), stt => state(ph)) associate(prm => param(ph), stt => state(ph))
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
pl => mech%get('plastic') pl => mech%get_dict('plastic')
#if defined (__GFORTRAN__) #if defined (__GFORTRAN__)
prm%output = output_as1dString(pl) prm%output = output_as1dString(pl)

View File

@ -79,7 +79,7 @@ module function plastic_kinehardening_init() result(myPlasticity)
a !< non-Schmid coefficients a !< non-Schmid coefficients
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
mech, & mech, &
@ -94,7 +94,7 @@ module function plastic_kinehardening_init() result(myPlasticity)
print'(/,1x,a)', 'J.A. Wollmershauser et al., International Journal of Fatigue 36:181193, 2012' print'(/,1x,a)', 'J.A. Wollmershauser et al., International Journal of Fatigue 36:181193, 2012'
print'( 1x,a)', 'https://doi.org/10.1016/j.ijfatigue.2011.07.008' print'( 1x,a)', 'https://doi.org/10.1016/j.ijfatigue.2011.07.008'
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
allocate(indexDotState(phases%length)) allocate(indexDotState(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
@ -107,9 +107,9 @@ module function plastic_kinehardening_init() result(myPlasticity)
associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph), & associate(prm => param(ph), stt => state(ph), dlt => deltaState(ph), &
idx_dot => indexDotState(ph)) idx_dot => indexDotState(ph))
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
pl => mech%get('plastic') pl => mech%get_dict('plastic')
#if defined (__GFORTRAN__) #if defined (__GFORTRAN__)
prm%output = output_as1dString(pl) prm%output = output_as1dString(pl)

View File

@ -17,7 +17,7 @@ module function plastic_none_init() result(myPlasticity)
logical, dimension(:), allocatable :: myPlasticity logical, dimension(:), allocatable :: myPlasticity
integer :: & integer :: &
ph ph
class(tNode), pointer :: & type(tDict), pointer :: &
phases phases
@ -27,7 +27,7 @@ module function plastic_none_init() result(myPlasticity)
print'(/,1x,a)', '<<<+- phase:mechanical:plastic:none init -+>>>' print'(/,1x,a)', '<<<+- phase:mechanical:plastic:none init -+>>>'
print'(/,a,i0)', ' # phases: ',count(myPlasticity); flush(IO_STDOUT) print'(/,a,i0)', ' # phases: ',count(myPlasticity); flush(IO_STDOUT)
phases => config_material%get('phase') phases => config_material%get_dict('phase')
do ph = 1, phases%length do ph = 1, phases%length
if (.not. myPlasticity(ph)) cycle if (.not. myPlasticity(ph)) cycle
call phase_allocateState(plasticState(ph),count(material_phaseID == ph),0,0,0) call phase_allocateState(plasticState(ph),count(material_phaseID == ph),0,0,0)

View File

@ -190,7 +190,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
extmsg = '' extmsg = ''
type(tInitialParameters) :: & type(tInitialParameters) :: &
ini ini
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
mech, & mech, &
@ -213,7 +213,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
print'( 1x,a)', 'http://publications.rwth-aachen.de/record/229993' print'( 1x,a)', 'http://publications.rwth-aachen.de/record/229993'
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(geom(phases%length)) allocate(geom(phases%length))
@ -230,9 +230,9 @@ module function plastic_nonlocal_init() result(myPlasticity)
associate(prm => param(ph), dot => dotState(ph), stt => state(ph), & associate(prm => param(ph), dot => dotState(ph), stt => state(ph), &
st0 => state0(ph), del => deltaState(ph), dst => dependentState(ph)) st0 => state0(ph), del => deltaState(ph), dst => dependentState(ph))
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
pl => mech%get('plastic') pl => mech%get_dict('plastic')
plasticState(ph)%nonlocal = pl%get_asBool('flux',defaultVal=.True.) plasticState(ph)%nonlocal = pl%get_asBool('flux',defaultVal=.True.)
#if defined (__GFORTRAN__) #if defined (__GFORTRAN__)
@ -520,7 +520,7 @@ module function plastic_nonlocal_init() result(myPlasticity)
if(.not. myPlasticity(ph)) cycle if(.not. myPlasticity(ph)) cycle
phase => phases%get(ph) phase => phases%get_dict(ph)
Nmembers = count(material_phaseID == ph) Nmembers = count(material_phaseID == ph)
l = 0 l = 0
do t = 1,4 do t = 1,4

View File

@ -92,7 +92,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
a !< non-Schmid coefficients a !< non-Schmid coefficients
character(len=pStringLen) :: & character(len=pStringLen) :: &
extmsg = '' extmsg = ''
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
mech, & mech, &
@ -106,7 +106,7 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
print'(/,a,i0)', ' # phases: ',count(myPlasticity); flush(IO_STDOUT) print'(/,a,i0)', ' # phases: ',count(myPlasticity); flush(IO_STDOUT)
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
allocate(indexDotState(phases%length)) allocate(indexDotState(phases%length))
allocate(state(phases%length)) allocate(state(phases%length))
@ -117,9 +117,9 @@ module function plastic_phenopowerlaw_init() result(myPlasticity)
associate(prm => param(ph), stt => state(ph), & associate(prm => param(ph), stt => state(ph), &
idx_dot => indexDotState(ph)) idx_dot => indexDotState(ph))
phase => phases%get(ph) phase => phases%get_dict(ph)
mech => phase%get('mechanical') mech => phase%get_dict('mechanical')
pl => mech%get('plastic') pl => mech%get_dict('plastic')
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! slip related parameters ! slip related parameters

View File

@ -76,11 +76,14 @@ contains
!---------------------------------------------------------------------------------------------- !----------------------------------------------------------------------------------------------
module subroutine thermal_init(phases) module subroutine thermal_init(phases)
class(tNode), pointer :: & type(tDict), pointer :: &
phases phases
class(tNode), pointer :: & type(tDict), pointer :: &
phase, thermal, sources phase, &
thermal
type(tList), pointer :: &
sources
integer :: & integer :: &
ph, so, & ph, so, &
@ -99,8 +102,8 @@ module subroutine thermal_init(phases)
Nmembers = count(material_phaseID == ph) Nmembers = count(material_phaseID == ph)
allocate(current(ph)%T(Nmembers),source=T_ROOM) allocate(current(ph)%T(Nmembers),source=T_ROOM)
allocate(current(ph)%dot_T(Nmembers),source=0.0_pReal) allocate(current(ph)%dot_T(Nmembers),source=0.0_pReal)
phase => phases%get(ph) phase => phases%get_dict(ph)
thermal => phase%get('thermal',defaultVal=emptyDict) thermal => phase%get_dict('thermal',defaultVal=emptyDict)
! ToDo: temperature dependency of K and C_p ! ToDo: temperature dependency of K and C_p
if (thermal%length > 0) then if (thermal%length > 0) then
@ -114,7 +117,7 @@ module subroutine thermal_init(phases)
#else #else
param(ph)%output = thermal%get_as1dString('output',defaultVal=emptyStringArray) param(ph)%output = thermal%get_as1dString('output',defaultVal=emptyStringArray)
#endif #endif
sources => thermal%get('source',defaultVal=emptyList) sources => thermal%get_list('source',defaultVal=emptyList)
thermal_Nsources(ph) = sources%length thermal_Nsources(ph) = sources%length
else else
thermal_Nsources(ph) = 0 thermal_Nsources(ph) = 0
@ -365,21 +368,23 @@ function thermal_active(source_label,src_length) result(active_source)
integer, intent(in) :: src_length !< max. number of sources in system integer, intent(in) :: src_length !< max. number of sources in system
logical, dimension(:,:), allocatable :: active_source logical, dimension(:,:), allocatable :: active_source
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
sources, thermal, & thermal, &
src src
type(tList), pointer :: &
sources
integer :: p,s integer :: p,s
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(active_source(src_length,phases%length), source = .false. ) allocate(active_source(src_length,phases%length), source = .false. )
do p = 1, phases%length do p = 1, phases%length
phase => phases%get(p) phase => phases%get_dict(p)
thermal => phase%get('thermal',defaultVal=emptyDict) thermal => phase%get_dict('thermal',defaultVal=emptyDict)
sources => thermal%get('source',defaultVal=emptyList) sources => thermal%get_list('source',defaultVal=emptyList)
do s = 1, sources%length do s = 1, sources%length
src => sources%get(s) src => sources%get_dict(s)
active_source(s,p) = src%get_asString('type') == source_label active_source(s,p) = src%get_asString('type') == source_label
end do end do
end do end do

View File

@ -26,11 +26,13 @@ module function dissipation_init(source_length) result(mySources)
integer, intent(in) :: source_length integer, intent(in) :: source_length
logical, dimension(:,:), allocatable :: mySources logical, dimension(:,:), allocatable :: mySources
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
sources, thermal, & thermal, &
src src
class(tList), pointer :: &
sources
integer :: so,Nmembers,ph integer :: so,Nmembers,ph
@ -40,18 +42,18 @@ module function dissipation_init(source_length) result(mySources)
print'(/,a,i2)', ' # phases: ',count(mySources); flush(IO_STDOUT) print'(/,a,i2)', ' # phases: ',count(mySources); flush(IO_STDOUT)
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
do ph = 1, phases%length do ph = 1, phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
if (count(mySources(:,ph)) == 0) cycle !ToDo: error if > 1 if (count(mySources(:,ph)) == 0) cycle !ToDo: error if > 1
thermal => phase%get('thermal') thermal => phase%get_dict('thermal')
sources => thermal%get('source') sources => thermal%get_list('source')
do so = 1, sources%length do so = 1, sources%length
if (mySources(so,ph)) then if (mySources(so,ph)) then
associate(prm => param(ph)) associate(prm => param(ph))
src => sources%get(so) src => sources%get_dict(so)
prm%kappa = src%get_asFloat('kappa') prm%kappa = src%get_asFloat('kappa')
Nmembers = count(material_phaseID == ph) Nmembers = count(material_phaseID == ph)

View File

@ -33,11 +33,13 @@ module function externalheat_init(source_length) result(mySources)
integer, intent(in) :: source_length integer, intent(in) :: source_length
logical, dimension(:,:), allocatable :: mySources logical, dimension(:,:), allocatable :: mySources
class(tNode), pointer :: & type(tDict), pointer :: &
phases, & phases, &
phase, & phase, &
sources, thermal, & thermal, &
src src
type(tList), pointer :: &
sources
integer :: so,Nmembers,ph integer :: so,Nmembers,ph
@ -47,20 +49,20 @@ module function externalheat_init(source_length) result(mySources)
print'(/,a,i2)', ' # phases: ',count(mySources); flush(IO_STDOUT) print'(/,a,i2)', ' # phases: ',count(mySources); flush(IO_STDOUT)
phases => config_material%get('phase') phases => config_material%get_dict('phase')
allocate(param(phases%length)) allocate(param(phases%length))
allocate(source_thermal_externalheat_offset (phases%length), source=0) allocate(source_thermal_externalheat_offset (phases%length), source=0)
do ph = 1, phases%length do ph = 1, phases%length
phase => phases%get(ph) phase => phases%get_dict(ph)
if (count(mySources(:,ph)) == 0) cycle if (count(mySources(:,ph)) == 0) cycle
thermal => phase%get('thermal') thermal => phase%get_dict('thermal')
sources => thermal%get('source') sources => thermal%get_list('source')
do so = 1, sources%length do so = 1, sources%length
if (mySources(so,ph)) then if (mySources(so,ph)) then
source_thermal_externalheat_offset(ph) = so source_thermal_externalheat_offset(ph) = so
associate(prm => param(ph)) associate(prm => param(ph))
src => sources%get(so) src => sources%get_dict(so)
prm%t_n = src%get_as1dFloat('t_n') prm%t_n = src%get_as1dFloat('t_n')
prm%nIntervals = size(prm%t_n) - 1 prm%nIntervals = size(prm%t_n) - 1

View File

@ -126,7 +126,7 @@ subroutine selfTest()
real(pReal), dimension(5) :: coef real(pReal), dimension(5) :: coef
integer :: i integer :: i
real(pReal) :: x_ref, x, y real(pReal) :: x_ref, x, y
class(tNode), pointer :: dict type(tDict), pointer :: dict
character(len=pStringLen), dimension(size(coef)) :: coef_s character(len=pStringLen), dimension(size(coef)) :: coef_s
character(len=pStringLen) :: x_ref_s, x_s, YAML_s character(len=pStringLen) :: x_ref_s, x_s, YAML_s
@ -156,7 +156,7 @@ subroutine selfTest()
'C,T^3: '//trim(adjustl(coef_s(4)))//IO_EOL//& 'C,T^3: '//trim(adjustl(coef_s(4)))//IO_EOL//&
'C,T^4: '//trim(adjustl(coef_s(5)))//IO_EOL//& 'C,T^4: '//trim(adjustl(coef_s(5)))//IO_EOL//&
'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL
Dict => YAML_parse_str(trim(YAML_s)) dict => YAML_parse_str_asDict(trim(YAML_s))
p2 = polynomial(dict%asDict(),'C','T') p2 = polynomial(dict%asDict(),'C','T')
if (dNeq(p1%at(x),p2%at(x),1.0e-6_pReal)) error stop 'polynomials: init' if (dNeq(p1%at(x),p2%at(x),1.0e-6_pReal)) error stop 'polynomials: init'
y = coef(1)+coef(2)*(x-x_ref)+coef(3)*(x-x_ref)**2+coef(4)*(x-x_ref)**3+coef(5)*(x-x_ref)**4 y = coef(1)+coef(2)*(x-x_ref)+coef(3)*(x-x_ref)**2+coef(4)*(x-x_ref)**3+coef(5)*(x-x_ref)**4
@ -165,28 +165,28 @@ subroutine selfTest()
YAML_s = 'C: 0.0'//IO_EOL//& YAML_s = 'C: 0.0'//IO_EOL//&
'C,T: '//trim(adjustl(coef_s(2)))//IO_EOL//& 'C,T: '//trim(adjustl(coef_s(2)))//IO_EOL//&
'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL
Dict => YAML_parse_str(trim(YAML_s)) dict => YAML_parse_str_asDict(trim(YAML_s))
p1 = polynomial(dict%asDict(),'C','T') p1 = polynomial(dict%asDict(),'C','T')
if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(linear)' if (dNeq(p1%at(x_ref+x),-p1%at(x_ref-x),1.0e-10_pReal)) error stop 'polynomials: eval(linear)'
YAML_s = 'C: 0.0'//IO_EOL//& YAML_s = 'C: 0.0'//IO_EOL//&
'C,T^2: '//trim(adjustl(coef_s(3)))//IO_EOL//& 'C,T^2: '//trim(adjustl(coef_s(3)))//IO_EOL//&
'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL 'T_ref: '//trim(adjustl(x_ref_s))//IO_EOL
Dict => YAML_parse_str(trim(YAML_s)) dict => YAML_parse_str_asDict(trim(YAML_s))
p1 = polynomial(dict%asDict(),'C','T') p1 = polynomial(dict%asDict(),'C','T')
if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval(quadratic)' if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1e-10_pReal)) error stop 'polynomials: eval(quadratic)'
YAML_s = 'Y: '//trim(adjustl(coef_s(1)))//IO_EOL//& YAML_s = 'Y: '//trim(adjustl(coef_s(1)))//IO_EOL//&
'Y,X^3: '//trim(adjustl(coef_s(2)))//IO_EOL//& 'Y,X^3: '//trim(adjustl(coef_s(2)))//IO_EOL//&
'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL
Dict => YAML_parse_str(trim(YAML_s)) dict => YAML_parse_str_asDict(trim(YAML_s))
p1 = polynomial(dict%asDict(),'Y','X') p1 = polynomial(dict%asDict(),'Y','X')
if (dNeq(p1%at(x_ref+x)-coef(1),-(p1%at(x_ref-x)-coef(1)),1.0e-8_pReal)) error stop 'polynomials: eval(cubic)' if (dNeq(p1%at(x_ref+x)-coef(1),-(p1%at(x_ref-x)-coef(1)),1.0e-8_pReal)) error stop 'polynomials: eval(cubic)'
YAML_s = 'Y: '//trim(adjustl(coef_s(1)))//IO_EOL//& YAML_s = 'Y: '//trim(adjustl(coef_s(1)))//IO_EOL//&
'Y,X^4: '//trim(adjustl(coef_s(2)))//IO_EOL//& 'Y,X^4: '//trim(adjustl(coef_s(2)))//IO_EOL//&
'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL 'X_ref: '//trim(adjustl(x_ref_s))//IO_EOL
Dict => YAML_parse_str(trim(YAML_s)) dict => YAML_parse_str_asDict(trim(YAML_s))
p1 = polynomial(dict%asDict(),'Y','X') p1 = polynomial(dict%asDict(),'Y','X')
if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1.0e-6_pReal)) error stop 'polynomials: eval(quartic)' if (dNeq(p1%at(x_ref+x),p1%at(x_ref-x),1.0e-6_pReal)) error stop 'polynomials: eval(quartic)'