polished field state related changes and brittle damage

This commit is contained in:
Luv Sharma 2014-09-22 18:15:19 +00:00
parent 78ab14806f
commit e83a0fb3f7
15 changed files with 217 additions and 614 deletions

View File

@ -353,20 +353,12 @@ PRECISION_gfortran :=-fdefault-real-8 -fdefault-double-8 -DFLOAT=8 -DINT=4
COMPILE =$(OPENMP_FLAG_$(F90)) $(COMPILE_OPTIONS_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(OPTI)_$(F90)) $(INCLUDE_DIRS) $(PRECISION_$(F90)) COMPILE =$(OPENMP_FLAG_$(F90)) $(COMPILE_OPTIONS_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(OPTI)_$(F90)) $(INCLUDE_DIRS) $(PRECISION_$(F90))
COMPILE_MAXOPTI =$(OPENMP_FLAG_$(F90)) $(COMPILE_OPTIONS_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(MAXOPTI)_$(F90)) $(INCLUDE_DIRS) $(PRECISION_$(F90)) -DSpectral COMPILE_MAXOPTI =$(OPENMP_FLAG_$(F90)) $(COMPILE_OPTIONS_$(F90)) $(STANDARD_CHECK_$(F90)) $(OPTIMIZATION_$(MAXOPTI)_$(F90)) $(INCLUDE_DIRS) $(PRECISION_$(F90)) -DSpectral
################################################################################################### ###################################################################################################
ifeq "$(STATE)" "NEWH"
DAMAGE_FILES = \ DAMAGE_FILES = \
damage_none.o damage_local.o damage_none.o damage_local.o
else
DAMAGE_FILES = \
damage_none.o damage_local.o damage_gradient.o
endif
ifeq "$(STATE)" "NEWH"
THERMAL_FILES = \ THERMAL_FILES = \
thermal_none.o thermal_adiabatic.o thermal_none.o thermal_adiabatic.o
else
THERMAL_FILES = \
thermal_none.o thermal_conduction.o
endif
CONSTITUTIVE_FILES = \ CONSTITUTIVE_FILES = \
constitutive_dislotwin.o constitutive_dislokmc.o constitutive_j2.o constitutive_phenopowerlaw.o \ constitutive_dislotwin.o constitutive_dislokmc.o constitutive_j2.o constitutive_phenopowerlaw.o \
constitutive_titanmod.o constitutive_nonlocal.o constitutive_none.o \ constitutive_titanmod.o constitutive_nonlocal.o constitutive_none.o \
@ -521,18 +513,12 @@ damage_none.o: damage_none.f90 \
damage_local.o: damage_local.f90 \ damage_local.o: damage_local.f90 \
lattice.o lattice.o
damage_gradient.o: damage_gradient.f90 \
lattice.o
constitutive_thermal.o: constitutive_thermal.f90 \ constitutive_thermal.o: constitutive_thermal.f90 \
$(THERMAL_FILES) $(THERMAL_FILES)
thermal_none.o: thermal_none.f90 \ thermal_none.o: thermal_none.f90 \
lattice.o lattice.o
thermal_conduction.o: thermal_conduction.f90 \
lattice.o
thermal_adiabatic.o: thermal_adiabatic.f90 \ thermal_adiabatic.o: thermal_adiabatic.f90 \
lattice.o lattice.o

View File

@ -23,12 +23,12 @@ module constitutive
constitutive_TandItsTangent, & constitutive_TandItsTangent, &
constitutive_collectDotState, & constitutive_collectDotState, &
constitutive_collectDeltaState, & constitutive_collectDeltaState, &
#ifdef NEWSTATE
constitutive_getLocalDamage, & constitutive_getLocalDamage, &
constitutive_putLocalDamage, &
constitutive_getNonLocalDamage, & constitutive_getNonLocalDamage, &
constitutive_getAdiabaticThermal, & constitutive_getAdiabaticThermal, &
constitutive_putAdiabaticThermal, &
constitutive_getConductionThermal, & constitutive_getConductionThermal, &
#endif
constitutive_postResults constitutive_postResults
private :: & private :: &
@ -361,8 +361,6 @@ subroutine constitutive_LpAndItsTangent(Lp, dLp_dTstar, Tstar_v, temperature, ip
PLASTICITY_DISLOKMC_ID, & PLASTICITY_DISLOKMC_ID, &
PLASTICITY_TITANMOD_ID, & PLASTICITY_TITANMOD_ID, &
PLASTICITY_NONLOCAL_ID PLASTICITY_NONLOCAL_ID
use constitutive_damage, only: &
constitutive_damageValue
use constitutive_j2, only: & use constitutive_j2, only: &
constitutive_j2_LpAndItsTangent constitutive_j2_LpAndItsTangent
use constitutive_phenopowerlaw, only: & use constitutive_phenopowerlaw, only: &
@ -396,17 +394,23 @@ subroutine constitutive_LpAndItsTangent(Lp, dLp_dTstar, Tstar_v, temperature, ip
Lp = 0.0_pReal Lp = 0.0_pReal
dLp_dTstar = 0.0_pReal dLp_dTstar = 0.0_pReal
case (PLASTICITY_J2_ID) case (PLASTICITY_J2_ID)
call constitutive_j2_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v/constitutive_damageValue(ipc,ip,el),ipc,ip,el) call constitutive_j2_LpAndItsTangent(Lp,dLp_dTstar, &
Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),ipc,ip,el)
case (PLASTICITY_PHENOPOWERLAW_ID) case (PLASTICITY_PHENOPOWERLAW_ID)
call constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v/constitutive_damageValue(ipc,ip,el),ipc,ip,el) call constitutive_phenopowerlaw_LpAndItsTangent(Lp,dLp_dTstar, &
Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),ipc,ip,el)
case (PLASTICITY_NONLOCAL_ID) case (PLASTICITY_NONLOCAL_ID)
call constitutive_nonlocal_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v/constitutive_damageValue(ipc,ip,el),temperature,ip,el) call constitutive_nonlocal_LpAndItsTangent(Lp,dLp_dTstar,&
Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),temperature,ip,el)
case (PLASTICITY_DISLOTWIN_ID) case (PLASTICITY_DISLOTWIN_ID)
call constitutive_dislotwin_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v/constitutive_damageValue(ipc,ip,el),temperature,ipc,ip,el) call constitutive_dislotwin_LpAndItsTangent(Lp,dLp_dTstar, &
Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),temperature,ipc,ip,el)
case (PLASTICITY_DISLOKMC_ID) case (PLASTICITY_DISLOKMC_ID)
call constitutive_dislokmc_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v/constitutive_damageValue(ipc,ip,el),temperature,ipc,ip,el) call constitutive_dislokmc_LpAndItsTangent(Lp,dLp_dTstar,&
Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),temperature,ipc,ip,el)
case (PLASTICITY_TITANMOD_ID) case (PLASTICITY_TITANMOD_ID)
call constitutive_titanmod_LpAndItsTangent(Lp,dLp_dTstar,Tstar_v/constitutive_damageValue(ipc,ip,el),temperature,ipc,ip,el) call constitutive_titanmod_LpAndItsTangent(Lp,dLp_dTstar, &
Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),temperature,ipc,ip,el)
end select end select
@ -461,10 +465,6 @@ subroutine constitutive_hooke_TandItsTangent(T, dT_dFe, Fe, ipc, ip, el)
use lattice, only: & use lattice, only: &
lattice_referenceTemperature, & lattice_referenceTemperature, &
lattice_thermalExpansion33 lattice_thermalExpansion33
use constitutive_damage, only: &
constitutive_damageValue
use constitutive_thermal, only: &
constitutive_temperature
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
@ -485,11 +485,11 @@ subroutine constitutive_hooke_TandItsTangent(T, dT_dFe, Fe, ipc, ip, el)
C = math_Mandel66to3333(constitutive_homogenizedC(ipc,ip,el)) C = math_Mandel66to3333(constitutive_homogenizedC(ipc,ip,el))
T = math_mul3333xx33(C,0.5_pReal*(math_mul33x33(math_transpose33(Fe),Fe)-math_I3) - & T = math_mul3333xx33(C,0.5_pReal*(math_mul33x33(math_transpose33(Fe),Fe)-math_I3) - &
lattice_thermalExpansion33(1:3,1:3,mappingConstitutive(2,ipc,ip,el))* & lattice_thermalExpansion33(1:3,1:3,mappingConstitutive(2,ipc,ip,el))* &
(constitutive_temperature(ipc,ip,el) - & (constitutive_getConductionThermal(ipc,ip,el) - &
lattice_referenceTemperature(mappingConstitutive(2,ipc,ip,el)))) lattice_referenceTemperature(mappingConstitutive(2,ipc,ip,el))))
pressure = math_trace33(T)/3.0_pReal pressure = math_trace33(T)/3.0_pReal
damage = constitutive_damageValue(ipc,ip,el) damage = constitutive_getNonlocalDamage(ipc,ip,el)
T = damage*T T = damage*T
if(pressure >= 0.0_pReal) then if(pressure >= 0.0_pReal) then
@ -619,10 +619,8 @@ logical function constitutive_collectDeltaState(Tstar_v, ipc, ip, el)
use material, only: & use material, only: &
phase_plasticity, & phase_plasticity, &
material_phase, & material_phase, &
#ifdef NEWSTATE
plasticState, & plasticState, &
mappingConstitutive, & mappingConstitutive, &
#endif
PLASTICITY_NONLOCAL_ID PLASTICITY_NONLOCAL_ID
use constitutive_nonlocal, only: & use constitutive_nonlocal, only: &
constitutive_nonlocal_deltaState constitutive_nonlocal_deltaState
@ -664,7 +662,7 @@ logical function constitutive_collectDeltaState(Tstar_v, ipc, ip, el)
end function constitutive_collectDeltaState end function constitutive_collectDeltaState
#ifdef NEWSTATE
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Returns the local(unregularised) damage !> @brief Returns the local(unregularised) damage
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -696,6 +694,35 @@ function constitutive_getLocalDamage(ipc, ip, el)
end function constitutive_getLocalDamage end function constitutive_getLocalDamage
!--------------------------------------------------------------------------------------------------
!> @brief Returns the local(unregularised) damage
!--------------------------------------------------------------------------------------------------
subroutine constitutive_putLocalDamage(ipc, ip, el, localDamage)
use prec, only: &
pReal
use material, only: &
material_phase, &
LOCAL_DAMAGE_BRITTLE_ID, &
phase_damage
use damage_local, only: &
constitutive_brittle_putDamage
implicit none
integer(pInt), intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
localDamage
select case (phase_damage(material_phase(ipc,ip,el)))
case (LOCAL_DAMAGE_BRITTLE_ID)
call constitutive_brittle_putDamage(ipc, ip, el, localDamage)
end select
end subroutine constitutive_putLocalDamage
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns nonlocal (regularised) damage !> @brief returns nonlocal (regularised) damage
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -724,7 +751,7 @@ function constitutive_getNonlocalDamage(ipc, ip, el)
case (FIELD_DAMAGE_NONLOCAL_ID) case (FIELD_DAMAGE_NONLOCAL_ID)
constitutive_getNonlocalDamage = fieldDamage(material_homog(ip,el))% & constitutive_getNonlocalDamage = fieldDamage(material_homog(ip,el))% &
state(1,mappingHomogenization(1,ip,el)) ! Taylor type field(1,mappingHomogenization(1,ip,el)) ! Taylor type
end select end select
@ -762,6 +789,35 @@ function constitutive_getAdiabaticThermal(ipc, ip, el)
end function constitutive_getAdiabaticThermal end function constitutive_getAdiabaticThermal
!--------------------------------------------------------------------------------------------------
!> @brief Returns the local(unregularised) damage
!--------------------------------------------------------------------------------------------------
subroutine constitutive_putAdiabaticThermal(ipc, ip, el, localTemperature)
use prec, only: &
pReal
use material, only: &
material_phase, &
LOCAL_THERMAL_HEATGEN_ID, &
phase_thermal
use thermal_adiabatic, only: &
constitutive_heatgen_putThermal
implicit none
integer(pInt), intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
localTemperature
select case (phase_thermal(material_phase(ipc,ip,el)))
case (LOCAL_THERMAL_HEATGEN_ID)
call constitutive_heatgen_putThermal(ipc, ip, el, localTemperature)
end select
end subroutine constitutive_putAdiabaticThermal
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns nonlocal (regularised) temperature !> @brief returns nonlocal (regularised) temperature
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -792,13 +848,11 @@ function constitutive_getConductionThermal(ipc, ip, el)
case (FIELD_THERMAL_CONDUCTION_ID) case (FIELD_THERMAL_CONDUCTION_ID)
constitutive_getConductionThermal = fieldThermal(material_homog(ip,el))% & constitutive_getConductionThermal = fieldThermal(material_homog(ip,el))% &
state(1,mappingHomogenization(1,ip,el)) ! Taylor type field(1,mappingHomogenization(1,ip,el)) ! Taylor type
end select end select
end function constitutive_getConductionThermal end function constitutive_getConductionThermal
#endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns array of constitutive results !> @brief returns array of constitutive results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -821,8 +875,6 @@ function constitutive_postResults(Tstar_v, FeArray, temperature, ipc, ip, el)
PLASTICITY_DISLOKMC_ID, & PLASTICITY_DISLOKMC_ID, &
PLASTICITY_TITANMOD_ID, & PLASTICITY_TITANMOD_ID, &
PLASTICITY_NONLOCAL_ID PLASTICITY_NONLOCAL_ID
use constitutive_damage, only: &
constitutive_damageValue
use constitutive_j2, only: & use constitutive_j2, only: &
#ifdef HDF #ifdef HDF
constitutive_j2_postResults2,& constitutive_j2_postResults2,&
@ -858,19 +910,19 @@ function constitutive_postResults(Tstar_v, FeArray, temperature, ipc, ip, el)
case (PLASTICITY_TITANMOD_ID) case (PLASTICITY_TITANMOD_ID)
constitutive_postResults = constitutive_titanmod_postResults(ipc,ip,el) constitutive_postResults = constitutive_titanmod_postResults(ipc,ip,el)
case (PLASTICITY_J2_ID) case (PLASTICITY_J2_ID)
constitutive_postResults= constitutive_j2_postResults(Tstar_v/constitutive_damageValue(ipc,ip,el),ipc,ip,el) constitutive_postResults= constitutive_j2_postResults(Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),ipc,ip,el)
case (PLASTICITY_PHENOPOWERLAW_ID) case (PLASTICITY_PHENOPOWERLAW_ID)
constitutive_postResults = & constitutive_postResults = &
constitutive_phenopowerlaw_postResults(Tstar_v/constitutive_damageValue(ipc,ip,el),ipc,ip,el) constitutive_phenopowerlaw_postResults(Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),ipc,ip,el)
case (PLASTICITY_DISLOTWIN_ID) case (PLASTICITY_DISLOTWIN_ID)
constitutive_postResults = & constitutive_postResults = &
constitutive_dislotwin_postResults(Tstar_v/constitutive_damageValue(ipc,ip,el),Temperature,ipc,ip,el) constitutive_dislotwin_postResults(Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),Temperature,ipc,ip,el)
case (PLASTICITY_DISLOKMC_ID) case (PLASTICITY_DISLOKMC_ID)
constitutive_postResults = & constitutive_postResults = &
constitutive_dislokmc_postResults(Tstar_v/constitutive_damageValue(ipc,ip,el),Temperature,ipc,ip,el) constitutive_dislokmc_postResults(Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),Temperature,ipc,ip,el)
case (PLASTICITY_NONLOCAL_ID) case (PLASTICITY_NONLOCAL_ID)
constitutive_postResults = & constitutive_postResults = &
constitutive_nonlocal_postResults (Tstar_v/constitutive_damageValue(ipc,ip,el),FeArray,ip,el) constitutive_nonlocal_postResults (Tstar_v/constitutive_getNonlocalDamage(ipc,ip,el),FeArray,ip,el)
end select end select
end function constitutive_postResults end function constitutive_postResults

