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

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

#include <IntegrandBase.h>

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

Public Member Functions

virtual bool parse (const tinyxml2::XMLElement *)
 Parses a data section from an XML element.
 
virtual void printLog () const
 Prints out the problem definition to the log stream.
 
virtual void setMode (SIM::SolutionMode mode)
 Defines the solution mode before the element assembly is started. More...
 
SIM::SolutionMode getMode (bool=false) const override
 Returns current solution mode.
 
virtual void setIntegrationPrm (unsigned short int, double)
 Initializes an integration parameter for the integrand.
 
virtual double getIntegrationPrm (unsigned short int) const
 Returns an integration parameter for the integrand.
 
virtual void initIntegration (size_t, size_t)
 Initializes the integrand with the number of integration points. More...
 
virtual void initIntegration (const TimeDomain &, const Vector &, bool=false)
 Initializes the integrand for a new integration loop. More...
 
virtual void initLHSbuffers (size_t)
 Initializes and toggles the use of left-hand-side matrix buffers.
 
virtual void initMatrixBuffers (size_t, size_t ielMax)
 Initializes the use of left-hand-side matrix buffers. More...
 
virtual void initResultPoints (double time, char=0)
 Initializes the integrand for a new result point loop. More...
 
virtual void initNodeMap (const std::vector< int > &)
 Initializes the global node number mapping for current patch.
 
virtual void setSecondaryInt (GlobalIntegral *=nullptr)
 Assigns a secondary integral to be computed (for reaction forces).
 
virtual GlobalIntegralgetGlobalInt (GlobalIntegral *gq) const
 Returns the system quantity to be integrated by *this. More...
 
virtual void initForPatch (const ASMbase *pch)
 Interface for initialization of integrand with patch-specific data. More...
 
LocalIntegralgetLocalIntegral (size_t nen, size_t iEl, bool neumann) const override
 Returns a local integral contribution object for the given element. More...
 
bool initElement (const std::vector< int > &MNPC, LocalIntegral &elmInt) override
 Initializes current element for numerical integration. More...
 
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. More...
 
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). More...
 
bool initElement (const std::vector< int > &MNPC, const MxFiniteElement &fe, const std::vector< size_t > &elem_sizes, const std::vector< size_t > &basis_sizes, LocalIntegral &elmInt) override
 Initializes current element for numerical integration (mixed). More...
 
bool initElementBou (const std::vector< int > &MNPC, LocalIntegral &elmInt) override
 Initializes current element for boundary integration. More...
 
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). More...
 
virtual bool hasInteriorTerms () const
 Returns whether this integrand has explicit interior contributions.
 
virtual bool hasBoundaryTerms () const
 Returns whether this integrand has explicit boundary contributions.
 
void activateElmGroup (const std::vector< int > &elms={})
 Assigns the group of active elements.
 
bool inActive (int iel) const
 Returns true, if the element iel is deactivated.
 
bool evalSol1 (Vector &s, const FiniteElement &fe, const Vec3 &X, const std::vector< int > &MNPC, size_t nskip=0) const
 Evaluates the secondary solution at a result point. More...
 
virtual bool evalSol2 (Vector &s, const Vectors &elmVec, const FiniteElement &fe, const Vec3 &X) const
 Evaluates the secondary solution at a result point. More...
 
virtual bool evalSol (Vector &s, const FiniteElement &fe, const Vec3 &X, const std::vector< int > &MNPC) const
 Evaluates the secondary solution at a result point. More...
 
virtual bool evalSol (Vector &s, const MxFiniteElement &fe, const Vec3 &X, const std::vector< int > &MNPC, const std::vector< size_t > &elem_sizes, const std::vector< size_t > &basis_sizes) const
 Evaluates the secondary solution at a result point (mixed problem). More...
 
virtual bool evalSol (Vector &s, const TensorFunc &asol, const Vec3 &X) const
 Evaluates the analytical secondary solution at a result point. More...
 
virtual bool evalSol (Vector &s, const STensorFunc &asol, const Vec3 &X) const
 Evaluates the analytical secondary solution at a result point. More...
 
virtual bool evalSol (Vector &s, const VecFunc &asol, const Vec3 &X) const
 Evaluates the analytical secondary solution at a result point. More...
 
virtual bool getPrincipalDir (Matrix &, size_t, size_t) const
 Returns an evaluated principal direction vector field for plotting.
 
virtual size_t getNo2ndSolPerLine () const
 Returns max number of 2ndary solution components to print per line.
 
virtual void primaryScalarFields (Matrix &)
 Computes some derived primary solution quantities.
 
virtual int derivativeOrder () const
 Returns the derivative order of the differential operator.
 
