sanity check for homogenization
number of (constituent) per microstructure need to match Nconstituents in homogenization.
This commit is contained in:
parent
62898a70a0
commit
bedcd0ad8c
|
@ -400,6 +400,8 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg)
|
||||||
msg = 'number of values does not match'
|
msg = 'number of values does not match'
|
||||||
case (147)
|
case (147)
|
||||||
msg = 'not supported anymore'
|
msg = 'not supported anymore'
|
||||||
|
case (148)
|
||||||
|
msg = 'Nconstituents mismatch between homogenization and microstructure'
|
||||||
|
|
||||||
!--------------------------------------------------------------------------------------------------
|
!--------------------------------------------------------------------------------------------------
|
||||||
! material error messages and related messages in mesh
|
! material error messages and related messages in mesh
|
||||||
|
|
|
@ -257,7 +257,7 @@ subroutine material_init
|
||||||
allocate(damage (material_Nhomogenization))
|
allocate(damage (material_Nhomogenization))
|
||||||
|
|
||||||
allocate(temperatureRate (material_Nhomogenization))
|
allocate(temperatureRate (material_Nhomogenization))
|
||||||
|
|
||||||
do m = 1,size(config_microstructure)
|
do m = 1,size(config_microstructure)
|
||||||
if(minval(microstructure_phase(1:microstructure_Nconstituents(m),m)) < 1 .or. &
|
if(minval(microstructure_phase(1:microstructure_Nconstituents(m),m)) < 1 .or. &
|
||||||
maxval(microstructure_phase(1:microstructure_Nconstituents(m),m)) > size(config_phase)) &
|
maxval(microstructure_phase(1:microstructure_Nconstituents(m),m)) > size(config_phase)) &
|
||||||
|
@ -268,6 +268,7 @@ subroutine material_init
|
||||||
if(microstructure_Nconstituents(m) < 1) &
|
if(microstructure_Nconstituents(m) < 1) &
|
||||||
call IO_error(151,m)
|
call IO_error(151,m)
|
||||||
enddo
|
enddo
|
||||||
|
if(homogenization_maxNgrains > size(microstructure_phase,1)) call IO_error(148)
|
||||||
|
|
||||||
debugOut: if (iand(myDebug,debug_levelExtensive) /= 0) then
|
debugOut: if (iand(myDebug,debug_levelExtensive) /= 0) then
|
||||||
write(6,'(/,a,/)') ' MATERIAL configuration'
|
write(6,'(/,a,/)') ' MATERIAL configuration'
|
||||||
|
@ -290,6 +291,7 @@ subroutine material_init
|
||||||
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
! new mappings
|
! new mappings
|
||||||
|
|
||||||
allocate(material_phaseAt(homogenization_maxNgrains,discretization_nElem), source=0)
|
allocate(material_phaseAt(homogenization_maxNgrains,discretization_nElem), source=0)
|
||||||
allocate(material_texture(homogenization_maxNgrains,discretization_nIP,discretization_nElem),source=0) !this is only needed by plasticity nonlocal
|
allocate(material_texture(homogenization_maxNgrains,discretization_nIP,discretization_nElem),source=0) !this is only needed by plasticity nonlocal
|
||||||
allocate(material_orientation0(homogenization_maxNgrains,discretization_nIP,discretization_nElem))
|
allocate(material_orientation0(homogenization_maxNgrains,discretization_nIP,discretization_nElem))
|
||||||
|
@ -298,9 +300,17 @@ subroutine material_init
|
||||||
do i = 1, discretization_nIP
|
do i = 1, discretization_nIP
|
||||||
myMicro = discretization_microstructureAt(e)
|
myMicro = discretization_microstructureAt(e)
|
||||||
do c = 1, homogenization_Ngrains(discretization_homogenizationAt(e))
|
do c = 1, homogenization_Ngrains(discretization_homogenizationAt(e))
|
||||||
material_phaseAt(c,e) = microstructure_phase(c,myMicro)
|
if(microstructure_phase(c,myMicro) > 0) then
|
||||||
material_texture(c,i,e) = microstructure_texture(c,myMicro)
|
material_phaseAt(c,e) = microstructure_phase(c,myMicro)
|
||||||
material_orientation0(c,i,e) = texture_orientation(material_texture(c,i,e))
|
else
|
||||||
|
call IO_error(150,ext_msg='phase')
|
||||||
|
endif
|
||||||
|
if(microstructure_texture(c,myMicro) > 0) then
|
||||||
|
material_texture(c,i,e) = microstructure_texture(c,myMicro)
|
||||||
|
material_orientation0(c,i,e) = texture_orientation(material_texture(c,i,e))
|
||||||
|
else
|
||||||
|
call IO_error(150,ext_msg='texture')
|
||||||
|
endif
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
@ -464,7 +474,7 @@ subroutine material_parseMicrostructure
|
||||||
real(pReal), dimension(:,:), allocatable :: &
|
real(pReal), dimension(:,:), allocatable :: &
|
||||||
microstructure_fraction !< vol fraction of each constituent in microstructure
|
microstructure_fraction !< vol fraction of each constituent in microstructure
|
||||||
integer :: &
|
integer :: &
|
||||||
microstructure_maxNconstituents !< max number of constituents in any phase
|
maxNconstituents !< max number of constituents in any phase
|
||||||
|
|
||||||
allocate(microstructure_Nconstituents(size(config_microstructure)), source=0)
|
allocate(microstructure_Nconstituents(size(config_microstructure)), source=0)
|
||||||
|
|
||||||
|
@ -475,10 +485,10 @@ subroutine material_parseMicrostructure
|
||||||
microstructure_Nconstituents(m) = config_microstructure(m)%countKeys('(constituent)')
|
microstructure_Nconstituents(m) = config_microstructure(m)%countKeys('(constituent)')
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
microstructure_maxNconstituents = maxval(microstructure_Nconstituents)
|
maxNconstituents = maxval(microstructure_Nconstituents)
|
||||||
allocate(microstructure_phase (microstructure_maxNconstituents,size(config_microstructure)),source=0)
|
allocate(microstructure_phase (maxNconstituents,size(config_microstructure)),source=0)
|
||||||
allocate(microstructure_texture (microstructure_maxNconstituents,size(config_microstructure)),source=0)
|
allocate(microstructure_texture (maxNconstituents,size(config_microstructure)),source=0)
|
||||||
allocate(microstructure_fraction(microstructure_maxNconstituents,size(config_microstructure)),source=0.0_pReal)
|
allocate(microstructure_fraction(maxNconstituents,size(config_microstructure)),source=0.0_pReal)
|
||||||
|
|
||||||
allocate(strings(1)) ! Intel 16.0 Bug
|
allocate(strings(1)) ! Intel 16.0 Bug
|
||||||
do m=1, size(config_microstructure)
|
do m=1, size(config_microstructure)
|
||||||
|
|
Loading…
Reference in New Issue