NeoPZ
pzmattest3d.h
Go to the documentation of this file.
1 
6 #ifndef MATTEST3DHPP
7 #define MATTEST3DHPP
8 
9 #include "TPZMaterial.h"
10 #include "pzfmatrix.h"
11 
17 {
18 private:
19 
22 
23  public :
26 
28  TPZMaterialTest3D(int nummat);
29 
31  virtual ~TPZMaterialTest3D();
32 
34  static int geq3;
35 
37  void SetMaterial(TPZFMatrix<STATE> &xfin);
38 
39  virtual int Dimension() const override;
40 
41  virtual int NStateVariables() const override;
42 
44  virtual void Print(std::ostream & out) override;
45 
46  virtual std::string Name() override { return "TPZMaterialTest3D"; }
47 
48  virtual void Contribute( TPZMaterialData &data,REAL weight,
49  TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef ) override;
50 
51  virtual void ContributeBC( TPZMaterialData &data,REAL weight,
53 
54  virtual void Contribute( TPZMaterialData &data,REAL weight,
55  TPZFMatrix<STATE> &ef ) override
56  {
57  TPZMaterial::Contribute(data,weight,ef);
58  }
59 
60  virtual void ContributeBC( TPZMaterialData &data,REAL weight,
61  TPZFMatrix<STATE> &ef,TPZBndCond &bc ) override
62  {
63  TPZMaterial::ContributeBC(data,weight,ef,bc);
64  }
65 
66  virtual int VariableIndex(const std::string &name) override;
67 
68  virtual int NSolutionVariables(int var) override;
69 
70  virtual int NFluxes() override { return 3;}
71 
72 protected:
73  virtual void Solution( TPZVec<STATE> &Sol,TPZFMatrix<STATE> &DSol,TPZFMatrix<REAL> &axes,
74  int var,TPZVec<STATE> &Solout ) override;
75 public:
80  virtual void Solution(TPZMaterialData &data, int var, TPZVec<STATE> &Solout) override
81  {
82  TPZMaterial::Solution(data,var,Solout);
83  }
84 
85  virtual TPZMaterial * NewMaterial() override;
86 
88  virtual void Flux( TPZVec<REAL> &x, TPZVec<STATE> &Sol,
89  TPZFMatrix<STATE> &DSol, TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux ) override;
90 
91  virtual void Errors( TPZVec<REAL> &x,TPZVec<STATE> &u,TPZFMatrix<STATE> &dudx,
92  TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux,TPZVec<STATE> &u_exact,
93  TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values ) override;
94 
95  public:
96 virtual int ClassId() const override;
97 
98 
99  virtual void Read(TPZStream &buf, void *context) override;
100 
101  virtual void Write(TPZStream &buf, int withclassid) const override;
102 };
103 
104 #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 int ClassId() const override
Define the class id associated with the class.
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...
Definition: pzmattest3d.cpp:90
virtual void Print(std::ostream &out) override
Prints the object data structure.
Definition: pzmattest3d.cpp:44
virtual int NFluxes() override
Returns the number of components which form the flux function.
Definition: pzmattest3d.h:70
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the residual vector at one integration point.
Definition: pzmattest3d.h:54
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 std::string Name() override
Returns the name of the material.
Definition: pzmattest3d.h:46
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.
Definition: pzmattest3d.h:80
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...
static int geq3
Cedric : para testes no programa main 3dmaterial.c.
Definition: pzmattest3d.h:34
void SetMaterial(TPZFMatrix< STATE > &xfin)
Set the flow.
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...
Definition: pzmattest3d.cpp:53
virtual 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...
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
Contains TPZMatrixclass which implements full matrix (using column major representation).
Implements a three dimensional linear material for test.
Definition: pzmattest3d.h:16
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
virtual int Dimension() const override
Returns the integrable dimension of the material.
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...
Definition: pzmattest3d.h:60
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 int NStateVariables() const override
Returns the number of state variables associated with the material.
Definition: pzmattest3d.cpp:39
TPZMaterialTest3D()
Default empty constructor.
Definition: pzmattest3d.cpp:24
virtual int VariableIndex(const std::string &name) override
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
TPZFMatrix< STATE > fXf
Source.
Definition: pzmattest3d.h:21
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
def values
Definition: rdt.py:119
virtual void Read(TPZStream &buf, void *context) override
read objects from the stream
virtual ~TPZMaterialTest3D()
Destructor.
Definition: pzmattest3d.cpp:35
virtual void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.