OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
trabbonematerial.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 "trabbonematerial.h"
36 #include "floatmatrix.h"
37 #include "floatarray.h"
38 #include "../sm/Materials/structuralmaterial.h"
39 #include "contextioerr.h"
40 #include "mathfem.h"
41 #include "classfactory.h"
42 
43 namespace oofem {
44 REGISTER_Material(TrabBoneMaterial);
45 
47 { }
48 
49 
50 int
52 {
53  return mode == _1dMat;
54 }
55 
56 
58 {
59  TrabBoneMaterialStatus *status = static_cast< TrabBoneMaterialStatus * >( this->giveStatus(gp) );
60  alpha = status->giveTempAlpha();
61 }
62 
63 
64 void
66  MatResponseMode mode, GaussPoint *gp,
67  TimeStep *tStep)
68 {
69  TrabBoneMaterialStatus *status = static_cast< TrabBoneMaterialStatus * >( this->giveStatus(gp) );
70 
71  double epsnew;
72  double epsp, depsp;
73  double dam, alpha;
74  double matconstc;
75  FloatArray epsnewArray;
76 
77  if ( mode == ElasticStiffness ) {
78  answer.resize(1, 1);
79  answer.at(1, 1) = E0;
80  } else if ( mode == SecantStiffness ) {
81  dam = status->giveTempDam();
82  matconstc = status->giveMatConstC();
83 
84  answer.resize(1, 1);
85  answer.at(1, 1) = ( 1.0 - dam ) * E0 + matconstc;
86  } else {
87  epsnew = status->giveTempStrainVector().at(1);
88  epsnewArray = status->giveTempStrainVector();
89  epsp = status->giveTempPlasStrainVector().at(1);
90  depsp = status->giveTempIncPlasStrainVector().at(1);
91  alpha = status->giveTempAlpha();
92  dam = status->giveTempDam();
93 
94  answer.resize(1, 1);
95 
96  computeDensification(gp, epsnewArray);
97  matconstc = status->giveMatConstC();
98 
99  if ( depsp != 0.0 ) {
100  answer.at(1, 1) = ( 1.0 - dam ) * ( E0 * ( Eil + Ek ) ) / ( E0 + Eil + Ek )
101  - E0 * E0 * ( epsnew - epsp ) / ( E0 + Eil + Ek ) * adam * exp(-adam * alpha) * depsp / fabs(depsp) + matconstc;
102  } else {
103  answer.at(1, 1) = ( 1.0 - dam ) * E0 + matconstc;
104  }
105  }
106 
107  status->setSmtrx( answer.at(1, 1) );
108 }
109 
110 
111 void
113 {
114  double epsnew, epsold;
115  double epsp, depsp;
116  double alpha;
117  double sigp, sigY;
118  double gNewton, dgNewton;
119 
120  TrabBoneMaterialStatus *status = static_cast< TrabBoneMaterialStatus * >( this->giveStatus(gp) );
121 
122  epsnew = totalStrain.at(1);
123  epsold = status->giveStrainVector().at(1);
124  epsp = status->givePlasStrainVector().at(1);
125  alpha = status->giveAlpha();
126  sigp = E0 * epsnew - ( E0 + Ek ) * epsp;
127 
128  if ( sigp < 0.0 ) {
129  sigY = SigYn;
130  } else {
131  sigY = SigYp;
132  }
133 
134  if ( sigp / fabs(sigp) * sigp > sigY + Eil * alpha + Eie * ( 1 - exp(-kie * alpha) ) ) {
135  depsp = epsnew - epsold;
136  gNewton = sigp / fabs(sigp) * ( E0 * epsnew - ( E0 + Ek ) * ( epsp + depsp ) ) - ( sigY + Eil * ( alpha +
137  sigp / fabs(sigp) * depsp ) + Eie * ( 1 - exp( -kie * ( alpha + sigp / fabs(sigp) * depsp ) ) ) );
138  while ( fabs(gNewton) > 10.e-7 ) {
139  gNewton = sigp / fabs(sigp) * ( E0 * epsnew - ( E0 + Ek ) * ( epsp + depsp ) ) - ( sigY + Eil * ( alpha +
140  sigp / fabs(sigp) * depsp ) + Eie * ( 1 - exp( -kie * ( alpha + sigp / fabs(sigp) * depsp ) ) ) );
141  dgNewton = -sigp / fabs(sigp) * ( ( E0 + Ek ) + Eil +
142  Eie * kie * exp( -kie * ( alpha + sigp / fabs(sigp) * depsp ) ) );
143  depsp += -gNewton / dgNewton;
144  }
145 
146  epsp += depsp;
147  } else {
148  depsp = 0.0;
149  }
150 
151  alpha += fabs(depsp);
152 
153  status->setTempEpsp(epsp);
154  status->setTempDepsp(depsp);
155  status->setTempAlpha(alpha);
156 }
157 
158 
159 void
161 {
162  double epsnew, sigc;
163  double matconstc;
164 
165  TrabBoneMaterialStatus *status = static_cast< TrabBoneMaterialStatus * >( this->giveStatus(gp) );
166 
167  epsnew = totalStrain.at(1);
168 
169  if ( epsnew > EpsC ) {
170  sigc = 0.0;
171  matconstc = 0.0;
172  } else {
173  sigc = Cc * ( epsnew - EpsC ) + Cc2 * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC );
174  matconstc = Cc + 7 * Cc2 * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC ) * ( epsnew - EpsC );
175  }
176 
177  status->setSigC(sigc);
178  status->setMatConstC(matconstc);
179 }
180 
181 
182 double
184 {
185  double dam;
186  if ( alpha > 0. ) {
187  dam = 1.0 - exp(-adam * alpha);
188  // dam = adam*alpha;
189  } else {
190  dam = 0.0;
191  }
192 
193  if ( alpha < 0. ) {
194  OOFEM_ERROR("Alpha less than zero. Not possible");
195  }
196 
197  return dam;
198 }
199 
200 
201 double
203 {
204  double alpha;
205 
206  computeCumPlastStrain(alpha, gp, tStep);
207 
208  double dam = computeDamageParam(alpha, gp);
209 
210  return dam;
211 }
212 
213 
214 void
216  const FloatArray &totalStrain,
217  TimeStep *tStep)
218 {
219  double epsnew, epsp;
220  double dam;
221  double sig, sigc;
222 
223  TrabBoneMaterialStatus *status = static_cast< TrabBoneMaterialStatus * >( this->giveStatus(gp) );
224  this->initTempStatus(gp);
225 
226  performPlasticityReturn(gp, totalStrain);
227 
228  epsnew = totalStrain.at(1);
229 
230  computeDensification(gp, totalStrain);
231 
232  dam = computeDamage(gp, tStep);
233 
234  epsp = status->giveTempPlasStrainVector().at(1);
235  sigc = status->giveSigC();
236  sig = ( 1 - dam ) * E0 * ( epsnew - epsp ) + sigc;
237 
238  answer.resize(1);
239  answer.at(1) = sig;
240  status->setTempDam(dam);
241  status->letTempStrainVectorBe(totalStrain);
242  status->letTempStressVectorBe(answer);
243 }
244 
245 
248 {
249  IRResultType result; // Required by IR_GIVE_FIELD macro
250 
251  // Read material properties here
252 
264 
266 }
267 
268 
272 
274 {
275  alpha = 0.0;
276  tempAlpha = 0.0;
277  dam = 0.0;
278  tempDam = 0.0;
279  smtrx = 0.0;
280  slope = 0.0;
281  sigC = 0.0;
282  matConstC = 0.0;
283  epsp.resize(1);
284  tempEpsp.resize(1);
285  epsp.at(1) = 0.0;
286  tempEpsp.at(1) = 0.0;
287  tempDepsp.resize(1);
288  tempDepsp.at(1) = 0.0;
289 }
290 
291 
293 { }
294 
295 
296 double
298 {
299  return alpha;
300 }
301 
302 double
304 {
305  return tempAlpha;
306 }
307 
308 double
310 {
311  return dam;
312 }
313 
314 double
316 {
317  return tempDam;
318 }
319 
320 double
322 {
323  return smtrx;
324 }
325 
326 double
328 {
329  return slope;
330 }
331 
332 double
334 {
335  return sigC;
336 }
337 
338 double
340 {
341  return matConstC;
342 }
343 
344 const FloatArray &
346 {
347  return epsp;
348 }
349 
350 const FloatArray &
352 {
353  return tempEpsp;
354 }
355 
356 const FloatArray &
358 {
359  return tempDepsp;
360 }
361 
362 
363 void
365 {
367  fprintf(file, "status { ");
368  fprintf(file, "plastrains %f, alpha %f, dam %f, Slope %f, Smtrx %f ", this->tempEpsp.at(1),
369  this->tempAlpha, this->tempDam, this->slope, this->smtrx);
370  fprintf(file, "}\n");
371 }
372 
373 
374 void
376 {
378  this->tempAlpha = this->alpha;
379  this->tempDam = this->dam;
380  this->tempEpsp = this->epsp;
381 }
382 
383 
384 void
386 {
388  this->alpha = this->tempAlpha;
389  this->dam = this->tempDam;
390  this->epsp = this->tempEpsp;
391 }
392 
393 
396 {
397  contextIOResultType iores;
398 
399  // save parent class status
400  if ( ( iores = StructuralMaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
401  THROW_CIOERR(iores);
402  }
403 
404  // write a raw data
405  //if (fwrite(&kappa,sizeof(double),1,stream) != CIO_OK) THROW_CIOERR(CIO_IOERR);
406  //if (fwrite(&damage,sizeof(double),1,stream)!= CIO_OK) THROW_CIOERR(CIO_IOERR);
407 
408  return CIO_OK;
409 }
410 
411 
414 {
415  contextIOResultType iores;
416 
417  // read parent class status
418  if ( ( iores = StructuralMaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
419  THROW_CIOERR(iores);
420  }
421 
422  // read raw data
423  //if (fread (&kappa,sizeof(double),1,stream) != 1) THROW_CIOERR(CIO_IOERR);
424  //if (fread (&damage,sizeof(double),1,stream) != 1) THROW_CIOERR(CIO_IOERR);
425 
426  return CIO_OK;
427 }
428 
429 
431 {
432  TrabBoneMaterialStatus *status =
434  return status;
435 }
436 } // end namespace oofem
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: structuralms.C:96
#define _IFT_TrabBoneMaterial_Eie
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Definition: structuralms.h:137
#define _IFT_TrabBoneMaterial_adam
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define _IFT_TrabBoneMaterial_Cc
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
const FloatArray & giveTempIncPlasStrainVector()
const FloatArray & giveTempPlasStrainVector()
GaussPoint * gp
Associated integration point.
Class and object Domain.
Definition: domain.h:115
void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
void setTempDepsp(double depsip)
#define _IFT_TrabBoneMaterial_EpsC
This class implements a structural material status information.
Definition: structuralms.h:65
virtual void computeCumPlastStrain(double &alpha, GaussPoint *gp, TimeStep *tStep)
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
#define _IFT_TrabBoneMaterial_kie
TrabBoneMaterialStatus(int n, Domain *d, GaussPoint *g)
#define _IFT_TrabBoneMaterial_E0
virtual void give1dStressStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d stiffness matrix of receiver.
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: structuralms.C:73
MatResponseMode
Describes the character of characteristic material matrix.
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
#define _IFT_TrabBoneMaterial_SigYn
#define _IFT_TrabBoneMaterial_Cc2
#define OOFEM_ERROR(...)
Definition: error.h:61
This class implements associated Material Status to TrabBoneMaterial.
double computeDamageParam(double alpha, GaussPoint *gp)
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver&#39;s temporary strain vector.
Definition: structuralms.h:115
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
#define _IFT_TrabBoneMaterial_SigYp
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: structuralms.C:157
virtual void giveRealStressVector_1d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Default implementation relies on giveRealStressVector_StressControl.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
void performPlasticityReturn(GaussPoint *gp, const FloatArray &totalStrain)
Abstract base class representing a material status information.
Definition: matstatus.h:84
Class representing vector of real numbers.
Definition: floatarray.h:82
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 letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
Definition: structuralms.h:135
TrabBoneMaterial(int n, Domain *d)
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
double computeDamage(GaussPoint *gp, TimeStep *tStep)
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
Abstract base class for all "structural" constitutive models.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: structuralms.C:108
Domain * giveDomain() const
Definition: femcmpnn.h:100
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
#define _IFT_TrabBoneMaterial_Eil
#define _IFT_TrabBoneMaterial_Ek
REGISTER_Material(DummyMaterial)
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: structuralms.C:133
the oofem namespace is to define a context or scope in which all oofem names are defined.
void computeDensification(GaussPoint *gp, const FloatArray &totalStrain)
const FloatArray & givePlasStrainVector()
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
Definition: material.C:267
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver&#39;s strain vector.
Definition: structuralms.h:105
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
virtual int hasMaterialModeCapability(MaterialMode)
Tests if material supports material mode.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
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:32 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011