NeoPZ
pzmathyperelastic.h
Go to the documentation of this file.
1 
6 #ifndef MATHYPERELASTICHPP
7 #define MATHYPERELASTICHPP
8 
9 #include "TPZMaterial.h"
10 #include "pzfmatrix.h"
11 
12 #ifdef _AUTODIFF
13 #include "fadType.h"
14 #endif
15 
21 
22  STATE fXf[3];
23 #ifndef _AUTODIFF
24  STATE fK2[3][3], fK3[3][3], fK4[3][3], fK6[3][3], fK7[3][3], fK8[3][3];
25  STATE fL1[3][3],fL2[3][3],fL3[3][3],fL4[3][3],fL5[3][3],fL6[3][3],fL7[3][3],fL8[3][3],fL9[3][3],fGradtrC[3][3];
26  STATE fGradDetF[3][3];
27 #endif
28  STATE fE1[3],fE5[3],fE9[3];
29 
30 
31  STATE fLambda,fNu,fE,fMu;
33 
34  public :
35 
36  TPZMatHyperElastic(int nummat,STATE e,STATE mu,STATE nu=-1.,STATE lambda=-1.,STATE coef1=-1.,STATE coef2=-1.,STATE coef3=-1.);
37 
38  virtual ~TPZMatHyperElastic();
39 
41  fXf[0] = xfin(0,0);
42  fXf[1] = xfin(1,0);
43  fXf[2] = xfin(2,0);
44  }
45 
46  int Dimension() const override { return 3;}
47 
48  virtual int NStateVariables() const override;
49 
50  virtual void Print(std::ostream & out) override;
51 
52  std::string Name() override { return "TPZMatHyperElastic"; }
53 
54  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override;
55  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ef) override
56  {
57  TPZMaterial::Contribute(data,weight,ef);
58  }
59 
60  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef, TPZBndCond &bc) override;
61 
62  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ef, TPZBndCond &bc) override
63  {
64  TPZMaterial::ContributeBC(data,weight,ef,bc);
65  }
66 
67 #ifdef _AUTODIFF
68 
70  virtual void ContributeEnergy(TPZVec<REAL> &x,
71  TPZVec<FADFADREAL> &sol,
72  TPZVec<FADFADREAL> &dsol,
73  FADFADREAL &U,
74  REAL weight);
75 
76  static void ComputeEnergy(STATE lambda, STATE mu, TPZFMatrix<STATE> &dsol, TFad<9,TFad<9,STATE> > &energy);
77 
79  virtual void ContributeBCEnergy(TPZVec<REAL> & x,
80  TPZVec<FADFADREAL> & sol, FADFADREAL &U,
81  REAL weight, TPZBndCond &bc);
82 
83 #endif
84 
85  virtual int VariableIndex(const std::string &name) override;
86 
87  virtual int NSolutionVariables(int var) override;
88 
89  virtual int NFluxes() override { return 9;}
90 
91 protected:
92  virtual void Solution(TPZVec<STATE> &Sol,TPZFMatrix<STATE> &DSol,TPZFMatrix<REAL> &axes,int var,TPZVec<STATE> &Solout) override;
93 public:
95  virtual void Solution(TPZMaterialData &data, int var, TPZVec<STATE> &Solout) override
96  {
97  TPZMaterial::Solution(data,var,Solout);
98  }
99 
101  virtual void Flux(TPZVec<REAL> &x, TPZVec<STATE> &Sol, TPZFMatrix<STATE> &DSol, TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux) override;
102 
103  void Errors(TPZVec<REAL> &x,TPZVec<STATE> &u,
105  TPZVec<STATE> &u_exact,TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values) override;//Cedric
106  public:
107 virtual int ClassId() const override;
108 
109 };
110 
111 #endif
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
virtual void Solution(TPZMaterialData &data, int var, TPZVec< STATE > &Solout) override
Returns the solution associated with the var index based on the finite element approximation.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the residual vector at one integration point.
clarg::argBool bc("-bc", "binary checkpoints", false)
Implements a hyper elasticity material.
virtual void Flux(TPZVec< REAL > &x, TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux) override
Computes the value of the flux function to be used by ZZ error estimator.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point...
virtual int VariableIndex(const std::string &name) override
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)=0
It computes a contribution to the stiffness matrix and load vector at one integration point...
std::string Name() override
Returns the name of the material.
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
void SetMaterial(TPZFMatrix< STATE > &xfin)
Contains TPZMatrixclass which implements full matrix (using column major representation).
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
Definition: tfad.h:64
virtual void Print(std::ostream &out) override
Prints out the data associated with the material.
TPZMatHyperElastic(int nummat, STATE e, STATE mu, STATE nu=-1., STATE lambda=-1., STATE coef1=-1., STATE coef2=-1., STATE coef3=-1.)
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc)=0
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
int Dimension() const override
Returns the integrable dimension of the material.
virtual int ClassId() const override
Define the class id associated with the class.
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
def values
Definition: rdt.py:119
virtual int NFluxes() override
Returns the number of components which form the flux function.
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
void Errors(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &dudx, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values) override
Computes the error due to the difference between the interpolated flux and the flux computed based o...
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.