NeoPZ
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
TPZLinearConvection Class Reference

Implements a linear scalar convection equation with modified SUPG difusion. More...

#include <TPZLinearConvection.h>

Inheritance diagram for TPZLinearConvection:
[legend]
Collaboration diagram for TPZLinearConvection:
[legend]

Public Member Functions

virtual int ClassId () const override
 Define the class id associated with the class. More...
 
 TPZLinearConvection (TPZLinearConvection &copy)
 Copy constructor. More...
 
 TPZLinearConvection (int id, TPZVec< STATE > &conv)
 Constructor for given convection. More...
 
virtual int Dimension () const override
 Returns the integrable dimension of the material. More...
 
virtual int NStateVariables () const override
 Returns the number of state variables associated with the material. More...
 
virtual int NFluxes () override
 Returns the number of components which form the flux function. More...
 
virtual void Print (std::ostream &out=std::cout) override
 Print out the data associated with the material. More...
 
virtual int VariableIndex (const std::string &name) override
 Returns the variable index associated with the name. More...
 
virtual int NSolutionVariables (int var) override
 Returns the number of variables associated with the variable indexed by var. More...
 
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. More...
 
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. More...
 
virtual TPZMaterialNewMaterial () override
 To create another material of the same type. More...
 
virtual void SetData (std::istream &data) override
 Reads data of the material from a istream (file data) More...
 
Contribute methods (weak formulation)
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. More...
 
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. More...
 
virtual void Contribute (TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef) override
 It computes a contribution to the residual vector at one integration point. More...
 
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. More...
 
- Public Member Functions inherited from TPZMaterial
 TPZMaterial (int id)
 Creates a material object and inserts it in the vector of material pointers of the mesh. More...
 
 TPZMaterial ()
 Default constructor. More...
 
 TPZMaterial (const TPZMaterial &mat)
 Creates a material object based on the referred object and inserts it in the vector of material pointers of the mesh. More...
 
TPZMaterialoperator= (const TPZMaterial &copy)
 operator = More...
 
virtual ~TPZMaterial ()
 Default destructor. More...
 
virtual void FillDataRequirements (TPZMaterialData &data)
 Fill material data parameter with necessary requirements for the. More...
 
virtual void FillDataRequirements (TPZVec< TPZMaterialData > &datavec)
 Fill material data parameter with necessary requirements for the Contribute method. Here, in base class, all requirements are considered as necessary. Each derived class may optimize performance by selecting only the necessary data. More...
 
virtual void FillBoundaryConditionDataRequirement (int type, TPZMaterialData &data)
 This method defines which parameters need to be initialized in order to compute the contribution of the boundary condition. More...
 
virtual void FillBoundaryConditionDataRequirement (int type, TPZVec< TPZMaterialData > &datavec)
 This method defines which parameters need to be initialized in order to compute the contribution of the boundary condition. More...
 
virtual void FillDataRequirementsInterface (TPZMaterialData &data)
 This method defines which parameters need to be initialized in order to compute the contribution of interface elements. More...
 
virtual void FillDataRequirementsInterface (TPZMaterialData &data, TPZVec< TPZMaterialData > &datavec_left, TPZVec< TPZMaterialData > &datavec_right)
 This method defines which parameters need to be initialized in order to compute the contribution of interface elements. More...
 
virtual std::string Name ()
 Returns the name of the material. More...
 
int Id () const
 
void SetId (int id)
 
int NumLoadCases ()
 returns the number of load cases for this material object More...
 
virtual int MinimumNumberofLoadCases ()
 returns the minimum number of load cases for this material More...
 
void SetNumLoadCases (int numloadcases)
 changes the number of load cases for this material More...
 
void SetPostProcessIndex (int index)
 indicates which variable should be post processed More...
 
