NeoPZ
pzdiscgal.h
Go to the documentation of this file.
1 
6 #ifndef TPZDISCGALHPP
7 #define TPZDISCGALHPP
8 
9 #include <iostream>
10 #include "TPZMaterial.h"
11 #include "pzfmatrix.h"
12 #include "pzvec.h"
13 
14 class TPZMaterialData;
15 
21 
22  public :
26  TPZDiscontinuousGalerkin(int nummat);
27 
31  virtual ~TPZDiscontinuousGalerkin();
32 
33  virtual std::string Name() override;
34 
43  virtual void FillDataRequirementsInterface(TPZMaterialData &data) override;
45  virtual int GetIntegrationOrder(TPZVec<int> &porder_left, TPZVec<int> &porder_right) const;
52  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override = 0;
53 
54  virtual void Contribute(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override {
55  TPZMaterial::Contribute(datavec,weight,ek,ef);
56  }
57 
64  virtual void Contribute(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ef) override
65  {
66  TPZMaterial::Contribute(datavec,weight,ef);
67  }
68 
69 
70  virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef, TPZBndCond &bc) override = 0 ;
71 
72  virtual void ContributeBC(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef,TPZBndCond &bc) override {
73  TPZMaterial::ContributeBC(datavec,weight,ek,ef,bc);
74  }
75 
76  virtual void Contribute(TPZMaterialData &data,REAL weight,TPZFMatrix<STATE> &ef) override {
77  TPZMaterial::Contribute(data,weight,ef);
78  }
79  virtual void ContributeBC(TPZMaterialData &data,REAL weight,TPZFMatrix<STATE> &ef,TPZBndCond &bc) override {
80  TPZMaterial::ContributeBC(data,weight,ef,bc);
81  }
82 
83  virtual void ContributeBC(TPZVec<TPZMaterialData> &datavec, REAL weight, TPZFMatrix<STATE> &ef, TPZBndCond &bc) override
84  {
85  TPZMaterial::ContributeBC(datavec,weight,ef,bc);
86  }
87 
98  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef);
99  virtual void ContributeInterface(TPZVec<TPZMaterialData> &datavec, TPZVec<TPZMaterialData> &dataleftvec, TPZVec<TPZMaterialData> &datarightvec,
100  REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef);
101 
112  virtual void ContributeInterface(TPZMaterialData &data, TPZVec<TPZMaterialData> &dataleft, TPZVec<TPZMaterialData> &dataright, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef);
113 
114 
124  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix<STATE> &ef);
125 
126 
136  virtual void ContributeInterface(TPZMaterialData &data, TPZVec<TPZMaterialData> &dataleft, TPZVec<TPZMaterialData> &dataright, REAL weight, TPZFMatrix<STATE> &ef);
137 
138 
149  virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef,TPZBndCond &bc) = 0;
150 
161  virtual void ContributeBCInterface(TPZMaterialData &data, TPZVec<TPZMaterialData> &dataleft, REAL weight, TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef,TPZBndCond &bc);
162 
163 
173  virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix<STATE> &ef,TPZBndCond &bc);
174 
176  void SolutionDisc(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, int var, TPZVec<STATE> &Solout)
177  {
178  std::cout << __PRETTY_FUNCTION__ << " should never be called\n";
179  }
180 
194  virtual int IsInterfaceConservative();
195 
200  virtual void InterfaceJump(TPZVec<REAL> &x, TPZSolVec &leftu,TPZSolVec &rightu,TPZSolVec &jump);
201 
202 
208  virtual void BCInterfaceJump(TPZVec<REAL> &x, TPZSolVec &leftu,TPZBndCond &bc,TPZSolVec & jump);
209 
210 
211 
213  REAL weight,
214  TPZVec<STATE> &nkL,
215  TPZVec<STATE> &nkR,
216  int &errorid) {
217  PZError << "Method not implemented\n";
218  }
219 
221  REAL weight,
222  TPZVec<STATE> &nk,
223  TPZBndCond &bc,
224  int &errorid) {
225  PZError << "Method not implemented\n";
226  }
227 
228  virtual void Errors(TPZVec<REAL> &x,TPZVec<STATE> &u,
230  TPZVec<STATE> &u_exact,TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values) override {
231  TPZMaterial::Errors(x,u, dudx, axes, flux, u_exact,du_exact,values);
232 
233  }
234 
235  virtual void Errors(TPZMaterialData &data, TPZVec<STATE> &u_exact, TPZFMatrix<STATE> &du_exact, TPZVec<REAL> &errors) override;
236 
237  virtual void Errors(TPZVec<TPZMaterialData> &data, TPZVec<STATE> &u_exact, TPZFMatrix<STATE> &du_exact, TPZVec<REAL> &errors) override;
238 
244  public:
245 
246  int ClassId() const override;
247 
249  void Write(TPZStream &buf, int withclassid) const override;
250 
252  void Read(TPZStream &buf, void *context) override;
253 
257 };
258 
259 
260 #endif
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
Definition: pzdiscgal.h:20
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the residual vector at one integration point.
Definition: pzdiscgal.h:76
void SolutionDisc(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, int var, TPZVec< STATE > &Solout)
Returns the solution associated with the var index based on the finite element approximation.
Definition: pzdiscgal.h:176
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: pzdiscgal.h:72
int ClassId() const override
Unique identifier for serialization purposes.
Definition: pzdiscgal.cpp:110
virtual void Errors(TPZMaterialData &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &errors)
Definition: TPZMaterial.h:496
TPZDiscontinuousGalerkin()
Simple constructor.
Definition: pzdiscgal.cpp:12
virtual void Contribute(TPZVec< TPZMaterialData > &datavec, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point to multip...
Definition: pzdiscgal.h:54
virtual void ContributeBC(TPZVec< TPZMaterialData > &datavec, REAL weight, 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: pzdiscgal.h:83
clarg::argBool bc("-bc", "binary checkpoints", false)
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: pzdiscgal.h:228
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
Definition: pzdiscgal.cpp:118
Templated vector implementation.
virtual ~TPZDiscontinuousGalerkin()
Destructor.
Definition: pzdiscgal.cpp:18
virtual void ContributeInterfaceBCErrors(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZVec< STATE > &nk, TPZBndCond &bc, int &errorid)
Definition: pzdiscgal.h:220
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: pzdiscgal.h:79
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 FillDataRequirementsInterface(TPZMaterialData &data) override
Fill material data parameter with necessary requirements for the ContributeInterface method...
Definition: pzdiscgal.cpp:22
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
virtual std::string Name() override
Returns the name of the material.
Definition: pzdiscgal.cpp:20
virtual void BCInterfaceJump(TPZVec< REAL > &x, TPZSolVec &leftu, TPZBndCond &bc, TPZSolVec &jump)
Computes interface jump from element to Dirichlet boundary condition. It has to reimplemented.
Definition: pzdiscgal.cpp:102
virtual int GetIntegrationOrder(TPZVec< int > &porder_left, TPZVec< int > &porder_right) const
return the integration order as a function of interpolation orders of the left and right elements ...
Definition: pzdiscgal.cpp:123
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
Definition: pzdiscgal.cpp:114
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override=0
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
Contains TPZMatrixclass which implements full matrix (using column major representation).
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
It computes a contribution to stiffness matrix and load vector at one integration point...
Definition: pzdiscgal.cpp:30
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc)=0
It computes a contribution to stiffness matrix and load vector at one BC integration point...
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 ContributeInterfaceErrors(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZVec< STATE > &nkL, TPZVec< STATE > &nkR, int &errorid)
Definition: pzdiscgal.h:212
virtual void InterfaceJump(TPZVec< REAL > &x, TPZSolVec &leftu, TPZSolVec &rightu, TPZSolVec &jump)
Computes interface jump = leftu - rightu.
Definition: pzdiscgal.cpp:77
virtual int IsInterfaceConservative()
Dicontinuous galerkin materials implement contribution of discontinuous elements and interfaces...
Definition: pzdiscgal.cpp:73
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
def values
Definition: rdt.py:119
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: pzdiscgal.h:64
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override=0
It computes a contribution to the stiffness matrix and load vector at one integration point...
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15