IFEM  90A354
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
GlbL2 Class Reference

General integrand for L2-projection of secondary solutions. More...

#include <GlbL2projector.h>

Inheritance diagram for GlbL2:
Inheritance graph
[legend]
Collaboration diagram for GlbL2:
Collaboration graph
[legend]

Public Member Functions

 GlbL2 (IntegrandBase *p, size_t n)
 The constructor initializes the projection matrices. More...
 
 GlbL2 (FunctionBase *f, size_t n)
 Alternative constructor for projection of an explicit function. More...
 
 GlbL2 (const FunctionVec &f, size_t n)
 Alternative constructor for projection of explicit functions. More...
 
virtual ~GlbL2 ()
 The destructor frees the system matrix and system vector.
 
virtual SIM::SolutionMode getMode (bool) const
 Returns current solution mode.
 
virtual int getIntegrandType () const
 Defines which FE quantities are needed by the integrand.
 
virtual LocalIntegralgetLocalIntegral (size_t nen, size_t iEl, bool neumann) const
 Returns a local integral contribution object for the given element. More...
 
virtual bool initElement (const IntVec &MNPC, const FiniteElement &fe, const Vec3 &X0, size_t nPt, LocalIntegral &elmInt)
 Initializes current element for numerical integration. More...
 
virtual bool initElement (const IntVec &MNPC1, const MxFiniteElement &fe, const uIntVec &elem_sizes, const uIntVec &basis_sizes, LocalIntegral &elmInt)
 Initializes current element for numerical integration (mixed). More...
 
virtual bool initElement (const IntVec &MNPC1, const uIntVec &elem_sizes, const uIntVec &basis_sizes, LocalIntegral &elmInt)
 Dummy implementation.
 
virtual bool initElement (const IntVec &, LocalIntegral &)
 Dummy implementation.
 
virtual bool initElementBou (const IntVec &, LocalIntegral &)
 Dummy implementation.
 
virtual bool initElementBou (const IntVec &, const uIntVec &, const uIntVec &, LocalIntegral &)
 Dummy implementation.
 
virtual bool evalInt (LocalIntegral &elmInt, const FiniteElement &fe, const Vec3 &X) const
 Evaluates the integrand at an interior point. More...
 
virtual bool evalIntMx (LocalIntegral &elmInt, const MxFiniteElement &fe, const Vec3 &X) const
 Evaluates the integrand at an interior point. More...
 
void preAssemble (const std::vector< IntVec > &MMNPC, size_t nel)
 Pre-computes the sparsity pattern of the projection matrix A. More...
 
bool solve (Matrix &sField)
 Solves the projection equation system and evaluates nodal values. More...
 
bool solve (const std::vector< Matrix * > &sField)
 Solves the projection equation system and evaluates nodal values. More...
 
virtual LocalIntegralgetLocalIntegral (size_t nen, size_t iEl, bool neumann=false) const=0
 Returns a local integral contribution object for the given element. More...
 
virtual LocalIntegralgetLocalIntegral (const std::vector< size_t > &nen, size_t iEl, bool neumann=false) const
 Returns a local integral contribution object for the given element. More...
 
virtual bool evalInt (LocalIntegral &elmInt, const FiniteElement &fe, const TimeDomain &time, const Vec3 &X) const
 Evaluates the integrand at an interior point. More...
 
virtual bool evalInt (LocalIntegral &elmInt, const FiniteElement &fe, const TimeDomain &time, const Vec3 &X, const Vec3 &normal) const
 Evaluates the integrand at an element interface point. More...
 
virtual bool evalInt (LocalIntegral &, const FiniteElement &fe, const Vec3 &) const
 Evaluates the integrand at interior points for stationary problems.
 
virtual bool evalInt (LocalIntegral &, const FiniteElement &fe, const Vec3 &, const Vec3 &) const
 Evaluates the integrand at interface points, stationary problems.
 
virtual bool evalIntMx (LocalIntegral &elmInt, const MxFiniteElement &fe, const TimeDomain &time, const Vec3 &X) const
 Evaluates the integrand at an interior point. More...
 
virtual bool evalIntMx (LocalIntegral &elmInt, const MxFiniteElement &fe, const TimeDomain &time, const Vec3 &X, const Vec3 &normal) const
 Evaluates the integrand at an element interface point. More...
 
virtual bool evalIntMx (LocalIntegral &, const MxFiniteElement &fe, const Vec3 &) const
 Evaluates the integrand at interior points for stationary problems.
 
