OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
trabbonegrad3d.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 
36 #include "trabbonegrad3d.h"
37 #include "gausspoint.h"
38 #include "floatmatrix.h"
39 #include "floatarray.h"
40 #include "mathfem.h"
41 #include "error.h"
42 #include "classfactory.h"
43 
44 
45 namespace oofem {
46 REGISTER_Material(TrabBoneGrad3D);
47 
49 {
50  L = 0.;
51 }
52 
54 { }
55 
56 int
58 {
59  return mode == _3dMat;
60 }
61 void
63  MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
64 //
65 // Returns characteristic material stiffness matrix of the receiver
66 //
67 {
68  OOFEM_ERROR("Shouldn't be called");
69 }
70 
71 void
73 {
74  MaterialMode mMode = gp->giveMaterialMode();
75  switch ( mMode ) {
76  case _3dMat:
77  give3dMaterialStiffnessMatrix(answer, mode, gp, tStep);
78  break;
79  default:
80  OOFEM_ERROR( "givePDGradMatrix_uu : unknown mode (%s)", __MaterialModeToString(mMode) );
81  }
82 }
83 
84 void
86 {
87  MaterialMode mMode = gp->giveMaterialMode();
88  switch ( mMode ) {
89  case _3dMat:
90  give3dKappaMatrix(answer, mode, gp, tStep);
91  break;
92  default:
93  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
94  }
95 }
96 
97 void
99 {
100  MaterialMode mMode = gp->giveMaterialMode();
101  switch ( mMode ) {
102  case _3dMat:
103  give3dGprime(answer, mode, gp, tStep);
104  break;
105  default:
106  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
107  }
108 }
109 
110 void
112 {
113  MaterialMode mMode = gp->giveMaterialMode();
114  switch ( mMode ) {
115  case _3dMat:
116  giveInternalLength(answer, mode, gp, tStep);
117  break;
118  default:
119  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
120  }
121 }
122 
123 void
125 {
126  MaterialMode mMode = gp->giveMaterialMode();
127  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
128 }
129 
130 
131 void
133 {
134  double tempDam, beta, tempKappa, kappa;
135  FloatArray tempEffectiveStress, tempTensor2, prodTensor, plasFlowDirec;
136  FloatMatrix elasticity, compliance, SSaTensor, secondTerm, thirdTerm, tangentMatrix;
137  TrabBoneGrad3DStatus *status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
138 
139  if ( mode == ElasticStiffness ) {
140  this->constructAnisoComplTensor(compliance);
141  elasticity.beInverseOf(compliance);
142  answer = elasticity;
143  } else if ( mode == SecantStiffness ) {
144  if ( printflag ) {
145  printf("secant\n");
146  }
147 
148  this->constructAnisoComplTensor(compliance);
149  elasticity.beInverseOf(compliance);
150  tempDam = status->giveTempDam();
151  answer = elasticity;
152  answer.times(1.0 - tempDam);
153  } else if ( mode == TangentStiffness ) {
154  kappa = status->giveKappa();
155  tempKappa = status->giveTempKappa();
156  tempDam = status->giveTempDam();
157  if ( tempKappa > kappa ) {
158  // plastic loading
159  // Imports
160  tempEffectiveStress = status->giveTempEffectiveStress();
161  plasFlowDirec = status->givePlasFlowDirec();
162  SSaTensor = status->giveSSaTensor();
163  beta = status->giveBeta();
164  // Construction of the dyadic product tensor
165  prodTensor.beTProductOf(SSaTensor, plasFlowDirec);
166  // Construction of the tangent stiffness second term
167  tempTensor2.beProductOf(SSaTensor, plasFlowDirec);
168  secondTerm.beDyadicProductOf(tempTensor2, prodTensor);
169  secondTerm.times(-( 1.0 - tempDam ) / beta);
170  // Construction of the tangent stiffness
171  tangentMatrix = SSaTensor;
172  tangentMatrix.times(1.0 - tempDam);
173  tangentMatrix.add(secondTerm);
174  if ( tempDam > status->giveDam() ) {
175  double nlKappa = status->giveNonlocalCumulatedStrain();
176  kappa = mParam * nlKappa + ( 1. - mParam ) * tempKappa;
177  double gPrime = TrabBone3D :: computeDamageParamPrime(kappa);
178  // Construction of the tangent stiffness third term
179  thirdTerm.beDyadicProductOf(tempEffectiveStress, prodTensor);
180  thirdTerm.times(gPrime);
181  thirdTerm.times( ( 1. - mParam ) / beta );
182  tangentMatrix.add(thirdTerm);
183  }
184 
185  answer = tangentMatrix;
186  } else {
187  // elastic behavior with damage
188  // Construction of the secant stiffness
189  this->constructAnisoComplTensor(compliance);
190  elasticity.beInverseOf(compliance);
191  answer = elasticity;
192  answer.times(1.0 - tempDam);
193  }
194  }
195 
196  double g = status->giveDensG();
197  if ( g <= 0 ) {
198  double factor = gammaL0 * pow(rho, rL) + gammaP0 *pow(rho, rP) * ( tDens - 1 ) * pow(g, tDens - 2);
199  tangentMatrix.resize(6, 6);
200  tangentMatrix.zero();
201  tangentMatrix.at(1, 1) = tangentMatrix.at(1, 2) = tangentMatrix.at(1, 3) = 1;
202  tangentMatrix.at(2, 1) = tangentMatrix.at(2, 2) = tangentMatrix.at(2, 3) = 1;
203  tangentMatrix.at(3, 1) = tangentMatrix.at(3, 2) = tangentMatrix.at(3, 3) = 1;
204  tangentMatrix.times(factor);
205  answer.add(tangentMatrix);
206  }
207 
208  status->setSmtrx(answer);
209 }
210 
211 
212 
213 
214 void
216 {
217  answer.resize(1, 6);
218  answer.zero();
219  if ( mode == TangentStiffness ) {
220  TrabBoneGrad3DStatus *status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
221  double beta;
222  FloatArray plasFlowDirec, prodTensor;
223  FloatMatrix SSaTensor;
224 
225  double kappa = status->giveKappa();
226  double tempKappa = status->giveTempKappa();
227  double dKappa = tempKappa - kappa;
228 
229  if ( dKappa > 0.0 ) {
230  plasFlowDirec = status->givePlasFlowDirec();
231  SSaTensor = status->giveSSaTensor();
232  beta = status->giveBeta();
233  prodTensor.beTProductOf(SSaTensor, plasFlowDirec);
234  for ( int i = 1; i <= 6; i++ ) {
235  answer.at(1, i) = prodTensor.at(i);
236  }
237 
238  answer.times(1. / beta);
239  }
240  }
241 }
242 
243 
244 
245 void
247 {
248  answer.resize(6, 1);
249  answer.zero();
250  if ( mode == TangentStiffness ) {
251  TrabBoneGrad3DStatus *status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
252  double damage, tempDamage;
253  double nlKappa, kappa;
254  FloatArray tempEffStress;
255  double gPrime;
256  double tempKappa = status->giveTempKappa();
257  damage = status->giveDam();
258  nlKappa = status->giveNonlocalCumulatedStrain();
259  kappa = mParam * nlKappa + ( 1. - mParam ) * tempKappa;
260  tempDamage = TrabBone3D :: computeDamageParam(kappa);
261 
262 
263  if ( ( tempDamage - damage ) > 0 ) {
264  tempEffStress = status->giveTempEffectiveStress();
265  for ( int i = 1; i <= 6; i++ ) {
266  answer.at(i, 1) = tempEffStress.at(i);
267  }
268 
269  kappa = mParam * nlKappa + ( 1. - mParam ) * tempKappa;
271  answer.times(gPrime * mParam);
272  }
273  }
274 }
275 
276 void
278 {
279  answer.resize(1, 1);
280  answer.at(1, 1) = L;
281 }
282 
283 void
284 TrabBoneGrad3D :: giveRealStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalCumulatedStrain, TimeStep *tStep)
285 {
286  TrabBoneGrad3DStatus *status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
287 
288  this->initTempStatus(gp);
289 
290  TrabBone3D :: performPlasticityReturn(gp, totalStrain, tStep);
291 
292  double tempDamage = computeDamage(gp, tStep);
293  FloatArray tempEffStress = status->giveTempEffectiveStress();
294  answer1.beScaled(1 - tempDamage, tempEffStress);
295  answer2 = status->giveTempKappa();
296 
297 
298  if ( densCrit != 0 ) {
299  FloatArray densStress;
300  computeDensificationStress(densStress, gp, totalStrain, tStep);
301  answer1.add(densStress);
302  }
303 
304 
305  status->letTempStrainVectorBe(totalStrain);
306  status->setNonlocalCumulatedStrain(nonlocalCumulatedStrain);
307 
308  status->setTempDam(tempDamage);
309  status->setTempEffectiveStress(tempEffStress);
310  status->letTempStressVectorBe(answer1);
311 }
312 
313 
314 void
316 {
317  TrabBoneGrad3DStatus *status = static_cast< TrabBoneGrad3DStatus * >( this->giveStatus(gp) );
318  double localCumPlastStrain = status->giveTempKappa();
319  double nlCumPlastStrain = status->giveNonlocalCumulatedStrain();
320  kappa = mParam * nlCumPlastStrain + ( 1 - mParam ) * localCumPlastStrain;
321 }
322 
323 
326 {
327  IRResultType result; // Required by IR_GIVE_FIELD macro
328 
330  if ( L < 0.0 ) {
331  L = 0.0;
332  }
333 
334  mParam = 2.;
336 
337  return TrabBone3D :: initializeFrom(ir);
338 }
339 
340 
342  TrabBone3DStatus(n, d, g)
343 {
344  nlKappa = 0;
345 }
346 
347 
349 { }
350 
351 
352 void
354 {
356 }
357 
358 
359 void
361 {
363 }
364 
365 
366 void
368 {
370  this->kappa = this->tempKappa;
371  this->dam = this->tempDam;
372  this->tsed = this->tempTSED;
373  this->plasDef = this->tempPlasDef;
374  //TrabBone3DStatus :: updateYourself(tStep);
375 }
376 } // end namespace oofem
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: structuralms.C:96
virtual void computeCumPlastStrain(double &kappa, GaussPoint *gp, TimeStep *tStep)
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
virtual void giveRealStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalCumulatedStrain, TimeStep *tStep)
gradient - based giveRealStressVector
void give3dKappaMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
TrabBoneGrad3D(int n, Domain *d)
double beta
Parameter which multiplied with the interaction radius cl0 gives its minimum allowed value...
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Definition: structuralms.h:137
virtual void givePDGradMatrix_uk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Right upper block.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
void computeDensificationStress(FloatArray &answer, GaussPoint *gp, const FloatArray &totalStrain, TimeStep *tStep)
Definition: trabbone3d.C:635
Class and object Domain.
Definition: domain.h:115
const FloatArray & giveTempEffectiveStress() const
Definition: trabbone3d.C:1193
void performPlasticityReturn(GaussPoint *gp, const FloatArray &totalStrain, TimeStep *tStep)
Definition: trabbone3d.C:203
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void givePDGradMatrix_kk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Right lower block.
virtual void updateYourself(TimeStep *)
Update equilibrium history variables according to temp-variables.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
void giveInternalLength(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
double computeDamage(GaussPoint *gp, TimeStep *tStep)
Definition: trabbone3d.C:612
void constructAnisoComplTensor(FloatMatrix &answer)
Construct anisotropic compliance tensor.
Definition: trabbone3d.C:686
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
MatResponseMode
Describes the character of characteristic material matrix.
#define _IFT_TrabBoneGrad3D_m
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
Definition: floatarray.C:146
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
void setSmtrx(FloatMatrix &smt)
Definition: trabbone3d.h:146
#define OOFEM_ERROR(...)
Definition: error.h:61
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
Material interface for gradient material models.
double computeDamageParam(double kappa)
Definition: trabbone3d.C:582
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
Definition: floatarray.C:708
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
double computeDamageParamPrime(double kappa)
Definition: trabbone3d.C:596
void setTempDam(double da)
Definition: trabbone3d.h:139
double gammaL0
Densificator properties.
Definition: trabbone3d.h:177
virtual void givePDGradMatrix_uu(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Left upper block.
virtual void givePDGradMatrix_LD(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Stress-based averaging.
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual void setNonlocalCumulatedStrain(double nonlocalCumulatedStrain)
TrabBoneGrad3DStatus(int n, Domain *d, GaussPoint *g)
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: trabbone3d.C:1224
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
const FloatArray & givePlasFlowDirec() const
Definition: trabbone3d.C:1199
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
Definition: structuralms.h:135
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
const FloatMatrix & giveSSaTensor() const
Definition: trabbone3d.C:1217
void setTempEffectiveStress(FloatArray &sc)
Definition: trabbone3d.h:143
Class representing the general Input Record.
Definition: inputrecord.h:101
void add(const FloatMatrix &a)
Adds matrix to the receiver.
Definition: floatmatrix.C:1023
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
void beDyadicProductOf(const FloatArray &vec1, const FloatArray &vec2)
Assigns to the receiver the dyadic product .
Definition: floatmatrix.C:492
virtual double giveNonlocalCumulatedStrain()
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: trabbone3d.C:964
#define _IFT_TrabBoneGrad3D_L
This class implements associated Material Status to TrabBone3D (trabecular bone material).
Definition: trabbone3d.h:101
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
virtual void givePDGradMatrix_ku(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Left lower block.
REGISTER_Material(DummyMaterial)
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
the oofem namespace is to define a context or scope in which all oofem names are defined.
double nlKappa
Equivalent strain for avaraging.
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
Definition: material.C:267
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
Definition: floatmatrix.C:835
Gradient bone damage-plastic material status.
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
void give3dGprime(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: trabbone3d.C:1235
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.

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