OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
druckerpragercutmat.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 "druckerpragercutmat.h"
37 #include "floatmatrix.h"
38 #include "floatarray.h"
39 #include "gausspoint.h"
40 #include "mathfem.h"
41 #include "contextioerr.h"
42 #include "datastream.h"
43 #include "classfactory.h"
44 
45 namespace oofem {
46 REGISTER_Material(DruckerPragerCutMat);
47 
48 // constructor
50 {
52  this->nsurf = 4;
53  this->rmType = mpm_CuttingPlane;
54  // this->rmType = mpm_ClosestPoint;
55 
56  this->plType = nonassociatedPT; // Rankine associated, DP nonassociated
57 
58  sigT = 0.;
59  H = 0.;
60  omegaCrit = 0.;
61  a = 0.;
62  yieldTol = 0.;
63  newtonIter = 30;
64  G = 0.;
65  K = 0.;
66 }
67 
68 // destructor
70 { }
71 
72 // specifies whether a given material mode is supported by this model
73 int
75 {
76  return mode == _3dMat || mode == _PlaneStrain;
77 }
78 
79 // reads the model parameters from the input file
82 {
83  IRResultType result; // required by IR_GIVE_FIELD macro
84 
86  if ( result != IRRT_OK ) return result;
87  result = linearElasticMaterial->initializeFrom(ir); // takes care of elastic constants
88  if ( result != IRRT_OK ) return result;
89 
90  G = static_cast< IsotropicLinearElasticMaterial * >(linearElasticMaterial)->giveShearModulus();
91  K = static_cast< IsotropicLinearElasticMaterial * >(linearElasticMaterial)->giveBulkModulus();
92 
93  IR_GIVE_FIELD(ir, tau0, _IFT_DruckerPragerCutMat_tau0); // initial yield stress under pure shear (DP model)
94  IR_GIVE_FIELD(ir, sigT, _IFT_DruckerPragerCutMat_sigT); // uniaxial tensile strength for cut-off, (Rankine plasticity model)
95  IR_GIVE_FIELD(ir, alpha, _IFT_DruckerPragerCutMat_alpha); // friction coefficient (DP model)
96  alphaPsi = alpha;
97  IR_GIVE_OPTIONAL_FIELD(ir, alphaPsi, _IFT_DruckerPragerCutMat_alphapsi); //dilatancy coefficient (DP model)
98  IR_GIVE_OPTIONAL_FIELD(ir, H, _IFT_DruckerPragerCutMat_h); // hardening modulus (DP model)
100  IR_GIVE_OPTIONAL_FIELD(ir, a, _IFT_DruckerPragerCutMat_a); // exponent in damage law
101  IR_GIVE_OPTIONAL_FIELD(ir, yieldTol, _IFT_DruckerPragerCutMat_yieldTol); //tolerance of the error in the yield criterion
102  IR_GIVE_OPTIONAL_FIELD(ir, newtonIter, _IFT_DruckerPragerCutMat_newtonIter); //Maximum number of iterations in lambda search
103 
104  return IRRT_OK;
105 }
106 
107 
110 {
111  return new MPlasticMaterial2Status(1, this->giveDomain(), gp, this->giveSizeOfReducedHardeningVarsVector(gp));
112 }
113 
114 double
115 DruckerPragerCutMat :: computeYieldValueAt(GaussPoint *gp, int isurf, const FloatArray &stressVector, const FloatArray &strainSpaceHardeningVariables)
116 {
117  //strainSpaceHardeningVariables = kappa
118  if ( isurf <= 3 ) { //Rankine, surfaces 1,2,3
119  FloatArray princStress(3);
120  this->computePrincipalValues(princStress, stressVector, principal_stress);
121  return princStress.at(isurf) - this->sigT;
122  } else { //Drucker-Prager, surface 4
123  double volumetricStress;
124  double DPYieldStressInShear = tau0 + H *strainSpaceHardeningVariables.at(4);
125  double JTwo;
126  FloatArray deviatoricStress;
127 
128  volumetricStress = this->computeDeviatoricVolumetricSplit(deviatoricStress, stressVector);
129  JTwo = computeSecondStressInvariant(deviatoricStress);
130  return 3. * alpha * volumetricStress + sqrt(JTwo) - DPYieldStressInShear;
131  }
132 }
133 
134 //associated and nonassociated flow rule
135 void
136 DruckerPragerCutMat :: computeStressGradientVector(FloatArray &answer, functType ftype, int isurf, GaussPoint *gp, const FloatArray &stressVector, const FloatArray &stressSpaceHardeningVars)
137 {
138  FloatArray princStress(3);
139  FloatMatrix t(3, 3);
140 
141  // compute principal stresses and their directions
142  this->computePrincipalValDir(princStress, t, stressVector, principal_stress);
143 
144  // derivation through stress transformation matrix. The transformation matrix is stored in t columnwise
145  answer.resize(6);
146  if ( isurf <= 3 ) { //Rankine associated
147  answer.at(1) = t.at(1, isurf) * t.at(1, isurf); //xx = 11
148  answer.at(2) = t.at(2, isurf) * t.at(2, isurf); //yy = 22
149  answer.at(3) = t.at(3, isurf) * t.at(3, isurf); //zz = 33
150  answer.at(4) = t.at(2, isurf) * t.at(3, isurf); //yz = 23
151  answer.at(5) = t.at(1, isurf) * t.at(3, isurf); //xz = 13
152  answer.at(6) = t.at(1, isurf) * t.at(2, isurf); //xy = 12
153  } else { //DP nonassociated
154  double sqrtJTwo;
155  FloatArray deviatoricStress;
156 
157  this->computeDeviatoricVolumetricSplit(deviatoricStress, stressVector);
158  sqrtJTwo = sqrt( computeSecondStressInvariant(deviatoricStress) );
159 
160  answer.at(1) = alphaPsi + deviatoricStress.at(1) / 2. / sqrtJTwo;
161  answer.at(2) = alphaPsi + deviatoricStress.at(2) / 2. / sqrtJTwo;
162  answer.at(3) = alphaPsi + deviatoricStress.at(3) / 2. / sqrtJTwo;
163  answer.at(4) = stressVector.at(4) / sqrtJTwo;
164  answer.at(5) = stressVector.at(5) / sqrtJTwo;
165  answer.at(6) = stressVector.at(6) / sqrtJTwo;
166  }
167 }
168 
169 //necesarry only for mpm_ClosestPoint, see Jirasek: Inelastic analysis of structures, pp. 411.
170 //Hessian matrix
171 void
172 DruckerPragerCutMat :: computeReducedSSGradientMatrix(FloatMatrix &gradientMatrix, int isurf, GaussPoint *gp, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)
173 {
174  switch ( gp->giveMaterialMode() ) {
175  case _3dMat:
176  gradientMatrix.resize(6, 6);
177  break;
178  case _PlaneStrain:
179  gradientMatrix.resize(4, 4);
180  break;
181  default:
182  OOFEM_ERROR("Unknown material mode (%s)", __MaterialModeToString( gp->giveMaterialMode() ) );
183  }
184 
185  gradientMatrix.zero();
186 
187  if ( isurf == 4 ) {
188  double c1 = 0.;
189  FloatArray deviatoricStress;
190  double JTwo, sqrtJTwo;
191 
192  computeDeviatoricVolumetricSplit(deviatoricStress, fullStressVector);
193  JTwo = computeSecondStressInvariant(deviatoricStress);
194  sqrtJTwo = sqrt(JTwo);
195 
196  if ( gp->giveMaterialMode() == _3dMat ) {
197  for ( int i = 1; i <= 6; i++ ) {
198  for ( int j = i; j <= 6; j++ ) {
199  if ( ( i == 1 && j == 1 ) || ( i == 2 && j == 2 ) || ( i == 3 && j == 3 ) ) {
200  c1 = 2 / 3.;
201  } else if ( ( i == 4 && j == 4 ) || ( i == 5 && j == 5 ) || ( i == 6 && j == 6 ) ) {
202  c1 = 1.;
203  } else if ( i <= 3 && j <= 3 ) {
204  c1 = -1 / 3.;
205  } else {
206  c1 = 0;
207  }
208  gradientMatrix.at(i, j) = 0.5 / JTwo * ( c1 * sqrtJTwo - deviatoricStress.at(i) * deviatoricStress.at(j) / 2. / sqrtJTwo );
209  }
210  }
211  gradientMatrix.symmetrized();
212  } else if ( gp->giveMaterialMode() == _PlaneStrain ) {
213  for ( int i = 1; i <= 4; i++ ) {
214  for ( int j = i; j <= 4; j++ ) {
215  if ( ( i == 1 && j == 1 ) || ( i == 2 && j == 2 ) || ( i == 3 && j == 3 ) ) {
216  c1 = 2 / 3.;
217  } else if ( ( i == 4 && j == 4 ) ) {
218  c1 = 1.;
219  } else if ( i <= 3 && j <= 3 ) {
220  c1 = -1 / 3.;
221  } else {
222  c1 = 0;
223  }
224  gradientMatrix.at(i, j) = 0.5 / JTwo * ( c1 * sqrtJTwo - deviatoricStress.at(i) * deviatoricStress.at(j) / 2. / sqrtJTwo );
225  }
226  }
227  gradientMatrix.symmetrized();
228  } else {
229  OOFEM_ERROR("Unknown material mode (%s)", __MaterialModeToString( gp->giveMaterialMode() ) );
230  }
231  }
232 }
233 
234 
235 void
237  GaussPoint *gp,
238  TimeStep *tStep)
239 { /* Returns elastic moduli in reduced stress-strain space*/
240  this->giveLinearElasticMaterial()->giveStiffnessMatrix(answer, ElasticStiffness, gp, tStep);
241 }
242 
243 //answer is dkappa (cumulative plastic strain), flow rule
244 void DruckerPragerCutMat :: computeStrainHardeningVarsIncrement(FloatArray &answer, GaussPoint *gp, const FloatArray &stress, const FloatArray &dlambda, const FloatArray &dplasticStrain, const IntArray &activeConditionMap)
245 {
246  answer.resize(4);
247  answer.zero();
248 
249  if ( dlambda.at(4) > 0. ) {
250  answer.at(4) = dlambda.at(4) * sqrt(1. / 3. + 2 * alphaPsi * alphaPsi);
251  }
252 }
253 
254 // Computes the derivative of yield/loading function with respect to kappa_1, kappa_2 etc.
255 void DruckerPragerCutMat :: computeKGradientVector(FloatArray &answer, functType ftype, int isurf, GaussPoint *gp, FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)
256 {
257  answer.resize(1); //1 hardening variable for DP model - kappa
258  answer.zero();
259 
260  if ( isurf == 4 ) {
261  answer.at(1) = this->H;
262  }
263 }
264 
265 //necesarry only for mpm_ClosestPoint
266 //Computes second mixed derivative of loading function with respect to stress and hardening vars.
267 void DruckerPragerCutMat :: computeReducedSKGradientMatrix(FloatMatrix &gradientMatrix, int isurf, GaussPoint *gp, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)
268 {
270  gradientMatrix.resize(size, 1); //six stresses in 3D and one kappa
271  gradientMatrix.zero();
272 }
273 
274 // computes dKappa_i/dsig_j gradient matrix
275 void DruckerPragerCutMat :: computeReducedHardeningVarsSigmaGradient(FloatMatrix &answer, GaussPoint *gp, const IntArray &activeConditionMap, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVars, const FloatArray &dlambda)
276 {
278  answer.resize(1, size);
279  answer.zero();
280 }
281 
282 // computes dKappa_i/dLambda_j for one surface
283 void DruckerPragerCutMat :: computeReducedHardeningVarsLamGradient(FloatMatrix &answer, GaussPoint *gp, int actSurf, const IntArray &activeConditionMap, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVars, const FloatArray &dlambda)
284 {
285  int indx;
286  answer.resize(1, actSurf); //actSurf = number of active surfaces
287  answer.zero();
288 
289  if ( ( indx = activeConditionMap.at(4) ) ) {
290  if ( dlambda.at(4) > 0. ) {
291  answer.at(1, indx) = sqrt(1. / 3. + 2 * alphaPsi * alphaPsi);
292  }
293  }
294 }
295 
296 
297 int
299 {
300  //MaterialStatus *status = this->giveStatus(gp);
301  if ( type == IST_DamageScalar ) {
302  answer.resize(1);
303  answer.zero();
305  //answer.at(1) = status->giveDamage();
306  return 1;
307  } else if ( type == IST_DamageTensor ) {
308  answer.resize(6);
309  answer.zero();
310  //answer.at(1) = answer.at(2) = answer.at(3) = status->giveDamage();
311  return 1;
312  } else {
313  return MPlasticMaterial2 :: giveIPValue(answer, gp, type, tStep);
314  }
315 }
316 } // end namespace oofem
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
static void computePrincipalValues(FloatArray &answer, const FloatArray &s, stressStrainPrincMode mode)
Common functions for convenience.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
#define _IFT_DruckerPragerCutMat_omegaCrit
Critical damage.
virtual int giveSizeOfReducedHardeningVarsVector(GaussPoint *) const
Class and object Domain.
Definition: domain.h:115
LinearElasticMaterial * linearElasticMaterial
Reference to bulk (undamaged) material.
For computing principal stresses.
double tau0
Initial yield stress under pure shear.
LinearElasticMaterial * giveLinearElasticMaterial()
Returns a reference to the basic elastic material.
#define _IFT_DruckerPragerCutMat_alpha
Friction coefficient (DP model)
int nsurf
Number of yield surfaces.
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void computeReducedSKGradientMatrix(FloatMatrix &gradientMatrix, int isurf, GaussPoint *gp, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)
computes mixed derivative of load function with respect to stress and hardening variables ...
virtual void computeStressGradientVector(FloatArray &answer, functType ftype, int isurf, GaussPoint *gp, const FloatArray &stressVector, const FloatArray &stressSpaceHardeningVars)
Computes the stress gradient of yield/loading function (df/d_sigma).
#define _IFT_DruckerPragerCutMat_yieldTol
Tolerance of the error in the yield criterion.
virtual void computeReducedElasticModuli(FloatMatrix &answer, GaussPoint *gp, TimeStep *tStep)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void computeKGradientVector(FloatArray &answer, functType ftype, int isurf, GaussPoint *gp, FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)
Computes the derivative of yield/loading function with respect to kappa_1, kappa_2 etc...
#define _IFT_DruckerPragerCutMat_tau0
Initial yield stress under pure shear (DP model)
enum oofem::MPlasticMaterial2::plastType plType
virtual void computeReducedHardeningVarsSigmaGradient(FloatMatrix &answer, GaussPoint *gp, const IntArray &activeConditionMap, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVars, const FloatArray &dlambda)
computes dk(i)/dsig(j) gradient matrix
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
DruckerPragerCutMat(int n, Domain *d)
virtual void computeReducedSSGradientMatrix(FloatMatrix &gradientMatrix, int isurf, GaussPoint *gp, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVariables)
Computes second derivative of yield/loading function with respect to stress.
This class implements associated Material Status to MPlasticMaterial.
static void computePrincipalValDir(FloatArray &answer, FloatMatrix &dir, const FloatArray &s, stressStrainPrincMode mode)
Computes principal values and directions of stress or strain vector.
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
functType
Type that allows to distinguish between yield function and loading function.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
double a
Parameter for damage computation from cumulative plastic strain.
virtual void computeStrainHardeningVarsIncrement(FloatArray &answer, GaussPoint *gp, const FloatArray &stress, const FloatArray &dlambda, const FloatArray &dplasticStrain, const IntArray &activeConditionMap)
Compute dot(kappa_1), dot(kappa_2) etc.
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
double yieldTol
Tolerance of the error in the yield criterion.
#define _IFT_DruckerPragerCutMat_a
Exponent in damage law.
#define _IFT_DruckerPragerCutMat_sigT
Uniaxial tensile strength for cut-off, (Rankine plasticity model)
double omegaCrit
Maximum damage value.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
This class implements an isotropic linear elastic material in a finite element problem.
#define OOFEM_ERROR(...)
Definition: error.h:61
enum oofem::MPlasticMaterial2::ReturnMappingAlgoType rmType
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
Abstract base class representing a material status information.
Definition: matstatus.h:84
virtual void computeReducedHardeningVarsLamGradient(FloatMatrix &answer, GaussPoint *gp, int actSurf, const IntArray &activeConditionMap, const FloatArray &fullStressVector, const FloatArray &strainSpaceHardeningVars, const FloatArray &dlambda)
computes dKappa_i/dLambda_j
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
double H
Hardening modulus.
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
static double computeSecondStressInvariant(const FloatArray &s)
Class representing the general Input Record.
Definition: inputrecord.h:101
#define _IFT_DruckerPragerCutMat_h
Hardening modulus (DP model)
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
double alpha
Friction coefficient.
static double computeDeviatoricVolumetricSplit(FloatArray &dev, const FloatArray &s)
Computes split of receiver into deviatoric and volumetric part.
double alphaPsi
Dilatancy coefficient (allowing non-associated plasticity).
double G
Elastic shear modulus.
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
Domain * giveDomain() const
Definition: femcmpnn.h:100
#define _IFT_DruckerPragerCutMat_alphapsi
REGISTER_Material(DummyMaterial)
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
#define _IFT_DruckerPragerCutMat_newtonIter
Maximum number of iterations in lambda search.
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
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
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
Definition: floatmatrix.C:1576
virtual double computeYieldValueAt(GaussPoint *gp, int isurf, const FloatArray &stressVector, const FloatArray &strainSpaceHardeningVariables)
Computes the value of yield function.
int newtonIter
Maximum number of iterations in lambda search.
double sigT
Uniaxial tensile strength for cut-off.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
Class representing solution step.
Definition: timestep.h:80
This class represents a base class for non-associated multisurface plasticity.
double K
Elastic bulk modulus.
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:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011