virtual bool writeGlvT (VTF *, int, int &, int &) const
 Writes surface tractions/fluxes for a given time step to VTF-file.
 
virtual bool hasTractionValues () const
 Returns whether there are any traction/flux values to write to VTF.
 
virtual bool diverged (size_t=0) const
 Returns true if simulation diverged on integration point level.
 
virtual NormBasegetNormIntegrand (AnaSol *=nullptr) const
 Returns a pointer to an Integrand for solution norm evaluation.
 
virtual ForceBasegetForceIntegrand (const Vec3 *, AnaSol *=nullptr) const
 Returns a pointer to an Integrand for boundary force evaluation.
 
virtual ForceBasegetForceIntegrand () const
 Returns a pointer to an Integrand for nodal force evaluation.
 
size_t getNoSpaceDim () const
 Returns the number of spatial dimensions.
 
virtual size_t getNoFields (int=2) const
 Returns the number of primary/secondary solution field components.
 
virtual size_t getNoGLMs () const
 Returns the number of global Lagrange multipliers in the model.
 
virtual std::string getField1Name (size_t idx, const char *prefix=0) const
 Returns the name of a primary solution field component. More...
 
virtual std::string getField2Name (size_t idx, const char *prefix=0) const
 Returns the name of a secondary solution field component. More...
 
virtual bool suppressOutput (size_t, ASM::ResultClass) const
 Filters a result components for output.
 
virtual size_t getNoSolutions (bool=true) const
 Returns the number of solution vectors.
 
virtual VectorgetExtractionField (size_t=1)
 Returns the patch-wise extraction function field, if any.
 
VectorgetSolution (size_t n=0)
 Accesses the primary solution vector of current patch.
 
VectorsgetSolutions ()
 Accesses the primary solution vectors of current patch.
 
void resetSolution ()
 Resets the primary solution vectors.
 
void printSolution (std::ostream &os, int pindx)
 Prints out the patch-wise solution vectors.
 
virtual void setNamedField (const std::string &, Field *)
 Registers where we can inject a mixed-basis scalar field.
 
virtual void setNamedFields (const std::string &, Fields *)
 Registers where we can inject a mixed-basis vector field.
 
VectorgetNamedVector (const std::string &name) const
 Returns a vector where we can store a named field.
 
virtual LinAlg::LinearSystemType getLinearSystemType () const
 Defines the properties of the resulting linear system. More...
 
void registerVector (const std::string &name, Vector *vec)
 Registers a vector to inject a named field into. More...
 
virtual void getNodalDofTypes (std::vector< char > &) const
 Returns nodal DOF flags for monolithic coupled integrands.
 
double getTimeLevel () const
 Returns current time/load parameter for 2ndary solution evaluation.
 
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 getIntegrandType () const
 Defines which FE quantities are needed by the integrand.
 
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.
 

Protected Member Functions

 IntegrandBase (unsigned short int n)
 The constructor is protected to allow sub-classes only.
 
bool initElement1 (const std::vector< int > &MNPC, Vectors &elmVec, size_t nskip=0) const
 Initializes the first primary solution vector for current element. More...
 
bool initElement2 (const std::vector< int > &MNPC, Vectors &elmVec, size_t nskip=0) const
 Initializes all primary solution vectors for current element. 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
 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

unsigned short int nsd
 Number of spatial dimensions (1, 2 or 3)
 
unsigned short int npv
 Number of primary solution variables per node.
 
double myTime
 Evaluation time for the secondary solution.
 
SIM::SolutionMode m_mode
 Current solution mode.
 
std::vector< int > elmGrp
 List of currently active elements.
 
Vectors primsol
 Primary solution vectors for current patch.
 

Private Attributes

std::map< std::string, Vector * > myFields
 Named fields of this integrand.
 

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

Member Function Documentation

◆ evalSol() [1/5]

bool IntegrandBase::evalSol ( Vector s,
const FiniteElement fe,
const Vec3 X,
const std::vector< int > &  MNPC 
) const
virtual

Evaluates the secondary solution at a result point.

Parameters
[out]sThe solution field values at current point
[in]feFinite element data at current point
[in]XCartesian coordinates of current point
[in]MNPCNodal point correspondance for the basis function values

The default implementation assumes that only the first primary solution vector is needed in the secondary solution evaluation, and thus forwards to the evalSol1() method. Override this method if the secondary solution depends on more than that.

References evalSol1().

