last remaining outputID enums removed

This commit is contained in:
Martin Diehl 2020-02-28 11:06:21 +01:00
parent 11d456bcd7
commit 15712d7ebb
2 changed files with 66 additions and 98 deletions

View File

@ -16,15 +16,9 @@ module damage_local
implicit none implicit none
private private
enum, bind(c)
enumerator :: &
undefined_ID, &
damage_ID
end enum
type :: tParameters type :: tParameters
integer(kind(undefined_ID)), dimension(:), allocatable :: & character(len=pStringLen), allocatable, dimension(:) :: &
outputID output
end type tParameters end type tParameters
type(tparameters), dimension(:), allocatable :: & type(tparameters), dimension(:), allocatable :: &
@ -33,7 +27,7 @@ module damage_local
public :: & public :: &
damage_local_init, & damage_local_init, &
damage_local_updateState, & damage_local_updateState, &
damage_local_Results damage_local_results
contains contains
@ -43,8 +37,7 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine damage_local_init subroutine damage_local_init
integer :: maxNinstance,o,NofMyHomog,h integer :: maxNinstance,NofMyHomog,h
character(len=pStringLen), dimension(:), allocatable :: outputs
write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_local_label//' init -+>>>'; flush(6) write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_local_label//' init -+>>>'; flush(6)
@ -57,15 +50,7 @@ subroutine damage_local_init
if (damage_type(h) /= DAMAGE_LOCAL_ID) cycle if (damage_type(h) /= DAMAGE_LOCAL_ID) cycle
associate(prm => param(damage_typeInstance(h)),config => config_homogenization(h)) associate(prm => param(damage_typeInstance(h)),config => config_homogenization(h))
outputs = config%getStrings('(output)',defaultVal=emptyStringArray) prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
allocate(prm%outputID(0))
do o=1, size(outputs)
select case(outputs(o))
case ('damage')
prm%outputID = [prm%outputID , damage_ID]
end select
enddo
NofMyHomog = count(material_homogenizationAt == h) NofMyHomog = count(material_homogenizationAt == h)
damageState(h)%sizeState = 1 damageState(h)%sizeState = 1
@ -179,14 +164,13 @@ subroutine damage_local_results(homog,group)
integer, intent(in) :: homog integer, intent(in) :: homog
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
integer :: o integer :: o
associate(prm => param(damage_typeInstance(homog))) associate(prm => param(damage_typeInstance(homog)))
outputsLoop: do o = 1,size(prm%output)
outputsLoop: do o = 1,size(prm%outputID) select case(prm%output(o))
select case(prm%outputID(o)) case ('damage')
case (damage_ID)
call results_writeDataset(group,damage(homog)%p,'phi',& call results_writeDataset(group,damage(homog)%p,'phi',&
'damage indicator','-') 'damage indicator','-')
end select end select

View File

@ -18,15 +18,9 @@ module damage_nonlocal
implicit none implicit none
private private
enum, bind(c)
enumerator :: &
undefined_ID, &
damage_ID
end enum
type :: tParameters type :: tParameters
integer(kind(undefined_ID)), dimension(:), allocatable :: & character(len=pStringLen), allocatable, dimension(:) :: &
outputID output
end type tParameters end type tParameters
type(tparameters), dimension(:), allocatable :: & type(tparameters), dimension(:), allocatable :: &
@ -38,7 +32,7 @@ module damage_nonlocal
damage_nonlocal_getDiffusion33, & damage_nonlocal_getDiffusion33, &
damage_nonlocal_getMobility, & damage_nonlocal_getMobility, &
damage_nonlocal_putNonLocalDamage, & damage_nonlocal_putNonLocalDamage, &
damage_nonlocal_Results damage_nonlocal_results
contains contains
@ -48,8 +42,7 @@ contains
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine damage_nonlocal_init subroutine damage_nonlocal_init
integer :: maxNinstance,o,NofMyHomog,h integer :: maxNinstance,NofMyHomog,h
character(len=pStringLen), dimension(:), allocatable :: outputs
write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_nonlocal_label//' init -+>>>'; flush(6) write(6,'(/,a)') ' <<<+- damage_'//DAMAGE_nonlocal_label//' init -+>>>'; flush(6)
@ -62,15 +55,7 @@ subroutine damage_nonlocal_init
if (damage_type(h) /= DAMAGE_NONLOCAL_ID) cycle if (damage_type(h) /= DAMAGE_NONLOCAL_ID) cycle
associate(prm => param(damage_typeInstance(h)),config => config_homogenization(h)) associate(prm => param(damage_typeInstance(h)),config => config_homogenization(h))
outputs = config%getStrings('(output)',defaultVal=emptyStringArray) prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
allocate(prm%outputID(0))
do o=1, size(outputs)
select case(outputs(o))
case ('damage')
prm%outputID = [prm%outputID, damage_ID]
end select
enddo
NofMyHomog = count(material_homogenizationAt == h) NofMyHomog = count(material_homogenizationAt == h)
damageState(h)%sizeState = 1 damageState(h)%sizeState = 1
@ -220,14 +205,13 @@ subroutine damage_nonlocal_results(homog,group)
integer, intent(in) :: homog integer, intent(in) :: homog
character(len=*), intent(in) :: group character(len=*), intent(in) :: group
integer :: o integer :: o
associate(prm => param(damage_typeInstance(homog))) associate(prm => param(damage_typeInstance(homog)))
outputsLoop: do o = 1,size(prm%output)
outputsLoop: do o = 1,size(prm%outputID) select case(prm%output(o))
select case(prm%outputID(o)) case ('damage')
case (damage_ID)
call results_writeDataset(group,damage(homog)%p,'phi',& call results_writeDataset(group,damage(homog)%p,'phi',&
'damage indicator','-') 'damage indicator','-')
end select end select