The Combined Spaces Material Group
Table of Contents
Combined Spaces Materials
The TPZMatCombinedSpacesT interface is dedicated for implementing weak formulations using a combination approximation spaces. Any given material using only one approximation space should then inherit from TPZMatBase<TPZMatCombinedSpacesT<TVar>, AnyInterfaces>. As an example of a combined spaces material, check TPZWaveguideModalAnalysis.
-
class TPZMatCombinedSpaces : public virtual TPZSavable
This class is a fundamental part of the TPZMaterial group.
It contains the type-agnostic interfaces that multiphysics materials should implement.
Subclassed by TPZMatCombinedSpacesT< STATE >, TPZMatCombinedSpacesT< TVar >
Public Functions
-
TPZMatCombinedSpaces() = default
Default constructor.
-
virtual int IntegrationRuleOrder(const TPZVec<int> &elPMaxOrder) const = 0
Gets the order of the integration rule necessary to integrate an element with polynomial order
p
taking the forcing function order into account.- Parameters
elPMaxOrder – [in] maximum element order for each space
- Returns
adjusted integration rule order
-
virtual int ClassId() const override
Unique identifier for each class.
-
TPZMatCombinedSpaces() = default
-
template<class TVar>
class TPZMatCombinedSpacesT : public TPZMatCombinedSpaces This class is a fundamental part of the TPZMaterial group.
It contains the interfaces that multiphysics materials should implement. It is noteworthy to observe that this definition does not depend on the definition of the approximation spaces.
Note
Materials should derive from TPZMatBase class.
- tparam TVar
State variable type (
CSTATE
/STATE
)
Subclassed by TPZMatCombinedSpacesBC< TVar >
Contribute
-
virtual void Contribute(const TPZVec<TPZMaterialDataT<TVar>> &datavec, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef) = 0
It computes a contribution to the stiffness matrix and load vector at one integration point.
- Parameters
datavec – [in] stores all input data
weight – [in] is the weight of the integration rule
ek – [out] is the element matrix
ef – [out] is the rhs vector
-
virtual void Contribute(const TPZVec<TPZMaterialDataT<TVar>> &datavec, REAL weight, TPZFMatrix<TVar> &ef)
It computes a contribution to the residual vector at one integration point.
- Parameters
datavec – [in] stores all input data
weight – [in] is the weight of the integration rule
ef – [out] is the residual vector
ContributeBC
-
virtual void ContributeBC(const TPZVec<TPZMaterialDataT<TVar>> &datavec, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef, TPZBndCondT<TVar> &bc) = 0
It computes a contribution to the stiffness matrix and load vector at one BC integration point.
- Parameters
datavec – [in] stores all input data
weight – [in] is the weight of the integration rule
ek – [out] is the element matrix
ef – [out] is the rhs vector
bc – [in] is the boundary condition material
-
virtual void ContributeBC(const TPZVec<TPZMaterialDataT<TVar>> &datavec, REAL weight, TPZFMatrix<TVar> &ef, TPZBndCondT<TVar> &bc)
It computes a contribution to the stiffness matrix and load vector at one BC integration point.
- Parameters
datavec – [in] stores all input data
weight – [in] is the weight of the integration rule
ef – [out] is the rhs vector
bc – [in] is the boundary condition material
Public Functions
-
TPZMatCombinedSpacesT() = default
Default constructor.
-
virtual void FillDataRequirements(TPZVec<TPZMaterialDataT<TVar>> &datavec) const
Fill material data parameter with necessary requirements for the Contribute method.
Here, in base class, all requirements are considered as not necessary.
-
virtual void FillDataRequirements(std::map<int, TPZMaterialDataT<TVar>> &datavec) const
Fill material data parameter with necessary requirements for the Contribute method.
Here, in base class, all requirements are considered as not necessary.
-
virtual void FillBoundaryConditionDataRequirements(int type, TPZVec<TPZMaterialDataT<TVar>> &datavec) const
This method defines which parameters need to be initialized in order to compute the contribution of the boundary condition.
-
virtual void Solution(const TPZVec<TPZMaterialDataT<TVar>> &datavec, int var, TPZVec<TVar> &sol) = 0
Returns the solution associated with a given index based on the finite element approximation.
- Parameters
datavec – [in] Stores all the input data.
var – [in] Index of the queried solution
sol – [out] FEM Solution at the integration point
-
virtual int IntegrationRuleOrder(const TPZVec<int> &elPMaxOrder) const override
Gets the order of the integration rule necessary to integrate an element with polynomial order
p
taking the forcing function order into account.- Parameters
elPMaxOrder – [in] maximum element order for each space
- Returns
adjusted integration rule order
-
virtual int ClassId() const override
Unique identifier for each class.
Combined Spaces Boundary Conditions
As discussed in Material Interfaces, each interface shall also define a boundary condition counterpart. In this case, it is the TPZMatCombinedSpacesBC. This class mostly forwards any TPZMatCombinedSpacesBC::Contribute calls to the appropriate TPZMatCombinedSpacesT::ContributeBC.
-
template<class TVar>
class TPZMatCombinedSpacesBC : public TPZMatCombinedSpacesT<TVar> Boundary condition interface for TPZMatCombinedSpacesT.
Public Functions
-
TPZMatCombinedSpacesBC() = default
Default constructor.
-
virtual void Contribute(const TPZVec<TPZMaterialDataT<TVar>> &datavec, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef) override
Forward the call to TPZMatCombinedSpacesT::ContributeBC.
-
virtual void Contribute(const TPZVec<TPZMaterialDataT<TVar>> &datavec, REAL weight, TPZFMatrix<TVar> &ef) override
Forward the call to TPZMatCombinedSpacesT::ContributeBC.
-
virtual void ContributeBC(const TPZVec<TPZMaterialDataT<TVar>> &datavec, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef, TPZBndCondT<TVar> &bc) override
This method should never be called.
Throws.
-
virtual void Solution(const TPZVec<TPZMaterialDataT<TVar>> &datavec, int var, TPZVec<TVar> &sol) override
This method should never be called.
Throws.
-
virtual void FillDataRequirements(TPZVec<TPZMaterialDataT<TVar>> &datavec) const override
Fill material data parameter with necessary requirements for the Contribute method.
Here, in base class, all requirements are considered as not necessary.
-
virtual int ClassId() const override
Unique identifier for each class.
Protected Attributes
-
TPZMatCombinedSpacesT<TVar> *fMatCombinedSpaces = {nullptr}
Pointer to material which created this BC.
-
TPZMatCombinedSpacesBC() = default
Available Interfaces
Interface
Interface for discontinuous materials
-
template<class TVar>
class TPZMatInterfaceCombinedSpaces : public virtual TPZSavable Interface for discontinuous materials using combined approximation spaces.
This material allows contribution of the FEM matrix using the interface between elements. It should be used as a template parameter of TPZMatBase.
Subclassed by TPZMatInterfaceCombinedSpacesBC< TVar >
Interface
-
virtual int GetIntegrationOrder(const TPZVec<int> &porder_left, const TPZVec<int> &porder_right) const
returns the integration order as a function of interpolation orders of the left and right elements
-
virtual void ContributeInterface(const TPZMaterialDataT<TVar> &data, const std::map<int, TPZMaterialDataT<TVar>> &dataleft, const std::map<int, TPZMaterialDataT<TVar>> &dataright, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef) = 0
Computes a contribution to the stiffness matrix and load vector at one integration point to multiphysics simulation.
- Since
June 5, 2012
- Parameters
data – [in]
dataleft – [in]
dataright – [in]
weight – [in]
ek – [out] is the stiffness matrix
ef – [out] is the load vector
-
virtual void ContributeInterface(const TPZMaterialDataT<TVar> &data, const std::map<int, TPZMaterialDataT<TVar>> &dataleft, const std::map<int, TPZMaterialDataT<TVar>> &dataright, REAL weight, TPZFMatrix<TVar> &ef)
Computes a contribution to residual vector at one integration point.
- Since
June 5, 2012
- Parameters
data – [in]
dataleft – [in]
dataright – [in]
weight – [in]
ef – [out] is the load vector
-
virtual void ContributeBCInterface(const TPZMaterialDataT<TVar> &data, const std::map<int, TPZMaterialDataT<TVar>> &dataleft, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef, TPZBndCondT<TVar> &bc) = 0
It computes a contribution to stiffness matrix and load vector at one BC integration point to multiphysics simulation.
- Since
February 21, 2013
- Parameters
data – [in]
dataleft – [in]
weight – [in]
ek – [out] is the stiffness matrix
ef – [out] is the load vector
bc – [in] is the boundary condition object
-
virtual void ContributeBCInterface(const TPZMaterialDataT<TVar> &data, const std::map<int, TPZMaterialDataT<TVar>> &dataleft, REAL weight, TPZFMatrix<TVar> &ef, TPZBndCondT<TVar> &bc)
It computes a contribution to the load vector at one BC integration point to multiphysics simulation.
- Since
February 21, 2013
- Parameters
data – [in]
dataleft – [in]
weight – [in]
ef – [out] is the load vector
bc – [in] is the boundary condition object
-
virtual void FillDataRequirementsInterface(TPZMaterialDataT<TVar> &data, std::map<int, TPZMaterialDataT<TVar>> &datavec_left, std::map<int, TPZMaterialDataT<TVar>> &datavec_right) = 0
This method defines which parameters need to be initialized in order to compute the contribution of interface elements.
-
virtual void SolutionInterface(const TPZMaterialDataT<TVar> &data, const std::map<int, TPZMaterialDataT<TVar>> &dataleftvec, const std::map<int, TPZMaterialDataT<TVar>> &datarightvec, int var, TPZVec<TVar> &Solout) = 0
Returns the solution associated with the var index based on the finite element approximation around one interface element.
-
virtual void SolutionInterface(const TPZMaterialDataT<TVar> &data, const std::map<int, TPZMaterialDataT<TVar>> &dataleftvec, const std::map<int, TPZMaterialDataT<TVar>> &datarightvec, int var, TPZVec<TVar> &Solout, TPZCompEl *left, TPZCompEl *right) = 0
Returns the solution associated with the var index based on the finite element approximation around one interface element.
-
virtual int GetIntegrationOrder(const TPZVec<int> &porder_left, const TPZVec<int> &porder_right) const
Error
Interface for computing the error of the FEM solution based on an exact solution.
-
template<class TVar>
class TPZMatErrorCombinedSpaces : public virtual TPZMatError<TVar> Interface for error computation of materials using combined approximation spaces.
This material allows the computation of error measures of the FEM approximation based on an exact solution. It should be used as a template parameter of TPZMatBase.
Subclassed by TPZMatErrorCombinedSpacesBC< TVar >
Error
-
virtual void Errors(const TPZVec<TPZMaterialDataT<TVar>> &data, TPZVec<REAL> &errors) = 0
Calculates the error at a given point x.
- Parameters
datavec – [in] input data
errors – [out] The calculated errors.
-
virtual void Errors(const TPZVec<TPZMaterialDataT<TVar>> &data, TPZVec<REAL> &errors) = 0
Common
See also the Common Interfaces.