NeoPZ
TPZNullMaterial.h
Go to the documentation of this file.
1 
7 #ifndef TPZNULLMATERIALH
8 #define TPZNULLMATERIALH
9 
10 #include "TPZMaterial.h"
11 
13 {
14 
15 public:
17  fDim = 1;
18  fNState = 1;
19  }
20 
22  TPZMaterial(copy)
23  {
24  fDim = copy.fDim;
25  fNState = copy.fNState;
26  }
27 
29  {
30  fDim = copy.fDim;
31  fNState = copy.fNState;
33  return *this;
34  }
35 
42 
44  virtual ~TPZNullMaterial();
45 
47  virtual TPZMaterial * NewMaterial() override
48  {
49  return new TPZNullMaterial(*this);
50  }
51 
52 
54  virtual std::string Name() override { return "TPZNullMaterial"; }
55 
57  virtual int Dimension() const override
58  {
59  return fDim;
60  }
61 
62  void SetDimension(int dim){
63  fDim = dim;
64  }
65 
67  virtual int NStateVariables() const override
68  {
69  return fNState;
70  }
71 
72  void SetNStateVariables(int nstate)
73  {
74  fNState = nstate;
75  }
76 
78  virtual int NFluxes() override{return 0;}
79 
80 
82  virtual void Print(std::ostream &out = std::cout)override;
83 
85  virtual int VariableIndex(const std::string &name)override;
86 
91  virtual int NSolutionVariables(int var) override;
92 
94  virtual void Solution(TPZMaterialData &data, int var, TPZVec<STATE> &Solout) override;
95 
97  virtual void Solution(TPZVec<TPZMaterialData> &datavec, int var, TPZVec<STATE> &Solout) override;
98 
100  virtual void Solution(TPZMaterialData &data, TPZVec<TPZMaterialData> &dataleftvec, TPZVec<TPZMaterialData> &datarightvec, int var, TPZVec<STATE> &Solout) override;
101 
103  virtual void Solution(TPZMaterialData &data, TPZVec<TPZMaterialData> &dataleftvec, TPZVec<TPZMaterialData> &datarightvec, int var, TPZVec<STATE> &Solout, TPZCompEl * left, TPZCompEl * ritgh) override;
104 
105 protected:
106 
108  virtual void Solution(TPZVec<STATE> &Sol,TPZFMatrix<STATE> &DSol,TPZFMatrix<REAL> &axes,int var,TPZVec<STATE> &Solout) override;
109 
111  int fDim;
112 
114  int fNState = 1;
115 
116 public:
117 
118  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override;
119 
120  virtual void Contribute(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override;
121 
122  virtual void Contribute(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ef)override
123  {
124  TPZFMatrix<STATE> ek(ef.Rows(),ef.Rows(),0.);
125  Contribute(datavec, weight, ek, ef);
126  }
127 
128  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef, TPZBndCond &bc)override;
129 
130 
131  virtual void ContributeBC(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef, TPZBndCond &bc)override
132  {
133 
134  }
135 
136  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ef) override;
137 
138  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ef, TPZBndCond &bc) override;
139 
140 
141 
142 public:
143 
145  virtual int ClassId() const override;
146 
148  virtual void Write(TPZStream &buf, int withclassid) const override;
149 
151  virtual void Read(TPZStream &buf, void *context) override;
152 
153  void ErrorsHdiv(TPZMaterialData &data,TPZVec<STATE> &u_exact,TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values) override;
154 
155 };
156 
157 
158 #endif
virtual int ClassId() const override
Unique identifier for serialization purposes.
virtual std::string Name() override
Returns the name of the material.
virtual void Contribute(TPZVec< TPZMaterialData > &datavec, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point to multip...
clarg::argBool bc("-bc", "binary checkpoints", false)
TPZMaterial & operator=(const TPZMaterial &copy)
operator =
Definition: TPZMaterial.cpp:62
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
void ErrorsHdiv(TPZMaterialData &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values) override
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...
virtual void Print(std::ostream &out=std::cout) override
Prints out the data associated with the material.
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
TPZNullMaterial(int num)
int fNState
Number of state variables.
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...
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
void SetNStateVariables(int nstate)
TPZNullMaterial(const TPZNullMaterial &copy)
virtual int Dimension() const override
Returns the integrable dimension of the material.
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
int64_t Rows() const
Returns number of rows.
Definition: pzmatrix.h:803
void SetDimension(int dim)
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
virtual void ContributeBC(TPZVec< TPZMaterialData > &datavec, 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 to mul...
int fDim
Problem dimension.
TPZNullMaterial & operator=(const TPZNullMaterial &copy)
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
virtual ~TPZNullMaterial()
Default destructor.
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.
def values
Definition: rdt.py:119
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
TPZNullMaterial()
Creates a material object and inserts it in the vector of material pointers of the mesh...
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
virtual int NFluxes() override
Returns the number of components which form the flux function.