View File

@ -21,7 +21,6 @@ module constitutive_damage
constitutive_damage_init, & constitutive_damage_init, &
constitutive_damage_microstructure, & constitutive_damage_microstructure, &
constitutive_damage_collectDotState, & constitutive_damage_collectDotState, &
constitutive_damageValue, &
constitutive_damage_postResults constitutive_damage_postResults
contains contains
@ -56,24 +55,12 @@ subroutine constitutive_damage_init
homogenization_Ngrains, & homogenization_Ngrains, &
homogenization_maxNgrains, & homogenization_maxNgrains, &
damageState, & damageState, &
#ifdef NEWSTATE
LOCAL_DAMAGE_NONE_ID, & LOCAL_DAMAGE_NONE_ID, &
LOCAL_DAMAGE_NONE_label, & LOCAL_DAMAGE_NONE_label, &
LOCAL_DAMAGE_BRITTLE_ID, & LOCAL_DAMAGE_BRITTLE_ID, &
LOCAL_DAMAGE_BRITTLE_label LOCAL_DAMAGE_BRITTLE_label
#else
DAMAGE_none_ID, &
DAMAGE_NONE_label, &
DAMAGE_local_ID, &
DAMAGE_LOCAL_label, &
DAMAGE_gradient_ID, &
DAMAGE_GRADIENT_label
#endif
use damage_none use damage_none
use damage_local use damage_local
#ifndef NEWSTATE
use damage_gradient
#endif
implicit none implicit none
integer(pInt), parameter :: FILEUNIT = 200_pInt integer(pInt), parameter :: FILEUNIT = 200_pInt
@ -91,14 +78,8 @@ use damage_gradient
! parse plasticities from config file ! parse plasticities from config file
if (.not. IO_open_jobFile_stat(FILEUNIT,material_localFileExt)) & ! no local material configuration present... if (.not. IO_open_jobFile_stat(FILEUNIT,material_localFileExt)) & ! no local material configuration present...
call IO_open_file(FILEUNIT,material_configFile) ! ... open material.config file call IO_open_file(FILEUNIT,material_configFile) ! ... open material.config file
#ifdef NEWSTATE
if (any(phase_damage == LOCAL_DAMAGE_NONE_ID)) call damage_none_init(FILEUNIT) if (any(phase_damage == LOCAL_DAMAGE_NONE_ID)) call damage_none_init(FILEUNIT)
if (any(phase_damage == LOCAL_DAMAGE_BRITTLE_ID)) call damage_local_init(FILEUNIT) if (any(phase_damage == LOCAL_DAMAGE_BRITTLE_ID)) call damage_local_init(FILEUNIT)
#else
if (any(phase_damage == DAMAGE_none_ID)) call damage_none_init(FILEUNIT)
if (any(phase_damage == DAMAGE_local_ID)) call damage_local_init(FILEUNIT)
if (any(phase_damage == DAMAGE_gradient_ID)) call damage_gradient_init(FILEUNIT)
#endif
close(FILEUNIT) close(FILEUNIT)
write(6,'(/,a)') ' <<<+- constitutive_damage init -+>>>' write(6,'(/,a)') ' <<<+- constitutive_damage init -+>>>'
@ -113,41 +94,21 @@ use damage_gradient
instance = phase_damageInstance(ph) ! which instance of a plasticity is present phase instance = phase_damageInstance(ph) ! which instance of a plasticity is present phase
knownDamage = .true. knownDamage = .true.
select case(phase_damage(ph)) ! split per constititution select case(phase_damage(ph)) ! split per constititution
#ifdef NEWSTATE
case (LOCAL_DAMAGE_none_ID) case (LOCAL_DAMAGE_none_ID)
outputName = LOCAL_DAMAGE_NONE_label outputName = LOCAL_DAMAGE_NONE_label
#else
case (DAMAGE_none_ID)
outputName = DAMAGE_NONE_label
#endif
thisOutput => null() thisOutput => null()
thisSize => null() thisSize => null()
#ifdef NEWSTATE
case (LOCAL_DAMAGE_BRITTLE_ID) case (LOCAL_DAMAGE_BRITTLE_ID)
outputName = LOCAL_DAMAGE_BRITTLE_label outputName = LOCAL_DAMAGE_BRITTLE_label
#else
case (DAMAGE_local_ID)
outputName = DAMAGE_LOCAL_label
#endif
thisOutput => damage_local_output thisOutput => damage_local_output
thisSize => damage_local_sizePostResult thisSize => damage_local_sizePostResult
#ifndef NEWSTATE
case (DAMAGE_gradient_ID)
outputName = DAMAGE_GRADIENT_label
thisOutput => damage_gradient_output
thisSize => damage_gradient_sizePostResult
#endif
case default case default
knownDamage = .false. knownDamage = .false.
end select end select
write(FILEUNIT,'(/,a,/)') '['//trim(phase_name(ph))//']' write(FILEUNIT,'(/,a,/)') '['//trim(phase_name(ph))//']'
if (knownDamage) then if (knownDamage) then
write(FILEUNIT,'(a)') '(damage)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(damage)'//char(9)//trim(outputName)
#ifdef NEWSTATE
if (phase_damage(ph) /= LOCAL_DAMAGE_none_ID) then if (phase_damage(ph) /= LOCAL_DAMAGE_none_ID) then
#else
if (phase_damage(ph) /= DAMAGE_none_ID) then
#endif
do e = 1_pInt,phase_Noutput(ph) do e = 1_pInt,phase_Noutput(ph)
write(FILEUNIT,'(a,i4)') trim(thisOutput(e,instance))//char(9),thisSize(e,instance) write(FILEUNIT,'(a,i4)') trim(thisOutput(e,instance))//char(9),thisSize(e,instance)
enddo enddo
@ -174,14 +135,10 @@ end subroutine constitutive_damage_init
subroutine constitutive_damage_microstructure(Tstar_v, Fe, ipc, ip, el) subroutine constitutive_damage_microstructure(Tstar_v, Fe, ipc, ip, el)
use material, only: & use material, only: &
material_phase, & material_phase, &
#ifndef NEWSTATE LOCAL_DAMAGE_BRITTLE_ID, &
DAMAGE_gradient_ID, &
#endif
phase_damage phase_damage
#ifndef NEWSTATE use damage_local, only: &
use damage_gradient, only: & damage_local_microstructure
damage_gradient_microstructure
#endif
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
@ -194,10 +151,8 @@ subroutine constitutive_damage_microstructure(Tstar_v, Fe, ipc, ip, el)
Fe Fe
select case (phase_damage(material_phase(ipc,ip,el))) select case (phase_damage(material_phase(ipc,ip,el)))
#ifndef NEWSTATE case (LOCAL_DAMAGE_BRITTLE_ID)
case (DAMAGE_gradient_ID) call damage_local_microstructure(Tstar_v, Fe, ipc, ip, el)
call damage_gradient_microstructure(Tstar_v, Fe, ipc, ip, el)
#endif
end select end select
@ -210,18 +165,8 @@ end subroutine constitutive_damage_microstructure
subroutine constitutive_damage_collectDotState(Tstar_v, Fe, Lp, ipc, ip, el) subroutine constitutive_damage_collectDotState(Tstar_v, Fe, Lp, ipc, ip, el)
use material, only: & use material, only: &
material_phase, & material_phase, &
#ifdef NEWSTATE
LOCAL_DAMAGE_BRITTLE_ID, & LOCAL_DAMAGE_BRITTLE_ID, &
#else
DAMAGE_local_ID, &
DAMAGE_gradient_ID, &
#endif
phase_damage phase_damage
#ifndef NEWSTATE
use damage_gradient, only: &
damage_gradient_dotState
#endif
use damage_local, only: & use damage_local, only: &
damage_local_dotState damage_local_dotState
@ -237,73 +182,13 @@ subroutine constitutive_damage_collectDotState(Tstar_v, Fe, Lp, ipc, ip, el)
Fe Fe
select case (phase_damage(material_phase(ipc,ip,el))) select case (phase_damage(material_phase(ipc,ip,el)))
#ifdef NEWSTATE
case (LOCAL_DAMAGE_BRITTLE_ID) case (LOCAL_DAMAGE_BRITTLE_ID)
call damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el) call damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el)
#else
case (DAMAGE_local_ID)
call damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el)
case (DAMAGE_gradient_ID)
call damage_gradient_dotState(Tstar_v, Fe, Lp, ipc, ip, el)
#endif
end select end select
end subroutine constitutive_damage_collectDotState end subroutine constitutive_damage_collectDotState
!--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on each damage model state layout
!--------------------------------------------------------------------------------------------------
function constitutive_damageValue(ipc, ip, el)
use material, only: &
material_phase, &
#ifdef NEWSTATE
LOCAL_DAMAGE_none_ID, &
LOCAL_DAMAGE_BRITTLE_ID, &
#else
DAMAGE_none_ID, &
DAMAGE_local_ID, &
DAMAGE_gradient_ID, &
#endif
phase_damage
use damage_local, only: &
damage_local_damageValue
#ifndef NEWSTATE
use damage_gradient, only: &
damage_gradient_damageValue
#endif
implicit none
integer(pInt), intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal) :: constitutive_damageValue
select case (phase_damage(material_phase(ipc,ip,el)))
#ifdef NEWSTATE
case (LOCAL_DAMAGE_none_ID)
constitutive_damageValue = 1.0_pReal
case (LOCAL_DAMAGE_BRITTLE_ID)
constitutive_damageValue = damage_local_damageValue(ipc, ip, el)
#else
case (DAMAGE_none_ID)
constitutive_damageValue = 1.0_pReal
case (DAMAGE_local_ID)
constitutive_damageValue = damage_local_damageValue(ipc, ip, el)
case (DAMAGE_gradient_ID)
constitutive_damageValue = damage_gradient_damageValue(ipc, ip, el)
#endif
end select
end function constitutive_damageValue
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns array of constitutive results !> @brief returns array of constitutive results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -311,19 +196,10 @@ function constitutive_damage_postResults(ipc, ip, el)
use material, only: & use material, only: &
damageState, & damageState, &
material_phase, & material_phase, &
#ifdef NEWSTATE
LOCAL_DAMAGE_BRITTLE_ID, & LOCAL_DAMAGE_BRITTLE_ID, &
#else
DAMAGE_local_ID, &
DAMAGE_gradient_ID, &
#endif
phase_damage phase_damage
use damage_local, only: & use damage_local, only: &
damage_local_postResults damage_local_postResults
#ifndef NEWSTATE
use damage_gradient, only: &
damage_gradient_postResults
#endif
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
@ -336,15 +212,8 @@ function constitutive_damage_postResults(ipc, ip, el)
constitutive_damage_postResults = 0.0_pReal constitutive_damage_postResults = 0.0_pReal
select case (phase_damage(material_phase(ipc,ip,el))) select case (phase_damage(material_phase(ipc,ip,el)))
#ifdef NEWSTATE
case (LOCAL_DAMAGE_BRITTLE_ID) case (LOCAL_DAMAGE_BRITTLE_ID)
constitutive_damage_postResults = damage_local_postResults(ipc, ip, el) constitutive_damage_postResults = damage_local_postResults(ipc, ip, el)
#else
case (DAMAGE_local_ID)
constitutive_damage_postResults = damage_local_postResults(ipc, ip, el)
case (DAMAGE_gradient_ID)
constitutive_damage_postResults = damage_gradient_postResults(ipc,ip,el)
#endif
end select end select
end function constitutive_damage_postResults end function constitutive_damage_postResults

