NeoPZ
TPZPorousElasticCriterion.cpp
Go to the documentation of this file.
1 //
2 // TPZPorousElasticCriterion.cpp
3 // pz
4 //
5 // Created by Omar DurĂ¡n on 1/16/19.
6 //
7 
9 
11 {
12 
13 }
14 
16 {
17 }
18 
20 {
22  if(&other == this){
23  return *this;
24  }
25 
26  fN = other.fN;
27  fER = other.fER;
28  fPER = other.fPER;
29  return *this;
30 }
31 
32 void TPZPorousElasticCriterion::Read(TPZStream& buf, void* context) {
33  fN.Read(buf, context);
34  fER.Read(buf, context);
35  fPER.Read(buf, context);
36 }
37 
38 void TPZPorousElasticCriterion::Write(TPZStream& buf, int withclassid) const {
39  fN.Write(buf, withclassid);
40  fER.Write(buf, withclassid);
41  fPER.Write(buf, withclassid);
42 }
43 
44 #define LE_Q
45 
47 {
48 
49  bool require_tangent_Q = (tangent != NULL);
50 
51 #ifdef PZDEBUG
52  if (require_tangent_Q){
53  // Check for required dimensions of tangent
54  if (tangent->Rows() != 6 || tangent->Cols() != 6) {
55  std::cerr << "Unable to compute the tangent operator. Required tangent array dimensions are 6x6." << std::endl;
56  DebugStop();
57  }
58  }
59 #endif
60 
61 #ifdef LE_Q
62 
63  fER.ComputeStress(eps, sigma);
64  fN.m_eps_t = eps;
65 
66  if (require_tangent_Q) {
67  fER.De(*tangent);
68  }
69 
70 
71 #else
72 
73  fPER.ComputeStress(eps, sigma);
74  fN.m_eps_t = eps;
75 
76  if (require_tangent_Q) {
77  fPER.De(eps, *tangent);
78  }
79 
80 #endif
81 
82 }
83 
85 {
86 
87  std::cout<< " \n this method is not implemented in TPZElasticCriteria. ";
88  DebugStop();
89 
90 }
91 
93 {
94 
95 #ifdef LE_Q
96 
97  fER.ComputeStrain(sigma, epsilon);
98  fN.m_eps_t = epsilon;
99 
101  fER = fPER.EvaluateElasticResponse(epsilon);
102 
103 #else
104 
105  fPER.ComputeStrain(sigma, epsilon);
106  fN.m_eps_t = epsilon;
107 
109  fER = fPER.EvaluateElasticResponse(epsilon);
110 
111 #endif
112 }
113 
114 
116 {
117  return fN;
118 }
119 
120 
122 {
123  phi.resize(3);
124  for (int i = 0; i < 3; i++) {
125  phi[i] = 0.;
126  }
127 }
128 
130 {
131  fN = state;
132 }
133 
135 {
136  return 1;
137 }
138 
140  return Hash("TPZPorousElasticCriterion") ^ TPZPlasticBase::ClassId() << 1;
141 }
142 
143 
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void ComputeStress(const TPZTensor< T > &epsilon, TPZTensor< T > &sigma) const
virtual void SetState(const TPZPlasticState< REAL > &state) override
TPZTensor< T > m_eps_t
Tensors representing the total and plastic strain states.
virtual void resize(const int64_t newsize)
Definition: pzvec.h:213
void Read(TPZStream &buf, void *context) override
virtual int ClassId() const override
Define the class id associated with the class.
virtual void ApplyStrain(const TPZTensor< REAL > &epsTotal) override
virtual void ApplyStrainComputeSigma(const TPZTensor< REAL > &eps, TPZTensor< REAL > &sigma, TPZFMatrix< REAL > *tangent=NULL) override
void ComputeStress(const TPZTensor< T > &epsilon, TPZTensor< T > &sigma) const
TPZPorousElasticCriterion & operator=(const TPZPorousElasticCriterion &cp)
void ComputeStrain(const TPZTensor< T > &sigma, TPZTensor< T > &epsilon) const
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
virtual void ApplyLoad(const TPZTensor< REAL > &sigma, TPZTensor< REAL > &eps) override
void De(const TPZTensor< STATE > &epsilon, TPZFMatrix< STATE > &De) const
virtual int IntegrationSteps() const override
virtual TPZPlasticState< REAL > GetState() const override
void Read(TPZStream &buf, void *context) override
read objects from the stream
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
virtual void Phi(const TPZTensor< REAL > &eps, TPZVec< REAL > &phi) const override
void Read(TPZStream &buf, void *context) override
void De(TPZFMatrix< REAL > &De)
int64_t Cols() const
Returns number of cols.
Definition: pzmatrix.h:809
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
void Read(TPZStream &buf, void *context) override
read objects from the stream
void ComputeStrain(const TPZTensor< T > &sigma, TPZTensor< T > &epsilon) const
int ClassId() const override
Define the class id associated with the class.
void Write(TPZStream &buf, int withclassid) const override
TPZElasticResponse EvaluateElasticResponse(const TPZTensor< STATE > &epsilon) const
Computes a linear elastic response from function evaluation of non linear expressions.
TPZPorousElasticResponse fPER
void Write(TPZStream &buf, int withclassid) const override