OOFEM 3.0
Loading...
Searching...
No Matches
intmatisodamage.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#include "intmatisodamage.h"
36#include "gausspoint.h"
37#include "floatmatrix.h"
38#include "floatarray.h"
39#include "mathfem.h"
40#include "datastream.h"
41#include "contextioerr.h"
42#include "classfactory.h"
43#include "dynamicinputrecord.h"
44
45namespace oofem {
47
48IntMatIsoDamage :: IntMatIsoDamage(int n, Domain *d) : StructuralInterfaceMaterial(n, d)
49{}
50
51
53IntMatIsoDamage :: giveEngTraction_3d(const FloatArrayF<3> &jump, GaussPoint *gp, TimeStep *tStep) const
54{
55 IntMatIsoDamageStatus *status = static_cast< IntMatIsoDamageStatus * >( this->giveStatus(gp) );
56
57 double tempKappa = 0.0, omega = 0.0;
58
59 // compute equivalent strain
60 double equivJump = this->computeEquivalentJump(jump);
61
62 // compute value of loading function
63 double f = equivJump - status->giveKappa();
64
65 if ( f <= 0.0 ) {
66 // no damage evolution
67 tempKappa = status->giveKappa();
68 omega = status->giveDamage();
69 } else {
70 // damage evolution
71 tempKappa = equivJump;
72 // evaluate damage parameter
73 omega = this->computeDamageParam(tempKappa);
74 }
75
76 double strength = 1.0 - min(omega, maxOmega);
77
78 if ( semiExplicit ) {
79 double oldOmega = status->giveDamage();
80 strength = 1.0 - min(oldOmega, maxOmega);
81 }
82
83 //answer = {ks * jump.at(1) * strength, ks * jump.at(2) * strength, kn * jump.at(3)};
84 FloatArrayF<3> answer = {kn * jump.at(1), ks * jump.at(2) * strength, ks * jump.at(3) * strength};
85 // damage in tension only
86 if ( jump.at(1) >= 0 ) {
87 answer.at(1) *= strength;
88 }
89
90 // update gp
91 status->letTempJumpBe(jump);
92 status->letTempTractionBe(answer);
93
94 status->setTempKappa(tempKappa);
95 status->setTempDamage(omega);
96
97 return answer;
98}
99
100
102IntMatIsoDamage :: giveFirstPKTraction_3d(const FloatArrayF<3> &jump, const FloatMatrixF<3,3> &F, GaussPoint* gp, TimeStep* tStep) const
103{
104 IntMatIsoDamageStatus *status = static_cast< IntMatIsoDamageStatus * > ( this->giveStatus ( gp ) );
105 auto answer = this->giveEngTraction_3d(jump, gp, tStep);
106 status->letTempFirstPKTractionBe(answer);
107 return answer;
108}
109
110
112IntMatIsoDamage :: give2dStiffnessMatrix_Eng(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
113{
114 IntMatIsoDamageStatus *status = static_cast< IntMatIsoDamageStatus * >( this->giveStatus(gp) );
115
116 // assemble eleastic stiffness
117 auto answer = diag<2>({kn, ks});
118
119 if ( rMode == ElasticStiffness ) {
120 return answer;
121 }
122
123 const auto &jump3d = status->giveTempJump();
124 FloatArray jump2d = {jump3d.at(1),jump3d.at(2)};
125 double om = min(status->giveTempDamage(), maxOmega);
126 double un = jump2d.at(1);
127
128 if ( rMode == SecantStiffness ) {
129 answer.at(2, 2) *= 1.0 - om;
130 // damage in tension only
131 if ( un >= 0 ) {
132 answer.at(1, 1) *= 1.0 - om;
133 }
134 } else { // Tangent Stiffness
135 answer.at(2, 2) *= 1.0 - om;
136 // damage in tension only
137 if ( un >= 0 ) {
138 answer.at(1, 1) *= 1.0 - om;
139
140#if 0
141 se.beProductOf(answer, jump2d);
142 double omega, omega_plus;
143 computeDamageParam(omega, un);
144 computeDamageParam(omega_plus, un + 1.0e-8 );
145 double dom = (omega_plus - omega)/ 1.0e-8;
146
147 // d( (1-omega)*D*j ) / dj = (1-omega)D - D*j openprod domega/dj
148 double fac = ft*(e0 - un)/gf;
149 dom = e0*exp(fac) /(un*un + 1.0e-9) + e0*ft*exp(fac) / (gf*un + 1.0e-9);
150
151 dom = -( -e0 / (un * un+1.0e-9) * exp( -( ft / gf ) * ( un - e0 ) ) + e0 / (un+1.0e-9) * exp( -( ft / gf ) * ( un - e0 ) ) * ( -( ft / gf ) ) );
152 if ( ( om > 0. ) && ( status->giveTempKappa() > status->giveKappa() ) ) {
153 answer.at(1, 2) -= se.at(1) * dom;
154 answer.at(2, 2) -= se.at(2) * dom;
155 }
156#endif
157 }
158 }
159 return answer;
160}
161
162
164IntMatIsoDamage :: give3dStiffnessMatrix_Eng(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
165{
166 IntMatIsoDamageStatus *status = static_cast< IntMatIsoDamageStatus * >( this->giveStatus(gp) );
167
168 // assemble eleastic stiffness
169 auto answer = diag<3>({kn, ks, ks});
170
171 if ( rMode == ElasticStiffness ) {
172 return answer;
173 }
174
175 const auto &jump3d = status->giveTempJump();
176 double om = min(status->giveTempDamage(), maxOmega);
177 double un = jump3d.at(1);
178
179 if ( rMode == SecantStiffness ) {
180 // damage in tension only
181 if ( un >= 0 ) {
182 answer.at(1, 1) *= 1.0 - om;
183 }
184 // Secant stiffness
185 answer.at(2, 2) *= 1.0 - om;
186 answer.at(3, 3) *= 1.0 - om;
187 } else {
188 // damage in tension only
189 if ( un >= 0 ) {
190 answer.at(1, 1) *= 1.0 - om;
191 }
192 // Tangent Stiffness
193 answer.at(2, 2) *= 1.0 - om;
194 answer.at(3, 3) *= 1.0 - om;
195 }
196 return answer;
197}
198
199
200int
201IntMatIsoDamage :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
202{
203 IntMatIsoDamageStatus *status = static_cast< IntMatIsoDamageStatus * >( this->giveStatus(gp) );
204 if ( type == IST_DamageTensor ) {
205 answer.resize(6);
206 answer.zero();
207 answer.at(1) = answer.at(2) = answer.at(3) = status->giveDamage();
208 return 1;
209 } else if ( type == IST_DamageTensorTemp ) {
210 answer.resize(6);
211 answer.zero();
212 answer.at(1) = answer.at(2) = answer.at(3) = status->giveTempDamage();
213 return 1;
214 } else if ( type == IST_PrincipalDamageTensor ) {
215 answer.resize(3);
216 answer.at(1) = answer.at(2) = answer.at(3) = status->giveDamage();
217 return 1;
218 } else if ( type == IST_PrincipalDamageTempTensor ) {
219 answer.resize(3);
220 answer.at(1) = answer.at(2) = answer.at(3) = status->giveTempDamage();
221 return 1;
222 } else if ( type == IST_MaxEquivalentStrainLevel ) {
223 answer.resize(1);
224 answer.at(1) = status->giveKappa();
225 return 1;
226 } else {
227 return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
228 }
229}
230
231
232void
233IntMatIsoDamage :: initializeFrom(InputRecord &ir)
234{
235 StructuralInterfaceMaterial :: initializeFrom(ir);
236
239
242 this->e0 = ft / kn;
243
244 //Set limit on the maximum isotropic damage parameter if needed
245 maxOmega = 0.999999;
247 maxOmega = min(maxOmega, 0.999999);
248 maxOmega = max(maxOmega, 0.0);
249}
250
251
252void
253IntMatIsoDamage :: giveInputRecord(DynamicInputRecord &input)
254{
255 StructuralInterfaceMaterial :: giveInputRecord(input);
256
257 input.setField(this->kn, _IFT_IntMatIsoDamage_kn);
258 input.setField(this->ks, _IFT_IntMatIsoDamage_ks);
259
260 input.setField(this->ft, _IFT_IntMatIsoDamage_ft);
261 input.setField(this->gf, _IFT_IntMatIsoDamage_gf);
262
264}
265
266
267double
268IntMatIsoDamage :: computeEquivalentJump(const FloatArray &jump) const
269{
270 return jump.at(1);
271}
272
273double
274IntMatIsoDamage :: computeDamageParam(double kappa) const
275{
276 if ( kappa > this->e0 ) {
277 return 1.0 - ( this->e0 / kappa ) * exp( -( ft / gf ) * ( kappa - e0 ) );
278 } else {
279 return 0.;
280 }
281}
282
283
284IntMatIsoDamageStatus :: IntMatIsoDamageStatus(GaussPoint *g) : StructuralInterfaceMaterialStatus(g)
285{}
286
287void
288IntMatIsoDamageStatus :: printOutputAt(FILE *file, TimeStep *tStep) const
289{
290 StructuralInterfaceMaterialStatus :: printOutputAt(file, tStep);
291 fprintf(file, "status { ");
292 if ( this->damage > 0.0 ) {
293 fprintf(file, "kappa %f, damage %f ", this->kappa, this->damage);
294 }
295
296 fprintf(file, "}\n");
297}
298
299
300void
301IntMatIsoDamageStatus :: initTempStatus()
302{
303 StructuralInterfaceMaterialStatus :: initTempStatus();
304 this->tempKappa = this->kappa;
305 this->tempDamage = this->damage;
306}
307
308void
309IntMatIsoDamageStatus :: updateYourself(TimeStep *tStep)
310{
311 StructuralInterfaceMaterialStatus :: updateYourself(tStep);
312 this->kappa = this->tempKappa;
313 this->damage = this->tempDamage;
314}
315
316
317void
318IntMatIsoDamageStatus :: saveContext(DataStream &stream, ContextMode mode)
319{
320 StructuralInterfaceMaterialStatus :: saveContext(stream, mode);
321
322 if ( !stream.write(kappa) ) {
324 }
325
326 if ( !stream.write(damage) ) {
328 }
329}
330
331void
332IntMatIsoDamageStatus :: restoreContext(DataStream &stream, ContextMode mode)
333{
334 StructuralInterfaceMaterialStatus :: restoreContext(stream, mode);
335
336 if ( !stream.read(kappa) ) {
338 }
339
340 if ( !stream.read(damage) ) {
342 }
343}
344
345} // end namespace oofem
#define REGISTER_Material(class)
virtual int read(int *data, std::size_t count)=0
Reads count integer values into array pointed by data.
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
void setField(int item, InputFieldType id)
double & at(std::size_t i)
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
void setTempDamage(double newDamage)
Sets the temp damage level to given value.
double giveKappa() const
Returns the last equilibrated scalar measure of the largest jump level.
double giveTempKappa() const
Returns the temp. scalar measure of the largest jump level.
double kappa
Scalar measure of the largest equivalent displacement ever reached in material.
double giveTempDamage() const override
Returns the temp. damage level.
double giveDamage() const override
Returns the last equilibrated damage level.
void setTempKappa(double newKappa)
Sets the temp scalar measure of the largest strain level to given value.
double damage
Damage level of material.
double tempDamage
Non-equilibrated damage level of material.
double tempKappa
Non-equilibrated scalar measure of the largest equivalent displacement.
double maxOmega
Maximum limit on omega. The purpose is elimination of a too compliant material which may cause conver...
FloatArrayF< 3 > giveEngTraction_3d(const FloatArrayF< 3 > &jump, GaussPoint *gp, TimeStep *tStep) const override
double kn
Elastic properties (normal moduli).
virtual double computeEquivalentJump(const FloatArray &jump) const
double e0
Limit elastic deformation.
double ks
Shear moduli.
virtual double computeDamageParam(double kappa) const
double ft
Tension strength.
double gf
Fracture energy.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
StructuralInterfaceMaterialStatus(GaussPoint *g)
Constructor. Creates new StructuralInterfaceMaterialStatus with number n, belonging to domain d and I...
const FloatArrayF< 3 > & giveTempJump() const
Returns the const pointer to receiver's temporary jump.
void letTempFirstPKTractionBe(const FloatArrayF< 3 > v)
Assigns tempFirstPKTraction to given vector v.
void letTempTractionBe(const FloatArrayF< 3 > v)
Assigns tempTraction to given vector v.
void letTempJumpBe(const FloatArrayF< 3 > v)
Assigns tempJump to given vector v.
#define THROW_CIOERR(e)
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_IntMatIsoDamage_gf
#define _IFT_IntMatIsoDamage_ft
#define _IFT_IntMatIsoDamage_ks
#define _IFT_IntMatIsoDamage_maxOmega
#define _IFT_IntMatIsoDamage_kn
long ContextMode
Definition contextmode.h:43
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
FloatMatrixF< N, N > diag(const FloatArrayF< N > &v)
@ CIO_IOERR
General IO error.

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011