NeoPZ
pzmat1dlin.h
Go to the documentation of this file.
1 
6 #ifndef MAT1DLINHPP
7 #define MAT1DLINHPP
8 
9 #include <iostream>
10 
11 
12 #include "pzfmatrix.h"
13 #include "TPZMaterial.h"
14 #include "pzvec.h"
15 
16 struct TPZElementMatrix;
17 class TPZBndCond;
18 template<class T>
19 class TPZVec;
20 
25 class TPZMat1dLin : public TPZMaterial{
26 
28 
29  public :
30 
31 
32  TPZMat1dLin(int num) : TPZRegisterClassId(&TPZMat1dLin::ClassId), TPZMaterial(num) , fXk(1,1,0.), fXc(1,1,0.), fXb(1,1,0.), fXf(1,1,0.) {
33  }
34 
36  TPZMaterial(copy), fXk(copy.fXk), fXc(copy.fXc), fXb(copy.fXb), fXf(copy.fXf)
37  {
38 
39  }
40 
42  {
44  fXk = copy.fXk;
45  fXc = copy.fXc;
46  fXb = copy.fXb;
47  fXf = copy.fXf;
48  return *this;
49  }
50 
51  virtual TPZMaterial *NewMaterial() override
52  {
53  return new TPZMat1dLin(*this);
54  }
55 
56  virtual int NStateVariables() const override {
57  return fXk.Rows();
58  }
59 
60  virtual int Dimension() const override {
61  return 1;
62  }
63 
64  void Print(std::ostream & out) override ;
65 
67  fXk = xkin;
68  fXc = xcin;
69  fXb = xbin;
70  fXf = xfin;
71  }
72 
73  virtual std::string Name() override { return "TPZMat1dLin"; }
74 
75  int NFluxes() override { return NStateVariables(); }
76 
79  virtual void Contribute(TPZMaterialData &data,
80  REAL weight,
82  TPZFMatrix<STATE> &ef) override ;
83 
86  virtual void Contribute(TPZMaterialData &data,
87  REAL weight,
88  TPZFMatrix<STATE> &ef) override
89  {
90  TPZMaterial::Contribute(data,weight,ef);
91  }
92 
95  virtual void ContributeBC(TPZMaterialData &data,
96  REAL weight,
99  TPZBndCond &bc) override ;
100 
103  virtual void ContributeBC(TPZMaterialData &data,
104  REAL weight,
105  TPZFMatrix<STATE> &ef,
106  TPZBndCond &bc) override
107  {
108  TPZMaterial::ContributeBC(data,weight,ef,bc);
109  }
110 
111  virtual void Flux(TPZVec<REAL> &x, TPZVec<STATE> &u, TPZFMatrix<STATE> &dudx, TPZFMatrix<REAL> &axes, TPZVec<STATE> &fl) override ;
112 
113  virtual void Errors(TPZVec<REAL> &x,TPZVec<STATE> &u,TPZFMatrix<STATE> &dudx, TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux,
114  TPZVec<STATE> &u_exact,TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values) override ;
115  public:
116 virtual int ClassId() const override ;
117 
118 };
119 
120 #endif
TPZMat1dLin & operator=(const TPZMat1dLin &copy)
Definition: pzmat1dlin.h:41
TPZMat1dLin(const TPZMat1dLin &copy)
Definition: pzmat1dlin.h:35
TPZFMatrix< STATE > fXc
Definition: pzmat1dlin.h:27
clarg::argBool bc("-bc", "binary checkpoints", false)
void Print(std::ostream &out) override
Prints out the data associated with the material.
Definition: pzmat1dlin.cpp:143
int NFluxes() override
Returns the number of components which form the flux function.
Definition: pzmat1dlin.h:75
TPZFMatrix< STATE > fXb
Definition: pzmat1dlin.h:27
Templated vector implementation.
TPZMaterial & operator=(const TPZMaterial &copy)
operator =
Definition: TPZMaterial.cpp:62
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Computes contribution to the stiffness matrix and right hand side at the integration point of a bound...
Definition: pzmat1dlin.cpp:67
TPZFMatrix< STATE > fXk
Definition: pzmat1dlin.h:27
virtual void Flux(TPZVec< REAL > &x, TPZVec< STATE > &u, TPZFMatrix< STATE > &dudx, TPZFMatrix< REAL > &axes, TPZVec< STATE > &fl) override
Computes the value of the flux function to be used by ZZ error estimator.
Definition: pzmat1dlin.cpp:152
This class implements a simple vector storage scheme for a templated class T. Utility.
Definition: pzgeopoint.h:19
void SetMaterial(TPZFMatrix< STATE > &xkin, TPZFMatrix< STATE > &xcin, TPZFMatrix< STATE > &xbin, TPZFMatrix< STATE > &xfin)
Definition: pzmat1dlin.h:66
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
Computes contribution to the stiffness matrix and right hand side at the integration point of a bound...
Definition: pzmat1dlin.h:103
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 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: pzmat1dlin.cpp:163
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).
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
virtual std::string Name() override
Returns the name of the material.
Definition: pzmat1dlin.h:73
TPZFMatrix< STATE > fXf
Definition: pzmat1dlin.h:27
virtual int ClassId() const override
Define the class id associated with the class.
Definition: pzmat1dlin.cpp:198
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...
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
Definition: pzelmat.h:30
TPZMat1dLin(int num)
Definition: pzmat1dlin.h:32
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Computes contribution to the stiffness matrix and right hand side at an integration point...
Definition: pzmat1dlin.cpp:16
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
Computes contribution to the stiffness matrix and right hand side at an integration point...
Definition: pzmat1dlin.h:86
def values
Definition: rdt.py:119
Implements a one dimensional linear problem.
Definition: pzmat1dlin.h:25
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
Definition: pzmat1dlin.h:51
virtual int Dimension() const override
Returns the integrable dimension of the material.
Definition: pzmat1dlin.h:60
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
Definition: pzmat1dlin.h:56