NeoPZ
pzelasAXImat.h
Go to the documentation of this file.
1 
6 #ifndef ELASAXIMATHPP
7 #define ELASAXIMATHPP
8 
9 #include <iostream>
10 
11 #include "TPZMaterial.h"
12 #include "pzdiscgal.h"
13 
14 #include <vector>
15 #include <math.h>
16 
22 
23  public :
24 
36  TPZElasticityAxiMaterial(int num, REAL E, REAL nu, REAL fx, REAL fy);
37 
48  TPZElasticityAxiMaterial(int num, REAL E, REAL nu, REAL fx, REAL fy, REAL coefTheta, REAL coefAlpha);
49 
52 
54  virtual TPZMaterial * NewMaterial() override { return new TPZElasticityAxiMaterial(*this);}
55 
57  virtual ~TPZElasticityAxiMaterial();
58 
67 
68  REAL ComputeR(TPZVec<REAL> &x);
69 
70  void SetMohrCoulomb(double c, double phi)
71  {
72  f_c = c;
73  f_phi = phi;
74  }
75 
77  {
78  fAlpha = alpha;
79  }
80 
81  void SetTemperature(REAL delt)
82  {
83  fDelTemperature = delt;
84  }
85 
87  virtual int Dimension() const override { return 2;}
88 
90  virtual int NStateVariables() const override;
91 
93  virtual void Print(std::ostream & out = std::cout) override;
94 
96  std::string Name() override { return "TPZElasticityAxiMaterial"; }
97 
99  virtual short NumberOfFluxes(){return 3;}
100 
102  virtual int NFluxes() override { return 3;}
103 
105  virtual void Contribute(TPZMaterialData &data, REAL weight,TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override;
106 
108  virtual void ContributeBC(TPZMaterialData &data,REAL weight,
110 
111  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright,
112  REAL weight, TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override;
113 
114  virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft,
115  REAL weight, TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef,TPZBndCond &bc) override {
116 
117  PZError << "\nFATAL ERROR - Method not implemented: " << __PRETTY_FUNCTION__ << "\n";
118  DebugStop();
119  }
120 
122  virtual int VariableIndex(const std::string &name) override;
123 
125  virtual int NSolutionVariables(int var) override;
126 
128  virtual void Solution(TPZMaterialData &data, int var, TPZVec<STATE> &Solout) override;
129 
131  virtual void Flux(TPZVec<REAL> &x, TPZVec<STATE> &Sol, TPZFMatrix<STATE> &DSol, TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux) override;
132 
137  void Errors(TPZVec<REAL> &x,TPZVec<STATE> &u,
139  TPZVec<STATE> &u_exact,TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values) override;//Cedric
140 
142  REAL E() {return fE;}
143 
145  REAL Nu() {return fnu;}
146 
148  void SetPreStress(REAL Sigxx, REAL Sigyy, REAL Sigxy);
149 
150  void SetTemperatureFunction(void (*func)(const TPZVec<REAL> &rz, REAL &temperature))
151  {
152  fTemperatureFunction = func;
153  }
154 
155  public:
156 virtual int ClassId() const override;
157 
158 
159  virtual void Read(TPZStream &buf, void *context) override;
160 
161  virtual void Write(TPZStream &buf, int withclassid) const override;
162 
166 
167  REAL fIntegral;
168 
169 private:
170 
172  REAL f_phi;
174  REAL f_c;
175 
177  REAL fE;
178 
180  REAL fnu;
181 
183  REAL fAlpha;
184 
186  REAL ff[3];
187 
190 
193 
196 
199 
202 
205 
208 
211 
213  void (*fTemperatureFunction)(const TPZVec<REAL> &rz, REAL &temperature);
214 
215 };
216 
217 #endif
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
Definition: pzdiscgal.h:20
REAL fPenaltyConstant
Penalty term.
Definition: pzelasAXImat.h:210
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...
void SetMohrCoulomb(double c, double phi)
Definition: pzelasAXImat.h:70
TPZManVector< REAL > f_AxisZ
Revolution Axis.
Definition: pzelasAXImat.h:201
Implements a two dimensional elastic material in plane stress or strain.
Definition: pzelasAXImat.h:21
REAL fAlpha
Thermal expansion coeficient.
Definition: pzelasAXImat.h:183
REAL fDelTemperature
Temperature difference.
Definition: pzelasAXImat.h:189
clarg::argBool bc("-bc", "binary checkpoints", false)
TPZManVector< REAL > f_Origin
Origin of AxisR and AxisZ.
Definition: pzelasAXImat.h:204
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 ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to stiffness matrix and load vector at one integration point...
virtual int ClassId() const override
Unique identifier for serialization purposes.
REAL f_phi
Mohr Coulomb Plasticity Criteria Data.
Definition: pzelasAXImat.h:172
void SetOrigin(TPZManVector< REAL > &Orig, TPZManVector< REAL > &AxisZ, TPZManVector< REAL > &AxisR)
Set the origin of Revolution Axis ( ), the direction of Revolution Axis ( ), and the Radius vector (...
REAL E()
Returns the elasticity modulus E.
Definition: pzelasAXImat.h:142
void SetTemperature(REAL delt)
Definition: pzelasAXImat.h:81
void SetTemperatureFunction(void(*func)(const TPZVec< REAL > &rz, REAL &temperature))
Definition: pzelasAXImat.h:150
REAL Nu()
Returns the poison coefficient modulus E.
Definition: pzelasAXImat.h:145
TPZElasticityAxiMaterial()
Default constructor.
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
virtual int Dimension() const override
Returns the model dimension.
Definition: pzelasAXImat.h:87
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
TPZManVector< REAL > GetAxisZ()
REAL fSymmetric
Symmetric.
Definition: pzelasAXImat.h:207
REAL ComputeR(TPZVec< REAL > &x)
REAL ff[3]
Forcing vector.
Definition: pzelasAXImat.h:186
virtual void Print(std::ostream &out=std::cout) override
Prints the material data.
virtual TPZMaterial * NewMaterial() override
Creates a new material from the current object ??
Definition: pzelasAXImat.h:54
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
TPZManVector< REAL > GetAxisR()
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
virtual ~TPZElasticityAxiMaterial()
Destructor.
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
void SetPreStress(REAL Sigxx, REAL Sigyy, REAL Sigxy)
Sets PresStress Tensor.
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var. var is obtained by cal...
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.
std::string Name() override
Returns the material name.
Definition: pzelasAXImat.h:96
REAL f_c
Mohr Coulomb Plasticity Criteria Data.
Definition: pzelasAXImat.h:174
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Calculates the element stiffness matrix.
void(* fTemperatureFunction)(const TPZVec< REAL > &rz, REAL &temperature)
Function which defines the temperature.
Definition: pzelasAXImat.h:213
void SetThermalExpansionCoefficient(REAL alpha)
Definition: pzelasAXImat.h:76
TPZManVector< REAL > GetOrigin()
virtual short NumberOfFluxes()
Return the number of components which form the flux function.
Definition: pzelasAXImat.h:99
REAL fnu
Poison coeficient.
Definition: pzelasAXImat.h:180
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
virtual int NFluxes() override
Return the number of components which form the flux function.
Definition: pzelasAXImat.h:102
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
def values
Definition: rdt.py:119
Contains the TPZDiscontinuousGalerkin class which implements the interface for discontinuous Galerkin...
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Applies the element boundary conditions.
REAL fE
Elasticity modulus.
Definition: pzelasAXImat.h:177
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to stiffness matrix and load vector at one BC integration point...
Definition: pzelasAXImat.h:114
TPZManVector< REAL > f_AxisR
Direction of Surface.
Definition: pzelasAXImat.h:198
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15