NeoPZ
TPZSandlerDimaggio.h
Go to the documentation of this file.
1 
5 #ifndef TPZSANDLERDIMAGGIO_H
6 #define TPZSANDLERDIMAGGIO_H
7 
8 #include "pzlog.h"
9 #include "TPZPlasticStep.h"
10 #include "TPZYCSandlerDimaggioL.h"
11 #include "TPZYCSandlerDimaggioL2.h"
13 #include "TPZElasticResponse.h"
14 #include "pzvec_extras.h"
15 #include "TPZPlasticStepID.h"
21 
22 #define SANDLERDIMAGGIOSTEP1 TPZPlasticStep<TPZYCSandlerDimaggioL, TPZSandlerDimaggioThermoForceA, TPZElasticResponse>
23 #define SANDLERDIMAGGIOSTEP1TRANSLATOR TPZPlasticStepTranslator<TPZYCSandlerDimaggioLTranslator, TPZSandlerDimaggioThermoForceATranslator, TPZElasticResponseTranslator>
24 #define SANDLERDIMAGGIOSTEP2 TPZPlasticStep<TPZYCSandlerDimaggioL2, TPZSandlerDimaggioThermoForceA, TPZElasticResponse>
25 #define SANDLERDIMAGGIOSTEP2TRANSLATOR TPZPlasticStepTranslator<TPZYCSandlerDimaggioL2Translator, TPZSandlerDimaggioThermoForceATranslator, TPZElasticResponseTranslator>
26 
27 
28 template<class SANDLERDIMAGGIOPARENT>
29 class TPZSandlerDimaggio : public SANDLERDIMAGGIOPARENT {
30 
31 public:
32 
34 
35 public:
36 
37  TPZSandlerDimaggio(REAL alpha=0./*-1.e-9*/):SANDLERDIMAGGIOPARENT(alpha) // avoiding nan
38  {
39  this->fMaterialTensionSign = 1;//Quando este numero for positivo carremento de compressao e negativo
40 
41  }
42 
43  TPZSandlerDimaggio(const TPZSandlerDimaggio & source):SANDLERDIMAGGIOPARENT(source)
44  {
45  this->fMaterialTensionSign = 1;
46  }
47 
49  {
50  this->fMaterialTensionSign = 1;
51  SANDLERDIMAGGIOPARENT::operator=(source);
52 
53  return *this;
54  }
55 
56  virtual const char * Name() const override
57  {
58  return "TPZSandlerDimaggio";
59  }
60 
61  virtual void Print(std::ostream & out) const override
62  {
63  out << "\n" << this->Name();
64  out << "\n Base Class Data:\n";
65  SANDLERDIMAGGIOPARENT::Print(out);
66  out << "\nTPZSandlerDimaggio internal members: None";
67  }
68 
69  int ClassId() const override;
70 
71 
72  void Write(TPZStream &buf, int withclassid) const override{
73  SANDLERDIMAGGIOPARENT::Write(buf, withclassid);
74  // fPlasticMem does not need to be stored
75 
76  }
77 
78  void Read(TPZStream& buf, void* context) override {
79  SANDLERDIMAGGIOPARENT::Read(buf, context);
80  this->fPlasticMem.Resize(0);
81  }
82 
93  void SetUp(REAL poisson, REAL E,
94  REAL A, REAL B, REAL C, REAL R,
95  REAL D, REAL W)
96  {
97  SANDLERDIMAGGIOPARENT::fYC.SetUp(A, B, C, D, R, W);
98  SANDLERDIMAGGIOPARENT::fN.m_hardening = this->fYC.InitialDamage();
99  SANDLERDIMAGGIOPARENT::fER.SetEngineeringData(E, poisson);
100  }
101  virtual void SetUp(const TPZTensor<REAL> & epsTotal) override {
102  SANDLERDIMAGGIOPARENT::SetUp(epsTotal);
103  }
104 
108  virtual TPZPlasticState<REAL> GetState() const override
109  {
110  return SANDLERDIMAGGIOPARENT::GetState();
111  }
112 
119  virtual void ApplyLoad(const TPZTensor<REAL> & sigma, TPZTensor<REAL> &epsTotal) override
120  {
121  SANDLERDIMAGGIOPARENT::ApplyLoad_Internal(sigma, epsTotal);
122  }
123 
127  virtual void ApplyStrain(const TPZTensor<REAL> &epsTotal) override
128  {
129  SANDLERDIMAGGIOPARENT::ApplyStrain_Internal(epsTotal);
130  }
131 
136  virtual void ApplyStrainComputeDep(const TPZTensor<REAL> &epsTotal, TPZTensor<REAL> &sigma, TPZFMatrix<REAL> &Dep) override
137  {
138 
139  SANDLERDIMAGGIOPARENT::ApplyStrainComputeDep_Internal(epsTotal, sigma, Dep);
140 
141  }
142 
143  virtual void ApplyStrainComputeSigma(const TPZTensor<REAL> &epsTotal, TPZTensor<REAL> &sigma, TPZFMatrix<REAL> * tangent = NULL) override
144  {
145  bool require_tangent_Q = true;
146  if (!tangent) {
147  require_tangent_Q = false;
148  }
149 
150 #ifdef PZDEBUG
151  // Check for required dimensions of tangent
152  if (!(tangent->Rows() == 6 && tangent->Cols() == 6)) {
153  std::cerr << "Unable to compute the tangent operator. Required tangent array dimensions are 6x6." << std::endl;
154  DebugStop();
155  }
156 #endif
157 
158  SANDLERDIMAGGIOPARENT::ApplyStrainComputeSigma_Internal(epsTotal, sigma);
159  }
160 
166  virtual void Phi(const TPZTensor<REAL> &epsTotal, TPZVec<REAL> &phi) const override
167  {
168  SANDLERDIMAGGIOPARENT::Phi_Internal(epsTotal, phi);
169  }
170 
171  virtual int GetNYield() const {
172  return as_integer(NYield);
173  }
174 
175 protected:
183  virtual void ComputeDep(TPZTensor<REAL> & sigma, TPZFMatrix<REAL> &Dep) override
184  {
185  const int nyield = this->fYC.NYield;
186 
187  SANDLERDIMAGGIOPARENT::ComputeDep(sigma, Dep);
188 
189  TPZManVector<REAL,3> plastifLen(nyield, 0.);
190  int n = this->fPlasticMem.NElements();
191  REAL deltaAlpha = fabs(this->fPlasticMem[n-1].m_elastoplastic_state.m_hardening - this->fPlasticMem[1].m_elastoplastic_state.m_hardening);
192 
193  this->IntegrationOverview(plastifLen);
194 
195  // if the plastification ocurred mainly in the first (0th) yield function, which is
196  // perfectly plastic, then the stiffness matrix may be singular.
197  if( (plastifLen[0] > 0.9 && plastifLen[1] < 0.1) ||
198  (plastifLen[0] < 1.e-10 && plastifLen[1] > 0.9 && deltaAlpha < 1.e-10) )
199  {
200  TPZFNMatrix<6*6> D(6,6,0.);
201 
202  SANDLERDIMAGGIOPARENT::fER.De(D);
203 
204  Dep.ZAXPY(0.01, D);
205 
206  #ifdef LOG4CXX_PLASTICITY
207  {
208  LoggerPtr logger(Logger::getLogger("plasticity.SandlerDimaggio"));
209  std::stringstream sout;
210  sout << "*** TPZYCSandlerDimaggio::ComputeDep *** Superimposing a fraction of the Elastic Stiffness Matrix on a perfectly plastic load";
211  cout << "\nfPlasticLen = " << plastifLen << " deltaAlpha = " << deltaAlpha;
212  LOGPZ_WARN(logger,sout.str().c_str());
213  }
214  #endif
215  }
216 
217  }
218 
219 public:
220 
221 
222 // The following static members load test data from article
223 // setup with data from McCormic Ranch Sand
224 // Dimaggio, Frank L. Sandler, Ivan S. Material model for granular soils
225 // J. of the Eng. Mech. Div. vol. 97 n0 EM3
226 // pp 935-949,1971
227 
228 static void McCormicRanchSand(TPZSandlerDimaggio & material)
229  {
230  #ifdef LOG4CXX_PLASTICITY
231  LoggerPtr loggerSandlerDimaggio(Logger::getLogger("plasticity.SandlerDimaggio"));
232  {
233  std::stringstream sout;
234  sout << ">>> TPZSandlerDimaggio::McCormicRanchSand ***";
235  LOGPZ_INFO(loggerSandlerDimaggio,sout.str().c_str());
236  }
237  #endif
238 
239  REAL E = 100, //ksi = 689 MPa
240  poisson = /*0.25;*/ 0.25; // In the 1971 article, although
241  // the authors documented a poisson coeff. of 0.25
242  // they seem to have used a poisson of 0.40, as
243  // calculated in the unloading cycle of the uniaxial
244  // strain test.
246  material.fER.SetUp(E, poisson);
247 
248  material.fResTol = 1.e-12;
249  material.fIntegrTol = 1.e-6;
250 
251  }
252 
253  static void McCormicRanchSandMod(TPZSandlerDimaggio & material)
254  {
255  #ifdef LOG4CXX_PLASTICITY
256  LoggerPtr loggerSandlerDimaggio(Logger::getLogger("plasticity.SandlerDimaggio"));
257  {
258  std::stringstream sout;
259  sout << ">>> TPZSandlerDimaggio::McCormicRanchSand ***";
260  LOGPZ_INFO(loggerSandlerDimaggio,sout.str().c_str());
261  }
262  #endif
263 
264  REAL E = 100, //ksi
265  poisson = /*0.25;*/ 0.40; // In the 1971 article, although
266  // the authors documented a poisson coeff. of 0.25
267  // they seem to have used a poisson of 0.40, as
268  // calculated in the unloading cycle of the uniaxial
269  // strain test.
271  material.fER.SetUp(E, poisson);
272 
273  }
274 
276  {
277  #ifdef LOG4CXX_PLASTICITY
278  LoggerPtr loggerSandlerDimaggio(Logger::getLogger("plasticity.SandlerDimaggio"));
279  {
280  std::stringstream sout;
281  sout << ">>> TPZSandlerDimaggio::McCormicRanchSand ***";
282  LOGPZ_INFO(loggerSandlerDimaggio,sout.str().c_str());
283  }
284  #endif
285 
286  REAL E = 100, //ksi
287  poisson = /*0.25;*/ 0.40; // In the 1971 article, although
288  // the authors documented a poisson coeff. of 0.25
289  // they seem to have used a poisson of 0.40, as
290  // calculated in the unloading cycle of the uniaxial
291  // strain test.
292 
293  material.fER.SetUp(E, poisson);
294 
295  REAL A = 0.25,
296  B = 0.67,
297  C = 0.18,
298  D = 0.67 / 2., //letting the material behave stronger to enable higher loads without too much volumetric plastic strain
299  R = 2.5,
300  W = 0.066;
301 
302  material.fYC.SetUp(A, B, C, D, R, W);
303  }
304 
305  static void UncDeepSandRes(TPZSandlerDimaggio & material)
306  {
307  #ifdef LOG4CXX_PLASTICITY
308  LoggerPtr loggerSandlerDimaggio(Logger::getLogger("plasticity.SandlerDimaggio"));
309  {
310  std::stringstream sout;
311  sout << ">>> TPZSandlerDimaggio::Unconsolidated Deep Sandstone Reservoir ***";
312  LOGPZ_INFO(loggerSandlerDimaggio,sout.str().c_str());
313  }
314  #endif
315 
316  REAL E = 1305, //ksi (9000MPa)
317  poisson = 0.25;
318 
319  material.fER.SetUp(E, poisson);
320 
321  REAL A = 2.61, //ksi = 18 in MPa
322  B = 0.169, // ksi 0.0245 in MPa
323  C = 2.57, // ksi = 17.7 in MPa
324  D = 0.05069, // = 0.00735 in MPa
325  R = 1.5,
326  W = 0.0908;
327 
328  material.fYC.SetUp(A, B, C, D, R, W);
329  }
330 
331  static void UncDeepSandTest(TPZSandlerDimaggio & material)
332  {
333 #ifdef LOG4CXX_PLASTICITY
334  LoggerPtr loggerSandlerDimaggio(Logger::getLogger("plasticity.SandlerDimaggio"));
335  {
336  std::stringstream sout;
337  sout << ">>> TPZSandlerDimaggio::Unconsolidated Deep Sandstone Reservoir ***";
338  LOGPZ_INFO(loggerSandlerDimaggio,sout.str().c_str());
339  }
340 #endif
341 
342  REAL E = 1305, //ksi (9000MPa)
343  poisson = 0.25;
344 
345 // material.fER.SetUp(E, poisson);
346 
347  REAL A = 10.,//2.61, //ksi = 18 in MPa
348  B = 0.169, // ksi 0.0245 in MPa
349  C = 2.57, // ksi = 17.7 in MPa
350  D = 0.05069, // = 0.00735 in MPa
351  R = 1.5,
352  W = 0.0908;
353 
354 // material.fYC.SetUp(A, B, C, D, R, W);
355  material.SetUp(poisson, E, A, B, C, R, D, W);
356  }
357 
358  static void UncDeepSandResPSI(TPZSandlerDimaggio & material)
359  {
360  #ifdef LOG4CXX_PLASTICITY
361  LoggerPtr loggerSandlerDimaggio(Logger::getLogger("plasticity.SandlerDimaggio"));
362  {
363  std::stringstream sout;
364  sout << ">>> TPZSandlerDimaggio::Unconsolidated Deep Sandstone Reservoir ***";
365  LOGPZ_INFO(loggerSandlerDimaggio,sout.str().c_str());
366  }
367  #endif
368 
369  REAL E = 1305000, //psi (9000MPa)
370  poisson = 0.25;
371 
372  material.fER.SetUp(E, poisson);
373 
374  REAL A = 2610, //psi = 18 in MPa
375  B = 0.000169, // psi 0.0245 in MPa
376  C = 2570, // psi = 17.7 in MPa
377  D = 0.00005069, // = 0.00735 in MPa
378  R = 1.5,
379  W = 0.0908;
380 
381  material.fYC.SetUp(A, B, C, D, R, W);
382  }
383 
384  static void UncDeepSandResMPa(TPZSandlerDimaggio & material)
385  {
386  #ifdef LOG4CXX_PLASTICITY
387  LoggerPtr loggerSandlerDimaggio(Logger::getLogger("plasticity.SandlerDimaggio"));
388  {
389  std::stringstream sout;
390  sout << ">>> TPZSandlerDimaggio::Unconsolidated Deep Sandstone Reservoir ***";
391  LOGPZ_INFO(loggerSandlerDimaggio,sout.str().c_str());
392  }
393  #endif
394 
395  REAL E = 9000,
396  poisson = 0.25;
397 
398  material.fER.SetUp(E, poisson);
399 
400  REAL A = 18,
401  B = 0.0245,
402  C = 17.7,
403  D = 0.00735,
404  R = 1.5,
405  W = 0.0908;
406 
407  material.fYC.SetUp(A, B, C, D, R, W);
408  }
409 
410  static void PRSMatMPa(TPZSandlerDimaggio & material)
411  {
412  #ifdef LOG4CXX_PLASTICITY
413  LoggerPtr loggerSandlerDimaggio(Logger::getLogger("plasticity.SandlerDimaggio"));
414  {
415  std::stringstream sout;
416  sout << ">>> TPZSandlerDimaggio::PRSMat MPa ***";
417  LOGPZ_INFO(loggerSandlerDimaggio,sout.str().c_str());
418  }
419  #endif
420 
421  REAL E = 29269.,
422  poisson = 0.203;
423 
424  material.fER.SetUp(E, poisson);
425 
426  REAL A = 116.67,
427  B = 0.0036895,
428  C = 111.48,
429  D = 0.018768,
430  R = 0.91969,
431  W = 0.006605;
432 
433  material.fYC.SetUp(A, B, C, D, R, W);
434  }
435 
436 public:
437 
438 };
439 
440 template<class SANDLERDIMAGGIOPARENT>
442  return Hash("TPZSandlerDimaggio") ^ SANDLERDIMAGGIOPARENT::ClassId() << 1;
443 }
444 
445 #endif //TPZSANDLERDIMAGGIO_H
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
Definition: tfadfunc.h:140
static void UncDeepSandRes(TPZSandlerDimaggio &material)
void ZAXPY(const TVar alpha, const TPZFMatrix< TVar > &p)
Performs an ZAXPY operation being *this += alpha * p.
Definition: pzfmatrix.cpp:879
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
static void UncDeepSandResPSI(TPZSandlerDimaggio &material)
static void McCormicRanchSandMod2(TPZSandlerDimaggio &material)
virtual void Phi(const TPZTensor< REAL > &epsTotal, TPZVec< REAL > &phi) const override
virtual void Print(std::ostream &out) const override
virtual void SetUp(const TPZTensor< REAL > &epsTotal) override
std::underlying_type< Enumeration >::type as_integer(const Enumeration value)
Definition: pzreal.h:37
static void McCormicRanchSand(TPZSandlerDimaggio &material)
static void UncDeepSandTest(TPZSandlerDimaggio &material)
#define LOGPZ_WARN(A, B)
Define log for warnings.
Definition: pzlog.h:91
static void McCormicRanchSandMod(TPZSandlerDimaggio &material)
static void McCormicRanchSand(TPZYCSandlerDimaggio &material)
int ClassId() const override
void Write(TPZStream &buf, int withclassid) const override
virtual void ApplyStrainComputeSigma(const TPZTensor< REAL > &epsTotal, TPZTensor< REAL > &sigma, TPZFMatrix< REAL > *tangent=NULL) override
#define LOGPZ_INFO(A, B)
Define log for informations.
Definition: pzlog.h:89
virtual void ComputeDep(TPZTensor< REAL > &sigma, TPZFMatrix< REAL > &Dep) override
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
virtual const char * Name() const override
virtual void ApplyStrain(const TPZTensor< REAL > &epsTotal) override
TPZSandlerDimaggio(const TPZSandlerDimaggio &source)
void SetUp(REAL poisson, REAL E, REAL A, REAL B, REAL C, REAL R, REAL D, REAL W)
static void UncDeepSandResMPa(TPZSandlerDimaggio &material)
void Read(TPZStream &buf, void *context) override
TPZSandlerDimaggio(REAL alpha=0.)
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
static void PRSMatMPa(TPZSandlerDimaggio &material)
TPZSandlerDimaggio & operator=(const TPZSandlerDimaggio &source)
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
virtual void ApplyLoad(const TPZTensor< REAL > &sigma, TPZTensor< REAL > &epsTotal) override
Extra utilities for TPZVec. Implementations of the saxpy, sscal, sdot, intercept, max and min functio...
virtual int GetNYield() const
virtual void ApplyStrainComputeDep(const TPZTensor< REAL > &epsTotal, TPZTensor< REAL > &sigma, TPZFMatrix< REAL > &Dep) override
virtual TPZPlasticState< REAL > GetState() const override
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
Definition: pzfmatrix.h:716