NeoPZ
|
This class adds to the term of diffusion to the variacional formulation
of the differential equation partial compressible of Euler (hyperbolic).
More...
#include <pzartdiff.h>
Public Member Functions | |
TPZArtDiff () | |
Simple constructor. More... | |
TPZArtDiff (TPZArtDiffType type, REAL gamma, REAL CFL=0., REAL delta=0.) | |
Specific constructor. More... | |
virtual | ~TPZArtDiff () |
template<class T > | |
void | ComputeTau (int dim, TPZFMatrix< REAL > &jacinv, TPZVec< T > &Sol, TPZVec< TPZDiffMatrix< T > > &Ai, TPZVec< TPZDiffMatrix< T > > &Tau) |
Computes the diffusive term according to the name. More... | |
A B C matrices and operations | |
template<class T > | |
void | ODotOperator (TPZVec< REAL > &dphi, TPZVec< TPZDiffMatrix< T > > &M, TPZDiffMatrix< T > &Result) |
Operation product point in the diffusion term. More... | |
template<class T > | |
void | ODotOperator (TPZVec< REAL > &dphi, TPZVec< TPZVec< T > > &TauDiv, TPZVec< T > &Result) |
Operation product point in the diffusion term. More... | |
void | Divergent (TPZFMatrix< STATE > &dsol, TPZFMatrix< REAL > &dphi, TPZVec< TPZDiffMatrix< STATE > > &Ai, TPZVec< STATE > &Div, TPZDiffMatrix< STATE > *dDiv) |
Evaluates the divergent of F. More... | |
Diff setup | |
template<class T > | |
void | PrepareDiff (int dim, TPZFMatrix< REAL > &jacinv, TPZVec< T > &U, TPZVec< TPZDiffMatrix< T > > &Ai, TPZVec< TPZDiffMatrix< T > > &Tau) |
Computes the common values A B C and Tau vector of matrixes for contributions. More... | |
void | PrepareFastDiff (int dim, TPZFMatrix< REAL > &jacinv, TPZVec< STATE > &sol, TPZFMatrix< STATE > &dsol, TPZFMatrix< REAL > &dphi, TPZVec< TPZVec< STATE > > &TauDiv, TPZVec< TPZDiffMatrix< STATE > > *pTaudDiv=NULL) |
Prepares the data to compute the diffusive term as fast as possible, sparing operations. More... | |
Contribute methods | |
void | ContributeApproxImplDiff (int dim, TPZFMatrix< REAL > &jacinv, TPZVec< STATE > &sol, TPZFMatrix< STATE > &dsol, TPZFMatrix< REAL > &dphix, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, REAL weight, REAL timeStep, REAL deltaX) |
Contributes the diffusion term to the tangent matrix (ek-approximated) and residual vector (ef) More... | |
void | ContributeExplDiff (int dim, TPZFMatrix< REAL > &jacinv, TPZVec< STATE > &sol, TPZFMatrix< STATE > &dsol, TPZFMatrix< REAL > &dphix, TPZFMatrix< STATE > &ef, REAL weight, REAL timeStep, REAL deltaX) |
Contributes the diffusion term to the tangent matrix (ek-approximated) and residual vector (ef) More... | |
Public Member Functions inherited from TPZSavable | |
TPZSavable () | |
virtual | ~TPZSavable () |
virtual std::list< std::map< std::string, uint64_t > > | VersionHistory () const |
virtual std::pair< std::string, uint64_t > | Version () const |
virtual bool | Compare (TPZSavable *copy, bool override=false) |
Compares the object for identity with the object pointed to, eventually copy the object. More... | |
virtual bool | Compare (TPZSavable *copy, bool override=false) const |
Compares the object for identity with the object pointed to, eventually copy the object. More... | |
Public Member Functions inherited from TPZRegisterClassId | |
template<typename T > | |
TPZRegisterClassId (int(T::*)() const) | |
TPZRegisterClassId ()=default | |
Static Public Member Functions | |
Intermediate Matrices | |
template<class T > | |
static void | RotMatrix (TPZVec< T > &sol, T &us, TPZDiffMatrix< T > &Rot, TPZDiffMatrix< T > &RotT) |
template<class T > | |
static void | MMatrix (TPZVec< T > &sol, T &us, REAL gamma, TPZDiffMatrix< T > &M, TPZDiffMatrix< T > &Mi) |
template<class T > | |
static void | RMMatrix (TPZVec< T > &sol, T &us, REAL gamma, TPZDiffMatrix< T > &RTM, TPZDiffMatrix< T > &RMi) |
template<class T > | |
static void | EigenSystemSUPG (TPZVec< T > &sol, T &us, T &c, REAL gamma, TPZDiffMatrix< T > &X, TPZDiffMatrix< T > &Xi, TPZDiffMatrix< T > &Lambda) |
template<class T > | |
static void | EigenSystemBornhaus (TPZVec< T > &sol, T &us, T &c, REAL gamma, TPZVec< REAL > &aaS, TPZDiffMatrix< T > &Y, TPZDiffMatrix< T > &Yi, TPZDiffMatrix< T > &Lambda) |
template<class T > | |
static void | ContributeBornhaus (TPZVec< T > &sol, T &us, T &c, REAL gamma, TPZVec< REAL > &aaS, TPZDiffMatrix< T > &Mat) |
Static Public Member Functions inherited from TPZSavable | |
static std::set< TPZRestoreClassBase * > & | RestoreClassSet () |
This static function guarantees that the gMap object is available when needed. More... | |
static std::map< int, TPZRestore_t > & | ClassIdMap () |
This static function guarantees that the gMap object is available when needed. More... | |
static std::pair< std::string, uint64_t > | NeoPZVersion () |
static void | Register (TPZRestoreClassBase *restore) |
static void | RegisterClassId (int classid, TPZRestore_t fun) |
static TPZSavable * | CreateInstance (const int &classId) |
Private Member Functions | |
template<class T > | |
void | SUPG (int dim, TPZVec< T > &sol, TPZVec< TPZDiffMatrix< T > > &Ai, TPZVec< TPZDiffMatrix< T > > &Tau) |
template<class T > | |
void | LS (int dim, TPZVec< T > &sol, TPZVec< TPZDiffMatrix< T > > &Ai, TPZVec< TPZDiffMatrix< T > > &Tau) |
template<class T > | |
void | LST (int dim, TPZVec< T > &sol, TPZVec< TPZDiffMatrix< T > > &Ai, TPZVec< TPZDiffMatrix< T > > &Tau) |
template<class T > | |
void | Bornhaus (int dim, TPZFMatrix< REAL > &jacinv, TPZVec< T > &sol, TPZVec< TPZDiffMatrix< T > > &Ai, TPZVec< TPZDiffMatrix< T > > &Tau) |
Private Attributes | |
TPZArtDiffType | fArtDiffType |
Kind of artificial diffusion term to apply. More... | |
REAL | fGamma |
Ratio between specific heat is constant and the specific heat the constant volume of a polytropic gas. More... | |
REAL | fDelta |
Scalar coefficient of the element in the diffusion term. More... | |
REAL | fCFL |
number More... | |
Attributes and parameters | |
TPZArtDiffType | ArtDiffType () |
Returns the type of artifical diffusion. More... | |
void | SetArtDiffType (TPZArtDiffType type) |
Configures the type of artificial diffusion. More... | |
TPZString | DiffusionName () |
Returns the name of diffusive term. More... | |
REAL | OptimalDelta () |
Returns the best value for delta based on the interpolation degree. More... | |
REAL | Delta (REAL deltaX, TPZVec< STATE > &sol) |
Returns the stored value for delta. More... | |
void | SetDelta (REAL delta) |
Sets the value for delta. More... | |
REAL | OptimalCFL (int degree=TPZCompEl::GetgOrder()) |
Returns the best value for based on the interpolation degree. More... | |
void | Write (TPZStream &buf, int withclassid) const override |
Save the element data to a stream. More... | |
void | Read (TPZStream &buf, void *context) override |
Read the element data from a stream. More... | |
int | ClassId () const override |
Class identificator. More... | |
template<class T > | |
static void | Pressure (REAL gamma, int dim, T &press, TPZVec< T > &U) |
pressure More... | |
This class adds to the term of diffusion to the variacional formulation
of the differential equation partial compressible of Euler (hyperbolic).
Definition at line 62 of file pzartdiff.h.
TPZArtDiff::TPZArtDiff | ( | ) |
Simple constructor.
Definition at line 25 of file pzartdiff.cpp.
TPZArtDiff::TPZArtDiff | ( | TPZArtDiffType | type, |
REAL | gamma, | ||
REAL | CFL = 0. , |
||
REAL | delta = 0. |
||
) |
Specific constructor.
Definition at line 15 of file pzartdiff.cpp.
|
virtual |
Definition at line 34 of file pzartdiff.cpp.
TPZArtDiffType TPZArtDiff::ArtDiffType | ( | ) |
Returns the type of artifical diffusion.
Definition at line 38 of file pzartdiff.cpp.
References fArtDiffType.
Referenced by Read().
|
private |
Definition at line 400 of file pzartdiff.cpp.
References ContributeBornhaus(), TPZEulerConsLaw::cSpeed(), EigenSystemBornhaus(), fGamma, MMatrix(), TPZDiffMatrix< T >::Multiply(), RMMatrix(), RotMatrix(), and TPZEulerConsLaw::uRes().
Referenced by ComputeTau().
|
overridevirtual |
Class identificator.
Implements TPZSavable.
Definition at line 848 of file pzartdiff.cpp.
References Hash().
void TPZArtDiff::ComputeTau | ( | int | dim, |
TPZFMatrix< REAL > & | jacinv, | ||
TPZVec< T > & | Sol, | ||
TPZVec< TPZDiffMatrix< T > > & | Ai, | ||
TPZVec< TPZDiffMatrix< T > > & | Tau | ||
) |
Computes the diffusive term according to the name.
Tau tensor
[in] | dim | Spatial dimension of the problem |
[in] | jacinv | Inverse jacobian of the mapping. |
[in] | Sol | Solution vector |
[in] | Ai | Vector of tensors tangent to the directional fluxes |
[out] | Tau | Diffusive tensors |
Definition at line 297 of file pzartdiff.cpp.
References Bornhaus(), Bornhaus_AD, fArtDiffType, LeastSquares_AD, LS(), LST(), PZError, SUPG(), SUPG_AD, and TrnLeastSquares_AD.
Referenced by PrepareDiff(), and PrepareFastDiff().
void TPZArtDiff::ContributeApproxImplDiff | ( | int | dim, |
TPZFMatrix< REAL > & | jacinv, | ||
TPZVec< STATE > & | sol, | ||
TPZFMatrix< STATE > & | dsol, | ||
TPZFMatrix< REAL > & | dphix, | ||
TPZFMatrix< STATE > & | ek, | ||
TPZFMatrix< STATE > & | ef, | ||
REAL | weight, | ||
REAL | timeStep, | ||
REAL | deltaX | ||
) |
Contributes the diffusion term to the tangent matrix (ek-approximated) and residual vector (ef)
[in] | dim | Spatial dimension |
[in] | jacinv | Inverse jacobian of the mapping. |
[in] | sol | Solution of the dim+2 state functions |
[in] | dsol | Derivatives of U with respect to the dim dimensions |
[in] | dphix | Derivatives of shape functions. |
[out] | ek | Tangent matrix to contribute to |
[out] | ef | Residual vector to contribute to |
[in] | weight | Gaussian quadrature integration weight |
[in] | timeStep | Time step |
[in] | deltaX | Diameter of element (used only if ); |
Definition at line 675 of file pzartdiff.cpp.
References TPZMatrix< TVar >::Cols(), Delta(), and PrepareFastDiff().
Referenced by TPZEulerConsLaw::ContributeApproxImplDiff().
|
static |
Definition at line 907 of file pzartdiff.h.
References TPZVec< T >::NElements(), PZError, TPZDiffMatrix< T >::Redim(), sqrt, and val().
Referenced by Bornhaus().
void TPZArtDiff::ContributeExplDiff | ( | int | dim, |
TPZFMatrix< REAL > & | jacinv, | ||
TPZVec< STATE > & | sol, | ||
TPZFMatrix< STATE > & | dsol, | ||
TPZFMatrix< REAL > & | dphix, | ||
TPZFMatrix< STATE > & | ef, | ||
REAL | weight, | ||
REAL | timeStep, | ||
REAL | deltaX | ||
) |
Contributes the diffusion term to the tangent matrix (ek-approximated) and residual vector (ef)
[in] | dim | Spatial dimension |
[in] | jacinv | Inverse jacobian of the mapping. |
[in] | sol | Solution of the dim+2 state functions |
[in] | dsol | Derivatives of U with respect to the dim dimensions |
[in] | dphix | Derivatives of shape functions. |
[out] | ef | Residual vector to contribute to |
[in] | weight | Gaussian quadrature integration weight |
[in] | timeStep | Time step |
[in] | deltaX | Diameter of element (used only if fDelta > 0); |
Definition at line 707 of file pzartdiff.cpp.
References TPZMatrix< TVar >::Cols(), Delta(), dx(), gamma(), TPZVec< T >::NElements(), ODotOperator(), PrepareFastDiff(), TPZEulerConsLaw::Pressure(), Pressure(), PZError, TPZVec< T >::size(), and val().
Referenced by TPZEulerConsLaw::ContributeExplDiff().
REAL TPZArtDiff::Delta | ( | REAL | deltaX, |
TPZVec< STATE > & | sol | ||
) |
Returns the stored value for delta.
[in] | sol | Solution |
[in] | deltaX | Delta X If fDelta is positive, then it is used as an overall scale on the deltaX. If fDelta is negative, then the absolute value of it is used as the delta for all elements. If fDelta is zero, then the routine OptimalDelta is called, but this method is useful only for the reflected shock problem. Prefer to use fDelta = 1. |
Definition at line 82 of file pzartdiff.cpp.
References Bornhaus_AD, TPZEulerConsLaw::cSpeed(), fArtDiffType, fDelta, fGamma, LeastSquares_AD, OptimalDelta(), PZError, SUPG_AD, TrnLeastSquares_AD, and TPZEulerConsLaw::uRes().
Referenced by ContributeApproxImplDiff(), and ContributeExplDiff().
TPZString TPZArtDiff::DiffusionName | ( | ) |
Returns the name of diffusive term.
Definition at line 48 of file pzartdiff.cpp.
References Bornhaus_AD, fArtDiffType, LeastSquares_AD, PZError, SUPG_AD, and TrnLeastSquares_AD.
Referenced by TPZEulerConsLaw::Print().
void TPZArtDiff::Divergent | ( | TPZFMatrix< STATE > & | dsol, |
TPZFMatrix< REAL > & | dphi, | ||
TPZVec< TPZDiffMatrix< STATE > > & | Ai, | ||
TPZVec< STATE > & | Div, | ||
TPZDiffMatrix< STATE > * | dDiv | ||
) |
Evaluates the divergent of F.
[in] | dsol | vector of solution values derived with respect to the spatial variables |
[in] | dphi | matrix containig the derivatives of shapefuntions |
[in] | Ai | vector of matrices tangent to the flux components. |
[out] | Div | value of the divergent |
[out] | dDiv | an apposimation to the matrix tangent to the divergent |
Definition at line 224 of file pzartdiff.cpp.
References TPZMatrix< TVar >::Cols(), TPZVec< T >::Fill(), TPZDiffMatrix< T >::Redim(), and TPZVec< T >::Resize().
Referenced by ODotOperator(), and PrepareFastDiff().
|
static |
aaS[0];
Definition at line 788 of file pzartdiff.h.
References TPZVec< T >::NElements(), PZError, TPZDiffMatrix< T >::Redim(), sqrt, and val().
Referenced by Bornhaus().
|
static |
Definition at line 703 of file pzartdiff.h.
References TPZVec< T >::NElements(), PZError, TPZDiffMatrix< T >::Redim(), and sqrt.
Referenced by SUPG().
|
private |
Definition at line 382 of file pzartdiff.cpp.
Referenced by ComputeTau().
|
private |
Definition at line 391 of file pzartdiff.cpp.
Referenced by ComputeTau().
|
inlinestatic |
Definition at line 500 of file pzartdiff.h.
References TPZVec< T >::NElements(), PZError, and TPZDiffMatrix< T >::Redim().
Referenced by Bornhaus(), and SUPG().
void TPZArtDiff::ODotOperator | ( | TPZVec< REAL > & | dphi, |
TPZVec< TPZDiffMatrix< T > > & | M, | ||
TPZDiffMatrix< T > & | Result | ||
) |
Operation product point in the diffusion term.
[in] | dphi | vector of scalars that make part of the ODot operation |
[in] | M | vector of matrices to operate |
[out] | Result | Result of the operation |
Definition at line 122 of file pzartdiff.cpp.
References TPZDiffMatrix< T >::Add(), TPZVec< T >::NElements(), PZError, and TPZDiffMatrix< T >::Redim().
Referenced by ContributeExplDiff().
void TPZArtDiff::ODotOperator | ( | TPZVec< REAL > & | dphi, |
TPZVec< TPZVec< T > > & | TauDiv, | ||
TPZVec< T > & | Result | ||
) |
Operation product point in the diffusion term.
[in] | dphi | vector of scalars that make part of the ODot operation |
[in] | TauDiv | vector of vectors to operate |
[out] | Result | Result of the operation |
Definition at line 137 of file pzartdiff.cpp.
References TPZMatrix< TVar >::Cols(), Divergent(), dx(), TPZVec< T >::Fill(), TPZVec< T >::NElements(), PZError, TPZDiffMatrix< T >::Redim(), TPZVec< T >::Resize(), and val().
REAL TPZArtDiff::OptimalCFL | ( | int | degree = TPZCompEl::GetgOrder() | ) |
Returns the best value for based on the interpolation degree.
Definition at line 115 of file pzartdiff.cpp.
References fCFL.
Referenced by OptimalDelta().
REAL TPZArtDiff::OptimalDelta | ( | ) |
Returns the best value for delta based on the interpolation degree.
Definition at line 75 of file pzartdiff.cpp.
References OptimalCFL().
Referenced by Delta().
void TPZArtDiff::PrepareDiff | ( | int | dim, |
TPZFMatrix< REAL > & | jacinv, | ||
TPZVec< T > & | U, | ||
TPZVec< TPZDiffMatrix< T > > & | Ai, | ||
TPZVec< TPZDiffMatrix< T > > & | Tau | ||
) |
Computes the common values A B C and Tau vector of matrixes for contributions.
[in] | dim | Spatial dimension of the problem |
[in] | jacinv | Inverse jacobian of the mapping. |
[in] | U | Vector of solutions at the point |
[out] | Ai | Matrixes A B C |
[out] | Tau | Diffusive vector of matrixes |
Definition at line 487 of file pzartdiff.cpp.
References ComputeTau(), fGamma, and TPZEulerConsLaw::JacobFlux().
void TPZArtDiff::PrepareFastDiff | ( | int | dim, |
TPZFMatrix< REAL > & | jacinv, | ||
TPZVec< STATE > & | sol, | ||
TPZFMatrix< STATE > & | dsol, | ||
TPZFMatrix< REAL > & | dphi, | ||
TPZVec< TPZVec< STATE > > & | TauDiv, | ||
TPZVec< TPZDiffMatrix< STATE > > * | pTaudDiv = NULL |
||
) |
Prepares the data to compute the diffusive term as fast as possible, sparing operations.
[in] | dim | Spatial dimension |
[in] | jacinv | Inverse jacobian of the mapping. |
[in] | sol | Solution of the dim+2 state functions |
[in] | dsol | Derivatives of U with respect to the dim dimensions |
[in] | dphi | Derivatives of shape functions. |
[out] | TauDiv | Vector of Vectors to store the values of Tau_i*Div |
[out] | pTaudDiv | Pointer of a vector to matrices to store the approximate derivatives of . If Null, then no approximation derivative is evaluated. |
Definition at line 494 of file pzartdiff.cpp.
References ComputeTau(), Divergent(), dx(), fGamma, TPZEulerConsLaw::JacobFlux(), TPZVec< T >::NElements(), TPZVec< T >::Resize(), and TPZMatrix< TVar >::Rows().
Referenced by ContributeApproxImplDiff(), and ContributeExplDiff().
|
static |
pressure
Referenced by ContributeExplDiff().
|
overridevirtual |
Read the element data from a stream.
Reimplemented from TPZSavable.
Definition at line 838 of file pzartdiff.cpp.
References ArtDiffType(), fArtDiffType, fCFL, fDelta, fGamma, and TPZStream::Read().
Referenced by TPZEulerConsLaw::Read().
|
inlinestatic |
Definition at line 564 of file pzartdiff.h.
References TPZVec< T >::NElements(), PZError, and TPZDiffMatrix< T >::Redim().
Referenced by Bornhaus(), and SUPG().
|
inlinestatic |
Definition at line 439 of file pzartdiff.h.
References TPZVec< T >::NElements(), PZError, TPZDiffMatrix< T >::Redim(), and TPZDiffMatrix< T >::Transpose().
Referenced by Bornhaus(), and SUPG().
void TPZArtDiff::SetArtDiffType | ( | TPZArtDiffType | type | ) |
Configures the type of artificial diffusion.
[in] | type | Type of diffusive term |
Definition at line 43 of file pzartdiff.cpp.
References fArtDiffType.
void TPZArtDiff::SetDelta | ( | REAL | delta | ) |
Sets the value for delta.
Definition at line 110 of file pzartdiff.cpp.
References fDelta.
Referenced by TPZEulerConsLaw::SetDelta().
|
private |
Definition at line 323 of file pzartdiff.cpp.
References TPZEulerConsLaw::cSpeed(), EigenSystemSUPG(), fGamma, MMatrix(), TPZDiffMatrix< T >::Multiply(), RMMatrix(), RotMatrix(), and TPZEulerConsLaw::uRes().
Referenced by ComputeTau().
|
overridevirtual |
Save the element data to a stream.
Reimplemented from TPZSavable.
Definition at line 829 of file pzartdiff.cpp.
References fArtDiffType, fCFL, fDelta, fGamma, tmp, and TPZStream::Write().
Referenced by TPZEulerConsLaw::Write().
|
private |
Kind of artificial diffusion term to apply.
Definition at line 423 of file pzartdiff.h.
Referenced by ArtDiffType(), ComputeTau(), Delta(), DiffusionName(), Read(), SetArtDiffType(), and Write().
|
private |
|
private |
Scalar coefficient of the element in the diffusion term.
Definition at line 429 of file pzartdiff.h.
Referenced by Delta(), Read(), SetDelta(), and Write().
|
private |
Ratio between specific heat is constant and the specific heat the constant volume of a polytropic gas.
Definition at line 426 of file pzartdiff.h.
Referenced by Bornhaus(), Delta(), PrepareDiff(), PrepareFastDiff(), Read(), SUPG(), and Write().