NeoPZ
TPZMatElastoPlastic.h
Go to the documentation of this file.
1 
5 #ifndef PZELASTOPLASTIC_H
6 #define PZELASTOPLASTIC_H
7 
8 
9 #include "TPZMaterial.h"
10 #include "TPZMatWithMem.h"
11 #include "TPZElastoPlasticMem.h"
12 #include "pzporoelastoplasticmem.h"
14 
18 template <class T, class TMEM = TPZElastoPlasticMem>
19 class TPZMatElastoPlastic : public TPZMatWithMem<TMEM>
20 {
21 
22 public:
23 
28 
32  TPZMatElastoPlastic(int id);
33 
38 
42  virtual ~TPZMatElastoPlastic();
43 
45  virtual void SetPlasticityModel(T & plasticity);
46 
47  virtual void UpdateMaterialCoeficients(TPZVec<REAL> &x,T & plasticity);
48 
50  virtual void SetBulkDensity(REAL & RhoB);
51 
53  virtual std::string Name() override;
54 
56  virtual int Dimension() const override { return 3; }
57 
59  virtual int NStateVariables() const override{ return 3; }
60 
62  virtual void Print(std::ostream &out, const int memory);
63 
65  virtual void Print(std::ostream &out) override;
66 
68  virtual int VariableIndex(const std::string &name) override;
69 
72  virtual int NSolutionVariables(int var) override;
73 
76  virtual void Solution(TPZMaterialData &data, int var, TPZVec<REAL> &Solout) override;
77 
81  virtual int NFluxes() override
82  {
83  PZError << "TPZMatElastoPlastic::NFluxes() - Method not implemented\n";
84  return 0;
85  }
86 
90  virtual void Flux(TPZVec<REAL> &x, TPZVec<REAL> &Sol, TPZFMatrix<REAL> &DSol, TPZFMatrix<REAL> &axes, TPZVec<REAL> &flux) override
91  {
92  PZError << "TPZMatElastoPlastic::Flux - Method not implemented\n";
93  }
94 
98  virtual void Errors(TPZVec<REAL> &x,TPZVec<REAL> &u, TPZFMatrix<REAL> &dudx,
99  TPZFMatrix<REAL> &axes, TPZVec<REAL> &flux,
100  TPZVec<REAL> &u_exact,TPZFMatrix<REAL> &du_exact,TPZVec<REAL> &values) override;
105  virtual int NEvalErrors() override {return 3;}
106 
110  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<REAL> &ek, TPZFMatrix<REAL> &ef) override;
111 
115  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<REAL> &ek, TPZFMatrix<REAL> &ef, TPZBndCond &bc) override;
116 
120  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<REAL> &ef) override;
121 
125  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<REAL> &ef, TPZBndCond &bc) override;
126 
132 
137  void ComputeDeltaStrainVector(TPZMaterialData & data, TPZFMatrix<REAL> &DeltaStrain);
138 
144 
149  void CheckConvergence(TPZMaterialData & data,TPZFMatrix<REAL> & DeltaStrain);
150 
158  TPZFMatrix<REAL> & Stress, TPZFMatrix<REAL> & Dep);
159 
165  void ApplyDeltaStrain(TPZMaterialData & data, TPZFMatrix<REAL> & DeltaStrain,
166  TPZFMatrix<REAL> & Stress);
167 
172  void ApplyDirection(TPZFMatrix<REAL> &vectorTensor, TPZVec<REAL> &Out);
173 
178  void vectorToTensor(const TPZFMatrix<REAL> & vectorTensor, TPZFMatrix<REAL> & Tensor);
179 
184  void EigenValues(TPZFMatrix<REAL> & vectorTensor, TPZVec<REAL> & ev);
185 
191  void EigenVectors(TPZFMatrix<REAL> &vectorTensor, TPZVec< REAL > &Solout, int direction);
192 
194  virtual TPZMaterial * NewMaterial() override;
195 
199  virtual int ClassId() const override;
200 
204  virtual void Write(TPZStream &buf, int withclassid) const override;
205 
209  virtual void Read(TPZStream &buf, void *context) override;
210 
214  virtual void SetTol(const REAL & tol);
215 
219  virtual void SetBulkDensity(const REAL & bulk);
220 
224  virtual void SetPorousElasticity(TPZPorousElasticResponse & PER);
225 
229  void SetPlasticModel(T & plasticity_model);
230 
234  virtual T & GetPlasticModel();
235 
240 
245  virtual void FillDataRequirements(TPZMaterialData &data) override;
246 
250  virtual void FillBoundaryConditionDataRequirement(int type,TPZMaterialData &data) override;
251 
253  ENone = -1,
256  EStrain = 2,
257  EStress = 3,
260  EYield = 6,
266  EStrainI1 = 12,
267  EStressI1 = 13,
270  EStrainJ2 = 16,
271  EStressJ2 = 17,
275  };
276 
277 protected:
278 
283 
288 
293 
300 
304  REAL m_tol;
305 
310 
315 
316 };
317 
318 template <class T, class TMEM>
320  return Hash("TPZMatElastoPlastic") ^ TPZMatWithMem<TMEM>::ClassId() << 1 ^ T().ClassId() << 2;
321 }
322 
323 #endif
virtual int NEvalErrors() override
TPZManVector< REAL, 3 > m_PostProcessDirection
TPZManVector< REAL, 3 > m_force
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual void SetBulkDensity(REAL &RhoB)
virtual std::string Name() override
virtual void Write(TPZStream &buf, int withclassid) const override
virtual int NFluxes() override
virtual void SetPlasticityModel(T &plasticity)
void SetPlasticModel(T &plasticity_model)
int ClassId() const override
Unique identifier for serialization purposes.
void ApplyDeltaStrain(TPZMaterialData &data, TPZFMatrix< REAL > &DeltaStrain, TPZFMatrix< REAL > &Stress)
virtual void Solution(TPZMaterialData &data, int var, TPZVec< REAL > &Solout) override
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< REAL > &ek, TPZFMatrix< REAL > &ef, TPZBndCond &bc) override
void ComputeDeltaStrainVector(TPZMaterialData &data, TPZFMatrix< REAL > &DeltaStrain)
Implements an abstract class implementing the memory features.
Definition: TPZMatWithMem.h:23
virtual int NSolutionVariables(int var) override
virtual TPZMaterial * NewMaterial() override
virtual void Read(TPZStream &buf, void *context) override
void ComputeStrainVector(TPZMaterialData &data, TPZFMatrix< REAL > &Strain)
virtual int Dimension() const override
virtual TPZPorousElasticResponse & GetPorousElasticity(TPZPorousElasticResponse &PER)
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
virtual void UpdateMaterialCoeficients(TPZVec< REAL > &x, T &plasticity)
virtual void SetTol(const REAL &tol)
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< REAL > &ek, TPZFMatrix< REAL > &ef) override
virtual void Print(std::ostream &out, const int memory)
static const double tol
Definition: pzgeoprism.cpp:23
void EigenValues(TPZFMatrix< REAL > &vectorTensor, TPZVec< REAL > &ev)
void EigenVectors(TPZFMatrix< REAL > &vectorTensor, TPZVec< REAL > &Solout, int direction)
virtual int NStateVariables() const override
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
virtual void Errors(TPZVec< REAL > &x, TPZVec< REAL > &u, TPZFMatrix< REAL > &dudx, TPZFMatrix< REAL > &axes, TPZVec< REAL > &flux, TPZVec< REAL > &u_exact, TPZFMatrix< REAL > &du_exact, TPZVec< REAL > &values) override
void ComputeStressVector(TPZMaterialData &data, TPZFMatrix< REAL > &Stress)
virtual void SetPorousElasticity(TPZPorousElasticResponse &PER)
virtual void FillBoundaryConditionDataRequirement(int type, TPZMaterialData &data) override
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
Contains the TPZMatWithMem class which implements the memory features.
virtual int ClassId() const override
void ApplyDirection(TPZFMatrix< REAL > &vectorTensor, TPZVec< REAL > &Out)
void CheckConvergence(TPZMaterialData &data, TPZFMatrix< REAL > &DeltaStrain)
virtual void Flux(TPZVec< REAL > &x, TPZVec< REAL > &Sol, TPZFMatrix< REAL > &DSol, TPZFMatrix< REAL > &axes, TPZVec< REAL > &flux) override
virtual int VariableIndex(const std::string &name) override
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
def values
Definition: rdt.py:119
void vectorToTensor(const TPZFMatrix< REAL > &vectorTensor, TPZFMatrix< REAL > &Tensor)
void ApplyDeltaStrainComputeDep(TPZMaterialData &data, TPZFMatrix< REAL > &DeltaStrain, TPZFMatrix< REAL > &Stress, TPZFMatrix< REAL > &Dep)
TPZPorousElasticResponse m_PER
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15
virtual void FillDataRequirements(TPZMaterialData &data) override