IFEM  90A354
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NormBase Class Reference

Base class representing a system level norm quantity. More...

#include <IntegrandBase.h>

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

Public Member Functions

virtual ~NormBase ()
 The destructor deletes the projected secondary solution fields.
 
virtual void initIntegration (size_t, size_t)
 Initializes the integrand with the number of integration points.
 
void initProjection (size_t nproj)
 Sets the number of projected solutions.
 
void setLocalIntegrals (LintegralVec *elementNorms)
 Sets a vector of LocalIntegrals to be used during norm integration.
 
LocalIntegralgetLocalIntegral (size_t, size_t iEl, bool) const override
 Returns a local integral container for the element iEl.
 
bool initElement (const std::vector< int > &MNPC, LocalIntegral &elmInt) override
 Initializes current element for numerical integration.
 
bool initElement (const std::vector< int > &MNPC, const FiniteElement &fe, const Vec3 &X0, size_t nPt, LocalIntegral &elmInt) override
 Initializes current element for numerical integration.
 
bool initElement (const std::vector< int > &MNPC, const std::vector< size_t > &elem_sizes, const std::vector< size_t > &basis_sizes, LocalIntegral &elmInt) override
 Initializes current element for numerical integration (mixed).
 
bool initElement (const std::vector< int > &MNPC, const MxFiniteElement &, const std::vector< size_t > &elem_sizes, const std::vector< size_t > &basis_sizes, LocalIntegral &elmInt) override
 Initializes current element for numerical integration (mixed).
 
bool initElementBou (const std::vector< int > &MNPC, LocalIntegral &elmInt) override
 Initializes current element for boundary integration.
 
bool initElementBou (const std::vector< int > &MNPC, const std::vector< size_t > &elem_sizes, const std::vector< size_t > &basis_sizes, LocalIntegral &elmInt) override
 Initializes current element for boundary integration (mixed).
 
virtual bool hasBoundaryTerms () const
 Returns whether this norm has explicit boundary contributions.
 
void activateElmGroup (const std::vector< int > &elms={})
 Assigns the group of active elements.
 
void addBoundaryTerms (Vectors &gNorm, double energy) const
 Adds external energy terms to relevant norms. More...
 
virtual size_t getNoFields (int group=0) const
 Returns the number of norm groups or size of a specified group. More...
 
virtual std::string getName (size_t i, size_t j, const char *prefix=0) const
 Returns the name of a norm quantity. More...
 
virtual bool hasElementContributions (size_t, size_t) const
 Returns whether a norm quantity stores element contributions.
 
VectorgetProjection (size_t i)
 Accesses a projected secondary solution vector of current patch.
 
void setFinalOperation (ASM::FinalNormOp op)
 Sets the final operation to apply to norms.
 
ASM::FinalNormOp getFinalOperation ()
 Returns the final operation applied to norms.
 
int getIntegrandType () const override
 Defines which FE quantities are needed by the integrand.
 
int getReducedIntegration (int n) const override
 Returns the number of reduced-order integration points.
 
bool reducedInt (LocalIntegral &elmInt, const FiniteElement &fe, const Vec3 &X) const override
 Evaluates reduced integration terms at an interior point. More...
 
virtual bool hasExternalProjections () const
 Returns whether projections are fed through external means.
 
virtual void setProjectedFields (Fields *f, size_t idx)
 Sets a projected secondary solution as a field quantity. More...
 
void setParam (const std::string &name, double value) override
 Assigns a parameter value to property functions of the integrand. More...
 
void setParam (const std::string &name, const Vec3 &value) override
 Assigns parameter values to property functions of the integrand. More...
 
SIM::SolutionMode getMode (bool) const override
 Returns current solution mode.
 
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...
 
- 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 getBouIntegrationPoints (int nGP) const
 Returns the number of boundary integration points.
 
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...
 

Protected Member Functions

 NormBase (IntegrandBase &p)
 The default constructor is protected to allow sub-classes only.
 
bool initProjection (const std::vector< int > &MNPC, LocalIntegral &elmInt, size_t nExtraNodes=0)
 Initializes the projected fields for current element.
 
double applyFinalOp (double value) const
 Applies the operation finalOp on the given value.
 
- 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
 Evaluates the integrand at interior points for stationary problems.
 
virtual bool evalIntMx (LocalIntegral &, const MxFiniteElement &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 &, 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...
 

Protected Attributes

IntegrandBasemyProblem
 The problem-specific data.
 
std::vector< Fields * > prjFld
 Projected secondary solution fields.
 
Vectors prjsol
 Projected secondary solution vectors for current patch.
 
bool projBou
 If true, the boundary integrand needs prjsol too.
 
unsigned short int nrcmp
 Number of projected solution components.
 
LintegralVeclints
 Local integrals used during norm integration.
 
ASM::FinalNormOp finalOp
 The final operation to apply to norms.
 

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...
 

Detailed Description

Base class representing a system level norm quantity.

Member Function Documentation

◆ addBoundaryTerms()

void NormBase::addBoundaryTerms ( Vectors gNorm,
double  energy 
) const

Adds external energy terms to relevant norms.

Parameters
gNormGlobal norm quantities
[in]energyGlobal external energy

References applyFinalOp().

◆ getLocalIntegral() [1/2]

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/2]

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

◆ getName()

std::string NormBase::getName ( size_t  i,
size_t  j,
const char *  prefix = 0 
) const
virtual

Returns the name of a norm quantity.

Parameters
[in]iThe norm group
[in]jThe norm number
[in]prefixCommon prefix for all norm names

Referenced by AdaptiveSetup::printNorms(), SIMgeneric::printNorms(), SIMoutput::writeGlvN(), and HDF5Writer::writeSIM().

◆ getNoFields()

size_t NormBase::getNoFields ( int  group = 0) const
virtual

Returns the number of norm groups or size of a specified group.

If group is zero, the number of norm groups is returned. If group is greater than zero, the size of that groups is returned.

References prjsol.

Referenced by getLocalIntegral(), AdaptiveSetup::initPrm(), SIMoutput::writeGlvN(), and HDF5Writer::writeSIM().

◆ reducedInt()

bool NormBase::reducedInt ( LocalIntegral elmInt,
const FiniteElement fe,
const Vec3 X 
) const
overridevirtual

Evaluates reduced integration terms 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 myProblem, and Integrand::reducedInt().

◆ setParam() [1/2]

void NormBase::setParam ( const std::string &  name,
const Vec3 value 
)
inlineoverridevirtual

Assigns parameter values to property functions of the integrand.

Parameters
[in]nameParameter name
[in]valueParameter value

Reimplemented from Integrand.

References myProblem, and Integrand::setParam().

◆ setParam() [2/2]

void NormBase::setParam ( const std::string &  name,
double  value 
)
inlineoverridevirtual

Assigns a parameter value to property functions of the integrand.

Parameters
[in]nameParameter name
[in]valueParameter value

Reimplemented from Integrand.

References myProblem, and Integrand::setParam().

◆ setProjectedFields()

void NormBase::setProjectedFields ( Fields f,
size_t  idx 
)
virtual

Sets a projected secondary solution as a field quantity.

Parameters
[in]fThe field defining the projected secondary solution
[in]idxProjection index

References prjFld.


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