separte functionality

This commit is contained in:
Martin Diehl 2021-01-08 07:37:51 +01:00
parent 65bd880fdf
commit 6c62e186de
4 changed files with 44 additions and 41 deletions

View File

@ -390,7 +390,6 @@ module constitutive
constitutive_forward, & constitutive_forward, &
constitutive_restore, & constitutive_restore, &
plastic_nonlocal_updateCompatibility, & plastic_nonlocal_updateCompatibility, &
source_active, &
kinematics_active, & kinematics_active, &
converged, & converged, &
crystallite_init, & crystallite_init, &
@ -466,35 +465,7 @@ subroutine constitutive_init
end subroutine constitutive_init end subroutine constitutive_init
!--------------------------------------------------------------------------------------------------
!> @brief checks if a source mechanism is active or not
!--------------------------------------------------------------------------------------------------
function source_active(source_label,src_length) result(active_source)
character(len=*), intent(in) :: source_label !< name of source mechanism
integer, intent(in) :: src_length !< max. number of sources in system
logical, dimension(:,:), allocatable :: active_source
class(tNode), pointer :: &
phases, &
phase, &
sources, &
src
integer :: p,s
phases => config_material%get('phase')
allocate(active_source(src_length,phases%length), source = .false. )
do p = 1, phases%length
phase => phases%get(p)
sources => phase%get('source',defaultVal=emptyList)
do s = 1, sources%length
src => sources%get(s)
if(src%get_asString('type') == source_label) active_source(s,p) = .true.
enddo
enddo
end function source_active
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------

View File

@ -453,4 +453,35 @@ function constitutive_damage_deltaState(Fe, co, ip, el, ph, of) result(broken)
end function constitutive_damage_deltaState end function constitutive_damage_deltaState
!--------------------------------------------------------------------------------------------------
!> @brief checks if a source mechanism is active or not
!--------------------------------------------------------------------------------------------------
function source_active(source_label,src_length) result(active_source)
character(len=*), intent(in) :: source_label !< name of source mechanism
integer, intent(in) :: src_length !< max. number of sources in system
logical, dimension(:,:), allocatable :: active_source
class(tNode), pointer :: &
phases, &
phase, &
sources, &
src
integer :: p,s
phases => config_material%get('phase')
allocate(active_source(src_length,phases%length), source = .false. )
do p = 1, phases%length
phase => phases%get(p)
sources => phase%get('source',defaultVal=emptyList)
do s = 1, sources%length
src => sources%get(s)
if(src%get_asString('type') == source_label) active_source(s,p) = .true.
enddo
enddo
end function source_active
end submodule constitutive_damage end submodule constitutive_damage

View File

@ -33,13 +33,14 @@ module function source_thermal_dissipation_init(source_length) result(mySources)
class(tNode), pointer :: & class(tNode), pointer :: &
phases, & phases, &
phase, & phase, &
sources, & sources, thermal, &
src src
integer :: Ninstances,sourceOffset,Nconstituents,p integer :: Ninstances,sourceOffset,Nconstituents,p
print'(/,a)', ' <<<+- source_thermal_dissipation init -+>>>' print'(/,a)', ' <<<+- thermal_externalheat init -+>>>'
mySources = thermal_active('dissipation',source_length)
mySources = source_active('thermal_dissipation',source_length)
Ninstances = count(mySources) Ninstances = count(mySources)
print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT) print'(a,i2)', ' # instances: ',Ninstances; flush(IO_STDOUT)
if(Ninstances == 0) return if(Ninstances == 0) return
@ -51,15 +52,16 @@ module function source_thermal_dissipation_init(source_length) result(mySources)
do p = 1, phases%length do p = 1, phases%length
phase => phases%get(p) phase => phases%get(p)
if(count(mySources(:,p)) == 0) cycle
if(any(mySources(:,p))) source_thermal_dissipation_instance(p) = count(mySources(:,1:p)) if(any(mySources(:,p))) source_thermal_dissipation_instance(p) = count(mySources(:,1:p))
sources => phase%get('source') if(count(mySources(:,p)) == 0) cycle
thermal => phase%get('thermal')
sources => thermal%get('source')
do sourceOffset = 1, sources%length do sourceOffset = 1, sources%length
if(mySources(sourceOffset,p)) then if(mySources(sourceOffset,p)) then
source_thermal_dissipation_offset(p) = sourceOffset source_thermal_dissipation_offset(p) = sourceOffset
associate(prm => param(source_thermal_dissipation_instance(p))) associate(prm => param(source_thermal_dissipation_instance(p)))
src => sources%get(sourceOffset) src => sources%get(sourceOffset)
prm%kappa = src%get_asFloat('kappa') prm%kappa = src%get_asFloat('kappa')
Nconstituents = count(material_phaseAt==p) * discretization_nIPs Nconstituents = count(material_phaseAt==p) * discretization_nIPs
call constitutive_allocateState(thermalState(p)%p(sourceOffset),Nconstituents,0,0,0) call constitutive_allocateState(thermalState(p)%p(sourceOffset),Nconstituents,0,0,0)

View File

@ -41,7 +41,7 @@ module function source_thermal_externalheat_init(source_length) result(mySources
src src
integer :: Ninstances,sourceOffset,Nconstituents,p integer :: Ninstances,sourceOffset,Nconstituents,p
print'(/,a)', ' <<<+- source_thermal_externalHeat init -+>>>' print'(/,a)', ' <<<+- thermal_externalheat init -+>>>'
mySources = thermal_active('externalheat',source_length) mySources = thermal_active('externalheat',source_length)
@ -74,7 +74,6 @@ module function source_thermal_externalheat_init(source_length) result(mySources
Nconstituents = count(material_phaseAt==p) * discretization_nIPs Nconstituents = count(material_phaseAt==p) * discretization_nIPs
call constitutive_allocateState(thermalState(p)%p(sourceOffset),Nconstituents,1,1,0) call constitutive_allocateState(thermalState(p)%p(sourceOffset),Nconstituents,1,1,0)
end associate end associate
endif endif
enddo enddo
enddo enddo