NeoPZ
pzmattest.h
Go to the documentation of this file.
1 
6 #ifndef MATTESTHPP
7 #define MATTESTHPP
8 
9 
10 #include "TPZMaterial.h"
11 #include "pzfmatrix.h"
12 
17 class TPZMaterialTest : public TPZMaterial {
18 
19  int fNumMat;//material id
20  STATE fAlfa;//intensity of singularity
21  STATE fX0;//singularity
23 
24  public :
25 
26  TPZMaterialTest(int nummat, STATE alfa, STATE x0);
27 
28  virtual ~TPZMaterialTest();
29 
30  STATE Alfa() {return fAlfa;}
31 
32  STATE X0() {return fX0;}
33 
35  fXf = xkin;
36  }
37 
38 // int Dimension() { return 2;}
39 
40  virtual int NStateVariables() const override;
41 
42  virtual void Print(std::ostream & out) override;
43 
44  virtual std::string Name() override { return "TPZMaterialTest"; }
45 
46  virtual void Contribute(TPZMaterialData &data,
47  REAL weight,
49  TPZFMatrix<STATE> &ef) override;
50 
51 
52  virtual void ContributeBC(TPZMaterialData &data,
53  REAL weight,
56  TPZBndCond &bc) override;
57 
58  virtual void Contribute(TPZMaterialData &data,
59  REAL weight,
60  TPZFMatrix<STATE> &ef) override
61  {
62  TPZMaterial::Contribute(data,weight,ef);
63  }
64 
65 
66  virtual void ContributeBC(TPZMaterialData &data,
67  REAL weight,
69  TPZBndCond &bc) override
70  {
71  TPZMaterial::ContributeBC(data,weight,ef,bc);
72  }
73 
74  virtual int VariableIndex(const std::string &name) override;
75 
76  virtual int NSolutionVariables(int var) override;
77 
78  virtual int NFluxes() override { return 2;}
79 
80 protected:
81  virtual void Solution(TPZVec<STATE> &Sol,TPZFMatrix<STATE> &DSol,TPZFMatrix<REAL> &axes,int var,TPZVec<STATE> &Solout) override;
82 public:
84  virtual void Solution(TPZMaterialData &data, int var, TPZVec<STATE> &Solout) override
85  {
86  TPZMaterial::Solution(data,var,Solout);
87  }
88 
90  virtual void Flux(TPZVec<REAL> &x, TPZVec<STATE> &Sol, TPZFMatrix<STATE> &DSol, TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux) override;
91 
94  TPZVec<STATE> &u_exact,TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values) override;//Cedric
95 };
96 
97 #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.
DESCRIBE PLEASE.
Definition: pzmattest.h:17
clarg::argBool bc("-bc", "binary checkpoints", false)
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: pzmattest.cpp:33
STATE Alfa()
Definition: pzmattest.h:30
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: pzmattest.h:84
virtual void Print(std::ostream &out) override
Prints out the data associated with the material.
Definition: pzmattest.cpp:27
void SetMaterial(TPZFMatrix< STATE > &xkin)
Definition: pzmattest.h:34
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
Definition: pzmattest.cpp:23
STATE X0()
Definition: pzmattest.h:32
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...
virtual int NFluxes() override
Returns the number of components which form the flux function.
Definition: pzmattest.h:78
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
Definition: pzmattest.cpp:127
Contains TPZMatrixclass which implements full matrix (using column major representation).
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
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...
Definition: pzmattest.cpp:154
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
Definition: pzmattest.cpp:133
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: pzmattest.cpp:56
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 Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the residual vector at one integration point.
Definition: pzmattest.h:58
virtual std::string Name() override
Returns the name of the material.
Definition: pzmattest.h:44
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: pzmattest.h:66
virtual ~TPZMaterialTest()
Definition: pzmattest.cpp:20
virtual void Flux(TPZVec< REAL > &x, TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux) override
Compute the value of the flux function to be used by ZZ error estimator.
Definition: pzmattest.cpp:147
TPZFMatrix< STATE > fXf
Definition: pzmattest.h:22
TPZMaterialTest(int nummat, STATE alfa, STATE x0)
Definition: pzmattest.cpp:15
def values
Definition: rdt.py:119
virtual int VariableIndex(const std::string &name) override
Definition: pzmattest.cpp:118