The Single Space Material Group
Table of Contents
Single Space Materials
The TPZMatSingleSpaceT interface is dedicated for implementing weak formulations using only one approximation space (regardless of which). Any given material using only one approximation space should then inherit from TPZMatBase<TPZMatSingleSpaceT<TVar>, AnyInterfaces>. As an example of single space materials, check TPZElasticity3D or TPZMatPoisson.
-
class TPZMatSingleSpace : public virtual TPZSavable
This class is a fundamental part of the TPZMaterial group.
It contains the type-agonstic interfaces that simple (non-multiphysics) materials should implement.
Subclassed by TPZMatSingleSpaceT< TVar >
Public Functions
-
TPZMatSingleSpace() = default
Default constructor.
-
virtual void FillDataRequirements(TPZMaterialData &data) const
Fill the TPZMaterialData parameter.
The needed parameters for the calculations of the Contribute methods should be set.By default, all requirements are considered to be false.
- Parameters
The – TPZMaterialData instance to be filled
-
virtual void FillBoundaryConditionDataRequirements(int type, TPZMaterialData &data) const
Fill the TPZMaterialData parameter for boundary condition.
The needed parameters for the calculations at the boundaries should be set. By default, all requirements are considered to be false.
- Parameters
type – Boundary condition type.
data – The TPZMaterialData instance to be filled
-
virtual int IntegrationRuleOrder(const 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
- Returns
adjusted integration rule order
-
virtual void GetSolDimensions(uint64_t &u_len, uint64_t &du_row, uint64_t &du_col) const
Get the dimensions of the solution for each state variable.
This will be used for initializing the corresponding TPZMaterialData.
- Parameters
u_len – [out] solution dimension.
du_row – [out] number of rows of the derivative
du_col – [out] number of columns of the derivative
-
virtual int ClassId() const override
Unique identifier for each class.
-
TPZMatSingleSpace() = default
-
template<class TVar>
class TPZMatSingleSpaceT : public TPZMatSingleSpace This class is a fundamental part of the TPZMaterial group.
It contains the interfaces that simple (non-multiphysics) materials should implement. It is noteworthy to observe that this definition does not depend on the definition of the approximation space.
Note
Materials should derive from TPZMatBase class.
- tparam TVar
State variable type (
CSTATE
/STATE
)
Subclassed by TPZMatSingleSpaceBC< TVar >
Contribute
-
virtual void Contribute(const TPZMaterialDataT<TVar> &data, 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
data – [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 TPZMaterialDataT<TVar> &data, REAL weight, TPZFMatrix<TVar> &ef)
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
ContributeBC
-
virtual void ContributeBC(const TPZMaterialDataT<TVar> &data, 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
data – [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 TPZMaterialDataT<TVar> &data, 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
data – [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
-
TPZMatSingleSpaceT() = default
Default constructor.
-
virtual void Solution(const TPZMaterialDataT<TVar> &data, int var, TPZVec<TVar> &sol)
Returns the solution associated with a given index based on the finite element approximation.
This method should be implemented if any computations on the solution are to be done.
- Parameters
data – [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 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
- Returns
adjusted integration rule order
-
virtual int ClassId() const override
Unique identifier for each class.
Single Space Boundary Conditions
As discussed in Material Interfaces, each interface shall also define a boundary condition counterpart. In this case, it is the TPZMatSingleSpaceBC. This class mostly forwards any TPZMatSingleSpaceBC::Contribute calls to the appropriate TPZMatSingleSpaceT::ContributeBC.
-
template<class TVar>
class TPZMatSingleSpaceBC : public TPZMatSingleSpaceT<TVar> Boundary condition interface for TPZMatSingleSpaceT.
Public Functions
-
TPZMatSingleSpaceBC() = default
Default constructor.
-
virtual void Contribute(const TPZMaterialDataT<TVar> &data, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef) override
Forward the call to TPZMatSingleSpaceT::ContributeBC.
-
virtual void Contribute(const TPZMaterialDataT<TVar> &data, REAL weight, TPZFMatrix<TVar> &ef) override
Forward the call to TPZMatSingleSpaceT::ContributeBC.
-
virtual void ContributeBC(const TPZMaterialDataT<TVar> &data, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef, TPZBndCondT<TVar> &bc) override
This method should never be called.
Throws.
-
virtual void Solution(const TPZMaterialDataT<TVar> &data, int var, TPZVec<TVar> &sol) override
This method should never be called.
Throws.
-
virtual void FillDataRequirements(TPZMaterialData &data) const override
Forward the call to TPZMatSingleSpaceT::FillBoundaryConditionDataRequirements.
-
virtual int ClassId() const override
Unique identifier for each class.
Protected Attributes
-
TPZMatSingleSpaceT<TVar> *fMatSingleSpace = {nullptr}
Pointer to material which created this BC.
-
TPZMatSingleSpaceBC() = default
Available Interfaces
Interface
Interface for discontinuous materials
-
template<class TVar>
class TPZMatInterfaceSingleSpace : public virtual TPZSavable Interface for discontinuous materials using a single approximation space.
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 TPZMatInterfaceSingleSpaceBC< TVar >
Interface
-
virtual void SolutionInterface(const TPZMaterialDataT<TVar> &data, const TPZMaterialDataT<TVar> &dataleft, const TPZMaterialDataT<TVar> &dataright, const int var, TPZVec<TVar> &Solout) = 0
Returns the solution associated with the var index based on the finite element approximation.
-
virtual void ContributeInterface(const TPZMaterialDataT<TVar> &data, const TPZMaterialDataT<TVar> &dataleft, const TPZMaterialDataT<TVar> &dataright, REAL weight, TPZFMatrix<TVar> &ek, TPZFMatrix<TVar> &ef) = 0
It computes a contribution to stiffness matrix and load vector at one integration point.
- Since
April 16, 2007
- 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 TPZMaterialDataT<TVar> &dataleft, const TPZMaterialDataT<TVar> &dataright, REAL weight, TPZFMatrix<TVar> &ef)
It computes a contribution to residual vector at one integration point.
- Since
April 16, 2007
- Parameters
data – [in]
dataleft – [in]
dataright – [in]
weight – [in]
ef – [out] is the load vector
-
virtual void ContributeBCInterface(const TPZMaterialDataT<TVar> &data, const 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.
- 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 TPZMaterialDataT<TVar> &dataleft, REAL weight, TPZFMatrix<TVar> &ef, TPZBndCondT<TVar> &bc)
It computes a contribution to residual vector at one BC integration point.
- Since
April 16, 2007
- Parameters
data – [in]
dataleft – [in]
weight – [in]
ef – [out] is the load vector
bc – [in] is the boundary condition object
-
virtual void FillDataRequirementsInterface(TPZMaterialData &data) const = 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 TPZMaterialDataT<TVar> &dataleft, const TPZMaterialDataT<TVar> &dataright, const int var, TPZVec<TVar> &Solout) = 0
Error
Interface for computing the error of the FEM solution based on an exact solution.
-
template<class TVar>
class TPZMatErrorSingleSpace : public virtual TPZMatError<TVar> Interface for error computation of materials using a single approximation space.
This material allows the computation of error measures of the FEM approximation based on an exact solution.
Subclassed by TPZMatErrorSingleSpaceBC< TVar >
Error
-
virtual void Errors(const TPZMaterialDataT<TVar> &data, TPZVec<REAL> &errors) = 0
Public interface for calculating errors See TPZMaterialData and TPZMaterialDataT for the available data.
-
virtual void Errors(const TPZMaterialDataT<TVar> &data, TPZVec<REAL> &errors) = 0
Common
See also the Common Interfaces.