NeoPZ
TPZMatDualHybridPoisson.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 
7 #ifndef TPZMatDualHybridPoissonH
8 #define TPZMatDualHybridPoissonH
9 
10 
11 #include <iostream>
12 #include "pzdiscgal.h"
13 #include "pzfmatrix.h"
14 
24 
25  protected :
26 
28  REAL fXf;
29 
30  REAL fBetaZero;
31 
32  int mydim;
33 
34 public:
35 
36 
37 
38  TPZMatDualHybridPoisson(int nummat, REAL f, REAL betaZero);
39  TPZMatDualHybridPoisson(int matid);
40 
42 
44 
45  void SetDimension(int dim){
46  mydim = dim;
47  }
48 
49  virtual ~TPZMatDualHybridPoisson() override;
50 
51  REAL Beta(int p, REAL size) const{
52  return p*p*this->fBetaZero/size;
53  }
54 
55  virtual TPZMaterial * NewMaterial() override {
56  return new TPZMatDualHybridPoisson(*this);
57  }
58 
59  virtual int Dimension() const override { return mydim;}
60 
61  virtual int NStateVariables() const override{
62  return 1;
63  }
64 
65  virtual void Print(std::ostream & out) override;
66 
67  virtual std::string Name() override { return "TPZMatDualHybridPoisson"; }
68 
74  virtual void Contribute(TPZMaterialData &data,REAL weight,TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override;
75 
76  virtual void ContributeBC(TPZMaterialData &data,REAL weight,
78 
79  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight,
80  TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override;
81 
82  virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight,TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef,TPZBndCond &bc) override;
83 
84  virtual int VariableIndex(const std::string &name) override;
85 
86  virtual int NSolutionVariables(int var) override;
87 
88  virtual int NFluxes() override { return 2;}
89 
90 public:
91 
92  virtual void Solution(TPZMaterialData &data, int var, TPZVec<STATE> &Solout) override;
93 
94  virtual void Flux(TPZVec<REAL> &x, TPZVec<STATE> &Sol, TPZFMatrix<STATE> &DSol, TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux) override
95  {
96  DebugStop();
97  }
98 
101  TPZVec<STATE> &u_exact,TPZFMatrix<STATE> &du_exact,TPZVec<REAL> &values) override;
102 
103  virtual int NEvalErrors() override {return 3;}
104 
105  public:
106 virtual int ClassId() const override;
107 
108  virtual void Write(TPZStream &buf, int withclassid) const override {
109  DebugStop();
110  }
111 
112  virtual void Read(TPZStream &buf, void *context) override {
113  DebugStop();
114  }
115 
116 };
117 
118 #endif
119 
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
Definition: pzdiscgal.h:20
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual int Dimension() const override
Returns the integrable dimension of the material.
REAL fXf
Forcing function value.
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
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.
virtual int ClassId() const override
Unique identifier for serialization purposes.
virtual void Flux(TPZVec< REAL > &x, TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux) override
Computes the value of the flux function to be used by ZZ error estimator.
REAL Beta(int p, REAL size) const
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
void
f
Definition: test.py:287
virtual int NFluxes() override
Returns the number of components which form the flux function.
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
void
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
Definition: pzerror.h:20
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
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...
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...
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
virtual ~TPZMatDualHybridPoisson() override
virtual void Print(std::ostream &out) 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.
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
def values
Definition: rdt.py:119
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
void
Contains the TPZDiscontinuousGalerkin class which implements the interface for discontinuous Galerkin...
virtual std::string Name() override
Returns the name of the material.
virtual int NEvalErrors() override
Returns the number of norm errors. Default is 3: energy, L2 and H1.