store data locally

This commit is contained in:
Martin Diehl 2021-04-11 13:55:30 +02:00
parent b2292986f4
commit f655a6fe5c
3 changed files with 22 additions and 46 deletions

View File

@ -398,9 +398,7 @@ module lattice
lattice_rho, & lattice_rho, &
lattice_c_p lattice_c_p
real(pReal), dimension(:,:,:), allocatable, public, protected :: & real(pReal), dimension(:,:,:), allocatable, public, protected :: &
lattice_C66, & lattice_C66
lattice_K_T, &
lattice_K_phi
integer(kind(lattice_UNDEFINED_ID)), dimension(:), allocatable, public, protected :: & integer(kind(lattice_UNDEFINED_ID)), dimension(:), allocatable, public, protected :: &
lattice_structure lattice_structure
! SHOULD NOT BE PART OF LATTICE END ! SHOULD NOT BE PART OF LATTICE END
@ -458,23 +456,19 @@ subroutine lattice_init
phases, & phases, &
phase, & phase, &
mech, & mech, &
elasticity, & elasticity
thermal, &
damage
print'(/,a)', ' <<<+- lattice init -+>>>'; flush(IO_STDOUT) print'(/,a)', ' <<<+- lattice init -+>>>'; flush(IO_STDOUT)
! SHOULD NOT BE PART OF LATTICE BEGIN
phases => config_material%get('phase') phases => config_material%get('phase')
Nphases = phases%length Nphases = phases%length
allocate(lattice_structure(Nphases),source = lattice_UNDEFINED_ID) allocate(lattice_structure(Nphases),source = lattice_UNDEFINED_ID)
allocate(lattice_C66(6,6,Nphases), source=0.0_pReal) allocate(lattice_C66(6,6,Nphases), source=0.0_pReal)
allocate(lattice_K_T (3,3,Nphases), source=0.0_pReal) allocate(lattice_rho, &
allocate(lattice_K_phi (3,3,Nphases), source=0.0_pReal)
allocate(lattice_mu_phi,&
lattice_rho,lattice_c_p, &
lattice_mu, lattice_nu,& lattice_mu, lattice_nu,&
source=[(0.0_pReal,i=1,Nphases)]) source=[(0.0_pReal,i=1,Nphases)])
@ -522,32 +516,7 @@ subroutine lattice_init
enddo enddo
lattice_rho(ph) = phase%get_asFloat('rho', defaultVal=0.0_pReal) lattice_rho(ph) = phase%get_asFloat('rho', defaultVal=0.0_pReal)
! SHOULD NOT BE PART OF LATTICE END
! SHOULD NOT BE PART OF LATTICE BEGIN
if (phase%contains('thermal')) then
thermal => phase%get('thermal')
lattice_K_T(1,1,ph) = thermal%get_asFloat('K_11',defaultVal=0.0_pReal)
lattice_K_T(2,2,ph) = thermal%get_asFloat('K_22',defaultVal=0.0_pReal)
lattice_K_T(3,3,ph) = thermal%get_asFloat('K_33',defaultVal=0.0_pReal)
lattice_K_T(1:3,1:3,ph) = lattice_applyLatticeSymmetry33(lattice_K_T(1:3,1:3,ph), &
phase%get_asString('lattice'))
lattice_c_p(ph) = thermal%get_asFloat('c_p', defaultVal=0.0_pReal)
endif
if (phase%contains('damage')) then
damage => phase%get('damage')
damage => damage%get(1)
lattice_K_phi(1,1,ph) = damage%get_asFloat('D_11',defaultVal=0.0_pReal)
lattice_K_phi(2,2,ph) = damage%get_asFloat('D_22',defaultVal=0.0_pReal)
lattice_K_phi(3,3,ph) = damage%get_asFloat('D_33',defaultVal=0.0_pReal)
lattice_K_phi(1:3,1:3,ph) = lattice_applyLatticeSymmetry33(lattice_K_phi(1:3,1:3,ph), &
phase%get_asString('lattice'))
lattice_mu_phi(ph) = damage%get_asFloat('M',defaultVal=0.0_pReal)
endif
! SHOULD NOT BE PART OF LATTICE END
call selfTest call selfTest

View File