View File

@ -19,7 +19,6 @@ module constitutive_thermal
constitutive_thermal_init, & constitutive_thermal_init, &
constitutive_thermal_microstructure, & constitutive_thermal_microstructure, &
constitutive_thermal_collectDotState, & constitutive_thermal_collectDotState, &
constitutive_temperature, &
constitutive_thermal_postResults constitutive_thermal_postResults
contains contains
@ -51,25 +50,15 @@ subroutine constitutive_thermal_init
phase_thermal, & phase_thermal, &
phase_thermalInstance, & phase_thermalInstance, &
phase_Noutput, & phase_Noutput, &
#ifdef NEWSTATE
LOCAL_THERMAL_none_ID, & LOCAL_THERMAL_none_ID, &
LOCAL_THERMAL_none_label, & LOCAL_THERMAL_none_label, &
LOCAL_THERMAL_heatgen_ID, & LOCAL_THERMAL_heatgen_ID, &
LOCAL_THERMAL_heatgen_label, & LOCAL_THERMAL_heatgen_label, &
#else
THERMAL_none_ID, &
THERMAL_NONE_label, &
THERMAL_conduction_ID, &
THERMAL_CONDUCTION_label, &
#endif
homogenization_Ngrains, & homogenization_Ngrains, &
homogenization_maxNgrains, & homogenization_maxNgrains, &
thermalState thermalState
use thermal_none use thermal_none
#ifndef NEWSTATE
use thermal_conduction
#endif
implicit none implicit none
integer(pInt), parameter :: FILEUNIT = 200_pInt integer(pInt), parameter :: FILEUNIT = 200_pInt
integer(pInt) :: & integer(pInt) :: &
@ -86,13 +75,8 @@ subroutine constitutive_thermal_init
! parse from config file ! parse from config file
if (.not. IO_open_jobFile_stat(FILEUNIT,material_localFileExt)) & ! no local material configuration present... if (.not. IO_open_jobFile_stat(FILEUNIT,material_localFileExt)) & ! no local material configuration present...
call IO_open_file(FILEUNIT,material_configFile) ! ... open material.config file call IO_open_file(FILEUNIT,material_configFile) ! ... open material.config file
#ifdef NEWSTATE
if (any(phase_thermal == LOCAL_THERMAL_none_ID)) call thermal_none_init(FILEUNIT) if (any(phase_thermal == LOCAL_THERMAL_none_ID)) call thermal_none_init(FILEUNIT)
! if (any(phase_thermal == LOCAL_THERMAL_HEATGEN_ID)) call thermal_heatgen_init(FILEUNIT) ! if (any(phase_thermal == LOCAL_THERMAL_HEATGEN_ID)) call thermal_heatgen_init(FILEUNIT)
#else
if (any(phase_thermal == THERMAL_none_ID)) call thermal_none_init(FILEUNIT)
if (any(phase_thermal == THERMAL_conduction_ID)) call thermal_conduction_init(FILEUNIT)
#endif
close(FILEUNIT) close(FILEUNIT)
write(6,'(/,a)') ' <<<+- constitutive_thermal init -+>>>' write(6,'(/,a)') ' <<<+- constitutive_thermal init -+>>>'
@ -107,7 +91,6 @@ subroutine constitutive_thermal_init
instance = phase_thermalInstance(ph) ! which instance is present phase instance = phase_thermalInstance(ph) ! which instance is present phase
knownThermal = .true. knownThermal = .true.
select case(phase_thermal(ph)) ! split per constititution select case(phase_thermal(ph)) ! split per constititution
#ifdef NEWSTATE
case (LOCAL_THERMAL_none_ID) case (LOCAL_THERMAL_none_ID)
outputName = LOCAL_THERMAL_NONE_label outputName = LOCAL_THERMAL_NONE_label
thisOutput => null() thisOutput => null()
@ -116,27 +99,13 @@ subroutine constitutive_thermal_init
outputName = LOCAL_THERMAL_HEATGEN_label outputName = LOCAL_THERMAL_HEATGEN_label
thisOutput => null() thisOutput => null()
thisSize => null() thisSize => null()
#else
case (THERMAL_none_ID)
outputName = THERMAL_NONE_label
thisOutput => null()
thisSize => null()
case (THERMAL_conduction_ID)
outputName = THERMAL_CONDUCTION_label
thisOutput => thermal_conduction_output
thisSize => thermal_conduction_sizePostResult
#endif
case default case default
knownThermal = .false. knownThermal = .false.
end select end select
write(FILEUNIT,'(/,a,/)') '['//trim(phase_name(ph))//']' write(FILEUNIT,'(/,a,/)') '['//trim(phase_name(ph))//']'
if (knownThermal) then if (knownThermal) then
write(FILEUNIT,'(a)') '(thermal)'//char(9)//trim(outputName) write(FILEUNIT,'(a)') '(thermal)'//char(9)//trim(outputName)
#ifdef NEWSTATE
if (phase_thermal(ph) /= LOCAL_THERMAL_none_ID) then if (phase_thermal(ph) /= LOCAL_THERMAL_none_ID) then
#else
if (phase_thermal(ph) /= THERMAL_none_ID) then
#endif
do e = 1_pInt,phase_Noutput(ph) do e = 1_pInt,phase_Noutput(ph)
write(FILEUNIT,'(a,i4)') trim(thisOutput(e,instance))//char(9),thisSize(e,instance) write(FILEUNIT,'(a,i4)') trim(thisOutput(e,instance))//char(9),thisSize(e,instance)
enddo enddo
@ -164,14 +133,7 @@ end subroutine constitutive_thermal_init
subroutine constitutive_thermal_microstructure(Tstar_v, Lp, ipc, ip, el) subroutine constitutive_thermal_microstructure(Tstar_v, Lp, ipc, ip, el)
use material, only: & use material, only: &
material_phase, & material_phase, &
#ifndef NEWSTATE
THERMAL_conduction_ID, &
#endif
phase_thermal phase_thermal
#ifndef NEWSTATE
use thermal_conduction, only: &
thermal_conduction_microstructure
#endif
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
@ -183,12 +145,6 @@ subroutine constitutive_thermal_microstructure(Tstar_v, Lp, ipc, ip, el)
real(pReal), intent(in), dimension(3,3) :: & real(pReal), intent(in), dimension(3,3) :: &
Lp Lp
select case (phase_thermal(material_phase(ipc,ip,el)))
#ifndef NEWSTATE
case (THERMAL_conduction_ID)
call thermal_conduction_microstructure(Tstar_v, Lp, ipc, ip, el)
#endif
end select
end subroutine constitutive_thermal_microstructure end subroutine constitutive_thermal_microstructure
@ -199,17 +155,9 @@ end subroutine constitutive_thermal_microstructure
subroutine constitutive_thermal_collectDotState(Tstar_v, Lp, ipc, ip, el) subroutine constitutive_thermal_collectDotState(Tstar_v, Lp, ipc, ip, el)
use material, only: & use material, only: &
material_phase, & material_phase, &
#ifdef NEWSTATE
LOCAL_THERMAL_none_ID, & LOCAL_THERMAL_none_ID, &
LOCAL_THERMAL_HEATGEN_ID, & LOCAL_THERMAL_HEATGEN_ID, &
#else
THERMAL_none_ID, &
THERMAL_adiabatic_ID, &
THERMAL_conduction_ID, &
#endif
phase_thermal phase_thermal
! use thermal_conduction, only: &
! thermal_adiabatic_microstructure
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
@ -222,68 +170,12 @@ subroutine constitutive_thermal_collectDotState(Tstar_v, Lp, ipc, ip, el)
Lp Lp
select case (phase_thermal(material_phase(ipc,ip,el))) select case (phase_thermal(material_phase(ipc,ip,el)))
#ifdef NEWSTATE
case (LOCAL_THERMAL_HEATGEN_ID) case (LOCAL_THERMAL_HEATGEN_ID)
#else
case (THERMAL_adiabatic_ID)
#endif
! call thermal_adiabatic_dotState(Tstar_v, Lp, ipc, ip, el) ! call thermal_adiabatic_dotState(Tstar_v, Lp, ipc, ip, el)
end select end select
end subroutine constitutive_thermal_collectDotState end subroutine constitutive_thermal_collectDotState
!--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on each thermal model state layout
!--------------------------------------------------------------------------------------------------
function constitutive_temperature(ipc, ip, el)
use material, only: &
material_phase, &
#ifdef NEWSTATE
LOCAL_THERMAL_none_ID, &
LOCAL_THERMAL_HEATGEN_ID, &
#else
THERMAL_none_ID, &
THERMAL_adiabatic_ID, &
THERMAL_conduction_ID, &
#endif
phase_thermal
use lattice, only: &
lattice_referenceTemperature
#ifndef NEWSTATE
use thermal_conduction, only: &
thermal_conduction_temperature
#endif
! use thermal_adiabatic, only: &
! thermal_adiabatic_temperature
implicit none
integer(pInt), intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal) :: constitutive_temperature
select case (phase_thermal(material_phase(ipc,ip,el)))
#ifdef NEWSTATE
case (LOCAL_THERMAL_none_ID)
constitutive_temperature = lattice_referenceTemperature(material_phase(ipc,ip,el))
case (LOCAL_THERMAL_HEATGEN_ID)
!constitutive_temperature = thermal_heatgen_temperature(ipc, ip, el)
#else
case (THERMAL_none_ID)
constitutive_temperature = lattice_referenceTemperature(material_phase(ipc,ip,el))
case (THERMAL_adiabatic_ID)
!constitutive_temperature = thermal_adiabatic_temperature(ipc, ip, el)
case (THERMAL_conduction_ID)
constitutive_temperature = thermal_conduction_temperature(ipc, ip, el)
#endif
end select
end function constitutive_temperature
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns array of constitutive results !> @brief returns array of constitutive results
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -291,14 +183,7 @@ function constitutive_thermal_postResults(ipc, ip, el)
use material, only: & use material, only: &
thermalState, & thermalState, &
material_phase, & material_phase, &
#ifndef NEWSTATE
THERMAL_conduction_ID, &
#endif
phase_thermal phase_thermal
#ifndef NEWSTATE
use thermal_conduction, only: &
thermal_conduction_postResults
#endif
implicit none implicit none
integer(pInt), intent(in) :: & integer(pInt), intent(in) :: &
@ -310,12 +195,6 @@ function constitutive_thermal_postResults(ipc, ip, el)
constitutive_thermal_postResults = 0.0_pReal constitutive_thermal_postResults = 0.0_pReal
select case (phase_thermal(material_phase(ipc,ip,el)))
#ifndef NEWSTATE
case (THERMAL_conduction_ID)
constitutive_thermal_postResults = thermal_conduction_postResults(ipc,ip,el)
#endif
end select
end function constitutive_thermal_postResults end function constitutive_thermal_postResults

