NeoPZ
pzeuler.h
Go to the documentation of this file.
1 
6 #ifndef PZEULER_H
7 #define PZEULER_H
8 
9 #include <iostream>
10 #include "TPZMaterial.h"
11 #include "pzfmatrix.h"
12 #include "pzvec.h"
13 #include "pzdiscgal.h"
14 
15 #include "pzausmflux.h"
16 #include "pzgradientflux.h"
17 #include "pzlog.h"
18 class TPZCompMesh;
19 
53 
54 public:
56  enum BCType{EFreeSlip = 1};
58  enum CALCType{EFlux = 1, EGradient = 2};
60  static void SetComputeFlux(){
61  gType = EFlux;
62  }
63 
64  static void SetComputeGradient(){
65  gType = EGradient;
66  }
67 
68 #ifdef LinearConvection
69  static void SetLinearConvection(TPZCompMesh * cmesh, TPZVec<REAL> &Celerity);
70 #endif
71 
72 private:
73 
74 #ifdef LinearConvection
75  TPZVec<STATE> fCelerity;
76 #endif
77 
78  static CALCType gType;
79 
81  static STATE gGamma;
82 
85 
88 
91 
92 public:
93 
94  static REAL Gamma(){ return gGamma; }
95 
97  static void FromPrimitiveToConservative(TPZVec<STATE> &sol,STATE gamma);
98 
100  static void FromConservativeToPrimitive(TPZVec<STATE> &sol,STATE gamma);
101 
103  TPZEulerEquation(int nummat, STATE gamma);
104 
107 
110 
113 
115  TPZMaterial * NewMaterial() override;
116 
118  virtual int NStateVariables() const override;
119 
121  virtual int Dimension() const override;
122 
124  static REAL Pressure(TPZVec<STATE> &U, double gamma);
125 
127  STATE cSpeed(TPZVec<STATE> & sol);
128 
130  STATE uRes(TPZVec<STATE> & sol);
131 
132  virtual void Print(std::ostream & out) override;
133 
134  virtual std::string Name() override {return "TPZEulerEquation";}
135 
136  virtual int VariableIndex(const std::string &name) override;
137 
138  virtual int NSolutionVariables(int var) override;
139 
140  virtual void Solution(TPZVec<STATE> &Sol,TPZFMatrix<STATE> &DSol,TPZFMatrix<REAL> &axes,int var,TPZVec<STATE> &Solout) override;
141 
148  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override;
149 
150  virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix<STATE> &ef) override;
151 
152  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix<STATE> &ek, TPZFMatrix<STATE> &ef) override;
153 
154  virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix<STATE> &ef) override;
155 
156  virtual void ContributeBC(TPZMaterialData &data,
157  REAL weight,
159  TPZBndCond &bc) override;
160 
161  virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft,
162  REAL weight,
164  TPZBndCond &bc) override;
165 
166  virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft,
167  REAL weight,
168  TPZFMatrix<STATE> &ef,
169  TPZBndCond &bc) override;
170  public:
171 virtual int ClassId() const override;
172 
174 };
175 
176 #endif
177 
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
Definition: pzdiscgal.h:20
static void FromPrimitiveToConservative(TPZVec< STATE > &sol, STATE gamma)
Convert from primitive to conservative variables.
Definition: pzeuler.cpp:42
CALCType
Type of flux computing.
Definition: pzeuler.h:58
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to stiffness matrix and load vector at one integration point...
Definition: pzeuler.cpp:203
Contains the TPZGradientFlux class.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
This material implements the weak statement of the three-dimensional compressible euler equations...
Definition: pzeuler.h:52
clarg::argBool bc("-bc", "binary checkpoints", false)
static REAL Pressure(TPZVec< STATE > &U, double gamma)
Returns the pressure value.
Definition: pzeuler.cpp:322
virtual void Solution(TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
Definition: pzeuler.cpp:140
Templated vector implementation.
TPZAUSMFlux fAUSMFlux
Convective flux object.
Definition: pzeuler.h:84
virtual int NSolutionVariables(int var) override
Returns the number of variables associated with the variable indexed by var.
Definition: pzeuler.cpp:130
BCType
Type of boundary condition.
Definition: pzeuler.h:56
static REAL Gamma()
Definition: pzeuler.h:94
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: pzeuler.cpp:193
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to stiffness matrix and load vector at one BC integration point...
Definition: pzeuler.cpp:268
This abstract class defines the behaviour which each derived class needs to implement.
Definition: TPZMaterial.h:39
virtual int Dimension() const override
Object-based overload.
Definition: pzeuler.cpp:109
virtual void Print(std::ostream &out) override
Prints out the data associated with the material.
Definition: pzeuler.cpp:113
TPZMaterial * NewMaterial() override
Creates a copy of this.
Definition: pzeuler.cpp:101
static void SetComputeFlux()
Set type of flux computing.
Definition: pzeuler.h:60
static STATE gGamma
Ratio between specific heat at constant pressure and the specific heat at constant volume of a polytr...
Definition: pzeuler.h:81
virtual int ClassId() const override
Unique identifier for serialization purposes.
Definition: pzeuler.cpp:394
Contains TPZMatrixclass which implements full matrix (using column major representation).
STATE uRes(TPZVec< STATE > &sol)
Returns .
Definition: pzeuler.cpp:365
This class defines the boundary condition for TPZMaterial objects.
Definition: pzbndcond.h:29
~TPZEulerEquation()
Default destructor.
Definition: pzeuler.cpp:79
TPZGradientFlux fGradientFlux
Gradient flux object.
Definition: pzeuler.h:87
Contains the TPZAUSMFlux class.
STATE cSpeed(TPZVec< STATE > &sol)
Computes sound speed.
Definition: pzeuler.cpp:346
virtual int NStateVariables() const override
Object-based overload.
Definition: pzeuler.cpp:105
long double gamma(unsigned int n)
Evaluate the factorial of a integer.
TPZEulerEquation()
Default constructor.
Definition: pzeuler.cpp:89
void ComputeEulerFlux(TPZVec< STATE > &sol, TPZFMatrix< STATE > &F)
Compute Euler Flux.
Definition: pzeuler.cpp:375
static void FromConservativeToPrimitive(TPZVec< STATE > &sol, STATE gamma)
Convert from conservative to primitive variables.
Definition: pzeuler.cpp:61
static CALCType gType
Definition: pzeuler.h:78
static void SetComputeGradient()
Definition: pzeuler.h:64
virtual int VariableIndex(const std::string &name) override
Returns the variable index associated with the name.
Definition: pzeuler.cpp:118
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
virtual std::string Name() override
Returns the name of the material.
Definition: pzeuler.h:134
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: pzeuler.cpp:260
Contains the TPZDiscontinuousGalerkin class which implements the interface for discontinuous Galerkin...
Implements the numerical flux for AUSM problem. (Jorge?)
Definition: pzausmflux.h:17
DESCRIBE PLEASE.