virtual bool evalIntMx (LocalIntegral &, const MxFiniteElement &fe, const Vec3 &, const Vec3 &) const
 Evaluates the integrand at interface points, stationary problems.
 
- Public Member Functions inherited from Integrand
virtual ~Integrand ()
 Empty destructor.
 
virtual void setNeumannOrder (char)
 Defines the Neumann order that is the subject of integration. More...
 
virtual void initPatch (size_t)
 Define the index of the patch being processed.
 
virtual LocalIntegralgetLocalIntegral (const std::vector< size_t > &nen, size_t iEl, bool neumann=false) const
 Returns a local integral contribution object for the given element. More...
 
virtual int getReducedIntegration (int) const
 Returns the number of reduced-order integration points.
 
virtual int getBouIntegrationPoints (int nGP) const
 Returns the number of boundary integration points.
 
virtual bool reducedInt (LocalIntegral &elmInt, const FiniteElement &fe, const Vec3 &X) const
 Evaluates reduced integration terms at an interior point. More...
 
virtual bool evalInt (LocalIntegral &elmInt, const FiniteElement &fe, const TimeDomain &time, const Vec3 &X) const
 Evaluates the integrand at an interior point. More...
 
virtual bool evalIntMx (LocalIntegral &elmInt, const MxFiniteElement &fe, const TimeDomain &time, const Vec3 &X) const
 Evaluates the integrand at an interior point. More...
 
virtual bool evalInt (LocalIntegral &elmInt, const FiniteElement &fe, const TimeDomain &time, const Vec3 &X, const Vec3 &normal) const
 Evaluates the integrand at an element interface point. More...
 
virtual bool evalIntMx (LocalIntegral &elmInt, const MxFiniteElement &fe, const TimeDomain &time, const Vec3 &X, const Vec3 &normal) const
 Evaluates the integrand at an element interface point. More...
 
virtual bool evalPoint (LocalIntegral &elmInt, const FiniteElement &fe, const Vec3 &pval)
 Evaluates the dirac-delta integrand at a specified point. More...
 
virtual bool finalizeElement (LocalIntegral &elmInt, const FiniteElement &fe, const TimeDomain &time, size_t iGP=0)
 Finalizes the element quantities after the numerical integration. More...
 
virtual bool finalizeElementBou (LocalIntegral &elmInt, const FiniteElement &fe, const TimeDomain &time)
 Finalizes the element quantities after boundary integration. More...
 
virtual bool evalBou (LocalIntegral &elmInt, const FiniteElement &fe, const TimeDomain &time, const Vec3 &X, const Vec3 &normal) const
 Evaluates the integrand at a boundary point. More...
 
virtual bool evalBouMx (LocalIntegral &elmInt, const MxFiniteElement &fe, const TimeDomain &time, const Vec3 &X, const Vec3 &normal) const
 Evaluates the integrand at a boundary point. More...
 
virtual void setParam (const std::string &, double)
 Assigns a parameter value to property functions of the integrand.
 
virtual void setParam (const std::string &, const Vec3 &)
 Assigns parameter values to property functions of the integrand.
 

Public Attributes

SparseMatrixpA
 Left-hand-side matrix of the L2-projection.
 
StdVectorpB
 Right-hand-side vectors of the L2-projection.
 

Static Public Attributes

static LinAlg::MatrixType MatrixType = LinAlg::SPARSE
 Matrix type for projection.
 
static LinSolParamsSolverParams = nullptr
 Linear solver params projection.
 

Private Member Functions

void allocate (size_t n)
 Allocates the system L2-projection matrices.
 

Private Attributes

IntegrandBaseproblem
 The main problem integrand.
 
FunctionVec functions
 Explicit functions to L2-project.
 
size_t nrhs
 Number of right-hand-size vectors.
 

Additional Inherited Members

- Public Types inherited from Integrand
enum  Traits {
  STANDARD = 0 , NO_DERIVATIVES = 1 , SECOND_DERIVATIVES = 1<< 1 , THIRD_DERIVATIVES = 1<< 2 ,
  AVERAGE = 1<< 3 , ELEMENT_CORNERS = 1<< 4 , ELEMENT_CENTER = 1<< 5 , G_MATRIX = 1<< 6 ,
  NODAL_ROTATIONS = 1<< 7 , XO_ELEMENTS = 1<< 8 , INTERFACE_TERMS = 1<< 9 , NORMAL_DERIVS = 1<<10 ,
  UPDATED_NODES = 1<<11 , PIOLA_MAPPING = 1<<12 , POINT_DEFORMATION = 1<<13
}
 Enum defining the additional terms that an Integrand may require. More...
 
