NeoPZ
TPZPlasticStepPV.h
Go to the documentation of this file.
1 
5 #ifndef TPZPlasticStepPV_H
6 #define TPZPlasticStepPV_H
7 
8 
9 #include "TPZTensor.h"
10 #include "pzreal.h"
11 #include "pzfmatrix.h"
12 #include "TPZPlasticState.h"
13 #include "TPZPlasticIntegrMem.h"
14 #include "TPZPlasticStep.h"
15 #include "pzlog.h"
16 #include "pzstepsolver.h"
17 #include "TPZElasticResponse.h"
19 
20 #include <set>
21 #include <ostream>
22 
23 // Metodos para deixar o prog mais "encapsulado"
29 
30 /*
31 
32  enum EElastoPlastic
33  {
34  EAuto = 0,
35  EForceElastic = 1,
36  EForcePlastic = 2
37  };
38  */
39 
43 template <class YC_t, class ER_t>
45 {
46 public:
47 
54  TPZPlasticStepPV(REAL alpha=0.):fYC(), fER(), fResTol(1.e-12), fMaxNewton(30), fN()
55  {
56  fN.m_hardening = alpha;
57  }
58 
65  {
66  fYC = source.fYC;
67  fER = source.fER;
68  fResTol = source.fResTol;
69  fMaxNewton = source.fMaxNewton;
70  fN = source.fN;
71  }
72 
79  {
80  fYC = source.fYC;
81  fER = source.fER;
82  fResTol = source.fResTol;
83  fMaxNewton = source.fMaxNewton;
84  fN = source.fN;
85 
86  return *this;
87  }
88 
92  virtual const char * Name() const override
93  {
94  return "TPZPlasticStepPV";
95  }
96 
97  virtual void Print(std::ostream & out) const override
98  {
99  out << "\n" << this->Name();
100  out << "\n YC_t:";
101  fYC.Print(out);
102  out << "\n ER_t:";
103  fER.Print(out);
104  out << "\nTPZPlasticStepPV Internal members:";
105  out << "\n fResTol = " << fResTol;
106  out << "\n fMaxNewton = " << fMaxNewton;
107  out << "\n fN = "; // PlasticState
108  fN.Print(out);
109  }
110 
111  typedef YC_t fNYields;
112 
119  virtual void InitialDamage(const TPZTensor<REAL> & sigma, REAL & k);
120 
128  virtual void ApplyStrainComputeSigma(const TPZTensor<REAL> &epsTotal, TPZTensor<REAL> &sigma, TPZFMatrix<REAL> * tangent = NULL) override;
129 
137  virtual void ApplyStressComputeStrain(const TPZTensor<REAL> &sigma, TPZTensor<REAL> &epsTotal, TPZFMatrix<REAL> * tangent_inv = NULL);
138 
144  virtual void ApplyStrain(const TPZTensor<REAL> &epsTotal) override;
145 
154  virtual void ApplyStrainComputeDep(const TPZTensor<REAL> &epsTotal, TPZTensor<REAL> &sigma, TPZFMatrix<REAL> &Dep) override;
155 
165  virtual void ApplyLoad(const TPZTensor<REAL> & sigma, TPZTensor<REAL> &epsTotal) override;
166 
167  virtual TPZPlasticState<REAL> GetState() const override;
173  virtual void Phi(const TPZTensor<REAL> &epsTotal, TPZVec<REAL> &phi) const override;
174 
175  virtual void SetElasticResponse(TPZElasticResponse &ER) override;
176 
177  virtual TPZElasticResponse GetElasticResponse() const override
178  {
179  return fER;
180  }
181 
186  virtual void SetState(const TPZPlasticState<REAL> &state) override;
187 
188 
189  //void CopyFromFNMatrixToTensor(TPZFNMatrix<6> FNM,TPZTensor<STATE> &copy);
191 
192 
193  //void CopyFromTensorToFNMatrix(TPZTensor<STATE> tensor,TPZFNMatrix<6> &copy);
195 
197  virtual void TrialStressCorrection(REAL kappa, TPZVec<STATE> &sigma, TPZVec<STATE> &sigma_tr);
198 
199  virtual int ClassId() const override;
200 
201  void Read(TPZStream& buf, void* context) override;
202 
203  void Write(TPZStream& buf, int withclassid) const override;
204 
205 
213  void TaylorCheck(TPZTensor<REAL> &EpsIni, TPZTensor<REAL> &deps, REAL kprev, TPZVec<REAL> &conv);
214 
215 
216  REAL ComputeNFromTaylorCheck(REAL alpha1, REAL alpha2, TPZFMatrix<REAL> &error1Mat, TPZFMatrix<REAL> &error2Mat);
217 
219  return fYC;
220  }
221 
222 
223 public:
224 
226  {
227  fResTol = tol;
228  }
229 
231  {
232  //fPlasticMem.Resize(0);
233  }
234 
235  //virtual void Write(TPZStream &buf) const;
236 
237  //virtual void Read(TPZStream &buf);
238 public:
239 
241  YC_t fYC;
242 
244  ER_t fER;
245 
246 protected:
247 
249  REAL fResTol;
250 
252  int fMaxNewton; // COLOCAR = 30 (sugestao do erick!)
253 
254 private:
255 
258  void TangentOperator(TPZFMatrix<REAL> & gradient,TPZTensor<REAL>::TPZDecomposed & eps_eigen_system, TPZTensor<REAL>::TPZDecomposed & sig_eigen_system, TPZFMatrix<REAL> & Tangent);
259 
260 public:
261 
264 
265 };
266 
267 template <class YC_t, class ER_t>
269  return Hash("TPZPlasticStepPV") ^ TPZPlasticBase::ClassId() << 1 ^ YC_t().ClassId() << 2 ^ ER_t().ClassId() << 3;
270 }
271 
272 #endif //TPZPlasticStepPV_H
int fMaxNewton
Maximum number of Newton interations allowed in the nonlinear solvers.
TPZPlasticStepPV(const TPZPlasticStepPV &source)
Copy Constructor.
TPZPlasticCriterion & GetYC() override
clarg::argString m2("-m2", "argument matrix file name (text format)", "matrix2.txt")
virtual void ApplyStrainComputeDep(const TPZTensor< REAL > &epsTotal, TPZTensor< REAL > &sigma, TPZFMatrix< REAL > &Dep) override
virtual void ApplyStrain(const TPZTensor< REAL > &epsTotal) override
TPZFMatrix< REAL > ProdT(TPZManVector< REAL, 3 > &v1, TPZManVector< REAL, 3 > &v2)
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.
void Print(std::ostream &Out, int fadDerivatives=1) const
More complete then Operator << because it allows derivatives supression.
void TaylorCheck(TPZTensor< REAL > &EpsIni, TPZTensor< REAL > &deps, REAL kprev, TPZVec< REAL > &conv)
T m_hardening
Plastic volumetric hardeing variable.
virtual const char * Name() const override
Name of the class ina string.
void SetResidualTolerance(STATE tol)
virtual void Phi(const TPZTensor< REAL > &epsTotal, TPZVec< REAL > &phi) const override
Return the value of the yield functions for the given strain.
REAL NormVecOfMat(TPZFNMatrix< 9 > mat)
REAL InnerVecOfMat(TPZFMatrix< REAL > &m1, TPZFMatrix< REAL > &m2)
REAL fResTol
Residual tolerance accepted in the plastic loop processes.
REAL ComputeNFromTaylorCheck(REAL alpha1, REAL alpha2, TPZFMatrix< REAL > &error1Mat, TPZFMatrix< REAL > &error2Mat)
virtual void SetElasticResponse(TPZElasticResponse &ER) override
virtual int ClassId() const override
Define the class id associated with the class.
void Read(TPZStream &buf, void *context) override
read objects from the stream
TPZPlasticStepPV & operator=(const TPZPlasticStepPV &source)
Operator =.
static const double tol
Definition: pzgeoprism.cpp:23
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
virtual void SetState(const TPZPlasticState< REAL > &state) override
Update the damage values.
Contains TPZMatrixclass which implements full matrix (using column major representation).
virtual void InitialDamage(const TPZTensor< REAL > &sigma, REAL &k)
YC_t fYC
Object which represents the yield criterium.
void CopyFromTensorToFMatrix(TPZTensor< STATE > tensor, TPZFMatrix< STATE > &copy)
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
virtual void ApplyStressComputeStrain(const TPZTensor< REAL > &sigma, TPZTensor< REAL > &epsTotal, TPZFMatrix< REAL > *tangent_inv=NULL)
TPZPlasticStepPV(REAL alpha=0.)
Constructor which Initialize the plastic material damage variable only.
virtual void Print(std::ostream &out) const override
ER_t fER
Object representing the elastic response.
Classe que efetua avanco de um passo de plastificacao utilizando o metodo de Newton.
virtual void ApplyLoad(const TPZTensor< REAL > &sigma, TPZTensor< REAL > &epsTotal) override
Contains TPZStepSolver class which defines step solvers class.
virtual void ApplyStrainComputeSigma(const TPZTensor< REAL > &epsTotal, TPZTensor< REAL > &sigma, TPZFMatrix< REAL > *tangent=NULL) override
virtual TPZElasticResponse GetElasticResponse() const override
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
TPZPlasticState< STATE > fN
Plastic State Variables (EpsT, EpsP, Alpha) at the current time step.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
void TangentOperator(TPZFMatrix< REAL > &gradient, TPZTensor< REAL >::TPZDecomposed &eps_eigen_system, TPZTensor< REAL >::TPZDecomposed &sig_eigen_system, TPZFMatrix< REAL > &Tangent)
Compute the tangent opreator.
TPZFNMatrix< 6 > FromMatToVoight(TPZFNMatrix< 9 > mat)
int ClassId() const override
Define the class id associated with the class.
virtual TPZPlasticState< REAL > GetState() const override
virtual void TrialStressCorrection(REAL kappa, TPZVec< STATE > &sigma, TPZVec< STATE > &sigma_tr)
Method that correct the Sigma trial based on the intersection with the yield surface.
void CopyFromFMatrixToTensor(TPZFMatrix< STATE > FNM, TPZTensor< STATE > &copy)
Object which represents the yield criterium.