View File

@ -115,9 +115,7 @@ module crystallite
crystallite_init, & crystallite_init, &
crystallite_stressAndItsTangent, & crystallite_stressAndItsTangent, &
crystallite_orientations, & crystallite_orientations, &
#ifdef NEWSTATE
crystallite_push33ToRef, & crystallite_push33ToRef, &
#endif
crystallite_postResults crystallite_postResults
private :: & private :: &
crystallite_integrateStateFPI, & crystallite_integrateStateFPI, &
@ -3414,9 +3412,6 @@ logical function crystallite_stateJump(g,i,e)
crystallite_stateJump = .true. crystallite_stateJump = .true.
end function crystallite_stateJump end function crystallite_stateJump
#ifdef NEWSTATE
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Map 2nd order tensor to reference config !> @brief Map 2nd order tensor to reference config
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -3437,8 +3432,6 @@ function crystallite_push33ToRef(g,i,e, tensor33)
crystallite_push33ToRef = matmul(invFp,matmul(tensor33,transpose(invFp))) crystallite_push33ToRef = matmul(invFp,matmul(tensor33,transpose(invFp)))
end function crystallite_push33ToRef end function crystallite_push33ToRef
#endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief calculation of stress (P) with time integration based on a residuum in Lp and !> @brief calculation of stress (P) with time integration based on a residuum in Lp and
!> intermediate acceleration of the Newton-Raphson correction !> intermediate acceleration of the Newton-Raphson correction

View File

@ -26,7 +26,6 @@ module damage_local
damage_local_Noutput !< number of outputs per instance of this damage damage_local_Noutput !< number of outputs per instance of this damage
real(pReal), dimension(:), allocatable, public :: & real(pReal), dimension(:), allocatable, public :: &
damage_local_crack_mobility, &
damage_local_aTol damage_local_aTol
enum, bind(c) enum, bind(c)
@ -43,10 +42,9 @@ module damage_local
damage_local_stateInit, & damage_local_stateInit, &
damage_local_aTolState, & damage_local_aTolState, &
damage_local_dotState, & damage_local_dotState, &
damage_local_damageValue, & damage_local_microstructure, &
#ifdef NEWSTATE
constitutive_brittle_getDamage, & constitutive_brittle_getDamage, &
#endif constitutive_brittle_putDamage, &
damage_local_postResults damage_local_postResults
contains contains
@ -83,13 +81,8 @@ subroutine damage_local_init(fileUnit)
phase_damage, & phase_damage, &
phase_damageInstance, & phase_damageInstance, &
phase_Noutput, & phase_Noutput, &
#ifdef NEWSTATE
LOCAL_DAMAGE_BRITTLE_label, & LOCAL_DAMAGE_BRITTLE_label, &
LOCAL_DAMAGE_BRITTLE_ID, & LOCAL_DAMAGE_BRITTLE_ID, &
#else
DAMAGE_LOCAL_label, &
DAMAGE_local_ID, &
#endif
material_phase, & material_phase, &
damageState, & damageState, &
MATERIAL_partPhase MATERIAL_partPhase
@ -107,20 +100,12 @@ subroutine damage_local_init(fileUnit)
character(len=65536) :: & character(len=65536) :: &
tag = '', & tag = '', &
line = '' line = ''
#ifdef NEWSTATE
write(6,'(/,a)') ' <<<+- damage_'//LOCAL_DAMAGE_BRITTLE_label//' init -+>>>' write(6,'(/,a)') ' <<<+- damage_'//LOCAL_DAMAGE_BRITTLE_label//' init -+>>>'
#else
write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_LOCAL_label//' init -+>>>'
#endif
write(6,'(a)') ' $Id: damage_local.f90 3210 2014-06-17 15:24:44Z MPIE\m.diehl $' write(6,'(a)') ' $Id: damage_local.f90 3210 2014-06-17 15:24:44Z MPIE\m.diehl $'
write(6,'(a15,a)') ' Current time: ',IO_timeStamp() write(6,'(a15,a)') ' Current time: ',IO_timeStamp()
#include "compilation_info.f90" #include "compilation_info.f90"
#ifdef NEWSTATE
maxNinstance = int(count(phase_damage == LOCAL_DAMAGE_BRITTLE_ID),pInt) maxNinstance = int(count(phase_damage == LOCAL_DAMAGE_BRITTLE_ID),pInt)
#else
maxNinstance = int(count(phase_damage == DAMAGE_local_ID),pInt)
#endif
if (maxNinstance == 0_pInt) return if (maxNinstance == 0_pInt) return
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) &
@ -132,7 +117,6 @@ subroutine damage_local_init(fileUnit)
damage_local_output = '' damage_local_output = ''
allocate(damage_local_outputID(maxval(phase_Noutput),maxNinstance), source=undefined_ID) allocate(damage_local_outputID(maxval(phase_Noutput),maxNinstance), source=undefined_ID)
allocate(damage_local_Noutput(maxNinstance), source=0_pInt) allocate(damage_local_Noutput(maxNinstance), source=0_pInt)
allocate(damage_local_crack_mobility(maxNinstance), source=0.0_pReal)
allocate(damage_local_aTol(maxNinstance), source=0.0_pReal) allocate(damage_local_aTol(maxNinstance), source=0.0_pReal)
rewind(fileUnit) rewind(fileUnit)
@ -152,31 +136,20 @@ subroutine damage_local_init(fileUnit)
phase = phase + 1_pInt ! advance phase section counter phase = phase + 1_pInt ! advance phase section counter
cycle ! skip to next line cycle ! skip to next line
endif endif
#ifdef NEWSTATE
if (phase > 0_pInt ) then; if (phase_damage(phase) == LOCAL_DAMAGE_BRITTLE_ID) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran if (phase > 0_pInt ) then; if (phase_damage(phase) == LOCAL_DAMAGE_BRITTLE_ID) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran
#else
if (phase > 0_pInt ) then; if (phase_damage(phase) == DAMAGE_local_ID) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran
#endif
instance = phase_damageInstance(phase) ! which instance of my damage is present phase instance = phase_damageInstance(phase) ! which instance of my damage is present phase
positions = IO_stringPos(line,MAXNCHUNKS) positions = IO_stringPos(line,MAXNCHUNKS)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case ('(output)') case ('(output)')
select case(IO_lc(IO_stringValue(line,positions,2_pInt))) select case(IO_lc(IO_stringValue(line,positions,2_pInt)))
#ifdef NEWSTATE
case ('local_damage_brittle') case ('local_damage_brittle')
#else
case ('local_damage')
#endif
damage_local_Noutput(instance) = damage_local_Noutput(instance) + 1_pInt damage_local_Noutput(instance) = damage_local_Noutput(instance) + 1_pInt
damage_local_outputID(damage_local_Noutput(instance),instance) = local_damage_ID damage_local_outputID(damage_local_Noutput(instance),instance) = local_damage_ID
damage_local_output(damage_local_Noutput(instance),instance) = & damage_local_output(damage_local_Noutput(instance),instance) = &
IO_lc(IO_stringValue(line,positions,2_pInt)) IO_lc(IO_stringValue(line,positions,2_pInt))
end select end select
case ('crack_mobility')
damage_local_crack_mobility(instance) = IO_floatValue(line,positions,2_pInt)
case ('atol_damage') case ('atol_damage')
damage_local_aTol(instance) = IO_floatValue(line,positions,2_pInt) damage_local_aTol(instance) = IO_floatValue(line,positions,2_pInt)
@ -185,11 +158,7 @@ subroutine damage_local_init(fileUnit)
enddo parsingFile enddo parsingFile
initializeInstances: do phase = 1_pInt, size(phase_damage) initializeInstances: do phase = 1_pInt, size(phase_damage)
#ifdef NEWSTATE
if (phase_damage(phase) == LOCAL_DAMAGE_BRITTLE_ID) then if (phase_damage(phase) == LOCAL_DAMAGE_BRITTLE_ID) then
#else
if (phase_damage(phase) == DAMAGE_local_ID) then
#endif
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phase==phase)
instance = phase_damageInstance(phase) instance = phase_damageInstance(phase)
@ -207,7 +176,7 @@ subroutine damage_local_init(fileUnit)
endif endif
enddo outputsLoop enddo outputsLoop
! Determine size of state array ! Determine size of state array
sizeDotState = 2_pInt sizeDotState = 1_pInt
sizeState = 2_pInt sizeState = 2_pInt
damageState(phase)%sizeState = sizeState damageState(phase)%sizeState = sizeState
@ -272,8 +241,7 @@ subroutine damage_local_aTolState(phase,instance)
instance ! number specifying the current instance of the damage instance ! number specifying the current instance of the damage
real(pReal), dimension(damageState(phase)%sizeState) :: tempTol real(pReal), dimension(damageState(phase)%sizeState) :: tempTol
tempTol(1) = 100.0_pReal tempTol = damage_local_aTol(instance)
tempTol(2) = damage_local_aTol(instance)
damageState(phase)%aTolState = tempTol damageState(phase)%aTolState = tempTol
end subroutine damage_local_aTolState end subroutine damage_local_aTolState
@ -281,6 +249,40 @@ end subroutine damage_local_aTolState
!> @brief calculates derived quantities from state !> @brief calculates derived quantities from state
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el) subroutine damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el)
use material, only: &
mappingConstitutive, &
phase_damageInstance, &
damageState
use lattice, only: &
lattice_DamageMobility
implicit none
integer(pInt), intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), intent(in), dimension(6) :: &
Tstar_v !< 2nd Piola Kirchhoff stress tensor (Mandel)
real(pReal), intent(in), dimension(3,3) :: &
Lp, &
Fe
integer(pInt) :: &
phase, constituent
phase = mappingConstitutive(2,ipc,ip,el)
constituent = mappingConstitutive(1,ipc,ip,el)
damageState(phase)%dotState(1,constituent) = &
(1.0_pReal/lattice_DamageMobility(phase))* &
(damageState(phase)%state(2,constituent) - &
damageState(phase)%state(1,constituent))
end subroutine damage_local_dotState
!--------------------------------------------------------------------------------------------------
!> @brief calculates derived quantities from state
!--------------------------------------------------------------------------------------------------
subroutine damage_local_microstructure(Tstar_v, Fe, ipc, ip, el)
use material, only: & use material, only: &
mappingConstitutive, & mappingConstitutive, &
phase_damageInstance, & phase_damageInstance, &
@ -294,7 +296,7 @@ subroutine damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el)
math_trace33, & math_trace33, &
math_I3 math_I3
use lattice, only: & use lattice, only: &
lattice_surfaceEnergy33, & lattice_damageDiffusion33, &
lattice_C66 lattice_C66
implicit none implicit none
@ -305,56 +307,23 @@ subroutine damage_local_dotState(Tstar_v, Fe, Lp, ipc, ip, el)
real(pReal), intent(in), dimension(6) :: & real(pReal), intent(in), dimension(6) :: &
Tstar_v !< 2nd Piola Kirchhoff stress tensor (Mandel) Tstar_v !< 2nd Piola Kirchhoff stress tensor (Mandel)
real(pReal), intent(in), dimension(3,3) :: & real(pReal), intent(in), dimension(3,3) :: &
Lp, &
Fe Fe
integer(pInt) :: & integer(pInt) :: &
phase, constituent, instance phase, constituent
real(pReal) :: & real(pReal) :: &
trialDamage, strain(3,3), stress(3,3), pressure strain(3,3), stress(3,3)
phase = mappingConstitutive(2,ipc,ip,el) phase = mappingConstitutive(2,ipc,ip,el)
constituent = mappingConstitutive(1,ipc,ip,el) constituent = mappingConstitutive(1,ipc,ip,el)
instance = phase_damageInstance(phase) ! which instance of my damage is present phase
strain = 0.5_pReal*(math_mul33x33(math_transpose33(Fe),Fe)-math_I3) strain = 0.5_pReal*(math_mul33x33(math_transpose33(Fe),Fe)-math_I3)
stress = math_mul3333xx33(math_Mandel66to3333(lattice_C66(1:6,1:6,phase)),strain) stress = math_mul3333xx33(math_Mandel66to3333(lattice_C66(1:6,1:6,phase)),strain)
pressure = math_trace33(stress)/3.0_pReal
if (pressure < 0.0_pReal) stress = stress - pressure*math_I3
trialDamage = min(1.0_pReal, &
(math_trace33(lattice_surfaceEnergy33(1:3,1:3,phase))/3.0_pReal)/ &
(sum(abs(strain*stress)) + &
damageState(phase)%state(1,constituent)))
damageState(phase)%dotState(1,constituent) = &
sum(abs(stress*Lp))
damageState(phase)%dotState(2,constituent) = &
damage_local_crack_mobility(instance)* &
(trialDamage - damageState(phase)%state(2,constituent))
end subroutine damage_local_dotState
!-------------------------------------------------------------------------------------------------- damageState(phase)%state(2,constituent) = min(1.0_pReal, &
!> @brief returns temperature based on local damage model state layout math_trace33(lattice_damageDiffusion33(1:3,1:3,phase))/ &
!-------------------------------------------------------------------------------------------------- sum(abs(stress*strain)))
function damage_local_damageValue(ipc, ip, el)
use material, only: &
mappingConstitutive, &
damageState
implicit none end subroutine damage_local_microstructure
integer(pInt), intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal) :: damage_local_damageValue
damage_local_damageValue = &
damageState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el))* &
damageState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el))
end function damage_local_damageValue
#ifdef NEWSTATE
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on local damage model state layout !> @brief returns temperature based on local damage model state layout
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -371,11 +340,30 @@ function constitutive_brittle_getDamage(ipc, ip, el)
real(pReal) :: constitutive_brittle_getDamage real(pReal) :: constitutive_brittle_getDamage
constitutive_brittle_getDamage = & constitutive_brittle_getDamage = &
damageState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el))* & damageState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el))* &
damageState(mappingConstitutive(2,ipc,ip,el))%state(2,mappingConstitutive(1,ipc,ip,el)) damageState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el))
end function constitutive_brittle_getDamage end function constitutive_brittle_getDamage
#endif
!--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on local damage model state layout
!--------------------------------------------------------------------------------------------------
subroutine constitutive_brittle_putDamage(ipc, ip, el, localDamage)
use material, only: &
mappingConstitutive, &
damageState
implicit none
integer(pInt), intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: localDamage
damageState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el)) = &
localDamage
end subroutine constitutive_brittle_putDamage
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return array of constitutive results !> @brief return array of constitutive results
@ -407,7 +395,7 @@ function damage_local_postResults(ipc,ip,el)
do o = 1_pInt,damage_local_Noutput(instance) do o = 1_pInt,damage_local_Noutput(instance)
select case(damage_local_outputID(o,instance)) select case(damage_local_outputID(o,instance))
case (local_damage_ID) case (local_damage_ID)
damage_local_postResults(c+1_pInt) = damageState(phase)%state(2,constituent) damage_local_postResults(c+1_pInt) = damageState(phase)%state(1,constituent)
c = c + 1 c = c + 1
end select end select