- Protected Member Functions inherited from Integrand
 Integrand ()
 The default constructor is protected to allow sub-classes only.
 
virtual bool evalInt (LocalIntegral &, const FiniteElement &fe, const Vec3 &, const Vec3 &) const
 Evaluates the integrand at interface points, stationary problems.
 
virtual bool evalIntMx (LocalIntegral &, const MxFiniteElement &fe, const Vec3 &, const Vec3 &) const
 Evaluates the integrand at interface points, stationary problems.
 
virtual bool evalBou (LocalIntegral &, const FiniteElement &, const Vec3 &, const Vec3 &) const
 Evaluates the integrand at boundary points for stationary problems.
 
virtual bool evalBouMx (LocalIntegral &, const MxFiniteElement &, const Vec3 &, const Vec3 &) const
 Evaluates the integrand at boundary points for stationary problems.
 
virtual bool finalizeElement (LocalIntegral &elmInt, const TimeDomain &, size_t)
 Finalizes the element quantities after the numerical integration. More...
 
virtual bool finalizeElement (LocalIntegral &)
 Finalizes the element quantities after the numerical integration. More...
 

Detailed Description

General integrand for L2-projection of secondary solutions.

Constructor & Destructor Documentation

◆ GlbL2() [1/3]

GlbL2::GlbL2 ( IntegrandBase p,
size_t  n 
)

The constructor initializes the projection matrices.

Parameters
[in]pThe main problem integrand
[in]nDimension of the L2-projection matrices (number of nodes)

References allocate(), IntegrandBase::getNoFields(), and nrhs.

◆ GlbL2() [2/3]

GlbL2::GlbL2 ( FunctionBase f,
size_t  n 
)

Alternative constructor for projection of an explicit function.

Parameters
[in]fThe function to do L2-projection on
[in]nDimension of the L2-projection matrices (number of nodes)

◆ GlbL2() [3/3]

GlbL2::GlbL2 ( const FunctionVec f,
size_t  n 
)

Alternative constructor for projection of explicit functions.

Parameters
[in]fThe functions to do L2-projection on
[in]nDimension of the L2-projection matrices (number of nodes)

References allocate(), and nrhs.

Member Function Documentation

◆ evalInt() [1/3]

virtual bool Integrand::evalInt
inline

Evaluates the integrand at an interior point.

Parameters
elmIntThe local integral object to receive the contributions
[in]feFinite element data of current integration point
[in]timeParameters for nonlinear and time-dependent simulations
[in]XCartesian coordinates of current integration point

The default implementation forwards to the stationary version. Reimplement this method for time-dependent or non-linear problems.

Referenced by evalIntMx().

◆ evalInt() [2/3]

virtual bool Integrand::evalInt
inline

Evaluates the integrand at an element interface point.

Parameters
elmIntThe local integral object to receive the contributions
[in]feFinite element data of current integration point
[in]timeParameters for nonlinear and time-dependent simulations
[in]XCartesian coordinates of current integration point
[in]normalInterface normal vector at current integration point

The default implementation forwards to the stationary version. Reimplement this method for time-dependent or non-linear problems.

◆ evalInt() [3/3]

bool GlbL2::evalInt ( LocalIntegral elmInt,
const FiniteElement fe,
const Vec3 X 
) const
virtual

Evaluates the integrand at an interior point.

Parameters
elmIntThe local integral object to receive the contributions
[in]feFinite element data of current integration point
[in]XCartesian coordinates of current integration point

Reimplemented from Integrand.

References ElmMats::A, ElmMats::b, FiniteElement::detJxW, IntegrandBase::diverged(), IntegrandBase::evalSol(), functions, ItgPoint::iGP, L2Mats::mnpc, FiniteElement::N, nrhs, problem, utl::vector< T >::push_back(), utl::vector< T >::reserve(), and utl::vector< T >::size().

◆ evalIntMx() [1/3]

virtual bool Integrand::evalIntMx
inline

Evaluates the integrand at an interior point.

Parameters
elmIntThe local integral object to receive the contributions
[in]feMixed finite element data of current integration point
[in]timeParameters for nonlinear and time-dependent simulations
[in]XCartesian coordinates of current integration point

This interface is used for mixed formulations only. The default implementation forwards to the stationary version. Reimplement this method for time-dependent or non-linear problems.

◆ evalIntMx() [2/3]

virtual bool Integrand::evalIntMx
inline

Evaluates the integrand at an element interface point.

Parameters
elmIntThe local integral object to receive the contributions
[in]feFinite element data of current integration point
[in]timeParameters for nonlinear and time-dependent simulations
[in]XCartesian coordinates of current integration point
[in]normalInterface normal vector at current integration point

