MFEM v4.8.0
Finite element discretization library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
mfem::Integrator Class Reference

This base class implements some shared functionality between linear and nonlinear form integrators. More...

#include <integrator.hpp>

Inheritance diagram for mfem::Integrator:
[legend]
Collaboration diagram for mfem::Integrator:
[legend]

Public Member Functions

 Integrator (const IntegrationRule *ir=NULL)
 Create a new Integrator, optionally providing a prescribed quadrature rule to use in assembly.
 
virtual void SetIntRule (const IntegrationRule *ir)
 Prescribe a fixed IntegrationRule to use, or set to null to let the integrator choose an appropriate rule.
 
void SetIntegrationRule (const IntegrationRule &ir)
 Prescribe a fixed IntegrationRule to use. Sets the NURBS patch integration rule to null.
 
void SetNURBSPatchIntRule (NURBSMeshRules *pr)
 Sets an integration rule for use on NURBS patches.
 
bool HasNURBSPatchIntRule () const
 Check if a NURBS patch integration rule has been set.
 
const IntegrationRuleGetIntRule () const
 Directly return the IntRule pointer (possibly null) without checking for NURBS patch rules or falling back on a default.
 
const IntegrationRuleGetIntegrationRule () const
 Equivalent to GetIntRule, but retained for backward compatibility with applications.
 

Protected Member Functions

const IntegrationRuleGetIntegrationRule (const FiniteElement &trial_fe, const FiniteElement &test_fe, const ElementTransformation &trans) const
 Returns an integration rule based on the arguments and internal state of the Integrator object.
 
const IntegrationRuleGetIntegrationRule (const FiniteElement &el, const ElementTransformation &trans) const
 Returns an integration rule based on the arguments and internal state. (Version for identical trial_fe and test_fe)
 
virtual const IntegrationRuleGetDefaultIntegrationRule (const FiniteElement &trial_fe, const FiniteElement &test_fe, const ElementTransformation &trans) const
 Subclasses should override to choose a default integration rule.
 

Protected Attributes

const IntegrationRuleIntRule
 
NURBSMeshRulespatchRules = nullptr
 

Detailed Description

This base class implements some shared functionality between linear and nonlinear form integrators.

Definition at line 22 of file integrator.hpp.

Constructor & Destructor Documentation

◆ Integrator()

mfem::Integrator::Integrator ( const IntegrationRule * ir = NULL)
inline

Create a new Integrator, optionally providing a prescribed quadrature rule to use in assembly.

Definition at line 27 of file integrator.hpp.

Member Function Documentation

◆ GetDefaultIntegrationRule()

virtual const IntegrationRule * mfem::Integrator::GetDefaultIntegrationRule ( const FiniteElement & trial_fe,
const FiniteElement & test_fe,
const ElementTransformation & trans ) const
inlineprotectedvirtual

Subclasses should override to choose a default integration rule.

This method is intended to be overridden by subclasses to choose an appropriate integration rule based on the finite element spaces and/or element transformation. The trial_fe and test_fe should be equal for linear forms. The default base-class implementation returns null, which assumes that an appropriate rule is provided by another means, or that null integration rules are handled appropriately by the caller.

Reimplemented in mfem::ConvectionIntegrator, mfem::DiffusionIntegrator, mfem::GradientIntegrator, mfem::HyperelasticNLFIntegrator, mfem::MassIntegrator, mfem::VectorConvectionNLFIntegrator, and mfem::VectorDivergenceIntegrator.

Definition at line 111 of file integrator.hpp.

◆ GetIntegrationRule() [1/3]

const IntegrationRule * mfem::Integrator::GetIntegrationRule ( ) const
inline

Equivalent to GetIntRule, but retained for backward compatibility with applications.

Definition at line 67 of file integrator.hpp.

◆ GetIntegrationRule() [2/3]

const IntegrationRule * mfem::Integrator::GetIntegrationRule ( const FiniteElement & el,
const ElementTransformation & trans ) const
protected

Returns an integration rule based on the arguments and internal state. (Version for identical trial_fe and test_fe)

See also
GetIntegrationRule(const FiniteElement*, const FiniteElement*, const ElementTransformation*)

Definition at line 44 of file integrator.cpp.

◆ GetIntegrationRule() [3/3]

const IntegrationRule * mfem::Integrator::GetIntegrationRule ( const FiniteElement & trial_fe,
const FiniteElement & test_fe,
const ElementTransformation & trans ) const
protected

Returns an integration rule based on the arguments and internal state of the Integrator object.

This method returns an integration rule in a way that depends on the integrator's attributes. Attributes can specify an existing IntegrationRule, and/or a NURBSMeshRules object. This method will pick the NURBSMeshRules' restriction to the element if given and applicable, and IntRule otherwise, prioritizing the NURBS rule if available. If neither is valid, the integrator will fall back on the virtual method GetDefaultIntegrationRule to choose a default integration rule, where subclasses can override this in a problem-specific way.

Definition at line 18 of file integrator.cpp.

◆ GetIntRule()

const IntegrationRule * mfem::Integrator::GetIntRule ( ) const
inline

Directly return the IntRule pointer (possibly null) without checking for NURBS patch rules or falling back on a default.

Definition at line 63 of file integrator.hpp.

◆ HasNURBSPatchIntRule()

bool mfem::Integrator::HasNURBSPatchIntRule ( ) const
inline

Check if a NURBS patch integration rule has been set.

Definition at line 59 of file integrator.hpp.

◆ SetIntegrationRule()

void mfem::Integrator::SetIntegrationRule ( const IntegrationRule & ir)
inline

Prescribe a fixed IntegrationRule to use. Sets the NURBS patch integration rule to null.

See also
SetIntRule(const IntegrationRule*)

Definition at line 46 of file integrator.hpp.

◆ SetIntRule()

virtual void mfem::Integrator::SetIntRule ( const IntegrationRule * ir)
inlinevirtual

Prescribe a fixed IntegrationRule to use, or set to null to let the integrator choose an appropriate rule.

This method allows setting a custom integration rule to use on each element during assembly, overriding the default choice if it is non-null. Passing a non-null value will set the Integrator's NURBS patch integration rule to null to avoid ambiguity in GetIntegrationRule.

Reimplemented in mfem::InverseIntegrator, mfem::LumpedIntegrator, mfem::QuadratureLFIntegrator, mfem::SumIntegrator, mfem::TransposeIntegrator, and mfem::VectorQuadratureLFIntegrator.

Definition at line 38 of file integrator.hpp.

◆ SetNURBSPatchIntRule()

void mfem::Integrator::SetNURBSPatchIntRule ( NURBSMeshRules * pr)
inline

Sets an integration rule for use on NURBS patches.

For patchwise integration, SetNURBSPatchIntRule must be called. Passing a non-null value will set the Integrator's standard element IntegrationRule to null to avoid ambiguity in GetIntegrationRule.

Definition at line 55 of file integrator.hpp.

Member Data Documentation

◆ IntRule

const IntegrationRule* mfem::Integrator::IntRule
protected

Definition at line 70 of file integrator.hpp.

◆ patchRules

NURBSMeshRules* mfem::Integrator::patchRules = nullptr
protected

Definition at line 71 of file integrator.hpp.


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