@ -131,9 +131,11 @@ module subroutine damage_init
if (sources%length == 1) then if (sources%length == 1) then
damage_active = .true. damage_active = .true.
source => sources%get(1) source => sources%get(1)
param(ph)%K(1,1) = source%get_asFloat('K_11',defaultVal=0.0_pReal) param(ph)%mu = source%get_asFloat('M',defaultVal=0.0_pReal)
param(ph)%K(2,2) = source%get_asFloat('K_22',defaultVal=0.0_pReal) param(ph)%K(1,1) = source%get_asFloat('D_11',defaultVal=0.0_pReal)
param(ph)%K(3,3) = source%get_asFloat('K_33',defaultVal=0.0_pReal) param(ph)%K(2,2) = source%get_asFloat('D_22',defaultVal=0.0_pReal)
param(ph)%K(3,3) = source%get_asFloat('D_33',defaultVal=0.0_pReal)
param(ph)%K = lattice_applyLatticeSymmetry33(param(ph)%K,phase%get_asString('lattice'))
endif endif
enddo enddo
@ -354,7 +356,7 @@ module function phase_mu_phi(co,ce) result(mu)
real(pReal) :: mu real(pReal) :: mu
mu = lattice_mu_phi(material_phaseID(co,ce)) mu = param(material_phaseID(co,ce))%mu
end function phase_mu_phi end function phase_mu_phi
@ -368,7 +370,7 @@ module function phase_K_phi(co,ce) result(K)
real(pReal), dimension(3,3) :: K real(pReal), dimension(3,3) :: K
K = crystallite_push33ToRef(co,ce,lattice_K_phi(1:3,1:3,material_phaseID(co,ce))) K = crystallite_push33ToRef(co,ce,param(material_phaseID(co,ce))%K)
end function phase_K_phi end function phase_K_phi

View File

@ -100,12 +100,17 @@ module subroutine thermal_init(phases)
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(ph)
thermal => phase%get('thermal',defaultVal=emptyDict) thermal => phase%get('thermal',defaultVal=emptyDict)
sources => thermal%get('source',defaultVal=emptyList) param(ph)%C_p = thermal%get_asFloat('c_p',defaultVal=0.0_pReal)
if (param(ph)%C_p <= 0) param(ph)%C_p = thermal%get_asFloat('C_p',defaultVal=0.0_pReal)
param(ph)%K(1,1) = thermal%get_asFloat('K_11',defaultVal=0.0_pReal) param(ph)%K(1,1) = thermal%get_asFloat('K_11',defaultVal=0.0_pReal)
param(ph)%K(2,2) = thermal%get_asFloat('K_22',defaultVal=0.0_pReal) param(ph)%K(2,2) = thermal%get_asFloat('K_22',defaultVal=0.0_pReal)
param(ph)%K(3,3) = thermal%get_asFloat('K_33',defaultVal=0.0_pReal) param(ph)%K(3,3) = thermal%get_asFloat('K_33',defaultVal=0.0_pReal)
param(ph)%K = lattice_applyLatticeSymmetry33(param(ph)%K,phase%get_asString('lattice'))
sources => thermal%get('source',defaultVal=emptyList)
thermal_Nsources(ph) = sources%length thermal_Nsources(ph) = sources%length
allocate(thermalstate(ph)%p(thermal_Nsources(ph))) allocate(thermalstate(ph)%p(thermal_Nsources(ph)))
enddo enddo
allocate(thermal_source(maxval(thermal_Nsources),phases%length), source = THERMAL_UNDEFINED_ID) allocate(thermal_source(maxval(thermal_Nsources),phases%length), source = THERMAL_UNDEFINED_ID)
@ -193,8 +198,8 @@ module function phase_mu_T(co,ce) result(mu)
real(pReal) :: mu real(pReal) :: mu
mu = lattice_c_p(material_phaseID(co,ce)) & mu = lattice_rho(material_phaseID(co,ce)) &
* lattice_rho(material_phaseID(co,ce)) * param(material_phaseID(co,ce))%C_p
end function phase_mu_T end function phase_mu_T
@ -208,7 +213,7 @@ module function phase_K_T(co,ce) result(K)
real(pReal), dimension(3,3) :: K real(pReal), dimension(3,3) :: K
K = crystallite_push33ToRef(co,ce,lattice_K_T(1:3,1:3,material_phaseID(co,ce))) K = crystallite_push33ToRef(co,ce,param(material_phaseID(co,ce))%K)
end function phase_K_T end function phase_K_T