OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
rankinematgrad.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 "rankinematgrad.h"
36 #include "stressvector.h"
37 #include "gausspoint.h"
38 #include "floatmatrix.h"
39 #include "floatarray.h"
40 #include "error.h"
41 #include "classfactory.h"
42 
43 namespace oofem {
45 // gradient regularization of Rankine plasticity
46 // coupled with isotropic damage
48 
49 REGISTER_Material(RankineMatGrad);
50 
51 // constructor
53 {
54  L = 0.;
55  negligible_damage = 0.;
56 }
57 
58 int
60 {
61  return mode == _PlaneStress;
62 }
63 
64 void
66 //
67 // Returns characteristic material matrix of the receiver
68 //
69 {
70  OOFEM_ERROR("Shouldn't be called.");
71 }
72 
73 void
75 {
76  MaterialMode mMode = gp->giveMaterialMode();
77  switch ( mMode ) {
78  case _PlaneStress:
79  givePlaneStressStiffMtrx(answer, mode, gp, tStep);
80  break;
81  default:
82  OOFEM_ERROR("mMode = %d not supported\n", mMode);
83  }
84 }
85 
86 void
88 {
89  MaterialMode mMode = gp->giveMaterialMode();
90  switch ( mMode ) {
91  case _PlaneStress:
92  givePlaneStressGprime(answer, mode, gp, tStep);
93  break;
94  default:
95  OOFEM_ERROR("mMode = %d not supported\n", mMode);
96  }
97 }
98 
99 void
101 {
102  MaterialMode mMode = gp->giveMaterialMode();
103  switch ( mMode ) {
104  case _PlaneStress:
105  givePlaneStressKappaMatrix(answer, mode, gp, tStep);
106  break;
107  default:
108  OOFEM_ERROR("mMode = %d not supported\n", mMode);
109  }
110 }
111 
112 
113 
114 void
116 {
117  MaterialMode mMode = gp->giveMaterialMode();
118  switch ( mMode ) {
119  case _PlaneStress:
120  giveInternalLength(answer, mode, gp, tStep);
121  break;
122  default:
123  OOFEM_ERROR("mMode = %d not supported\n", mMode);
124  }
125 }
126 
127 void
129 {
130  MaterialMode mMode = gp->giveMaterialMode();
131  OOFEM_ERROR("mMode = %d not supported\n", mMode);
132 }
133 
134 void
136 {
137  RankineMatGradStatus *status = static_cast< RankineMatGradStatus * >( this->giveStatus(gp) );
138  double tempDamage = status->giveTempDamage();
139  double damage = status->giveDamage();
140  double gprime;
141  // Note:
142  // The approximate solution of Helmholtz equation can lead
143  // to very small but nonzero nonlocal kappa at some points that
144  // are actually elastic. If such small values are positive,
145  // they lead to a very small but nonzero damage. If this is
146  // interpreted as "loading", the tangent terms are activated,
147  // but damage will not actually grow at such points and the
148  // convergence rate is slowed down. It is better to consider
149  // such points as elastic.
150  if ( tempDamage - damage <= negligible_damage ) {
151  gprime = 0.;
152  } else {
153  double nonlocalCumulatedStrain = status->giveNonlocalCumulatedStrain();
154  double tempLocalCumulatedStrain = status->giveTempCumulativePlasticStrain();
155  double overNonlocalCumulatedStrain = mParam * nonlocalCumulatedStrain + ( 1. - mParam ) * tempLocalCumulatedStrain;
156  gprime = computeDamageParamPrime(overNonlocalCumulatedStrain);
157  gprime *= ( 1. - mParam );
158  }
159 
160  evaluatePlaneStressStiffMtrx(answer, mode, gp, tStep, gprime);
161 }
162 
163 // derivative of kappa (result of stress return) wrt final strain
164 void
166 {
167  RankineMatGradStatus *status = static_cast< RankineMatGradStatus * >( this->giveStatus(gp) );
168  answer.resize(1, 3);
169  answer.zero();
170  if ( mode != TangentStiffness ) {
171  return;
172  }
173 
174  double tempKappa = status->giveTempCumulativePlasticStrain();
175  double dKappa = tempKappa - status->giveCumulativePlasticStrain();
176  if ( dKappa <= 0. ) {
177  return;
178  }
179 
180  FloatArray eta(3);
181  double dkap1 = status->giveDKappa(1);
182  double H = evalPlasticModulus(tempKappa);
183 
184  // evaluate in principal coordinates
185 
186  if ( dkap1 == 0. ) {
187  // regular case
188  double Estar = E / ( 1. - nu * nu );
189  double aux = Estar / ( H + Estar );
190  eta.at(1) = aux;
191  eta.at(2) = nu * aux;
192  eta.at(3) = 0.;
193  } else {
194  // vertex case
195  double dkap2 = status->giveDKappa(2);
196  double denom = E * dkap1 + H * ( 1. - nu ) * ( dkap1 + dkap2 );
197  eta.at(1) = E * dkap1 / denom;
198  eta.at(2) = E * dkap2 / denom;
199  eta.at(3) = 0.;
200  }
201 
202  // transform to global coordinates
203 
204  FloatArray sigPrinc(2);
205  FloatMatrix nPrinc(2, 2);
206  StressVector effStress(status->giveTempEffectiveStress(), _PlaneStress);
207  effStress.computePrincipalValDir(sigPrinc, nPrinc);
208 
209  FloatMatrix T(3, 3);
211  FloatArray etaglob(3);
212  etaglob.beProductOf(T, eta);
213 
214  answer.at(1, 1) = etaglob.at(1);
215  answer.at(1, 2) = etaglob.at(2);
216  answer.at(1, 3) = etaglob.at(3);
217 }
218 
219 // minus derivative of total stress wrt nonlocal kappa
220 void
222 {
223  answer.resize(3, 1);
224  answer.zero();
225  if ( mode != TangentStiffness ) {
226  return;
227  }
228 
229  RankineMatGradStatus *status = static_cast< RankineMatGradStatus * >( this->giveStatus(gp) );
230  double damage = status->giveDamage();
231  double tempDamage = status->giveTempDamage();
232  if ( tempDamage - damage <= negligible_damage ) {
233  return;
234  }
235 
236  double nonlocalCumulatedStrain = status->giveNonlocalCumulatedStrain();
237  double tempCumulatedStrain = status->giveTempCumulativePlasticStrain();
238  double overNonlocalCumulatedStrain = mParam * nonlocalCumulatedStrain + ( 1. - mParam ) * tempCumulatedStrain;
239  const FloatArray &tempEffStress = status->giveTempEffectiveStress();
240  answer.at(1, 1) = tempEffStress.at(1);
241  answer.at(2, 1) = tempEffStress.at(2);
242  answer.at(3, 1) = tempEffStress.at(3);
243  double gPrime = computeDamageParamPrime(overNonlocalCumulatedStrain);
244  answer.times(gPrime * mParam);
245 }
246 
247 void
249 {
250  answer.resize(1, 1);
251  answer.at(1, 1) = L;
252 }
253 
254 void
255 RankineMatGrad :: giveRealStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalCumulatedStrain, TimeStep *tStep)
256 {
257  RankineMatGradStatus *status = static_cast< RankineMatGradStatus * >( this->giveStatus(gp) );
258 
259  this->initTempStatus(gp);
260 
261  double tempDamage;
262  RankineMat :: performPlasticityReturn(gp, totalStrain);
263 
264  tempDamage = computeDamage(gp, tStep);
265  const FloatArray &tempEffStress = status->giveTempEffectiveStress();
266  answer1.beScaled(1.0 - tempDamage, tempEffStress);
267  answer2 = status->giveTempCumulativePlasticStrain();
268 
269  status->setNonlocalCumulatedStrain(nonlocalCumulatedStrain);
270  status->letTempStrainVectorBe(totalStrain);
271  status->setTempDamage(tempDamage);
272  status->letTempEffectiveStressBe(tempEffStress);
273  status->letTempStressVectorBe(answer1);
274 #ifdef keep_track_of_dissipated_energy
275  double gf = sig0 * sig0 / E; // only estimated, but OK for this purpose
276  status->computeWork_PlaneStress(gp, gf);
277 #endif
278  double knl = giveNonlocalCumPlasticStrain(gp);
279  double khat = mParam * knl + ( 1. - mParam ) * answer2;
280  status->setKappa_nl(knl);
281  status->setKappa_hat(khat);
282 }
283 
284 
285 void
287 {
288  RankineMatGradStatus *status = static_cast< RankineMatGradStatus * >( this->giveStatus(gp) );
289  double localCumPlastStrain = status->giveTempCumulativePlasticStrain();
290  double nlCumPlastStrain = status->giveNonlocalCumulatedStrain();
291  kappa = mParam * nlCumPlastStrain + ( 1. - mParam ) * localCumPlastStrain;
292 }
293 
294 double
296 {
297  RankineMatGradStatus *status = static_cast< RankineMatGradStatus * >( this->giveStatus(gp) );
298  return status->giveNonlocalCumulatedStrain();
299 }
300 
303 {
304  IRResultType result; // Required by IR_GIVE_FIELD macro
305 
307  if ( L < 0.0 ) {
308  L = 0.0;
309  }
310 
311  mParam = 2.;
313 
314  negligible_damage = 0.;
316 
317  return RankineMat :: initializeFrom(ir);
318 }
319 
320 
321 int
323 {
324  if ( type == IST_CumPlasticStrain_2 ) {
325  answer.resize(1);
326  answer.at(1) = giveNonlocalCumPlasticStrain(gp);
327  return 1;
328  } else if ( type == IST_MaxEquivalentStrainLevel ) {
329  answer.resize(1);
330  computeCumPlastStrain(answer.at(1), gp, tStep);
331  return 1;
332  } else {
333  return RankineMat :: giveIPValue(answer, gp, type, tStep);
334  }
335 }
336 
337 //=============================================================================
338 // GRADIENT RANKINE MATERIAL STATUS
339 //=============================================================================
340 
341 
343  RankineMatStatus(n, d, g)
344 {
346 }
347 
348 void
350 {
352 
353  fprintf(file, "status {");
354  fprintf(file, "damage %g, kappa %g, kappa_nl %g, kappa_hat %g", damage, kappa, kappa_nl, kappa_hat);
355 #ifdef keep_track_of_dissipated_energy
356  fprintf(file, ", dissW %g, freeE %g, stressW %g", this->dissWork, ( this->stressWork ) - ( this->dissWork ), this->stressWork);
357 #endif
358  fprintf(file, " }\n");
359 }
360 
361 
362 void
364 {
365  // RankineMatStatus::initTempStatus();
367 
368  if ( plasticStrain.giveSize() == 0 ) {
369  if ( gp->giveMaterialMode() == _PlaneStress ) {
371  } else if ( gp->giveMaterialMode() == _3dMat ) {
373  }
374 
376  }
377 
378  tempDamage = damage;
380  tempKappa = kappa;
381 
382  kappa_nl = 0.; // only containers
383  kappa_hat = 0.;
384 }
385 
386 
387 void
389 {
391 }
392 } // end namespace oofem
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
void givePlaneStressGprime(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
#define _IFT_RankineMatGrad_m
FloatArray plasticStrain
Plastic strain (initial).
Definition: rankinemat.h:200
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane stress stiffness matrix of receiver.
This class implements an isotropic elastoplastic material with Rankine yield condition, associated flow rule and linear isotropic softening, and with isotropic damage that leads to softening.
Definition: rankinemat.h:85
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Definition: structuralms.h:137
static void givePlaneStressVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 2d stress vector transformation matrix from standard vector transformation matrix...
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Definition: rankinemat.C:776
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
double tempKappa
Cumulative plastic strain (final).
Definition: rankinemat.h:215
GaussPoint * gp
Associated integration point.
Class and object Domain.
Definition: domain.h:115
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
double giveTempCumulativePlasticStrain()
Definition: rankinemat.h:254
void setKappa_hat(double kap)
virtual void giveRealStressVectorGrad(FloatArray &answer1, double &answer2, GaussPoint *gp, const FloatArray &totalStrain, double nonlocalCumulatedStrain, TimeStep *tStep)
gradient - based giveRealStressVector
virtual void givePDGradMatrix_LD(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Stress-based averaging.
double damage
Damage (initial).
Definition: rankinemat.h:225
RankineMatGradStatus(int n, Domain *d, GaussPoint *g)
void evaluatePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep, double gprime)
Executive method used by local and gradient version.
Definition: rankinemat.C:521
Specialization of a floating point array for representing a stress state.
Definition: stressvector.h:48
double sig0
Initial (uniaxial) yield stress.
Definition: rankinemat.h:107
Gradient rankine material status.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
const FloatArray & giveTempEffectiveStress() const
Definition: rankinemat.h:269
void computePrincipalValDir(FloatArray &answer, FloatMatrix &dir) const
Computes principal values and directions of receiver vector.
Definition: stressvector.C:182
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Definition: rankinemat.C:650
void givePlaneStressKappaMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
double stressWork
Density of total work done by stresses on strain increments.
Definition: rankinemat.h:235
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
virtual void givePDGradMatrix_ku(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Left lower block.
#define _IFT_RankineMatGrad_negligibleDamage
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.
void setKappa_nl(double kap)
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
RankineMatGrad(int n, Domain *d)
void computeWork_PlaneStress(GaussPoint *gp, double gf)
Computes the increment of total stress work and of dissipated work (gf is the dissipation density per...
Definition: rankinemat.C:879
void giveInternalLength(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
Definition: floatarray.C:146
virtual IRResultType initializeFrom(InputRecord *ir)
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual void computeCumPlastStrain(double &kappa, GaussPoint *gp, TimeStep *tStep)
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
Material interface for gradient material models.
double giveNonlocalCumPlasticStrain(GaussPoint *gp)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
double computeDamage(GaussPoint *gp, TimeStep *tStep)
Definition: rankinemat.C:470
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
#define _IFT_RankineMatGrad_L
double giveCumulativePlasticStrain()
Definition: rankinemat.h:253
virtual void givePDGradMatrix_uk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Right upper block.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
Class representing vector of real numbers.
Definition: floatarray.h:82
void setTempDamage(double value)
Definition: rankinemat.h:284
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
void performPlasticityReturn(GaussPoint *gp, const FloatArray &totalStrain)
Definition: rankinemat.C:283
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
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 giveDKappa(int i)
Definition: rankinemat.h:256
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: rankinemat.C:81
virtual void givePDGradMatrix_uu(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Left upper block.
double computeDamageParamPrime(double tempKappa)
Definition: rankinemat.C:453
double E
Young&#39;s modulus.
Definition: rankinemat.h:92
virtual void setNonlocalCumulatedStrain(double nonlocalCumulatedStrain)
virtual void givePDGradMatrix_kk(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Right lower block.
double kappa
Cumulative plastic strain (initial).
Definition: rankinemat.h:212
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: structuralms.C:108
FloatArray tempPlasticStrain
Plastic strain (final).
Definition: rankinemat.h:203
double dissWork
Density of dissipated work.
Definition: rankinemat.h:239
virtual double giveNonlocalCumulatedStrain()
REGISTER_Material(DummyMaterial)
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
the oofem namespace is to define a context or scope in which all oofem names are defined.
#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
double evalPlasticModulus(const double kappa)
Definition: rankinemat.C:261
double nu
Poisson&#39;s ratio.
Definition: rankinemat.h:95
void letTempEffectiveStressBe(FloatArray values)
Definition: rankinemat.h:275
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
double tempDamage
Damage (final).
Definition: rankinemat.h:228
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:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011