View File

@ -40,13 +40,8 @@ subroutine damage_none_init(fileUnit)
use material, only: & use material, only: &
phase_damage, & phase_damage, &
phase_Noutput, & phase_Noutput, &
#ifdef NEWSTATE
LOCAL_DAMAGE_NONE_label, & LOCAL_DAMAGE_NONE_label, &
LOCAL_DAMAGE_NONE_ID, & LOCAL_DAMAGE_NONE_ID, &
#else
DAMAGE_NONE_label, &
DAMAGE_NONE_ID, &
#endif
material_phase, & material_phase, &
damageState, & damageState, &
MATERIAL_partPhase MATERIAL_partPhase
@ -60,19 +55,11 @@ subroutine damage_none_init(fileUnit)
NofMyPhase, & NofMyPhase, &
sizeState, & sizeState, &
sizeDotState sizeDotState
#ifdef NEWSTATE
write(6,'(/,a)') ' <<<+- damage_'//LOCAL_DAMAGE_NONE_label//' init -+>>>' write(6,'(/,a)') ' <<<+- damage_'//LOCAL_DAMAGE_NONE_label//' init -+>>>'
#else
write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_NONE_label//' init -+>>>'
#endif
write(6,'(a)') ' $Id: damage_none.f90 3148 2014-05-27 14:46:03Z MPIE\m.diehl $' write(6,'(a)') ' $Id: damage_none.f90 3148 2014-05-27 14:46:03Z MPIE\m.diehl $'
write(6,'(a15,a)') ' Current time: ',IO_timeStamp() write(6,'(a15,a)') ' Current time: ',IO_timeStamp()
#include "compilation_info.f90" #include "compilation_info.f90"
#ifdef NEWSTATE
maxNinstance = int(count(phase_damage == LOCAL_DAMAGE_NONE_ID),pInt) maxNinstance = int(count(phase_damage == LOCAL_DAMAGE_NONE_ID),pInt)
#else
maxNinstance = int(count(phase_damage == DAMAGE_NONE_ID),pInt)
#endif
if (maxNinstance == 0_pInt) return if (maxNinstance == 0_pInt) return
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) &
@ -80,11 +67,7 @@ subroutine damage_none_init(fileUnit)
initializeInstances: do phase = 1_pInt, size(phase_damage) initializeInstances: do phase = 1_pInt, size(phase_damage)
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phase==phase)
#ifdef NEWSTATE
if (phase_damage(phase) == LOCAL_DAMAGE_none_ID) then if (phase_damage(phase) == LOCAL_DAMAGE_none_ID) then
#else
if (phase_damage(phase) == DAMAGE_none_ID) then
#endif
sizeState = 0_pInt sizeState = 0_pInt
damageState(phase)%sizeState = sizeState damageState(phase)%sizeState = sizeState
sizeDotState = sizeState sizeDotState = sizeState

View File

@ -49,7 +49,6 @@ module homogenization
public :: & public :: &
homogenization_init, & homogenization_init, &
materialpoint_stressAndItsTangent, & materialpoint_stressAndItsTangent, &
#ifdef NEWSTATE
field_getDAMAGE, & field_getDAMAGE, &
field_putDAMAGE, & field_putDAMAGE, &
field_getThermal, & field_getThermal, &
@ -59,7 +58,6 @@ module homogenization
field_getThermalConductivity33, & field_getThermalConductivity33, &
field_getMassDensity, & field_getMassDensity, &
field_getSpecificHeat, & field_getSpecificHeat, &
#endif
materialpoint_postResults materialpoint_postResults
private :: & private :: &
homogenization_partitionDeformation, & homogenization_partitionDeformation, &
@ -103,10 +101,8 @@ subroutine homogenization_init()
mesh_element, & mesh_element, &
FE_Nips, & FE_Nips, &
FE_geomtype FE_geomtype
#ifdef NEWSTATE
use lattice, only: & use lattice, only: &
lattice_referenceTemperature lattice_referenceTemperature
#endif
use constitutive, only: & use constitutive, only: &
constitutive_maxSizePostResults constitutive_maxSizePostResults
use constitutive_damage, only: & use constitutive_damage, only: &
@ -178,21 +174,20 @@ subroutine homogenization_init()
enddo enddo
close(FILEUNIT) close(FILEUNIT)
#ifdef NEWSTATE
do p = 1,material_Nhomogenization do p = 1,material_Nhomogenization
NofMyField=count(material_homog==p) NofMyField=count(material_homog==p)
select case(field_damage_type(p)) select case(field_damage_type(p))
case (FIELD_DAMAGE_LOCAL_ID) case (FIELD_DAMAGE_LOCAL_ID)
fieldDamage(p)%sizeState = 0_pInt fieldDamage(p)%sizeField = 0_pInt
fieldDamage(p)%sizePostResults = 0_pInt fieldDamage(p)%sizePostResults = 0_pInt
allocate(fieldDamage(p)%state(fieldDamage(p)%sizeState,NofMyField), source = 1.0_pReal) allocate(fieldDamage(p)%field(fieldDamage(p)%sizeField,NofMyField), source = 1.0_pReal)
case (FIELD_DAMAGE_NONLOCAL_ID) case (FIELD_DAMAGE_NONLOCAL_ID)
fieldDamage(p)%sizeState = 1_pInt fieldDamage(p)%sizeField = 1_pInt
fieldDamage(p)%sizePostResults = 1_pInt fieldDamage(p)%sizePostResults = 1_pInt
allocate(fieldDamage(p)%state(fieldDamage(p)%sizeState,NofMyField), source = 1.0_pReal) allocate(fieldDamage(p)%field(fieldDamage(p)%sizeField,NofMyField), source = 1.0_pReal)
end select end select
enddo enddo
@ -203,21 +198,20 @@ subroutine homogenization_init()
select case(field_thermal_type(p)) select case(field_thermal_type(p))
case (FIELD_THERMAL_ADIABATIC_ID) case (FIELD_THERMAL_ADIABATIC_ID)
fieldThermal(p)%sizeState = 0_pInt fieldThermal(p)%sizeField = 0_pInt
fieldThermal(p)%sizePostResults = 0_pInt fieldThermal(p)%sizePostResults = 0_pInt
allocate(fieldThermal(p)%state(fieldThermal(p)%sizeState,NofMyField), & allocate(fieldThermal(p)%field(fieldThermal(p)%sizeField,NofMyField), &
source = 273.0_pReal) ! ToDo: temporary fix for now source = 273.0_pReal) ! ToDo: temporary fix for now
case (FIELD_THERMAL_CONDUCTION_ID) case (FIELD_THERMAL_CONDUCTION_ID)
fieldThermal(p)%sizeState = 1_pInt fieldThermal(p)%sizeField = 1_pInt
fieldThermal(p)%sizePostResults = 1_pInt fieldThermal(p)%sizePostResults = 1_pInt
allocate(fieldThermal(p)%state(fieldThermal(p)%sizeState,NofMyField), & allocate(fieldThermal(p)%field(fieldThermal(p)%sizeField,NofMyField), &
source = 273.0_pReal) ! ToDo: temporary fix for now source = 273.0_pReal) ! ToDo: temporary fix for now
end select end select
enddo enddo
#endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
! allocate and initialize global variables ! allocate and initialize global variables
allocate(homogenization_sizePostResults(mesh_maxNips,mesh_NcpElems), source=0_pInt) allocate(homogenization_sizePostResults(mesh_maxNips,mesh_NcpElems), source=0_pInt)
@ -860,7 +854,6 @@ real(pReal) function homogenization_averageHeat(ip,el)
end function homogenization_averageHeat end function homogenization_averageHeat
#ifdef NEWSTATE
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief Returns average specific heat at each integration point !> @brief Returns average specific heat at each integration point
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -1079,12 +1072,7 @@ real(pReal) function field_getDAMAGE(ip,el)
use mesh, only: & use mesh, only: &
mesh_element mesh_element
use material, only: & use material, only: &
material_homog, &
field_damage_type, &
FIELD_DAMAGE_LOCAL_ID, &
FIELD_DAMAGE_NONLOCAL_ID, &
homogenization_Ngrains homogenization_Ngrains
use constitutive, only: & use constitutive, only: &
constitutive_getLocalDamage constitutive_getLocalDamage
@ -1099,17 +1087,9 @@ real(pReal) function field_getDAMAGE(ip,el)
! computing the damage value needed to be passed to field solver ! computing the damage value needed to be passed to field solver
field_getDAMAGE =0.0_pReal field_getDAMAGE =0.0_pReal
select case(field_damage_type(material_homog(ip,el))) do ipc = 1, homogenization_Ngrains(mesh_element(3,el))
field_getDAMAGE = field_getDAMAGE + constitutive_getLocalDamage(ipc,ip,el)
case (FIELD_DAMAGE_LOCAL_ID) enddo
field_getDAMAGE = 1.0_pReal
case (FIELD_DAMAGE_NONLOCAL_ID)
do ipc = 1, homogenization_Ngrains(mesh_element(3,el))
field_getDAMAGE = field_getDAMAGE + constitutive_getLocalDamage(ipc,ip,el)
enddo
end select
field_getDAMAGE = field_getDAMAGE /homogenization_Ngrains(mesh_element(3,el)) field_getDAMAGE = field_getDAMAGE /homogenization_Ngrains(mesh_element(3,el))
@ -1136,7 +1116,7 @@ subroutine field_putDAMAGE(ip,el,fieldDamageValue) ! naming scheme
select case(field_damage_type(material_homog(ip,el))) select case(field_damage_type(material_homog(ip,el)))
case (FIELD_DAMAGE_NONLOCAL_ID) case (FIELD_DAMAGE_NONLOCAL_ID)
fieldDamage(material_homog(ip,el))% & fieldDamage(material_homog(ip,el))% &
state(1, mappingHomogenization(1,ip,el)) = fieldDamageValue field(1, mappingHomogenization(1,ip,el)) = fieldDamageValue
end select end select
@ -1149,12 +1129,7 @@ real(pReal) function field_getThermal(ip,el)
use mesh, only: & use mesh, only: &
mesh_element mesh_element
use material, only: & use material, only: &
material_homog, &
field_thermal_type, &
FIELD_THERMAL_ADIABATIC_ID, &
FIELD_THERMAL_CONDUCTION_ID, &
homogenization_Ngrains homogenization_Ngrains
use constitutive, only: & use constitutive, only: &
constitutive_getAdiabaticThermal constitutive_getAdiabaticThermal
@ -1166,20 +1141,10 @@ real(pReal) function field_getThermal(ip,el)
ipc ipc
field_getThermal = 1.0_pReal field_getThermal = 0.0_pReal
do ipc = 1, homogenization_Ngrains(mesh_element(3,el))
select case(field_thermal_type(material_homog(ip,el))) field_getThermal = field_getThermal + constitutive_getAdiabaticThermal(ipc,ip,el) ! array/function/subroutine which is faster
enddo
case (FIELD_THERMAL_ADIABATIC_ID)
field_getThermal = 1.0_pReal
case (FIELD_THERMAL_CONDUCTION_ID)
do ipc = 1, homogenization_Ngrains(mesh_element(3,el))
field_getThermal = field_getThermal + constitutive_getAdiabaticThermal(ipc,ip,el) ! array/function/subroutine which is faster
enddo
end select
field_getThermal = field_getThermal /homogenization_Ngrains(mesh_element(3,el)) field_getThermal = field_getThermal /homogenization_Ngrains(mesh_element(3,el))
end function field_getThermal end function field_getThermal
@ -1205,12 +1170,12 @@ subroutine field_putThermal(ip,el,fieldThermalValue)
select case(field_thermal_type(material_homog(ip,el))) select case(field_thermal_type(material_homog(ip,el)))
case (FIELD_THERMAL_CONDUCTION_ID) case (FIELD_THERMAL_CONDUCTION_ID)
fieldThermal(material_homog(ip,el))% & fieldThermal(material_homog(ip,el))% &
state(1,mappingHomogenization(1,ip,el)) = fieldThermalValue field(1,mappingHomogenization(1,ip,el)) = fieldThermalValue
end select end select
end subroutine field_putThermal end subroutine field_putThermal
#endif
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return array of homogenization results for post file inclusion. call only, !> @brief return array of homogenization results for post file inclusion. call only,
!> if homogenization_sizePostResults(i,e) > 0 !! !> if homogenization_sizePostResults(i,e) > 0 !!

