@@ -72,8 +72,10 @@ module subroutine damage_init()
72
72
type (tDict), pointer :: &
73
73
phases, &
74
74
phase, &
75
- source
76
- character (len= :), allocatable :: refs
75
+ damage
76
+ character (len= :), allocatable :: &
77
+ refs, &
78
+ extmsg
77
79
logical :: damage_active
78
80
79
81
@@ -85,40 +87,59 @@ module subroutine damage_init()
85
87
allocate (damageState(phases% length))
86
88
allocate (param(phases% length))
87
89
90
+ extmsg = ' '
88
91
damage_active = .false.
89
92
do ph = 1 ,phases% length
90
93
91
94
Nmembers = count (material_ID_phase == ph)
92
-
93
95
allocate (current(ph)% phi(Nmembers),source= 1.0_pREAL )
94
96
95
97
phase = > phases% get_dict(ph)
96
- source = > phase% get_dict(' damage' ,defaultVal= emptyDict)
97
- if (source% length > 0 ) then
98
+ if (damage_active) then
99
+ damage = > phase% get_dict(' damage' )
100
+ else
101
+ damage = > phase% get_dict(' damage' ,defaultVal= emptyDict)
102
+ end if
103
+
104
+ if (damage% length > 0 ) then
105
+ damage_active = .true.
106
+
98
107
print ' (/,1x,a,i0,a)' , ' phase ' ,ph,' : ' // phases% key(ph)
99
- refs = config_listReferences(source ,indent= 3 )
108
+ refs = config_listReferences(damage ,indent= 3 )
100
109
if (len (refs) > 0 ) print ' (/,1x,a)' , refs
101
- damage_active = .true.
102
- param(ph)% mu = source% get_asReal(' mu' )
103
- param(ph)% l_c = source% get_asReal(' l_c' )
110
+
111
+ param(ph)% mu = damage% get_asReal(' mu' )
112
+ param(ph)% l_c = damage% get_asReal(' l_c' )
113
+
114
+ ! sanity checks
115
+ if (param(ph)% mu < 0.0_pREAL ) extmsg = trim (extmsg)// ' mu'
116
+ if (param(ph)% l_c < 0.0_pREAL ) extmsg = trim (extmsg)// ' l_c'
117
+ if (extmsg /= ' ' ) call IO_error(211 ,ext_msg= trim (extmsg))
118
+
104
119
end if
105
120
106
121
end do
107
122
108
123
allocate (damage_type(phases% length), source = UNDEFINED)
109
124
125
+ where (isobrittle_init() ) damage_type = DAMAGE_ISOBRITTLE
126
+ where (anisobrittle_init()) damage_type = DAMAGE_ANISOBRITTLE
127
+ phase_damage_maxSizeDotState = maxval (damageState% sizeDotState)
128
+
110
129
if (damage_active) then
111
- where (isobrittle_init() ) damage_type = DAMAGE_ISOBRITTLE
112
- where (anisobrittle_init()) damage_type = DAMAGE_ANISOBRITTLE
130
+ do ph = 1 ,phases% length
131
+ phase = > phases% get_dict(ph)
132
+ damage = > phase% get_dict(' damage' )
133
+ if (any (damage% keys() == ' type' ) .and. damage_type(ph) == UNDEFINED) &
134
+ call IO_error(200 ,label1= ' damage' ,ext_msg= damage% get_asStr(' type' ))
135
+ end do
113
136
end if
114
137
115
- phase_damage_maxSizeDotState = maxval (damageState% sizeDotState)
116
-
117
138
end subroutine damage_init
118
139
119
140
120
141
!- -------------------------------------------------------------------------------------------------
121
- ! > @brief calculate stress (P)
142
+ ! > @brief t.b.d.
122
143
!- -------------------------------------------------------------------------------------------------
123
144
module function phase_damage_constitutive (Delta_t ,co ,ce ) result(status)
124
145
@@ -141,7 +162,7 @@ end function phase_damage_constitutive
141
162
142
163
143
164
!- -------------------------------------------------------------------------------------------------
144
- ! > @brief returns the degraded/modified elasticity matrix
165
+ ! > @brief Return the degraded/modified elasticity matrix.
145
166
!- -------------------------------------------------------------------------------------------------
146
167
module function phase_damage_C66 (C66 ,ph ,en ) result(C66_degraded)
147
168
0 commit comments