Referenced by GlbL2::evalInt(), GlbL2::evalIntMx(), evalSol(), ASMs2DLag::evalSolution(), ASMs3DLag::evalSolution(), ASMs2DmxLag::evalSolution(), ASMs2DTri::evalSolution(), ASMs3DmxLag::evalSolution(), ASMs1DLag::evalSolution(), ASMs1DSpec::evalSolution(), ASMs2DSpec::evalSolution(), ASMs3DSpec::evalSolution(), ASMs2Dmx::evalSolution(), ASMs3Dmx::evalSolution(), ASMs2D::evalSolution(), ASMs3D::evalSolution(), ASMu2Dmx::evalSolution(), ASMu3Dmx::evalSolution(), ASMu2D::evalSolution(), ASMu3D::evalSolution(), ASMs1D::evalSolution(), and SIMoutput::writeGlvS2().

◆ evalSol() [2/5]

bool IntegrandBase::evalSol ( Vector s,
const MxFiniteElement fe,
const Vec3 X,
const std::vector< int > &  MNPC,
const std::vector< size_t > &  elem_sizes,
const std::vector< size_t > &  basis_sizes 
) const
virtual

Evaluates the secondary solution at a result point (mixed problem).

Parameters
[out]sThe solution field values at current point
[in]feMixed finite element data at current point
[in]XCartesian coordinates of current point
[in]MNPCNodal point correspondance for the bases
[in]elem_sizesSize of each basis on the element
[in]basis_sizesSize of each basis on the patch

This method is used when a mixed interpolation basis is used. The default implementation forwards to the single-basis version, using first basis only. Override this method for mixed problems requiring element-level solution vectors also for the other bases in the secondary solution evaluation.

References evalSol().

◆ evalSol() [3/5]

bool IntegrandBase::evalSol ( Vector s,
const STensorFunc asol,
const Vec3 X 
) const
virtual

Evaluates the analytical secondary solution at a result point.

Parameters
[out]sThe solution field values at current point
[in]asolThe analytical solution field (symmetric tensor field)
[in]XCartesian coordinates of current point

References nsd.

◆ evalSol() [4/5]

bool IntegrandBase::evalSol ( Vector s,
const TensorFunc asol,
const Vec3 X 
) const
virtual

Evaluates the analytical secondary solution at a result point.

Parameters
[out]sThe solution field values at current point
[in]asolThe analytical solution field (tensor field)
[in]XCartesian coordinates of current point

References nsd.

◆ evalSol() [5/5]

bool IntegrandBase::evalSol ( Vector s,
const VecFunc asol,
const Vec3 X 
) const
virtual

Evaluates the analytical secondary solution at a result point.

Parameters
[out]sThe solution field values at current point
[in]asolThe analytical solution field (vector field)
[in]XCartesian coordinates of current point

References nsd.

◆ evalSol1()

bool IntegrandBase::evalSol1 ( Vector s,
const FiniteElement fe,
const Vec3 X,
const std::vector< int > &  MNPC,
size_t  nskip = 0 
) const

Evaluates the secondary solution at a result point.

Parameters
[out]sThe solution field values at current point
[in]feFinite element data at current point
[in]XCartesian coordinates of current point
[in]MNPCNodal point correspondance for the basis function values
[in]nskipIf nonzero, skip the last nskip nodes of MNPC

This method can be used when only the first primary solution vector is needed in the secondary solution evaluation. Thus, only one element-level solution vector is extracted and forwarded to the virtual method evalSol2().

References evalSol2(), utl::gather(), npv, and primsol.

Referenced by evalSol().

◆ evalSol2()

bool IntegrandBase::evalSol2 ( Vector s,
const Vectors elmVec,
const FiniteElement fe,
const Vec3 X 
) const
virtual

Evaluates the secondary solution at a result point.

Parameters
[out]sThe solution field values at current point
[in]elmVecElement-level primary solution vectors
[in]feFinite element data at current point
[in]XCartesian coordinates of current point

This method must be overridded in a sub-class.

Referenced by evalSol1().

◆ getField1Name()

std::string IntegrandBase::getField1Name ( size_t  idx,
const char *  prefix = 0 
) const
virtual

Returns the name of a primary solution field component.

Parameters
[in]idxField component index
[in]prefixName prefix for all components

Referenced by SIMoutput::dumpSolution(), SIMoutput::evalResults(), SIMoutput::preprocessResultPoints(), SIMoutput::writeGlvS1(), and HDF5Writer::writeSIM().

◆ getField2Name()

std::string IntegrandBase::getField2Name ( size_t  idx,
const char *  prefix = 0 
) const
virtual

Returns the name of a secondary solution field component.

Parameters
[in]idxField component index
[in]prefixName prefix for all components