View File

@ -164,6 +164,7 @@ subroutine homogenization_RGC_init(fileUnit)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case ('nconstituents','ngrains','type') case ('nconstituents','ngrains','type')
case('field_damage')
case ('(output)') case ('(output)')
output = output + 1_pInt output = output + 1_pInt
homogenization_RGC_output(output,i) = IO_lc(IO_stringValue(line,positions,2_pInt)) homogenization_RGC_output(output,i) = IO_lc(IO_stringValue(line,positions,2_pInt))
@ -607,22 +608,22 @@ function homogenization_RGC_updateState(P,F,F0,avgF,dt,dPdF,ip,el)
enddo enddo
enddo enddo
homogState(mappingHomogenization(2,ip,el))% & homogState(mappingHomogenization(2,ip,el))% &
state(3*nIntFaceTot+1,mappingHomogenization(1,ip,el)) = constitutiveWork ! the bulk mechanical/constitutive work state(3*nIntFaceTot+1,mappingHomogenization(1,ip,el)) = constitutiveWork ! the bulk mechanical/constitutive work
homogState(mappingHomogenization(2,ip,el))% & homogState(mappingHomogenization(2,ip,el))% &
state(3*nIntFaceTot+2,mappingHomogenization(1,ip,el)) = sum(NN(1,:))/real(nGrain,pReal) ! the overall mismatch of all interface normal to e1-direction state(3*nIntFaceTot+2,mappingHomogenization(1,ip,el)) = sum(NN(1,:))/real(nGrain,pReal) ! the overall mismatch of all interface normal to e1-direction
homogState(mappingHomogenization(2,ip,el))% & homogState(mappingHomogenization(2,ip,el))% &
state(3*nIntFaceTot+3,mappingHomogenization(1,ip,el)) = sum(NN(2,:))/real(nGrain,pReal) ! the overall mismatch of all interface normal to e2-direction state(3*nIntFaceTot+3,mappingHomogenization(1,ip,el)) = sum(NN(2,:))/real(nGrain,pReal) ! the overall mismatch of all interface normal to e2-direction
homogState(mappingHomogenization(2,ip,el))% & homogState(mappingHomogenization(2,ip,el))% &
state(3*nIntFaceTot+4,mappingHomogenization(1,ip,el)) = sum(NN(3,:))/real(nGrain,pReal) ! the overall mismatch of all interface normal to e3-direction state(3*nIntFaceTot+4,mappingHomogenization(1,ip,el)) = sum(NN(3,:))/real(nGrain,pReal) ! the overall mismatch of all interface normal to e3-direction
homogState(mappingHomogenization(2,ip,el))% & homogState(mappingHomogenization(2,ip,el))% &
state(3*nIntFaceTot+5,mappingHomogenization(1,ip,el)) = penaltyEnergy ! the overall penalty energy state(3*nIntFaceTot+5,mappingHomogenization(1,ip,el)) = penaltyEnergy ! the overall penalty energy
homogState(mappingHomogenization(2,ip,el))% & homogState(mappingHomogenization(2,ip,el))% &
state(3*nIntFaceTot+6,mappingHomogenization(1,ip,el)) = volDiscrep ! the overall volume discrepancy state(3*nIntFaceTot+6,mappingHomogenization(1,ip,el)) = volDiscrep ! the overall volume discrepancy
homogState(mappingHomogenization(2,ip,el))% & homogState(mappingHomogenization(2,ip,el))% &
state(3*nIntFaceTot+7,mappingHomogenization(1,ip,el)) = & state(3*nIntFaceTot+7,mappingHomogenization(1,ip,el)) = &
sum(abs(drelax))/dt/real(3_pInt*nIntFaceTot,pReal) ! the average rate of relaxation vectors sum(abs(drelax))/dt/real(3_pInt*nIntFaceTot,pReal) ! the average rate of relaxation vectors
homogState(mappingHomogenization(2,ip,el))% & homogState(mappingHomogenization(2,ip,el))% &
state(3*nIntFaceTot+8,mappingHomogenization(1,ip,el)) = maxval(abs(drelax))/dt ! the maximum rate of relaxation vectors state(3*nIntFaceTot+8,mappingHomogenization(1,ip,el)) = maxval(abs(drelax))/dt ! the maximum rate of relaxation vectors
if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0_pInt & if (iand(debug_level(debug_homogenization),debug_levelExtensive) /= 0_pInt &
.and. debug_e == el .and. debug_i == ip) then .and. debug_e == el .and. debug_i == ip) then

View File

@ -123,9 +123,7 @@ subroutine homogenization_isostrain_init(fileUnit)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
select case(tag) select case(tag)
case('type') case('type')
#ifdef NEWSTATE
case('field_damage') case('field_damage')
#endif
case ('(output)') case ('(output)')
output = output + 1_pInt output = output + 1_pInt
homogenization_isostrain_output(output,i) = IO_lc(IO_stringValue(line,positions,2_pInt)) homogenization_isostrain_output(output,i) = IO_lc(IO_stringValue(line,positions,2_pInt))

View File

@ -741,16 +741,12 @@ module lattice
real(pReal), dimension(:,:,:), allocatable, public, protected :: & real(pReal), dimension(:,:,:), allocatable, public, protected :: &
lattice_thermalConductivity33, & lattice_thermalConductivity33, &
lattice_thermalExpansion33, & lattice_thermalExpansion33, &
#ifdef NEWSTATE
lattice_damageDiffusion33, & lattice_damageDiffusion33, &
#endif
lattice_surfaceEnergy33 lattice_surfaceEnergy33
real(pReal), dimension(:), allocatable, public, protected :: & real(pReal), dimension(:), allocatable, public, protected :: &
#ifdef NEWSTATE
lattice_damageMobility, & lattice_damageMobility, &
lattice_massDensity, & lattice_massDensity, &
lattice_specificHeat, & lattice_specificHeat, &
#endif
lattice_referenceTemperature lattice_referenceTemperature
enum, bind(c) enum, bind(c)
enumerator :: LATTICE_undefined_ID, & enumerator :: LATTICE_undefined_ID, &
@ -1004,12 +1000,10 @@ subroutine lattice_init
allocate(lattice_C3333(3,3,3,3,Nphases), source=0.0_pReal) allocate(lattice_C3333(3,3,3,3,Nphases), source=0.0_pReal)
allocate(lattice_thermalConductivity33(3,3,Nphases), source=0.0_pReal) allocate(lattice_thermalConductivity33(3,3,Nphases), source=0.0_pReal)
allocate(lattice_thermalExpansion33 (3,3,Nphases), source=0.0_pReal) allocate(lattice_thermalExpansion33 (3,3,Nphases), source=0.0_pReal)
#ifdef NEWSTATE
allocate(lattice_damageDiffusion33 (3,3,Nphases), source=0.0_pReal) allocate(lattice_damageDiffusion33 (3,3,Nphases), source=0.0_pReal)
allocate(lattice_damageMobility ( Nphases), source=0.0_pReal) allocate(lattice_damageMobility ( Nphases), source=0.0_pReal)
allocate(lattice_massDensity ( Nphases), source=0.0_pReal) allocate(lattice_massDensity ( Nphases), source=0.0_pReal)
allocate(lattice_specificHeat ( Nphases), source=0.0_pReal) allocate(lattice_specificHeat ( Nphases), source=0.0_pReal)
#endif
allocate(lattice_surfaceEnergy33 (3,3,Nphases), source=0.0_pReal) allocate(lattice_surfaceEnergy33 (3,3,Nphases), source=0.0_pReal)
allocate(lattice_referenceTemperature (Nphases), source=0.0_pReal) allocate(lattice_referenceTemperature (Nphases), source=0.0_pReal)
@ -1136,7 +1130,6 @@ subroutine lattice_init
lattice_surfaceEnergy33(3,3,section) = IO_floatValue(line,positions,2_pInt) lattice_surfaceEnergy33(3,3,section) = IO_floatValue(line,positions,2_pInt)
case ('reference_temperature') case ('reference_temperature')
lattice_referenceTemperature(section) = IO_floatValue(line,positions,2_pInt) lattice_referenceTemperature(section) = IO_floatValue(line,positions,2_pInt)
#ifdef NEWSTATE
case ('k_d11') case ('k_d11')
lattice_DamageDiffusion33(1,1,section) = IO_floatValue(line,positions,2_pInt) lattice_DamageDiffusion33(1,1,section) = IO_floatValue(line,positions,2_pInt)
case ('k_d12') case ('k_d12')
@ -1155,14 +1148,12 @@ subroutine lattice_init
lattice_DamageDiffusion33(3,2,section) = IO_floatValue(line,positions,2_pInt) lattice_DamageDiffusion33(3,2,section) = IO_floatValue(line,positions,2_pInt)
case ('k_d33') case ('k_d33')
lattice_DamageDiffusion33(3,3,section) = IO_floatValue(line,positions,2_pInt) lattice_DamageDiffusion33(3,3,section) = IO_floatValue(line,positions,2_pInt)
case ('mobility_d') case ('damage_mobility')
lattice_DamageMobility(section) = IO_floatValue(line,positions,2_pInt) lattice_DamageMobility(section) = IO_floatValue(line,positions,2_pInt)
case ('specific_heat') case ('specific_heat')
lattice_specificHeat(section) = IO_floatValue(line,positions,2_pInt) lattice_specificHeat(section) = IO_floatValue(line,positions,2_pInt)
case ('mass_density') case ('mass_density')
lattice_massDensity(section) = IO_floatValue(line,positions,2_pInt) lattice_massDensity(section) = IO_floatValue(line,positions,2_pInt)
#endif
end select end select
endif endif
enddo enddo

View File

