NeoPZ
TPZElasticResponse.cpp
Go to the documentation of this file.
1 //
2 // TPZElasticResponse.h
3 // pz
4 //
5 // Created by Erick Slis Raggio Santos on 04/07/2009.
6 //
7 
8 #include "TPZElasticResponse.h"
9 
11  return Hash("TPZElasticResponse");
12 }
13 
15  m_eps_star.Zero();
16 }
17 
19  m_lambda = other.m_lambda;
20  m_mu = other.m_mu;
21  m_eps_star = other.m_eps_star;
22 }
23 
25  m_lambda = other.m_lambda;
26  m_mu = other.m_mu;
27  m_eps_star = other.m_eps_star;
28  return *this;
29 }
30 
31 
32 void TPZElasticResponse::Write(TPZStream& buf, int withclassid) const { //ok
33  buf.Write(&m_lambda);
34  buf.Write(&m_mu);
35  m_eps_star.Write(buf,withclassid);
36 }
37 
38 void TPZElasticResponse::Read(TPZStream& buf, void* context) { //ok
39  buf.Read(&m_lambda);
40  buf.Read(&m_mu);
41  m_eps_star.Read(buf, context);
42 }
43 
44 
45 const char * TPZElasticResponse::Name() const {
46  return "TPZElasticResponse";
47 }
48 
49 void TPZElasticResponse::Print(std::ostream & out) const {
50  out << this->Name();
51  out << "\n Young = " << E();
52  out << "\n Poisson = " << Poisson();
53  out << "\n m_lambda = " << m_lambda;
54  out << "\n m_mu = " << m_mu;
55 }
56 
58  REAL Mu2 = 2 * m_mu;
59 
60  De.Zero();
61 
62  De(_XX_, _XX_) += m_lambda;
63  De(_XX_, _YY_) += m_lambda;
64  De(_XX_, _ZZ_) += m_lambda;
65  De(_YY_, _XX_) += m_lambda;
66  De(_YY_, _YY_) += m_lambda;
67  De(_YY_, _ZZ_) += m_lambda;
68  De(_ZZ_, _XX_) += m_lambda;
69  De(_ZZ_, _YY_) += m_lambda;
70  De(_ZZ_, _ZZ_) += m_lambda;
71 
72  int i;
73  for (i = 0; i < 6; i++)De(i, i) += Mu2;
74 }
75 
77 
78  m_lambda = Poisson * Eyoung / ((1. + Poisson)*(1. - 2. * Poisson));
79  m_mu = Eyoung / (2. * (1. + Poisson));
80 }
81 
82 void TPZElasticResponse::SetLameData(REAL lambda, REAL mu) {
83 
84  m_lambda = lambda;
85  m_mu = mu;
86 }
87 
89  return m_lambda;
90 }
91 
92 REAL TPZElasticResponse::K() const {
93  return m_lambda + 2. * m_mu / 3.;
94 }
95 
96 REAL TPZElasticResponse::Mu() const {
97  return m_mu;
98 }
99 
100 REAL TPZElasticResponse::G() const {
101  return Mu();
102 }
103 
104 REAL TPZElasticResponse::E() const {
105  REAL E = m_mu * (3. * m_lambda + 2. * m_mu) / (m_lambda + m_mu);
106  return E;
107 }
108 
110  REAL poisson = m_lambda / (2. * (m_lambda + m_mu));
111  return poisson;
112 }
113 
115  m_eps_star = eps_star;
116 }
117 
119  return m_eps_star;
120 }
REAL m_lambda
First Lamé parameter.
void Print(std::ostream &out) const
void SetLameData(REAL lambda, REAL mu)
void Read(TPZStream &buf, void *context) override
void Write(TPZStream &buf, int withclassid) const override
Method to write to a pzstream.
Definition: TPZTensor.h:688
void Read(TPZStream &buf, void *context) override
Method to read the object from a pzstream.
Definition: TPZTensor.h:683
TPZTensor< REAL > & ResidualStrainData()
void Zero()
Definition: TPZTensor.h:801
int Zero() override
Makes Zero all the elements.
Definition: pzfmatrix.h:651
virtual void Write(const bool val)
Definition: TPZStream.cpp:8
#define _XX_
Definition: TPZTensor.h:27
#define _YY_
Definition: TPZTensor.h:30
TPZTensor< REAL > m_eps_star
Residual strain at zero stress state.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
const char * Name() const
#define _ZZ_
Definition: TPZTensor.h:32
void De(TPZFMatrix< REAL > &De)
void SetEngineeringData(REAL Eyoung, REAL Poisson)
TPZElasticResponse & operator=(const TPZElasticResponse &other)
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
int ClassId() const override
void SetResidualStrainData(TPZTensor< REAL > &eps_res)
void Write(TPZStream &buf, int withclassid) const override
REAL m_mu
Second Lamé parameter.
virtual void Read(bool &val)
Definition: TPZStream.cpp:91