Referenced by SIMoutput::dumpSolution(), SIMoutput::evalResults(), SIMoutput::preprocessResultPoints(), SIMoutput::writeGlvP(), SIMoutput::writeGlvS2(), and HDF5Writer::writeSIM().

◆ getGlobalInt()

GlobalIntegral & IntegrandBase::getGlobalInt ( GlobalIntegral gq) const
virtual

Returns the system quantity to be integrated by *this.

Override this method if the problem to be solved consists of multiple IntegrandBase objects. This method is then supposed to return the corresponding integrated quantity for this integrand. The default implementation returns the object provided as argument.

◆ getLinearSystemType()

virtual LinAlg::LinearSystemType IntegrandBase::getLinearSystemType ( ) const
inlinevirtual

Defines the properties of the resulting linear system.

This method is used by PETSc to optimize assembly and matrix-vector products. For maximum speed always override this method to reflect symmetry/definiteness of your operator.

References LinAlg::GENERAL_MATRIX.

Referenced by SIMinput::parse().

◆ 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 * IntegrandBase::getLocalIntegral ( size_t  nen,
size_t  iEl,
bool  neumann 
) const
overridevirtual

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

The default implementation returns an ElmMats object with one left-hand-side matrix (unless we are doing a boundary integral) and one right-hand-side vector. The dimension of the element matrices are assumed to be npv*nen. Override this method if your integrand needs more element matrices.

Implements Integrand.

References m_mode, npv, ElmMats::redim(), ElmMats::resize(), and ElmMats::rhsOnly.

Referenced by GlbL2::getLocalIntegral().

◆ 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/4]

bool IntegrandBase::initElement ( const std::vector< int > &  MNPC,
const FiniteElement fe,
const Vec3 X0,
size_t  nPt,
LocalIntegral elmInt 
)
overridevirtual

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

Override this method if your integrand needs either the FiniteElement object itself, the element center, or the total number of integration points within the element. The default implementation forwards to the overloaded method not taking any of fe, X0 or nPt as arguments.

Implements Integrand.

References initElement().

◆ initElement() [2/4]

bool IntegrandBase::initElement ( const std::vector< int > &  MNPC,
const MxFiniteElement fe,
const std::vector< size_t > &  elem_sizes,
const std::vector< size_t > &  basis_sizes,
LocalIntegral elmInt 
)
overridevirtual

Initializes current element for numerical integration (mixed).

Parameters
[in]MNPCMatrix 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 initElement().

◆ initElement() [3/4]

bool IntegrandBase::initElement ( const std::vector< int > &  MNPC,
const std::vector< size_t > &  elem_sizes,
const std::vector< size_t > &  basis_sizes,
LocalIntegral elmInt 
)
overridevirtual

Initializes current element for numerical integration (mixed).

Parameters
[in]MNPCMatrix of nodal point correspondance 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

This method is used when a mixed interpolation basis is used. The default implementation forwards to the single-basis version, using first basis only. Override this method for mixed problems requiring element-level solution vectors also for the other bases.

Implements Integrand.

References initElement().

◆ initElement() [4/4]

bool IntegrandBase::initElement ( const std::vector< int > &  MNPC,
LocalIntegral elmInt 
)
overridevirtual

Initializes current element for numerical integration.

Parameters
[in]MNPCMatrix of nodal point correspondance for current element
elmIntLocal integral for element

This method is invoked once before starting the numerical integration loop over the Gaussian quadrature points over an element. It is supposed to perform all the necessary internal initializations needed before the numerical integration is started for current element.

The default implementation extracts the element-level solution vectors, stored in the provided elmInt argument, corresponding to each of the patch-wise solution vectors in the member primsol. Override this method if your integrand requires some additional or other element initializations.

Implements Integrand.

References initElement2(), and LocalIntegral::vec.

Referenced by GlbL2::initElement(), initElement(), NormBase::initElement(), and ForceBase::initElementBou().

◆ initElement1()

bool IntegrandBase::initElement1 ( const std::vector< int > &  MNPC,
Vectors elmVec,
size_t  nskip = 0 
) const
protected

Initializes the first primary solution vector for current element.

Parameters
[in]MNPCMatrix of nodal point correspondance for current element
[out]elmVecPrimary element solution vector
[in]nskipIf nonzero, skip the last nskip nodes of MNPC

This method can be used when only the first primary solution vector is needed. Thus, the returned elmVec array of element solution vectors will always have dimension 1.

The nodal point correspondance array MNPC may contain more nodal indices than should be used in the extraction process. In that case, the number of nodes to omit at the end needs to be specified through the nskip argument.

References utl::gather(), npv, and primsol.

Referenced by initElement2(), and initElementBou().

◆ initElement2()