@ -13,10 +13,7 @@ module material
pReal, & pReal, &
pInt, & pInt, &
tState, & tState, &
#ifdef NEWSTATE tFieldData, &
hState, &
fState, &
#endif
p_intvec p_intvec
implicit none implicit none
@ -30,7 +27,6 @@ module material
PLASTICITY_DISLOKMC_label = 'dislokmc', & PLASTICITY_DISLOKMC_label = 'dislokmc', &
PLASTICITY_TITANMOD_label = 'titanmod', & PLASTICITY_TITANMOD_label = 'titanmod', &
PLASTICITY_NONLOCAL_label = 'nonlocal', & PLASTICITY_NONLOCAL_label = 'nonlocal', &
#ifdef NEWSTATE
LOCAL_DAMAGE_NONE_label = 'none', & LOCAL_DAMAGE_NONE_label = 'none', &
LOCAL_DAMAGE_BRITTLE_label = 'brittle', & LOCAL_DAMAGE_BRITTLE_label = 'brittle', &
LOCAL_THERMAL_NONE_label = 'none', & LOCAL_THERMAL_NONE_label = 'none', &
@ -39,16 +35,6 @@ module material
FIELD_DAMAGE_NONLOCAL_label = 'nonlocal', & FIELD_DAMAGE_NONLOCAL_label = 'nonlocal', &
FIELD_THERMAL_ADIABATIC_label = 'adiabatic', & FIELD_THERMAL_ADIABATIC_label = 'adiabatic', &
FIELD_THERMAL_CONDUCTION_label = 'conduction', & FIELD_THERMAL_CONDUCTION_label = 'conduction', &
#else
DAMAGE_NONE_label = 'none', &
DAMAGE_LOCAL_label = 'local', &
DAMAGE_GRADIENT_label = 'gradient', &
THERMAL_NONE_label = 'none', &
THERMAL_ISO_label = 'isothermal', &
THERMAL_CONDUCTION_label = 'conduction', &
THERMAL_ADIABATIC_label = 'adiabatic', &
#endif
HOMOGENIZATION_NONE_label = 'none', & HOMOGENIZATION_NONE_label = 'none', &
HOMOGENIZATION_ISOSTRAIN_label = 'isostrain', & HOMOGENIZATION_ISOSTRAIN_label = 'isostrain', &
HOMOGENIZATION_RGC_label = 'rgc' HOMOGENIZATION_RGC_label = 'rgc'
@ -69,7 +55,6 @@ module material
PLASTICITY_titanmod_ID, & PLASTICITY_titanmod_ID, &
PLASTICITY_nonlocal_ID PLASTICITY_nonlocal_ID
end enum end enum
#ifdef NEWSTATE
enum, bind(c) enum, bind(c)
enumerator :: LOCAL_DAMAGE_NONE_ID, & enumerator :: LOCAL_DAMAGE_NONE_ID, &
LOCAL_DAMAGE_BRITTLE_ID LOCAL_DAMAGE_BRITTLE_ID
@ -87,19 +72,6 @@ module material
enumerator :: FIELD_THERMAL_ADIABATIC_ID, & enumerator :: FIELD_THERMAL_ADIABATIC_ID, &
FIELD_THERMAL_CONDUCTION_ID FIELD_THERMAL_CONDUCTION_ID
end enum end enum
#else
enum, bind(c)
enumerator :: DAMAGE_none_ID, &
DAMAGE_local_ID, &
DAMAGE_gradient_ID
end enum
enum, bind(c)
enumerator :: THERMAL_none_ID, &
THERMAL_iso_ID, &
THERMAL_conduction_ID, &
THERMAL_adiabatic_ID
end enum
#endif
enum, bind(c) enum, bind(c)
enumerator :: HOMOGENIZATION_undefined_ID, & enumerator :: HOMOGENIZATION_undefined_ID, &
HOMOGENIZATION_none_ID, & HOMOGENIZATION_none_ID, &
@ -120,7 +92,6 @@ module material
phase_elasticity !< elasticity of each phase phase_elasticity !< elasticity of each phase
integer(kind(PLASTICITY_undefined_ID)), dimension(:), allocatable, public, protected :: & integer(kind(PLASTICITY_undefined_ID)), dimension(:), allocatable, public, protected :: &
phase_plasticity !< plasticity of each phase phase_plasticity !< plasticity of each phase
#ifdef NEWSTATE
integer(kind(LOCAL_DAMAGE_none_ID)), dimension(:), allocatable, public, protected :: & integer(kind(LOCAL_DAMAGE_none_ID)), dimension(:), allocatable, public, protected :: &
phase_damage !< local damage of each phase phase_damage !< local damage of each phase
integer(kind(LOCAL_THERMAL_none_ID)), dimension(:), allocatable, public, protected :: & integer(kind(LOCAL_THERMAL_none_ID)), dimension(:), allocatable, public, protected :: &
@ -129,12 +100,6 @@ module material
field_damage_type !< field damage of each phase field_damage_type !< field damage of each phase
integer(kind(FIELD_THERMAL_ADIABATIC_ID)), dimension(:), allocatable, public, protected :: & integer(kind(FIELD_THERMAL_ADIABATIC_ID)), dimension(:), allocatable, public, protected :: &
field_thermal_type !< field thermal of each phase field_thermal_type !< field thermal of each phase
#else
integer(kind(DAMAGE_none_ID)), dimension(:), allocatable, public, protected :: &
phase_damage !< damage of each phase
integer(kind(THERMAL_none_ID)), dimension(:), allocatable, public, protected :: &
phase_thermal !< thermal of each phase
#endif
integer(kind(HOMOGENIZATION_undefined_ID)), dimension(:), allocatable, public, protected :: & integer(kind(HOMOGENIZATION_undefined_ID)), dimension(:), allocatable, public, protected :: &
homogenization_type !< type of each homogenization homogenization_type !< type of each homogenization
@ -173,12 +138,10 @@ module material
thermalState,& thermalState,&
homogState homogState
#ifdef NEWSTATE type(tFieldData), allocatable, dimension(:), public :: &
type(fState), allocatable, dimension(:), public :: &
fieldDamage fieldDamage
type(fState), allocatable, dimension(:), public :: & type(tFieldData), allocatable, dimension(:), public :: &
fieldThermal fieldThermal
#endif
integer(pInt), dimension(:,:,:), allocatable, public, protected :: & integer(pInt), dimension(:,:,:), allocatable, public, protected :: &
@ -251,7 +214,6 @@ module material
PLASTICITY_dislokmc_ID, & PLASTICITY_dislokmc_ID, &
PLASTICITY_titanmod_ID, & PLASTICITY_titanmod_ID, &
PLASTICITY_nonlocal_ID, & PLASTICITY_nonlocal_ID, &
#ifdef NEWSTATE
LOCAL_DAMAGE_none_ID, & LOCAL_DAMAGE_none_ID, &
LOCAL_DAMAGE_brittle_ID, & LOCAL_DAMAGE_brittle_ID, &
LOCAL_THERMAL_none_ID, & LOCAL_THERMAL_none_ID, &
@ -260,15 +222,6 @@ module material
FIELD_DAMAGE_NONLOCAL_ID, & FIELD_DAMAGE_NONLOCAL_ID, &
FIELD_THERMAL_ADIABATIC_ID, & FIELD_THERMAL_ADIABATIC_ID, &
FIELD_THERMAL_CONDUCTION_ID, & FIELD_THERMAL_CONDUCTION_ID, &
#else
DAMAGE_none_ID, &
DAMAGE_local_ID, &
DAMAGE_gradient_ID, &
THERMAL_none_ID, &
THERMAL_iso_ID, &
THERMAL_conduction_ID, &
THERMAL_adiabatic_ID, &
#endif
HOMOGENIZATION_none_ID, & HOMOGENIZATION_none_ID, &
HOMOGENIZATION_isostrain_ID, & HOMOGENIZATION_isostrain_ID, &
#ifdef HDF #ifdef HDF
@ -344,10 +297,8 @@ subroutine material_init
allocate(damageState (material_Nphase)) allocate(damageState (material_Nphase))
allocate(thermalState(material_Nphase)) allocate(thermalState(material_Nphase))
allocate(homogState (material_Nhomogenization)) allocate(homogState (material_Nhomogenization))
#ifdef NEWSTATE
allocate(fieldDamage (material_Nhomogenization)) allocate(fieldDamage (material_Nhomogenization))
allocate(fieldThermal(material_Nhomogenization)) allocate(fieldThermal(material_Nhomogenization))
#endif
do m = 1_pInt,material_Nmicrostructure do m = 1_pInt,material_Nmicrostructure
if(microstructure_crystallite(m) < 1_pInt .or. & if(microstructure_crystallite(m) < 1_pInt .or. &
microstructure_crystallite(m) > material_Ncrystallite) & microstructure_crystallite(m) > material_Ncrystallite) &
@ -450,10 +401,8 @@ subroutine material_parseHomogenization(fileUnit,myPart)
allocate(homogenization_name(Nsections)); homogenization_name = '' allocate(homogenization_name(Nsections)); homogenization_name = ''
allocate(homogenization_type(Nsections), source=HOMOGENIZATION_undefined_ID) allocate(homogenization_type(Nsections), source=HOMOGENIZATION_undefined_ID)
#ifdef NEWSTATE
allocate(FIELD_DAMAGE_type(Nsections), source=FIELD_DAMAGE_LOCAL_ID) allocate(FIELD_DAMAGE_type(Nsections), source=FIELD_DAMAGE_LOCAL_ID)
allocate(FIELD_THERMAL_type(Nsections), source=FIELD_THERMAL_ADIABATIC_ID) allocate(FIELD_THERMAL_type(Nsections), source=FIELD_THERMAL_ADIABATIC_ID)
#endif
allocate(homogenization_typeInstance(Nsections), source=0_pInt) allocate(homogenization_typeInstance(Nsections), source=0_pInt)
allocate(homogenization_Ngrains(Nsections), source=0_pInt) allocate(homogenization_Ngrains(Nsections), source=0_pInt)
allocate(homogenization_Noutput(Nsections), source=0_pInt) allocate(homogenization_Noutput(Nsections), source=0_pInt)
@ -500,7 +449,6 @@ subroutine material_parseHomogenization(fileUnit,myPart)
end select end select
homogenization_typeInstance(section) = & homogenization_typeInstance(section) = &
count(homogenization_type==homogenization_type(section)) ! count instances count(homogenization_type==homogenization_type(section)) ! count instances
#ifdef NEWSTATE
case ('field_damage') case ('field_damage')
select case (IO_lc(IO_stringValue(line,positions,2_pInt))) select case (IO_lc(IO_stringValue(line,positions,2_pInt)))
case(FIELD_DAMAGE_LOCAL_label) case(FIELD_DAMAGE_LOCAL_label)
@ -520,8 +468,6 @@ subroutine material_parseHomogenization(fileUnit,myPart)
case default case default
call IO_error(500_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt))) call IO_error(500_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt)))
end select end select
#endif
case ('nconstituents','ngrains') case ('nconstituents','ngrains')
homogenization_Ngrains(section) = IO_intValue(line,positions,2_pInt) homogenization_Ngrains(section) = IO_intValue(line,positions,2_pInt)
end select end select
@ -729,17 +675,9 @@ subroutine material_parsePhase(fileUnit,myPart)
allocate(phase_elasticityInstance(Nsections), source=0_pInt) allocate(phase_elasticityInstance(Nsections), source=0_pInt)
allocate(phase_plasticity(Nsections) , source=PLASTICITY_undefined_ID) allocate(phase_plasticity(Nsections) , source=PLASTICITY_undefined_ID)
allocate(phase_plasticityInstance(Nsections), source=0_pInt) allocate(phase_plasticityInstance(Nsections), source=0_pInt)
#ifdef NEWSTATE
allocate(phase_damage(Nsections) , source=LOCAL_DAMAGE_none_ID) allocate(phase_damage(Nsections) , source=LOCAL_DAMAGE_none_ID)
#else
allocate(phase_damage(Nsections) , source=DAMAGE_none_ID)
#endif
allocate(phase_damageInstance(Nsections), source=0_pInt) allocate(phase_damageInstance(Nsections), source=0_pInt)
#ifdef NEWSTATE
allocate(phase_thermal(Nsections) , source=LOCAL_THERMAL_none_ID) allocate(phase_thermal(Nsections) , source=LOCAL_THERMAL_none_ID)
#else
allocate(phase_thermal(Nsections) , source=THERMAL_none_ID)
#endif
allocate(phase_thermalInstance(Nsections), source=0_pInt) allocate(phase_thermalInstance(Nsections), source=0_pInt)
allocate(phase_Noutput(Nsections), source=0_pInt) allocate(phase_Noutput(Nsections), source=0_pInt)
allocate(phase_localPlasticity(Nsections), source=.false.) allocate(phase_localPlasticity(Nsections), source=.false.)
@ -801,40 +739,20 @@ subroutine material_parsePhase(fileUnit,myPart)
phase_plasticityInstance(section) = count(phase_plasticity(1:section) == phase_plasticity(section)) ! count instances phase_plasticityInstance(section) = count(phase_plasticity(1:section) == phase_plasticity(section)) ! count instances
case ('damage') case ('damage')
select case (IO_lc(IO_stringValue(line,positions,2_pInt))) select case (IO_lc(IO_stringValue(line,positions,2_pInt)))
#ifdef NEWSTATE
case (LOCAL_DAMAGE_NONE_label) case (LOCAL_DAMAGE_NONE_label)
phase_damage(section) = LOCAL_DAMAGE_none_ID phase_damage(section) = LOCAL_DAMAGE_none_ID
case (LOCAL_DAMAGE_BRITTLE_label) case (LOCAL_DAMAGE_BRITTLE_label)
phase_damage(section) = LOCAL_DAMAGE_BRITTLE_ID phase_damage(section) = LOCAL_DAMAGE_BRITTLE_ID
#else
case (DAMAGE_NONE_label)
phase_damage(section) = DAMAGE_none_ID
case (DAMAGE_LOCAL_label)
phase_damage(section) = DAMAGE_local_ID
case (DAMAGE_GRADIENT_label)
phase_damage(section) = DAMAGE_gradient_ID
#endif
case default case default
call IO_error(200_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt))) call IO_error(200_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt)))
end select end select
phase_damageInstance(section) = count(phase_damage(1:section) == phase_damage(section)) ! count instances phase_damageInstance(section) = count(phase_damage(1:section) == phase_damage(section)) ! count instances
case ('thermal') case ('thermal')
select case (IO_lc(IO_stringValue(line,positions,2_pInt))) select case (IO_lc(IO_stringValue(line,positions,2_pInt)))
#ifdef NEWSTATE
case (LOCAL_THERMAL_NONE_label) case (LOCAL_THERMAL_NONE_label)
phase_thermal(section) = LOCAL_THERMAL_none_ID phase_thermal(section) = LOCAL_THERMAL_none_ID
case (LOCAL_THERMAL_HEATGEN_label) case (LOCAL_THERMAL_HEATGEN_label)
phase_thermal(section) = LOCAL_THERMAL_HEATGEN_ID phase_thermal(section) = LOCAL_THERMAL_HEATGEN_ID
#else
case (THERMAL_NONE_label)
phase_thermal(section) = THERMAL_none_ID
case (THERMAL_ISO_label)
phase_thermal(section) = THERMAL_iso_ID
case (THERMAL_CONDUCTION_label)
phase_thermal(section) = THERMAL_conduction_ID
case (THERMAL_ADIABATIC_label)
phase_thermal(section) = THERMAL_adiabatic_ID
#endif
case default case default
call IO_error(200_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt))) call IO_error(200_pInt,ext_msg=trim(IO_stringValue(line,positions,2_pInt)))
end select end select

