NeoPZ
TPZVecL2.h
Go to the documentation of this file.
1 
7 #ifndef PZVECL2HPP
8 #define PZVECL2HPP
9 
10 #include "TPZMaterial.h"
11 
22 class TPZVecL2 : public TPZMaterial
23 {
24 
25 
26 public:
27 
30  TPZVecL2(int id);
31 
33  TPZVecL2();
34 
37  TPZVecL2(const TPZVecL2 &mat);
38 
39  TPZVecL2 &operator=(const TPZVecL2 &mat);
40 
42  virtual ~TPZVecL2();
43 
50  virtual std::string Name() override { return "TPZVecL2"; }
51 
53  virtual int Dimension() const override
54  {
55  return fDim;
56  }
57 
58  void SetDimension(int dim){
59  fDim = dim;
60  }
61 
63  virtual int NStateVariables() const override
64  {
65  return fNState;
66  }
67 
68  void SetNStateVariables(int nstate)
69  {
70  fNState = nstate;
71  }
72 
74  virtual int NFluxes() override {return 0;}
75 
76 
78  virtual void Print(std::ostream &out = std::cout) override;
79 
81  virtual int VariableIndex(const std::string &name) override;
82 
87  virtual int NSolutionVariables(int var) override;
88 
90  virtual void Solution(TPZMaterialData &data, int var, TPZVec<STATE> &Solout) override;
91 
93  virtual void Solution(TPZVec<TPZMaterialData> &datavec, int var, TPZVec<STATE> &Solout) override;
94 
96  virtual void Solution(TPZMaterialData &data, TPZVec<TPZMaterialData> &dataleftvec, TPZVec<TPZMaterialData> &datarightvec, int var, TPZVec<STATE> &Solout) override;
97 
99  virtual void Solution(TPZMaterialData &data, TPZVec<TPZMaterialData> &dataleftvec, TPZVec<TPZMaterialData> &datarightvec, int var, TPZVec<STATE> &Solout, TPZCompEl * left, TPZCompEl * ritgh) override;
100 
101 protected:
103  virtual void Solution(TPZVec<STATE> &Sol,TPZFMatrix<STATE> &DSol,TPZFMatrix<REAL> &axes,int var,TPZVec<STATE> &Solout) override;
104 
106  int fDim;
107 
109  int fNState = 1;
110 
111 public:
112 
125  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override;
126 
127 
135  virtual void Contribute(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override;
136 
144  virtual void Contribute(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ef) override
145  {
146  TPZFMatrix<STATE> ek(ef.Rows(),ef.Rows(),0.);
147  Contribute(datavec, weight, ek, ef);
148  }
149 
159  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef, TPZBndCond &bc) override;
160 
161 
172  virtual void ContributeBC(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef, TPZBndCond &bc) override
173  {
174 
175  }
176 
184  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ef) override;
185 
194  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ef, TPZBndCond &bc) override;
195 
200  virtual TPZMaterial * NewMaterial() override;
201 
207  public:
208 virtual int ClassId() const override;
209 
210 
212  virtual void Write(TPZStream &buf, int withclassid) const override;
213 
215  virtual void Read(TPZStream &buf, void *context) override;
216 
217  void ErrorsHdiv(TPZMaterialData &data,TPZVec<STATE> &u_exact,TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values) override;
218 
221 };
222 
223 #endif
224 
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
Definition: TPZVecL2.cpp:58
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...
Definition: TPZVecL2.h:144
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: TPZVecL2.cpp:174
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: TPZVecL2.cpp:75
virtual ~TPZVecL2()
Default destructor.
Definition: TPZVecL2.cpp:36
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
Definition: TPZVecL2.cpp:66
void ErrorsHdiv(TPZMaterialData &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values) override
Definition: TPZVecL2.cpp:284
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
Definition: TPZVecL2.cpp:145
virtual int Dimension() const override
Returns the integrable dimension of the material.
Definition: TPZVecL2.h:53
int fNState
Number of state variables.
Definition: TPZVecL2.h:109
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZVecL2.h:22
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
TPZVecL2()
Default constructor.
Definition: TPZVecL2.cpp:26
virtual std::string Name() override
Fill material data parameter with necessary requirements for the.
Definition: TPZVecL2.h:50
void SetDimension(int dim)
Definition: TPZVecL2.h:58
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
Definition: TPZVecL2.h:63
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
Definition: TPZVecL2.cpp:116
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...
Definition: TPZVecL2.h:172
virtual int NFluxes() override
Returns the number of components which form the flux function.
Definition: TPZVecL2.h:74
virtual void Print(std::ostream &out=std::cout) override
Prints out the data associated with the material.
Definition: TPZVecL2.cpp:52
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
virtual int ClassId() const override
Unique identifier for serialization purposes.
Definition: TPZVecL2.cpp:140
def values
Definition: rdt.py:119
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
Definition: TPZVecL2.cpp:155
void SetNStateVariables(int nstate)
Definition: TPZVecL2.h:68
TPZVecL2 & operator=(const TPZVecL2 &mat)
Definition: TPZVecL2.cpp:46
Defines the interface of a computational element. Computational Element.
Definition: pzcompel.h:59
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: TPZVecL2.cpp:230
int fDim
Problem dimension.
Definition: TPZVecL2.h:106