OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 2013 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 "isointerfacedamage01.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 
45 namespace oofem {
46 REGISTER_Material(IsoInterfaceDamageMaterial);
47 
49 {
50  maxOmega = 0.999999;
51  beta = 0.;
52 }
53 
54 
56 
57 
58 void
60 {
62  FloatMatrix de;
63  double equivStrain, tempKappa = 0.0, omega = 0.0;
64 
65  // compute equivalent strain
66  this->computeEquivalentStrain(equivStrain, jump, gp, tStep);
67 
68  // compute value of loading function if strainLevel crit apply
69  tempKappa = status->giveKappa();
70 
71  if ( tempKappa >= equivStrain ) {
72  // damage does not grow
73  omega = status->giveDamage();
74  } else {
75  // damage grows
76  tempKappa = equivStrain;
77  // evaluate damage
78  this->computeDamageParam(omega, tempKappa, jump, gp);
79  }
80 
81  this->give3dStiffnessMatrix_Eng(de, ElasticStiffness, gp, tStep);
82  de.times(1.0 - omega);
83  answer.beProductOf(de, jump);
84 
85  // update gp
86  status->letTempJumpBe(jump);
87  status->letTempTractionBe(answer);
88  status->setTempKappa(tempKappa);
89  status->setTempDamage(omega);
90 }
91 
92 
93 void
95 {
96  double om, un;
98 
99  // assemble eleastic stiffness
100  answer.resize(3, 3);
101  answer.zero();
102  answer.at(1, 1) = kn;
103  answer.at(2, 2) = ks;
104  answer.at(3, 3) = ks;
105 
106  if ( rMode == ElasticStiffness ) {
107  return;
108  }
109 
110  if ( rMode == SecantStiffness ) {
111  // Secant stiffness
112  om = status->giveTempDamage();
113  un = status->giveTempJump().at(1);
114  om = min(om, maxOmega);
115  // damage in tension only
116  if ( un >= 0 ) {
117  answer.times(1.0 - om);
118  }
119 
120  return;
121  } else {
122  // Tangent Stiffness
123  FloatArray se;
124  const FloatArray &e = status->giveTempJump();
125  se.beProductOf(answer, e);
126 
127  om = status->giveTempDamage();
128  un = status->giveTempJump().at(1);
129  om = min(om, maxOmega);
130  // damage in tension only
131  if ( un >= 0 ) {
132  answer.times(1.0 - om);
133  return;
134 #if 0
135  // Unreachable code - commented out to supress compiler warnings
136  double dom = -( -e0 / un / un * exp( -( ft / gf ) * ( un - e0 ) ) + e0 / un * exp( -( ft / gf ) * ( un - e0 ) ) * ( -( ft / gf ) ) );
137  if ( ( om > 0. ) && ( status->giveTempKappa() > status->giveKappa() ) ) {
138  answer.at(1, 1) -= se.at(1) * dom;
139  answer.at(2, 1) -= se.at(2) * dom;
140  }
141 #endif
142  }
143  }
144 }
145 
146 
147 int
149 {
150  IsoInterfaceDamageMaterialStatus *status = static_cast< IsoInterfaceDamageMaterialStatus * >( this->giveStatus(gp) );
151  if ( type == IST_DamageTensor ) {
152  answer.resize(6);
153  answer.zero();
154  answer.at(1) = answer.at(2) = answer.at(3) = status->giveDamage();
155  return 1;
156  } else if ( type == IST_DamageTensorTemp ) {
157  answer.resize(6);
158  answer.zero();
159  answer.at(1) = answer.at(2) = answer.at(3) = status->giveTempDamage();
160  return 1;
161  } else if ( type == IST_PrincipalDamageTensor ) {
162  answer.resize(3);
163  answer.at(1) = answer.at(2) = answer.at(3) = status->giveDamage();
164  return 1;
165  } else if ( type == IST_PrincipalDamageTempTensor ) {
166  answer.resize(3);
167  answer.at(1) = answer.at(2) = answer.at(3) = status->giveTempDamage();
168  return 1;
169  } else if ( type == IST_MaxEquivalentStrainLevel ) {
170  answer.resize(1);
171  answer.at(1) = status->giveKappa();
172  return 1;
173  } else {
174  return StructuralInterfaceMaterial :: giveIPValue(answer, gp, type, tStep);
175  }
176 }
177 
178 
181 {
182  IRResultType result; // Required by IR_GIVE_FIELD macro
183 
186 
189  this->e0 = ft / kn;
190 
191  //Set limit on the maximum isotropic damage parameter if needed
193  maxOmega = min(maxOmega, 0.999999);
194  maxOmega = max(maxOmega, 0.0);
195 
196  beta = 0.;
198 
200 }
201 
202 
203 void
205 {
207 
210 
213 
215 }
216 
217 
218 void
220 {
221  double epsNplus = macbra( jump.at(1) );
222  double epsT2 = jump.at(2) * jump.at(2);
223  if ( jump.giveSize() == 3 ) {
224  epsT2 += jump.at(3) * jump.at(3);
225  }
226  kappa = sqrt(epsNplus * epsNplus + beta * epsT2);
227 }
228 
229 void
230 IsoInterfaceDamageMaterial :: computeDamageParam(double &omega, double kappa, const FloatArray &strain, GaussPoint *gp)
231 {
232  if ( kappa > this->e0 ) {
233  omega = 1.0 - ( this->e0 / kappa ) * exp( -( ft / gf ) * ( kappa - e0 ) );
234  } else {
235  omega = 0.0;
236  }
237 }
238 
239 
241 {
242  kappa = tempKappa = 0.0;
243  damage = tempDamage = 0.0;
244 }
245 
246 
248 { }
249 
250 
251 void
253 {
255  fprintf(file, "status { ");
256  if ( this->damage > 0.0 ) {
257  fprintf(file, "kappa %f, damage %f ", this->kappa, this->damage);
258  }
259 
260  fprintf(file, "}\n");
261 }
262 
263 
264 void
266 {
268  this->tempKappa = this->kappa;
269  this->tempDamage = this->damage;
270 }
271 
272 void
274 {
276  this->kappa = this->tempKappa;
277  this->damage = this->tempDamage;
278 }
279 
280 
283 {
284  contextIOResultType iores;
285 
286  // save parent class status
287  if ( ( iores = StructuralInterfaceMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
288  THROW_CIOERR(iores);
289  }
290 
291  // write a raw data
292  if ( !stream.write(kappa) ) {
294  }
295 
296  if ( !stream.write(damage) ) {
298  }
299 
300  return CIO_OK;
301 }
302 
305 {
306  contextIOResultType iores;
307 
308  // read parent class status
309  if ( ( iores = StructuralInterfaceMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
310  THROW_CIOERR(iores);
311  }
312 
313  // read raw data
314  if ( !stream.read(kappa) ) {
316  }
317 
318  if ( !stream.read(damage) ) {
320  }
321 
322  return CIO_OK;
323 }
324 } // end namespace oofem
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
void setField(int item, InputFieldType id)
double tempDamage
Non-equilibrated damage level of material.
double giveDamage()
Returns the last equilibrated damage level.
double kappa
Scalar measure of the largest equivalent displacement ever reached in material.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
IsoInterfaceDamageMaterial(int n, Domain *d)
Constructor.
Class and object Domain.
Definition: domain.h:115
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
double kn
Elastic properties (normal moduli).
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
This class implements associated Material Status to IsoInterfaceDamageMaterial.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
int max(int i, int j)
Returns bigger value form two given decimals.
Definition: mathfem.h:71
#define _IFT_IsoInterfaceDamageMaterial_kn
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
double macbra(double x)
Returns the positive part of given float.
Definition: mathfem.h:115
General IO error.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
MatResponseMode
Describes the character of characteristic material matrix.
double beta
Weight factor for the influence of shear component of displacement jump on equivalent strain...
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
IsoInterfaceDamageMaterialStatus(int n, Domain *d, GaussPoint *g)
Constructor.
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
void computeEquivalentStrain(double &kappa, const FloatArray &jump, GaussPoint *gp, TimeStep *tStep)
double maxOmega
Maximum limit on omega. The purpose is elimination of a too compliant material which may cause conver...
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
double damage
Damage level of material.
double tempKappa
Non-equilibrated scalar measure of the largest equivalent displacement.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
double giveTempDamage()
Returns the temp. damage level.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual void computeDamageParam(double &omega, double kappa, const FloatArray &strain, GaussPoint *gp)
computes the value of damage parameter omega, based on given value of equivalent strain.
double e0
Limit elastic deformation.
void letTempJumpBe(FloatArray v)
Assigns tempJump to given vector v.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
virtual void give3dStiffnessMatrix_Eng(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
#define _IFT_IsoInterfaceDamageMaterial_maxOmega
void setTempKappa(double newKappa)
Sets the temp scalar measure of the largest strain level to given value.
This class implements a structural interface material status information.
#define _IFT_IsoInterfaceDamageMaterial_ks
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
double giveKappa()
Returns the last equilibrated scalar measure of the largest strain level.
virtual ~IsoInterfaceDamageMaterial()
Destructor.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Class representing vector of real numbers.
Definition: floatarray.h:82
#define _IFT_IsoInterfaceDamageMaterial_ft
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Class representing the a dynamic Input Record.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
int min(int i, int j)
Returns smaller value from two given decimals.
Definition: mathfem.h:59
double giveTempKappa()
Returns the temp. scalar measure of the largest strain level.
REGISTER_Material(DummyMaterial)
void letTempTractionBe(FloatArray v)
Assigns tempTraction to given vector v.
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
Abstract base class for all "structural" interface models.
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define _IFT_IsoInterfaceDamageMaterial_gf
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
const FloatArray & giveTempJump() const
Returns the const pointer to receiver&#39;s temporary jump.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
virtual ~IsoInterfaceDamageMaterialStatus()
Destructor.
virtual void giveEngTraction_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &jump, TimeStep *tStep)
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
void setTempDamage(double newDamage)
Sets the temp damage level to given value.
#define _IFT_IsoInterfaceDamageMaterial_beta
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011