NeoPZ
TPZLinearConvection.h
Go to the documentation of this file.
1 
6 #ifndef TPZLINEARCONVECTION_H
7 #define TPZLINEARCONVECTION_H
8 
9 #include "TPZMaterial.h"
10 #include "pzfmatrix.h"
11 
12 class TPZBndCond;
18 public:
19 
20  virtual int ClassId() const override;
21 
25  TPZLinearConvection(int id,TPZVec<STATE> &conv) ;
26 
28  virtual int Dimension() const override;
29 
31  virtual int NStateVariables() const override ;
32 
34  virtual int NFluxes() override {return 2;}
35 
41  virtual void Contribute(TPZMaterialData &data, REAL weight,
42  TPZFMatrix<STATE> &ek,TPZFMatrix<STATE> &ef) override;
43 
44 
45  virtual void ContributeBC(TPZMaterialData &data,REAL weight,
47 
48  virtual void Contribute(TPZMaterialData &data, REAL weight,
49  TPZFMatrix<STATE> &ef) override
50  {
51  TPZMaterial::Contribute(data,weight,ef);
52  }
53 
54 
55  virtual void ContributeBC(TPZMaterialData &data,REAL weight,
56  TPZFMatrix<STATE> &ef,TPZBndCond &bc) override
57  {
58  TPZMaterial::ContributeBC(data,weight,ef,bc);
59  }
60 
64  virtual void Print(std::ostream &out = std::cout) override;
65 
67  virtual int VariableIndex(const std::string &name) override;
68 
69  virtual int NSolutionVariables(int var) override;
70 
71 protected:
72  virtual void Solution(TPZVec<STATE> &Sol,TPZFMatrix<STATE> &DSol,TPZFMatrix<REAL> &axes,int var,TPZVec<STATE> &Solout) override;
73 public:
74  virtual void Solution(TPZMaterialData &data,int var,TPZVec<STATE> &Solout) override
75  {
76  int numbersol = data.sol.size();
77  if (numbersol != 1) {
78  DebugStop();
79  }
80 
81  Solution(data.sol[0],data.dsol[0],data.axes,var,Solout);
82  }
83 
84  virtual void Flux(TPZVec<REAL> &x, TPZVec<STATE> &Sol, TPZFMatrix<STATE> &DSol, TPZFMatrix<REAL> &axes, TPZVec<STATE> &flux) override {}
85 
87  virtual TPZMaterial * NewMaterial() override;
88 
90  virtual void SetData(std::istream &data) override;
91 
92 private:
93  STATE fConvect[2];
94 
95 };
96 
97 #endif //TPZLINEARCONVECTION_H
virtual void SetData(std::istream &data) override
Reads data of the material from a istream (file data)
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
clarg::argBool bc("-bc", "binary checkpoints", false)
TPZLinearConvection(TPZLinearConvection &copy)
Copy constructor.
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
virtual int Dimension() const override
Returns the integrable dimension of the material.
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...
Implements a linear scalar convection equation with modified SUPG difusion.
virtual int ClassId() const override
Define the class id associated with the class.
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
int64_t size() const
Returns the number of elements of the vector.
Definition: pzvec.h:196
virtual void Print(std::ostream &out=std::cout) override
Print out the data associated with the material.
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 int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
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 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
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
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...
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
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.
virtual TPZMaterial * NewMaterial() override
To create another material of the same type.
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...
TPZSolVec sol
vector of the solutions at the integration point
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 void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to the residual vector at one integration point.