bool IntegrandBase::initElement2 ( const std::vector< int > &  MNPC,
Vectors elmVec,
size_t  nskip = 0 
) const
protected

Initializes all primary solution vectors for current element.

Parameters
[in]MNPCMatrix of nodal point correspondance for current element
[out]elmVecPrimary element solution vectors
[in]nskipIf nonzero, skip the last nskip nodes of MNPC

This is the basic implementation of the element solution vector extraction. The output array elmVec will contain one element-level solution vector corresponding to each patch-level vector in primsol.

The nodal point correspondance array MNPC may contain more nodal indices than should be used in the extraction process. In that case, the number of nodes to omit at the end needs to be specified through the nskip argument.

References utl::gather(), initElement1(), npv, and primsol.

Referenced by initElement().

◆ initElementBou() [1/2]

bool IntegrandBase::initElementBou ( const std::vector< int > &  MNPC,
const std::vector< size_t > &  elem_sizes,
const std::vector< size_t > &  basis_sizes,
LocalIntegral elmInt 
)
overridevirtual

Initializes current element for boundary integration (mixed).

Parameters
[in]MNPCMatrix of nodal point correspondance 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

This method is used when a mixed interpolation basis is used. The default implementation forwards to the single-basis version, using first basis only. Override this method for mixed problems requiring element-level solution vectors also for the other bases.

Implements Integrand.

References initElementBou().

◆ initElementBou() [2/2]

bool IntegrandBase::initElementBou ( const std::vector< int > &  MNPC,
LocalIntegral elmInt 
)
overridevirtual

Initializes current element for boundary integration.

Parameters
[in]MNPCMatrix of nodal point correspondance for current element
elmIntLocal integral for element

The default implementation extracts the element-level vector only for the first (current) primary solution vector. Override this method if your boundary integrand requires more than that.

Implements Integrand.

References initElement1(), and LocalIntegral::vec.

Referenced by initElementBou(), and NormBase::initElementBou().

◆ initForPatch()

void IntegrandBase::initForPatch ( const ASMbase pch)
virtual

Interface for initialization of integrand with patch-specific data.

Override this method if the integrand needs some patch-specific data to be initialized before performing the numerical integration. The default version only passes the patch index to the initPatch() method.

References ASMbase::idx, and Integrand::initPatch().

◆ initIntegration() [1/2]

virtual void IntegrandBase::initIntegration ( const TimeDomain ,
const Vector ,
bool  = false 
)
inlinevirtual

Initializes the integrand for a new integration loop.

This method is invoked once before starting the numerical integration over the entire spatial domain.

◆ initIntegration() [2/2]

virtual void IntegrandBase::initIntegration ( size_t  ,
size_t   
)
inlinevirtual

Initializes the integrand with the number of integration points.

This method is invoked only once during the preprocessing stage.

Referenced by SIMbase::project(), and SIMbase::solutionNorms().

◆ initMatrixBuffers()

virtual void IntegrandBase::initMatrixBuffers ( size_t  ,
size_t  ielMax 
)
inlinevirtual

Initializes the use of left-hand-side matrix buffers.

Override this method if your integrand uses the global element index and not the external ID, as key in the element matrix buffers. The total number of elements in the model is given as the first argument, whereas ielMax is the highest occurring external element ID.

References initLHSbuffers().

Referenced by SIMbase::initLHSbuffers().

◆ initResultPoints()

virtual void IntegrandBase::initResultPoints ( double  time,
char  = 0 
)
inlinevirtual

Initializes the integrand for a new result point loop.

This method is invoked once before starting the evaluation of the secondary solution at all result sampling points, after the converged primary solution has been found. The default implementation only sets the evaluation time for the secondary solutions, which may be used when some secondary solution fields have direct dependency to the current time. The method is overridden by integrands containing internal result buffers that need to be (re-)initialized.

References myTime.

Referenced by SIMoutput::dumpResults(), SIMoutput::eval2ndSolution(), SIMbase::project(), SIMoutput::savePoints(), SIMoutput::saveResults(), and SIMoutput::writeGlvS2().

◆ registerVector()

void IntegrandBase::registerVector ( const std::string &  name,
Vector vec 
)

Registers a vector to inject a named field into.

Parameters
[in]nameName of field
[in]vecVector to inject field into

References myFields.

◆ setMode()

void IntegrandBase::setMode ( SIM::SolutionMode  mode)
virtual

Defines the solution mode before the element assembly is started.

The default implementation of this method allocates for one solution vector in primsol when the mode is set to SIM::RECOVERY or SIM::NORMS, but only if the vector is empty. This is sufficient for most linear problems with a single right-hand side.

References m_mode, and primsol.


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