OOFEM 3.0
Loading...
Searching...
No Matches
isointerfacedamage01.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
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
48IsoInterfaceDamageMaterial :: IsoInterfaceDamageMaterial(int n, Domain *d) : StructuralInterfaceMaterial(n, d)
49{}
50
51
53IsoInterfaceDamageMaterial :: giveEngTraction_3d(const FloatArrayF<3> &jump, GaussPoint *gp, TimeStep *tStep) const
54{
56
57 // compute equivalent strain
58 double equivStrain = this->computeEquivalentStrain(jump, gp, tStep);
59
60 // compute value of loading function if strainLevel crit apply
61 double tempKappa = status->giveKappa();
62 double omega;
63 if ( tempKappa >= equivStrain ) {
64 // damage does not grow
65 omega = status->giveDamage();
66 } else {
67 // damage grows
68 tempKappa = equivStrain;
69 // evaluate damage
70 omega = this->computeDamageParam(tempKappa, jump, gp);
71 }
72
73 auto de = this->give3dStiffnessMatrix_Eng(ElasticStiffness, gp, tStep);
74 auto answer = (1.0 - omega) * dot(de, jump);
75
76 // update gp
77 status->letTempJumpBe(jump);
78 status->letTempTractionBe(answer);
79 status->setTempKappa(tempKappa);
80 status->setTempDamage(omega);
81
82 return answer;
83}
84
85
87IsoInterfaceDamageMaterial :: give3dStiffnessMatrix_Eng(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
88{
90
91 auto answer = diag<3>({kn, ks, ks});
92
93 if ( rMode == ElasticStiffness ) {
94 return answer;
95 }
96
97 double un = status->giveTempJump().at(1);
98 if ( rMode == SecantStiffness ) {
99 // damage in tension only
100 if ( un >= 0 ) {
101 double om = min(status->giveTempDamage(), maxOmega);
102 answer *= 1.0 - om;
103 }
104
105 return answer;
106 } else { // Tangent Stiffness
107 // damage in tension only
108 if ( un >= 0 ) {
109 double om = min(status->giveTempDamage(), maxOmega);
110 answer *= 1.0 - om;
111#if 0
112 // Unreachable code - commented out to supress compiler warnings
113 double dom = -( -e0 / un / un * exp( -( ft / gf ) * ( un - e0 ) ) + e0 / un * exp( -( ft / gf ) * ( un - e0 ) ) * ( -( ft / gf ) ) );
114 if ( ( om > 0. ) && ( status->giveTempKappa() > status->giveKappa() ) ) {
115 const auto &e = status->giveTempJump();
116 auto se = dot(answer, e);
117 answer.at(1, 1) -= se.at(1) * dom;
118 answer.at(2, 1) -= se.at(2) * dom;
119 }
120#endif
121 }
122 return answer;
123 }
124}
125
126
127int
128IsoInterfaceDamageMaterial :: giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
129{
131 if ( type == IST_DamageTensor ) {
132 answer.resize(6);
133 answer.zero();
134 answer.at(1) = answer.at(2) = answer.at(3) = status->giveDamage();
135 return 1;
136 } else if ( type == IST_DamageTensorTemp ) {
137 answer.resize(6);
138 answer.zero();
139 answer.at(1) = answer.at(2) = answer.at(3) = status->giveTempDamage();
140 return 1;
141 } else if ( type == IST_PrincipalDamageTensor ) {
142 answer.resize(3);
143 answer.at(1) = answer.at(2) = answer.at(3) = status->giveDamage();
144 return 1;
145 } else if ( type == IST_PrincipalDamageTempTensor ) {
146 answer.resize(3);
147 answer.at(1) = answer.at(2) = answer.at(3) = status->giveTempDamage();
148 return 1;
149 } else if ( type == IST_MaxEquivalentStrainLevel ) {
150 answer.resize(1);
151 answer.at(1) = status->giveKappa();
152 return 1;
153 } else {
154 return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
155 }
156}
157
158
159void
160IsoInterfaceDamageMaterial :: initializeFrom(InputRecord &ir)
161{
162 StructuralInterfaceMaterial :: initializeFrom(ir);
163
166
169 this->e0 = ft / kn;
170
171 //Set limit on the maximum isotropic damage parameter if needed
173 maxOmega = min(maxOmega, 0.999999);
174 maxOmega = max(maxOmega, 0.0);
175
176 beta = 0.;
178}
179
180
181void
182IsoInterfaceDamageMaterial :: giveInputRecord(DynamicInputRecord &input)
183{
184 StructuralInterfaceMaterial :: giveInputRecord(input);
185
188
191
193}
194
195
196double
197IsoInterfaceDamageMaterial :: computeEquivalentStrain(const FloatArrayF<3> &jump, GaussPoint *gp, TimeStep *tStep) const
198{
199 double epsNplus = macbra( jump.at(1) );
200 double epsT2 = jump.at(2) * jump.at(2);
201 if ( jump.giveSize() == 3 ) {
202 epsT2 += jump.at(3) * jump.at(3);
203 }
204 return sqrt(epsNplus * epsNplus + beta * epsT2);
205}
206
207double
208IsoInterfaceDamageMaterial :: computeDamageParam(double kappa, const FloatArrayF<3> &strain, GaussPoint *gp) const
209{
210 if ( kappa > this->e0 ) {
211 return 1.0 - ( this->e0 / kappa ) * exp( -( ft / gf ) * ( kappa - e0 ) );
212 } else {
213 return 0.0;
214 }
215}
216
217
218IsoInterfaceDamageMaterialStatus :: IsoInterfaceDamageMaterialStatus(GaussPoint *g) : StructuralInterfaceMaterialStatus(g)
219{}
220
221
222void
223IsoInterfaceDamageMaterialStatus :: printOutputAt(FILE *file, TimeStep *tStep) const
224{
225 StructuralInterfaceMaterialStatus :: printOutputAt(file, tStep);
226 fprintf(file, "status { ");
227 if ( this->damage > 0.0 ) {
228 fprintf(file, "kappa %f, damage %f ", this->kappa, this->damage);
229 }
230
231 fprintf(file, "}\n");
232}
233
234
235void
236IsoInterfaceDamageMaterialStatus :: initTempStatus()
237{
238 StructuralInterfaceMaterialStatus :: initTempStatus();
239 this->tempKappa = this->kappa;
240 this->tempDamage = this->damage;
241}
242
243void
244IsoInterfaceDamageMaterialStatus :: updateYourself(TimeStep *tStep)
245{
246 StructuralInterfaceMaterialStatus :: updateYourself(tStep);
247 this->kappa = this->tempKappa;
248 this->damage = this->tempDamage;
249}
250
251
252void
253IsoInterfaceDamageMaterialStatus :: saveContext(DataStream &stream, ContextMode mode)
254{
255 StructuralInterfaceMaterialStatus :: saveContext(stream, mode);
256
257 if ( !stream.write(kappa) ) {
259 }
260
261 if ( !stream.write(damage) ) {
263 }
264}
265
266void
267IsoInterfaceDamageMaterialStatus :: restoreContext(DataStream &stream, ContextMode mode)
268{
269 StructuralInterfaceMaterialStatus :: restoreContext(stream, mode);
270
271 if ( !stream.read(kappa) ) {
273 }
274
275 if ( !stream.read(damage) ) {
277 }
278}
279} // 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)
int giveSize() const
Returns the size of receiver.
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 setTempKappa(double newKappa)
Sets the temp scalar measure of the largest strain level to given value.
double damage
Damage level of material.
double giveTempKappa() const
Returns the temp. scalar measure of the largest strain level.
double giveDamage() const override
Returns the last equilibrated damage level.
double tempKappa
Non-equilibrated scalar measure of the largest equivalent displacement.
void setTempDamage(double newDamage)
Sets the temp damage level to given value.
double tempDamage
Non-equilibrated damage level of material.
double giveTempDamage() const override
Returns the temp. damage level.
double giveKappa() const
Returns the last equilibrated scalar measure of the largest strain level.
double kappa
Scalar measure of the largest equivalent displacement ever reached in material.
double beta
Weight factor for the influence of shear component of displacement jump on equivalent strain.
FloatMatrixF< 3, 3 > give3dStiffnessMatrix_Eng(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const override
double kn
Elastic properties (normal moduli).
double computeEquivalentStrain(const FloatArrayF< 3 > &jump, GaussPoint *gp, TimeStep *tStep) const
double maxOmega
Maximum limit on omega. The purpose is elimination of a too compliant material which may cause conver...
double e0
Limit elastic deformation.
virtual double computeDamageParam(double kappa, const FloatArrayF< 3 > &strain, GaussPoint *gp) const
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 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_IsoInterfaceDamageMaterial_ks
#define _IFT_IsoInterfaceDamageMaterial_ft
#define _IFT_IsoInterfaceDamageMaterial_gf
#define _IFT_IsoInterfaceDamageMaterial_kn
#define _IFT_IsoInterfaceDamageMaterial_maxOmega
#define _IFT_IsoInterfaceDamageMaterial_beta
long ContextMode
Definition contextmode.h:43
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
double macbra(double x)
Returns the positive part of given float.
Definition mathfem.h:128
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
FloatMatrixF< N, N > diag(const FloatArrayF< N > &v)
double dot(const FloatArray &x, const FloatArray &y)
@ 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