The default implementation forwards to the stationary version. Reimplement this method for time-dependent or non-linear problems.

◆ evalIntMx() [3/3]

bool GlbL2::evalIntMx ( LocalIntegral elmInt,
const MxFiniteElement fe,
const Vec3 X 
) const
virtual

Evaluates the integrand at an interior point.

Parameters
elmIntThe local integral object to receive the contributions
[in]feMixed finite element data of current integration point
[in]XCartesian coordinates of current integration point

Reimplemented from Integrand.

References ElmMats::A, ElmMats::b, L2Mats::basis_sizes, FiniteElement::detJxW, IntegrandBase::diverged(), L2Mats::elem_sizes, evalInt(), IntegrandBase::evalSol(), ItgPoint::iGP, L2Mats::mnpc, FiniteElement::N, problem, and utl::vector< T >::size().

◆ getLocalIntegral() [1/3]

virtual LocalIntegral* Integrand::getLocalIntegral
inline

Returns a local integral contribution object for the given element.

Parameters
[in]nenNumber of nodes on each basis
[in]iElGlobal element number (1-based)
[in]neumannWhether or not we are assembling Neumann BCs

This form is used for mixed formulations only. The default implementation just forwards to the single-basis version. Reimplement this method if your mixed formulation requires specialized local integral objects.

◆ getLocalIntegral() [2/3]

LocalIntegral * GlbL2::getLocalIntegral ( size_t  nen,
size_t  iEl,
bool  neumann 
) const
virtual

Returns a local integral contribution object for the given element.

Parameters
[in]nenNumber of nodes on element
[in]iElGlobal element number (1-based)
[in]neumannWhether or not we are assembling Neumann BCs

Implements Integrand.

References IntegrandBase::getLocalIntegral(), nrhs, and problem.

◆ getLocalIntegral() [3/3]

virtual LocalIntegral* Integrand::getLocalIntegral

Returns a local integral contribution object for the given element.

Parameters
[in]nenNumber of nodes on element
[in]iElGlobal element number (1-based)
[in]neumannWhether or not we are assembling Neumann BCs

◆ initElement() [1/2]

bool GlbL2::initElement ( const IntVec MNPC,
const FiniteElement fe,
const Vec3 X0,
size_t  nPt,
LocalIntegral elmInt 
)
virtual

Initializes current element for numerical integration.

Parameters
[in]MNPCMatrix of nodal point correspondance for current element
[in]feNodal and integration point data for current element
[in]X0Cartesian coordinates of the element center
[in]nPtNumber of integration points in this element
elmIntLocal integral for element

Implements Integrand.

References L2Mats::elmData, IntegrandBase::initElement(), L2Mats::mnpc, and problem.

◆ initElement() [2/2]

bool GlbL2::initElement ( const IntVec MNPC1,
const MxFiniteElement fe,
const uIntVec elem_sizes,
const uIntVec basis_sizes,
LocalIntegral elmInt 
)
virtual

Initializes current element for numerical integration (mixed).

Parameters
[in]MNPC1Matrix of nodal point correspondance for current element
[in]feNodal and integration point data for current element
[in]elem_sizesSize of each basis on the element
[in]basis_sizesSize of each basis on the patch
elmIntLocal integral for element

Implements Integrand.

References L2Mats::basis_sizes, L2Mats::elem_sizes, L2Mats::elmData, IntegrandBase::initElement(), L2Mats::mnpc, and problem.

◆ preAssemble()

void GlbL2::preAssemble ( const std::vector< IntVec > &  MMNPC,
size_t  nel 
)

Pre-computes the sparsity pattern of the projection matrix A.

Parameters
[in]MMNPCMatrix of matrices of nodal point correspondances
[in]nelNumber of elements

References pA, and SparseMatrix::preAssemble().

Referenced by ASMbase::L2projection().

◆ solve() [1/2]

bool GlbL2::solve ( const std::vector< Matrix * > &  sField)

Solves the projection equation system and evaluates nodal values.

Parameters
[out]sFieldNodal/control-point values of the projected results.

References SparseMatrix::dim(), functions, pA, pB, and SparseMatrix::solve().

◆ solve() [2/2]

bool GlbL2::solve ( Matrix sField)

Solves the projection equation system and evaluates nodal values.

Parameters
[out]sFieldNodal/control-point values of the projected results.

References SparseMatrix::dim(), nrhs, utl::matrix< T >::resize(), and SparseMatrix::solve().

Referenced by ASMbase::L2projection().


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