View File

@ -78,13 +78,11 @@ module prec
real(pReal), allocatable, dimension(:,:,:) :: RKCK45dotState real(pReal), allocatable, dimension(:,:,:) :: RKCK45dotState
end type end type
#ifdef NEWSTATE
type, public :: tFieldData type, public :: tFieldData
integer(pInt) :: sizeField = 0_pInt , & integer(pInt) :: sizeField = 0_pInt , &
sizePostResults = 0_pInt sizePostResults = 0_pInt
real(pReal), allocatable, dimension(:,:) :: field ! material points, state size real(pReal), allocatable, dimension(:,:) :: field ! material points, state size
end type end type
#endif
public :: & public :: &
prec_init prec_init

View File

@ -42,9 +42,8 @@ module thermal_adiabatic
thermal_adiabatic_stateInit, & thermal_adiabatic_stateInit, &
thermal_adiabatic_aTolState, & thermal_adiabatic_aTolState, &
thermal_adiabatic_dotState, & thermal_adiabatic_dotState, &
#ifdef NEWSTATE
constitutive_heatgen_getThermal, & constitutive_heatgen_getThermal, &
#endif constitutive_heatgen_putThermal, &
thermal_adiabatic_temperature, & thermal_adiabatic_temperature, &
thermal_adiabatic_postResults thermal_adiabatic_postResults
@ -82,13 +81,8 @@ subroutine thermal_adiabatic_init(fileUnit)
phase_thermal, & phase_thermal, &
phase_thermalInstance, & phase_thermalInstance, &
phase_Noutput, & phase_Noutput, &
#ifdef NEWSTATE
LOCAL_THERMAL_HEATGEN_label, & LOCAL_THERMAL_HEATGEN_label, &
LOCAL_THERMAL_HEATGEN_ID, & LOCAL_THERMAL_HEATGEN_ID, &
#else
THERMAL_ADIABATIC_label, &
THERMAL_adiabatic_ID, &
#endif
material_phase, & material_phase, &
thermalState, & thermalState, &
MATERIAL_partPhase MATERIAL_partPhase
@ -106,23 +100,14 @@ subroutine thermal_adiabatic_init(fileUnit)
character(len=65536) :: & character(len=65536) :: &
tag = '', & tag = '', &
line = '' line = ''
#ifdef NEWSTATE
write(6,'(/,a)') ' <<<+- thermal_'//LOCAL_THERMAL_HEATGEN_label//' init -+>>>'
#else
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_ADIABATIC_label//' init -+>>>'
#endif
write(6,'(/,a)') ' <<<+- thermal_'//LOCAL_THERMAL_HEATGEN_label//' init -+>>>'
write(6,'(a)') ' $Id: thermal_adiabatic.f90 3210 2014-06-17 15:24:44Z MPIE\m.diehl $' write(6,'(a)') ' $Id: thermal_adiabatic.f90 3210 2014-06-17 15:24:44Z MPIE\m.diehl $'
write(6,'(a15,a)') ' Current time: ',IO_timeStamp() write(6,'(a15,a)') ' Current time: ',IO_timeStamp()
#include "compilation_info.f90" #include "compilation_info.f90"
#ifdef NEWSTATE
maxNinstance = int(count(phase_thermal == LOCAL_THERMAL_HEATGEN_ID),pInt) maxNinstance = int(count(phase_thermal == LOCAL_THERMAL_HEATGEN_ID),pInt)
#else
maxNinstance = int(count(phase_thermal == THERMAL_adiabatic_ID),pInt)
#endif
if (maxNinstance == 0_pInt) return if (maxNinstance == 0_pInt) return
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) &
write(6,'(a16,1x,i5,/)') '# instances:',maxNinstance write(6,'(a16,1x,i5,/)') '# instances:',maxNinstance
@ -152,11 +137,9 @@ subroutine thermal_adiabatic_init(fileUnit)
phase = phase + 1_pInt ! advance phase section counter phase = phase + 1_pInt ! advance phase section counter
cycle ! skip to next line cycle ! skip to next line
endif endif
#ifdef NEWSTATE
if (phase > 0_pInt ) then; if (phase_thermal(phase) == LOCAL_THERMAL_HEATGEN_ID) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran if (phase > 0_pInt ) then; if (phase_thermal(phase) == LOCAL_THERMAL_HEATGEN_ID) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran
#else
if (phase > 0_pInt ) then; if (phase_thermal(phase) == THERMAL_adiabatic_ID) then ! do not short-circuit here (.and. with next if statemen). It's not safe in Fortran
#endif
instance = phase_thermalInstance(phase) ! which instance of my thermal is present phase instance = phase_thermalInstance(phase) ! which instance of my thermal is present phase
positions = IO_stringPos(line,MAXNCHUNKS) positions = IO_stringPos(line,MAXNCHUNKS)
tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key tag = IO_lc(IO_stringValue(line,positions,1_pInt)) ! extract key
@ -179,11 +162,7 @@ subroutine thermal_adiabatic_init(fileUnit)
enddo parsingFile enddo parsingFile
initializeInstances: do phase = 1_pInt, size(phase_thermal) initializeInstances: do phase = 1_pInt, size(phase_thermal)
#ifdef NEWSTATE
if (phase_thermal(phase) == LOCAL_THERMAL_HEATGEN_ID) then if (phase_thermal(phase) == LOCAL_THERMAL_HEATGEN_ID) then
#else
if (phase_thermal(phase) == THERMAL_adiabatic_ID) then
#endif
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phase==phase)
instance = phase_thermalInstance(phase) instance = phase_thermalInstance(phase)
@ -324,7 +303,6 @@ function thermal_adiabatic_temperature(ipc, ip, el)
end function thermal_adiabatic_temperature end function thermal_adiabatic_temperature
#ifdef NEWSTATE
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on local damage model state layout !> @brief returns temperature based on local damage model state layout
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
@ -345,7 +323,27 @@ function constitutive_heatgen_getThermal(ipc, ip, el)
thermalState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el)) thermalState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el))
end function constitutive_heatgen_getThermal end function constitutive_heatgen_getThermal
#endif
!--------------------------------------------------------------------------------------------------
!> @brief returns temperature based on local damage model state layout
!--------------------------------------------------------------------------------------------------
subroutine constitutive_heatgen_putThermal(ipc, ip, el, localTemperature)
use material, only: &
mappingConstitutive, &
ThermalState
implicit none
integer(pInt), intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
localTemperature
thermalState(mappingConstitutive(2,ipc,ip,el))%state(1,mappingConstitutive(1,ipc,ip,el))= &
localTemperature
end subroutine constitutive_heatgen_putThermal
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
!> @brief return array of constitutive results !> @brief return array of constitutive results

View File

@ -40,13 +40,8 @@ subroutine thermal_none_init(fileUnit)
use material, only: & use material, only: &
phase_thermal, & phase_thermal, &
phase_Noutput, & phase_Noutput, &
#ifdef NEWSTATE
LOCAL_THERMAL_NONE_label, & LOCAL_THERMAL_NONE_label, &
LOCAL_THERMAL_NONE_ID, & LOCAL_THERMAL_NONE_ID, &
#else
THERMAL_NONE_label, &
THERMAL_NONE_ID, &
#endif
material_phase, & material_phase, &
thermalState, & thermalState, &
MATERIAL_partPhase MATERIAL_partPhase
@ -60,20 +55,13 @@ subroutine thermal_none_init(fileUnit)
NofMyPhase, & NofMyPhase, &
sizeState, & sizeState, &
sizeDotState sizeDotState
#ifdef NEWSTATE
write(6,'(/,a)') ' <<<+- thermal_'//LOCAL_THERMAL_NONE_label//' init -+>>>' write(6,'(/,a)') ' <<<+- thermal_'//LOCAL_THERMAL_NONE_label//' init -+>>>'
#else
write(6,'(/,a)') ' <<<+- thermal_'//THERMAL_NONE_label//' init -+>>>'
#endif
write(6,'(a)') ' $Id: thermal_none.f90 3148 2014-05-27 14:46:03Z MPIE\m.diehl $' write(6,'(a)') ' $Id: thermal_none.f90 3148 2014-05-27 14:46:03Z MPIE\m.diehl $'
write(6,'(a15,a)') ' Current time: ',IO_timeStamp() write(6,'(a15,a)') ' Current time: ',IO_timeStamp()
#include "compilation_info.f90" #include "compilation_info.f90"
#ifdef NEWSTATE
maxNinstance = int(count(phase_thermal == LOCAL_THERMAL_NONE_ID),pInt) maxNinstance = int(count(phase_thermal == LOCAL_THERMAL_NONE_ID),pInt)
#else
maxNinstance = int(count(phase_thermal == THERMAL_NONE_ID),pInt)
#endif
if (maxNinstance == 0_pInt) return if (maxNinstance == 0_pInt) return
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) & if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0_pInt) &
@ -82,11 +70,7 @@ subroutine thermal_none_init(fileUnit)
initializeInstances: do phase = 1_pInt, size(phase_thermal) initializeInstances: do phase = 1_pInt, size(phase_thermal)
NofMyPhase=count(material_phase==phase) NofMyPhase=count(material_phase==phase)
#ifdef NEWSTATE
if (phase_thermal(phase) == LOCAL_THERMAL_none_ID) then if (phase_thermal(phase) == LOCAL_THERMAL_none_ID) then
#else
if (phase_thermal(phase) == THERMAL_none_ID) then
#endif
sizeState = 0_pInt sizeState = 0_pInt
thermalState(phase)%sizeState = sizeState thermalState(phase)%sizeState = sizeState
sizeDotState = sizeState sizeDotState = sizeState