NeoPZ
TPZYCRankine.h
Go to the documentation of this file.
1 // $Id: TPZYCRankine.h,v 1.2 2010-06-11 22:12:14 diogo Exp $
2 
3 #ifndef TPZYCRANKINE_H
4 #define TPZYCRANKINE_H
5 
6 #include "TPZTensor.h"
7 #include "pzlog.h"
8 
9 template <class T_YCBASE>
10 class TPZYCRankine : public T_YCBASE{
11 
12 public:
13 
14  TPZYCRankine():T_YCBASE(),fYieldT(0.)
15  {
16  }
17 
19  {
20  }
21 
22  enum {NYield = 1 + T_YCBASE::NYield};
23 
24  const char * Name() const
25  {
26  return "TPZYCRankine<>";
27  }
28 
33  void SetUpRankine(const REAL & YieldT)
34  {
35  fYieldT = YieldT;
36  }
37 
45  template < class T>
46  void Compute(const TPZTensor<T> & sigma, const T & A, TPZVec<T> &result, int checkForcedYield = 0) const;
47 
55  template <class T>
56  void N(const TPZTensor<T> & sigma,const T & A, TPZVec<TPZTensor<T> > & Ndir, int checkForcedYield = 0) const;
57 
65  template <class T>
66  void H(const TPZTensor<T> & sigma,const T & A, TPZVec<T> & h, int checkForcedYield = 0) const;
67 
71  template <class T>
72  void AlphaMultiplier(const T &A, T &multiplier) const
73  {
74  multiplier = T(1.);
75  }
76 
77  void Write(TPZStream &buf, int withclassid = 0) const override
78  {
79  T_YCBASE::Write(buf,withclassid);
80  buf.Write(&fYieldT);
81  }
82  void Read(TPZStream &buf, void *context = 0) override
83  {
84  T_YCBASE::Read(buf,context);
85  buf.Read(&fYieldT);
86  }
87 
88  public:
89 int ClassId() const override;
90 
91 protected:
92 
93  REAL fYieldT;
94 public:
95 
96 
97 };
98 
99 
100 
106 template < class T_YCBASE>
107 template < class T>
108 inline void TPZYCRankine<T_YCBASE>::Compute(const TPZTensor<T> & sigma, const T & A,TPZVec<T> &result, int checkForcedYield) const
109 {
110  T_YCBASE::Compute(sigma, A, result, checkForcedYield);
111  // Chen Plasticity for structural engineers pg 88
112  T theta, I1, J2, J3;
113  I1 = sigma.I1();
114  J2 = sigma.J2();
115  J3 = sigma.J3();
116 
117  T sqrtJ2 = sqrt(J2);
118  T sqrtJ232 = J2 * sqrtJ2;
119  //T value = J3 / pow(J2, 3./2.) * T(sqrt(27.)/2.);
120  //T value = J3 / exp ( T(3./2.) * log(J2) ) * T(sqrt(27.)/2.);
121  T value = J3 / sqrtJ232 * T(sqrt(27.)/2.);
122  theta = acos( value / T(3.) );
123  // theta MUST lie between 0 and 60 deg !!!
124 
125  value = sqrt(J2) * T(2. * sqrt(3.)) * cos(theta) + I1 - T(3. * fYieldT);
126  result[T_YCBASE::NYield] = value;
127 }
128 
129 
136 template < class T_YCBASE>
137 template <class T>
138 inline void TPZYCRankine<T_YCBASE>::N(const TPZTensor<T> & sigma,const T & A, TPZVec<TPZTensor<T> > & Ndir, int checkForcedYield) const
139 {
140  T_YCBASE::N(sigma, A, Ndir, checkForcedYield);
141  // implementar contribuicao para
142 
143  TPZTensor<T> NRankine;
144  NRankine.XX() = T(0.);//dfdsigmaxx
145  NRankine.YY() = T(0.);//dfdsigmayy
146  NRankine.ZZ() = T(0.);//dfdsigmazz
147  NRankine.XY() = T(0.);//dfdsigmaxy
148  NRankine.XZ() = T(0.);//dfdsigmaxz
149  NRankine.YZ() = T(0.);//dfdsigmayz
150  Ndir[T_YCBASE::NYield] = NRankine;
151 
152 }
153 
154 template < class T_YCBASE>
155 template <class T>
156 inline void TPZYCRankine<T_YCBASE>:: H(const TPZTensor<T> & sigma,const T & A, TPZVec<T> & h, int checkForcedYield)const
157 {
158  h[T_YCBASE::NYield] = 0.; // not really necessary since this model does not handle hardening.
159 }
160 
161 template <class T_YCBASE>
163  return Hash("TPZYCRankine") ^ T_YCBASE::ClassId() << 1;
164 }
165 #endif //TPZYCRANKINE_H
void N(const TPZTensor< T > &sigma, const T &A, TPZVec< TPZTensor< T > > &Ndir, int checkForcedYield=0) const
Definition: TPZYCRankine.h:138
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.
const char * Name() const
Definition: TPZYCRankine.h:24
T I1() const
Definition: TPZTensor.h:903
void Compute(const TPZTensor< T > &sigma, const T &A, TPZVec< T > &result, int checkForcedYield=0) const
Definition: TPZYCRankine.h:108
T & YY() const
Definition: TPZTensor.h:578
clarg::argBool h("-h", "help message", false)
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
void Read(TPZStream &buf, void *context=0) override
Definition: TPZYCRankine.h:82
void H(const TPZTensor< T > &sigma, const T &A, TPZVec< T > &h, int checkForcedYield=0) const
Definition: TPZYCRankine.h:156
expr_ expr_ expr_ expr_ acos
Definition: tfadfunc.h:75
T & YZ() const
Definition: TPZTensor.h:582
virtual void Write(const bool val)
Definition: TPZStream.cpp:8
int ClassId() const override
Definition: TPZYCRankine.h:162
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Definition: tfadfunc.h:120
T J2() const
Definition: TPZTensor.h:927
void Write(TPZStream &buf, int withclassid=0) const override
Definition: TPZYCRankine.h:77
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
T & XX() const
Definition: TPZTensor.h:566
T & XY() const
Definition: TPZTensor.h:570
T & ZZ() const
Definition: TPZTensor.h:586
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
void AlphaMultiplier(const T &A, T &multiplier) const
Definition: TPZYCRankine.h:72
T & XZ() const
Definition: TPZTensor.h:574
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
Definition: pzreal.h:514
T J3() const
Definition: TPZTensor.h:946
virtual void Read(bool &val)
Definition: TPZStream.cpp:91
void SetUpRankine(const REAL &YieldT)
Definition: TPZYCRankine.h:33