NeoPZ
TPZYCMohrCoulombPV.h
Go to the documentation of this file.
1 /*
2  * TPZMohrCoulomb.h
3  * FEMPZ
4  *
5  * Created by Nathan Shauer on 5/4/13.
6  * Copyright 2010 __MyCompanyName__. All rights reserved.
7  *
8  */
9 
10 #ifndef TPZYCMOHRCOULOMBPV_H
11 #define TPZYCMOHRCOULOMBPV_H
12 
13 #include "pzlog.h"
14 #include "TPZTensor.h"
15 #include "pzvec_extras.h"
16 #include "TPZPlasticState.h"
17 #include "TPZElasticResponse.h"
18 #include "TPZPlasticCriterion.h"
19 
20 #ifdef LOG4CXX
21 static LoggerPtr loggerMohrCoulombPV(Logger::getLogger("pz.plasticity.mohrcoulombpv"));
22 #endif
23 
25 public:
26 
27  enum {
28  NYield = 3
29  };
30 
31 private:
32 
33  REAL fPhi;
34  REAL fPsi;
35  REAL fc;
37 
38 protected:
40 
41 public:
42 
44  // we can only expect a consistent tangent matrix if the decision tree remains the same
45 
47 
49 
50  }
51 
53 
54  }
55 
57  fWhichPlane = copy.fWhichPlane;
58  fGamma = copy.fGamma;
59  return *this;
60  }
61 
62  enum MPlane {
64  };
65 
67 
69  };
70 
71 public:
72 
77 
81  TPZYCMohrCoulombPV(REAL Phi, REAL Psi, REAL c, TPZElasticResponse &ER);
82 
87 
100  void SetUp(REAL Phi, REAL Psi, REAL c, TPZElasticResponse &ER) {
101  fPhi = Phi;
102  fPsi = Psi;
103  fc = c;
104  fER = ER;
105  }
106 
111 
112  virtual int ClassId() const override;
113 
114  void Read(TPZStream& buf, void* context) override;
115 
116  void Write(TPZStream& buf, int withclassid) const override;
117 
121  void SetEpsBar(REAL &epsbar) {
122  fEpsPlasticBar = epsbar;
123  }
124 
128  virtual void Print(std::ostream &out) const override;
129 
131  fER = ER;
132  }
133 
135  return fER;
136  }
137 
141  REAL InitialDamage(const TPZVec<REAL> &stress_p) const;
142 
146  template <class T>
147  void PlasticityFunction(const T epsp, T &c, T &H) const;
148 
152  template<class T>
153  TPZVec<T> SigmaElastPV(const TPZVec<T> &deform) const;
154 
158  template<class T>
159  T PhiPlane(const TPZVec<T> &sigma) const;
160 
164  template<class T>
165  bool ReturnMapPlane(const TPZVec<T> &sigma_trial, TPZVec<T> &sigma_projected,
166  TComputeSequence &memory, REAL &epsbarnew) const;
167 
171  void ComputePlaneTangent(TPZMatrix<REAL> &tang, REAL &epsbarp) const;
172 
176  template<class T>
177  bool ReturnMapLeftEdge(const TPZVec<T> &sigma_trial, TPZVec<T> &sigma_projected,
178  TComputeSequence &memory, REAL &epsbarnew) const;
179 
183  void ComputeLeftEdgeTangent(TPZMatrix<REAL> &tang, REAL &epsbarp) const;
184 
188  template<class T>
189  bool ReturnMapRightEdge(const TPZVec<T> &sigma_trial, TPZVec<T> &sigma_projected,
190  TComputeSequence &memory, REAL &epsbarnew) const;
191 
195  void ComputeRightEdgeTangent(TPZMatrix<REAL> &tang, REAL &epsbarp) const;
196 
200  template<class T>
201  bool ReturnMapApex(const TPZVec<T> &sigma_trial, TPZVec<T> &sigma_projected,
202  TComputeSequence &memory, REAL &epsbarnew) const;
203 
210  void ComputeApexGradient(TPZMatrix<REAL> & gradient, REAL & eps_bar_p) const;
211 
223  void ProjectSigma(const TPZVec<STATE> & sigma_trial, STATE k_prev, TPZVec<STATE> & sigma, STATE &k_proj, int & m_type, TPZFMatrix<REAL> * gradient = NULL);
224 
225  // Deprecated
226  void ProjectSigmaDep(const TPZVec<STATE> &sigmatrial, STATE kprev, TPZVec<STATE> &sigmaproj, STATE &kpro, TPZFMatrix<STATE> &tang){
227  std::cerr << "Deprecated gradient calculation is incorporated on ProjectSigma method." << std::endl;
228  DebugStop();
229  }
230 
238  void Phi(TPZVec<STATE> sig_vec, STATE alpha, TPZVec<STATE> &phi)const;
239 
245  STATE Phi() {
246  return fPhi;
247  }
248 
250  void SetPhi(STATE phi)
251  {
252  fPhi = phi;
253  }
254 
260  STATE Psi() {
261  return fPsi;
262  }
263 
269  STATE Cohesion() {
270  return fc;
271  }
272 
274  void SetCohesion(STATE cohesion)
275  {
276  fc = cohesion;
277  }
278 
279 
285  STATE E() {
286  return fER.E();
287  }
288 
294  STATE Poisson() {
295  return fER.Poisson();
296  }
297 
298 
299  virtual void YieldFunction(const TPZVec<STATE>& sigma, STATE kprev, TPZVec<STATE>& yield) const override{
300  Phi(sigma, kprev, yield);
301  }
302 
303  virtual int GetNYield() const override{
304  return as_integer(NYield);
305  }
306 };
307 
308 
309 #endif //TPZYCMOHRCOULOMBPV_H
void ProjectSigmaDep(const TPZVec< STATE > &sigmatrial, STATE kprev, TPZVec< STATE > &sigmaproj, STATE &kpro, TPZFMatrix< STATE > &tang)
void ComputePlaneTangent(TPZMatrix< REAL > &tang, REAL &epsbarp) const
Computes dsigmapr/dsigmatr for the ReturnMapPlane.
void ComputeLeftEdgeTangent(TPZMatrix< REAL > &tang, REAL &epsbarp) const
Computes dsigmapr/dsigmatr for the ReturnMapLeftEdge.
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.
bool ReturnMapPlane(const TPZVec< T > &sigma_trial, TPZVec< T > &sigma_projected, TComputeSequence &memory, REAL &epsbarnew) const
Implements the return map in the plane of the surface.
virtual int GetNYield() const override
virtual void YieldFunction(const TPZVec< STATE > &sigma, STATE kprev, TPZVec< STATE > &yield) const override
T PhiPlane(const TPZVec< T > &sigma) const
Calcula o valor da funcao criteiro de plastificacao.
void PlasticityFunction(const T epsp, T &c, T &H) const
Calculates the value c(epsp) and its derivative.
std::underlying_type< Enumeration >::type as_integer(const Enumeration value)
Definition: pzreal.h:37
TPZElasticResponse fER
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void SetPhi(STATE phi)
Set up the phi.
void SetEpsBar(REAL &epsbar)
Sets epsbar.
bool ReturnMapLeftEdge(const TPZVec< T > &sigma_trial, TPZVec< T > &sigma_projected, TComputeSequence &memory, REAL &epsbarnew) const
Implements the return map in the left edge of the surface.
static LoggerPtr loggerMohrCoulombPV(Logger::getLogger("pz.plasticity.mohrcoulombpv"))
void SetElasticResponse(const TPZElasticResponse &ER)
void SetCohesion(STATE cohesion)
Set up the cohesion.
virtual TPZElasticResponse GetElasticResponse() const
void Read(TPZStream &buf, void *context) override
read objects from the stream
virtual int ClassId() const override
Define the class id associated with the class.
REAL InitialDamage(const TPZVec< REAL > &stress_p) const
Compute initial damage variable from the given principal stress state.
TPZYCMohrCoulombPV()
empty constructor
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
void ComputeApexGradient(TPZMatrix< REAL > &gradient, REAL &eps_bar_p) const
TComputeSequence & operator=(const TComputeSequence &copy)
virtual void Print(std::ostream &out) const override
Print Method.
TComputeSequence(const TComputeSequence &copy)
void ProjectSigma(const TPZVec< STATE > &sigma_trial, STATE k_prev, TPZVec< STATE > &sigma, STATE &k_proj, int &m_type, TPZFMatrix< REAL > *gradient=NULL)
structure which contains the decision tree of the return map
bool ReturnMapRightEdge(const TPZVec< T > &sigma_trial, TPZVec< T > &sigma_projected, TComputeSequence &memory, REAL &epsbarnew) const
Implements the return map in the right edge of the surface.
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
TPZVec< T > SigmaElastPV(const TPZVec< T > &deform) const
sigma = lambda Tr(E)I + 2 mu E
Extra utilities for TPZVec. Implementations of the saxpy, sscal, sdot, intercept, max and min functio...
void ComputeRightEdgeTangent(TPZMatrix< REAL > &tang, REAL &epsbarp) const
Computes dsigmapr/dsigmatr for the ReturnMapRightEdge.
void SetUp(REAL Phi, REAL Psi, REAL c, TPZElasticResponse &ER)
Sets up the data.
bool ReturnMapApex(const TPZVec< T > &sigma_trial, TPZVec< T > &sigma_projected, TComputeSequence &memory, REAL &epsbarnew) const
Implements the return map in the apex.