more efficient rate calculation in updateState when subdt is zero

This commit is contained in:
Tias Maiti 2015-08-05 11:09:38 +00:00
parent 7928ce3ac3
commit 09c7affbbc
2 changed files with 5 additions and 14 deletions

View File

@ -226,13 +226,9 @@ function thermal_adiabatic_updateState(subdt, ip, el)
.true.]
temperature (homog)%p(thermalMapping(homog)%p(ip,el)) = T
if (subdt > tiny(0.0_pReal)) then
temperatureRate(homog)%p(thermalMapping(homog)%p(ip,el)) = &
(thermalState(homog)%state(1,offset) - thermalState(homog)%subState0(1,offset))/subdt
else
temperatureRate(homog)%p(thermalMapping(homog)%p(ip,el)) = 0.0_pReal
endif
temperatureRate(homog)%p(thermalMapping(homog)%p(ip,el)) = &
(thermalState(homog)%state(1,offset) - thermalState(homog)%subState0(1,offset))/(subdt+tiny(0.0_pReal))
end function thermal_adiabatic_updateState
!--------------------------------------------------------------------------------------------------

View File

@ -227,13 +227,8 @@ function vacancyflux_isochempot_updateState(subdt, ip, el)
.true.]
vacancyConc (homog)%p(vacancyfluxMapping(homog)%p(ip,el)) = Cv
if (subdt > tiny(0.0_pReal)) then
vacancyConcRate(homog)%p(vacancyfluxMapping(homog)%p(ip,el)) = &
(vacancyfluxState(homog)%state(1,offset) - vacancyfluxState(homog)%subState0(1,offset))/subdt
else
vacancyConcRate(homog)%p(vacancyfluxMapping(homog)%p(ip,el)) = 0.0_pReal
endif
vacancyConcRate(homog)%p(vacancyfluxMapping(homog)%p(ip,el)) = &
(vacancyfluxState(homog)%state(1,offset) - vacancyfluxState(homog)%subState0(1,offset))/(subdt+tiny(0.0_pReal))
end function vacancyflux_isochempot_updateState