virtual TPZBndCondCreateBC (TPZMaterial *reference, int id, int typ, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
 Creates an object TPZBndCond derived of TPZMaterial. More...
 
void SetForcingFunction (TPZAutoPointer< TPZFunction< STATE > > fp)
 Sets a procedure as source function for the material. More...
 
void SetForcingFunction (void(*fp)(const TPZVec< REAL > &loc, TPZVec< STATE > &result), int porder)
 
void SetForcingFunction (void(*fp)(const TPZVec< REAL > &loc, TPZVec< STATE > &result, TPZFMatrix< STATE > &gradu), int porder)
 
TPZAutoPointer< TPZFunction< STATE > > & ForcingFunction ()
 Returns a procedure as source function for the material. More...
 
void SetForcingFunctionExact (TPZAutoPointer< TPZFunction< STATE > > fp)
 Sets a procedure as exact solution for the problem. More...
 
TPZAutoPointer< TPZFunction< STATE > > & ForcingFunctionExact ()
 Returns a procedure as exact solution for the problem. More...
 
void SetTimeDependentForcingFunction (TPZAutoPointer< TPZFunction< STATE > > fp)
 Sets a procedure as time dependent source function for the material. More...
 
TPZAutoPointer< TPZFunction< STATE > > & TimeDependentForcingFunction ()
 Returns a procedure as time dependent source function for the material. More...
 
void SetTimeDependentFunctionExact (TPZAutoPointer< TPZFunction< STATE > > fp)
 Sets a procedure as time dependent exact solution for the problem. More...
 
TPZAutoPointer< TPZFunction< STATE > > & TimedependentFunctionExact ()
 Returns a procedure as time dependent exact solution for the problem. More...
 
void SetBCForcingFunction (TPZAutoPointer< TPZFunction< STATE > > fp)
 Sets a procedure as variable boundary condition. More...
 
TPZAutoPointer< TPZFunction< STATE > > & BCForcingFunction ()
 Returns a procedure as variable boundary condition. More...
 
void SetTimedependentBCForcingFunction (TPZAutoPointer< TPZFunction< STATE > > fp)
 Sets a procedure as time variable boundary condition. More...
 
TPZAutoPointer< TPZFunction< STATE > > & TimedependentBCForcingFunction ()
 Returns a procedure as time variable boundary condition. More...
 
virtual int HasForcingFunction ()
 Directive that gives true if the material has a forcing function. More...
 
virtual int HasForcingFunctionExact ()
 Directive that gives true if the material has a function exact. More...
 
virtual int HasBCForcingFunction ()
 Directive that gives true if the material has a bc forcing function exact. More...
 
virtual int HasTimedependentFunctionExact ()
 Directive that gives true if the material has a time dependent function exact. More...
 
virtual int HasTimedependentForcingFunction ()
 Directive that gives true if the material has a time dependent forcing function. More...
 
virtual int HasTimedependentBCForcingFunction ()
 Directive that gives true if the material has a time dependent bc forcing function. More...
 
virtual int IntegrationRuleOrder (int elPMaxOrder) const
 Gets the order of the integration rule necessary to integrate an element with polinomial order p. More...
 
virtual int IntegrationRuleOrder (TPZVec< int > &elPMaxOrder) const
 Gets the order of the integration rule necessary to integrate an element multiphysic. More...
 
virtual void Errors (TPZMaterialData &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &errors)
 
virtual void Errors (TPZVec< TPZMaterialData > &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &errors)
 
virtual void Errors (TPZVec< REAL > &x, TPZVec< STATE > &sol, TPZFMatrix< STATE > &dsol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux, TPZVec< STATE > &uexact, TPZFMatrix< STATE > &duexact, TPZVec< REAL > &val)
 Computes the error due to the difference between the interpolated flux
and the flux computed based on the derivative of the solution. More...
 
virtual void ErrorsHdiv (TPZMaterialData &data, TPZVec< STATE > &u_exact, TPZFMatrix< STATE > &du_exact, TPZVec< REAL > &values)
 
virtual int NEvalErrors ()
 Returns the number of norm errors. Default is 3: energy, L2 and H1. More...
 
virtual void Clone (std::map< int, TPZMaterial * > &matvec)
 Creates a copy of the material object and put it in the vector which is passed on. More...
 
virtual int FluxType ()
 To return a numerical flux type to apply over the interfaces of the elements. More...
 
virtual void ContributeErrors (TPZMaterialData &data, REAL weight, TPZVec< REAL > &nk, int &errorid)
 
virtual REAL ComputeSquareResidual (TPZVec< REAL > &X, TPZVec< STATE > &sol, TPZFMatrix< STATE > &dsol)
 Computes square of residual of the differential equation at one integration point. More...
 
virtual int PushMemItem (int sourceIndex=-1)
 Pushes a new entry in the context of materials with memory, returning its index at the internal storage stack. More...
 
virtual void FreeMemItem (int index)
 Frees an entry in the material with memory internal history storage. More...
 
void SetLinearContext (bool IsLinear)
 Sets fLinearContext attribute. More...
 
bool GetLinearContext () const
 Returns fLinearContext attribute. More...
 
virtual void Contribute (TPZVec< TPZMaterialData > &datavec, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
 It computes a contribution to the stiffness matrix and load vector at one integration point to multiphysics simulation. More...
 
virtual void Contribute (TPZVec< TPZMaterialData > &datavec, REAL weight, TPZFMatrix< STATE > &ef)
 It computes a contribution to the stiffness matrix and load vector at one integration point to multiphysics simulation. More...
 
virtual void ContributeBC (TPZVec< TPZMaterialData > &datavec, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc)
 It computes a contribution to the stiffness matrix and load vector at one BC integration point to multiphysics simulation. More...
 
virtual void ContributeBC (TPZVec< TPZMaterialData > &datavec, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc)
 It computes a contribution to the stiffness matrix and load vector at one BC integration point to multiphysics simulation. More...
 
int ClassId () const override
 Unique identifier for serialization purposes. More...
 
void Write (TPZStream &buf, int withclassid) const override
 Saves the element data to a stream. More...
 
void Read (TPZStream &buf, void *context) override
 Reads the element data from a stream. More...
 
virtual void Solution (TPZVec< TPZMaterialData > &datavec, int var, TPZVec< STATE > &Solout)
 Returns the solution associated with the var index based on the finite element approximation. More...
 
virtual void Solution (TPZMaterialData &data, TPZVec< TPZMaterialData > &dataleftvec, TPZVec< TPZMaterialData > &datarightvec, int var, TPZVec< STATE > &Solout)
 Returns the solution associated with the var index based on the finite element approximation around one interface element. More...
 
virtual void Solution (TPZMaterialData &data, TPZVec< TPZMaterialData > &dataleftvec, TPZVec< TPZMaterialData > &datarightvec, int var, TPZVec< STATE > &Solout, TPZCompEl *left, TPZCompEl *ritgh)
 Returns the solution associated with the var index based on the finite element approximation around one interface element. 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
 

Protected Member Functions

virtual void Solution (TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, int var, TPZVec< STATE > &Solout) override
 
- Protected Member Functions inherited from TPZMaterial

Private Attributes

STATE fConvect [2]
 

Additional Inherited Members

- 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 TPZSavableCreateInstance (const int &classId)
 
- Static Public Attributes inherited from TPZMaterial
static REAL gBigNumber
 Big number to penalization method, used for Dirichlet conditions. More...
 
- Protected Attributes inherited from TPZMaterial
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
 Pointer to forcing function, it is the right member at differential equation. More...
 
TPZAutoPointer< TPZFunction< STATE > > fForcingFunctionExact
 Pointer to exact solution function, needed to calculate exact error. More...
 
TPZAutoPointer< TPZFunction< STATE > > fTimeDependentForcingFunction
 Pointer to time dependent forcing function, it is the right member at differential equation. More...
 
TPZAutoPointer< TPZFunction< STATE > > fTimedependentFunctionExact
 Pointer to time dependent exact solution function, needed to calculate exact error. More...
 
TPZAutoPointer< TPZFunction< STATE > > fBCForcingFunction
 Pointer to bc forcing function, it is a variable boundary condition at differential equation. More...
 
TPZAutoPointer< TPZFunction< STATE > > fTimedependentBCForcingFunction
 Pointer to time dependent bc forcing function, it is a variable boundary condition at differential equation. More...
 
bool fLinearContext
 Defines whether the equation context is linear solver or non linear. More...
 
int fNumLoadCases
 Defines the number of load cases generated by this material. More...
 
int fPostProcIndex
 indicates which solution should be used for post processing More...
 

Detailed Description

Implements a linear scalar convection equation with modified SUPG difusion.

Definition at line 17 of file TPZLinearConvection.h.

Constructor & Destructor Documentation

◆ TPZLinearConvection() [1/2]

TPZLinearConvection::TPZLinearConvection ( TPZLinearConvection copy)

Copy constructor.

Definition at line 12 of file TPZLinearConvection.cpp.

References fConvect.

Referenced by NewMaterial().

◆ TPZLinearConvection() [2/2]

TPZLinearConvection::TPZLinearConvection ( int  id,
TPZVec< STATE > &  conv 
)

Constructor for given convection.

Definition at line 17 of file TPZLinearConvection.cpp.

References fConvect.

Member Function Documentation

◆ ClassId()

int TPZLinearConvection::ClassId ( ) const
overridevirtual

Define the class id associated with the class.

This id has to be unique for all classes A non unique id is flagged at the startup of the program

Implements TPZSavable.

Definition at line 147 of file TPZLinearConvection.cpp.

References TPZMaterial::ClassId(), and Hash().

◆ Contribute() [1/2]

void TPZLinearConvection::Contribute ( TPZMaterialData data,
REAL  weight,
TPZFMatrix< STATE > &  ek,
TPZFMatrix< STATE > &  ef 
)
overridevirtual

It computes a contribution to the stiffness matrix and load vector at one integration point.

Parameters
data[in] stores all input data
weight[in] is the weight of the integration rule
ek[out] is the stiffness matrix
ef[out] is the load vector
Since
April 16, 2007

Implements TPZMaterial.

Definition at line 58 of file TPZLinearConvection.cpp.

References TPZMaterialData::axes, TPZMaterialData::dphix, fConvect, TPZMaterialData::jacinv, TPZMaterialData::phi, TPZMatrix< TVar >::Rows(), and sqrt.

Referenced by NFluxes().

◆ Contribute() [2/2]

virtual void TPZLinearConvection::Contribute ( TPZMaterialData data,
REAL  weight,
TPZFMatrix< STATE > &  ef 
)
inlineoverridevirtual

It computes a contribution to the residual vector at one integration point.

Parameters
data[in] stores all input data
weight[in] is the weight of the integration rule
ef[out] is the residual vector
Since
April 16, 2007

Reimplemented from TPZMaterial.

Definition at line 48 of file TPZLinearConvection.h.

References TPZMaterial::Contribute().

◆ ContributeBC() [1/2]

void TPZLinearConvection::ContributeBC ( TPZMaterialData data,
REAL  weight,
TPZFMatrix< STATE > &  ek,
TPZFMatrix< STATE > &  ef,
TPZBndCond bc 
)
overridevirtual

It computes a contribution to the stiffness matrix and load vector at one BC integration point.

Parameters
data[in] stores all input data
weight[in] is the weight of the integration rule
ek[out] is the stiffness matrix
ef[out] is the load vector
bc[in] is the boundary condition material
Since
October 07, 2011

Implements TPZMaterial.

Definition at line 90 of file TPZLinearConvection.cpp.

References TPZMaterial::gBigNumber, idf, TPZBndCond::Material(), NStateVariables(), TPZMaterialData::phi, PZError, TPZMatrix< TVar >::Rows(), TPZBndCond::Type(), TPZBndCond::Val1(), and TPZBndCond::Val2().

Referenced by NFluxes().

◆ ContributeBC() [2/2]

virtual void TPZLinearConvection::ContributeBC ( TPZMaterialData data,
REAL  weight,
TPZFMatrix< STATE > &  ef,
TPZBndCond bc 
)
inlineoverridevirtual

It computes a contribution to the stiffness matrix and load vector at one BC integration point.

Parameters
data[in] stores all input data
weight[in] is the weight of the integration rule
ef[out] is the load vector
bc[in] is the boundary condition material
Since
April 16, 2007

Reimplemented from TPZMaterial.

Definition at line 55 of file TPZLinearConvection.h.

References TPZMaterial::ContributeBC(), NSolutionVariables(), Print(), Solution(), and VariableIndex().

◆ Dimension()

int TPZLinearConvection::Dimension ( ) const
overridevirtual

Returns the integrable dimension of the material.

Implements TPZMaterial.

Definition at line 55 of file TPZLinearConvection.cpp.

◆ Flux()

virtual void TPZLinearConvection::Flux ( TPZVec< REAL > &  x,
TPZVec< STATE > &  Sol,
TPZFMatrix< STATE > &  DSol,
TPZFMatrix< REAL > &  axes,
TPZVec< STATE > &  flux 
)
inlineoverridevirtual

Computes the value of the flux function to be used by ZZ error estimator.

Reimplemented from TPZMaterial.

Definition at line 84 of file TPZLinearConvection.h.

References NewMaterial(), and SetData().

◆ NewMaterial()

TPZMaterial * TPZLinearConvection::NewMaterial ( )
overridevirtual

To create another material of the same type.

Reimplemented from TPZMaterial.

Definition at line 27 of file TPZLinearConvection.cpp.

References TPZLinearConvection().

Referenced by Flux().

◆ NFluxes()

virtual int TPZLinearConvection::NFluxes ( )
inlineoverridevirtual

Returns the number of components which form the flux function.

Reimplemented from TPZMaterial.

Definition at line 34 of file TPZLinearConvection.h.

References bc, Contribute(), and ContributeBC().

◆ NSolutionVariables()

int TPZLinearConvection::NSolutionVariables ( int  var)
overridevirtual

Returns the number of variables associated with the variable indexed by var.

Parameters
varIndex variable into the solution, is obtained by calling VariableIndex

Reimplemented from TPZMaterial.

Definition at line 40 of file TPZLinearConvection.cpp.

References TPZMaterial::NSolutionVariables().

Referenced by ContributeBC().

◆ NStateVariables()

int TPZLinearConvection::NStateVariables ( ) const
overridevirtual

Returns the number of state variables associated with the material.

Implements TPZMaterial.

Definition at line 52 of file TPZLinearConvection.cpp.

Referenced by ContributeBC().

◆ Print()

void TPZLinearConvection::Print ( std::ostream &  out = std::cout)
overridevirtual

Print out the data associated with the material.

Reimplemented from TPZMaterial.

Definition at line 48 of file TPZLinearConvection.cpp.

References fConvect, and TPZMaterial::Print().

Referenced by ContributeBC().

◆ SetData()

void TPZLinearConvection::SetData ( std::istream &  data)
overridevirtual

Reads data of the material from a istream (file data)

Reimplemented from TPZMaterial.

Definition at line 23 of file TPZLinearConvection.cpp.

References fConvect, and PZError.

Referenced by Flux().

◆ Solution() [1/2]

void TPZLinearConvection::Solution ( TPZVec< STATE > &  Sol,
TPZFMatrix< STATE > &  DSol,
TPZFMatrix< REAL > &  axes,
int  var,
TPZVec< STATE > &  Solout 
)
overrideprotectedvirtual
Deprecated:
Deprecated interface for Solution method which must use material data.

Reimplemented from TPZMaterial.

Definition at line 32 of file TPZLinearConvection.cpp.

References fConvect, TPZVec< T >::Resize(), and TPZMaterial::Solution().

Referenced by ContributeBC(), and Solution().

◆ Solution() [2/2]

virtual void TPZLinearConvection::Solution ( TPZMaterialData data,
int  var,
TPZVec< STATE > &  Solout 
)
inlineoverridevirtual

Returns the solution associated with the var index based on the finite element approximation.

Reimplemented from TPZMaterial.

Definition at line 74 of file TPZLinearConvection.h.

References TPZMaterialData::axes, DebugStop, TPZMaterialData::dsol, TPZVec< T >::size(), TPZMaterialData::sol, and Solution().

◆ VariableIndex()

int TPZLinearConvection::VariableIndex ( const std::string &  name)
overridevirtual

Returns the variable index associated with the name.

Reimplemented from TPZMaterial.

Definition at line 44 of file TPZLinearConvection.cpp.

References TPZMaterial::VariableIndex().

Referenced by ContributeBC().

Member Data Documentation

◆ fConvect

STATE TPZLinearConvection::fConvect[2]
private

Definition at line 93 of file TPZLinearConvection.h.

Referenced by Contribute(), Print(), SetData(), Solution(), and TPZLinearConvection().


The documentation for this class was generated from the following files: