MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::NonlinearFormIntegrator Class Reference

This class is used to express the local action of a general nonlinear finite element operator. In addition it may provide the capability to assemble the local gradient operator and to compute the local energy. More...

#include <nonlininteg.hpp>

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

Public Types

enum  Mode { ELEMENTWISE = 0 , PATCHWISE = 1 , PATCHWISE_REDUCED = 2 }
 

Public Member Functions

void SetIntegrationMode (Mode m)
 
bool Patchwise () const
 
void SetPAMemoryType (MemoryType mt)
 
virtual void AssembleElementVector (const FiniteElement &el, ElementTransformation &Tr, const Vector &elfun, Vector &elvect)
 Perform the local action of the NonlinearFormIntegrator.
 
virtual void AssembleFaceVector (const FiniteElement &el1, const FiniteElement &el2, FaceElementTransformations &Tr, const Vector &elfun, Vector &elvect)
 Perform the local action of the NonlinearFormIntegrator resulting from a face integral term.
 
virtual void AssembleElementGrad (const FiniteElement &el, ElementTransformation &Tr, const Vector &elfun, DenseMatrix &elmat)
 Assemble the local gradient matrix.
 
virtual void AssembleFaceGrad (const FiniteElement &el1, const FiniteElement &el2, FaceElementTransformations &Tr, const Vector &elfun, DenseMatrix &elmat)
 Assemble the local action of the gradient of the NonlinearFormIntegrator resulting from a face integral term.
 
virtual real_t GetElementEnergy (const FiniteElement &el, ElementTransformation &Tr, const Vector &elfun)
 Compute the local energy.
 
virtual void AssemblePA (const FiniteElementSpace &fes)
 Method defining partial assembly.
 
virtual void AssemblePA (const FiniteElementSpace &trial_fes, const FiniteElementSpace &test_fes)
 
virtual void AssembleGradPA (const Vector &x, const FiniteElementSpace &fes)
 Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at the state x.
 
virtual real_t GetLocalStateEnergyPA (const Vector &x) const
 Compute the local (to the MPI rank) energy with partial assembly.
 
virtual void AddMultPA (const Vector &x, Vector &y) const
 Method for partially assembled action.
 
virtual void AddMultGradPA (const Vector &x, Vector &y) const
 Method for partially assembled gradient action.
 
virtual void AssembleGradDiagonalPA (Vector &diag) const
 Method for computing the diagonal of the gradient with partial assembly.
 
virtual bool SupportsCeed () const
 Indicates whether this integrator can use a Ceed backend.
 
virtual void AssembleMF (const FiniteElementSpace &fes)
 Method defining fully unassembled operator.
 
virtual void AddMultMF (const Vector &x, Vector &y) const
 
ceed::OperatorGetCeedOp ()
 
virtual ~NonlinearFormIntegrator ()
 
- Public Member Functions inherited from mfem::Integrator
 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

 NonlinearFormIntegrator (const IntegrationRule *ir=NULL)
 
- Protected Member Functions inherited from mfem::Integrator
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

Mode integrationMode = Mode::ELEMENTWISE
 
ceed::OperatorceedOp
 
MemoryType pa_mt = MemoryType::DEFAULT
 
- Protected Attributes inherited from mfem::Integrator
const IntegrationRuleIntRule
 
NURBSMeshRulespatchRules = nullptr
 

Detailed Description

This class is used to express the local action of a general nonlinear finite element operator. In addition it may provide the capability to assemble the local gradient operator and to compute the local energy.

Definition at line 28 of file nonlininteg.hpp.

Member Enumeration Documentation

◆ Mode

Enumerator
ELEMENTWISE 

Element-wise integration (default)

PATCHWISE 

Patch-wise integration (NURBS meshes)

PATCHWISE_REDUCED 

Patch-wise integration (NURBS meshes) with reduced integration rules.

Definition at line 31 of file nonlininteg.hpp.

Constructor & Destructor Documentation

◆ NonlinearFormIntegrator()

mfem::NonlinearFormIntegrator::NonlinearFormIntegrator ( const IntegrationRule * ir = NULL)
inlineprotected

Definition at line 47 of file nonlininteg.hpp.

◆ ~NonlinearFormIntegrator()

virtual mfem::NonlinearFormIntegrator::~NonlinearFormIntegrator ( )
inlinevirtual

Definition at line 154 of file nonlininteg.hpp.

Member Function Documentation

◆ AddMultGradPA()

void mfem::NonlinearFormIntegrator::AddMultGradPA ( const Vector & x,
Vector & y ) const
virtual

Method for partially assembled gradient action.

All arguments are E-vectors. This method can be called only after the method AssembleGradPA() has been called.

Parameters
[in]xThe gradient Operator is applied to the Vector x.
[in,out]yThe result Vector: \( y += G x \).

Reimplemented in mfem::TMOP_Integrator, and mfem::TMOPComboIntegrator.

Definition at line 51 of file nonlininteg.cpp.

◆ AddMultMF()

void mfem::NonlinearFormIntegrator::AddMultMF ( const Vector & x,
Vector & y ) const
virtual

Perform the action of integrator on the input x and add the result to the output y. Both x and y are E-vectors, i.e. they represent the element-wise discontinuous version of the FE space.

This method can be called only after the method AssembleMF() has been called.

Reimplemented in mfem::BilinearFormIntegrator, mfem::ConvectionIntegrator, mfem::DiffusionIntegrator, mfem::MassIntegrator, mfem::SumIntegrator, mfem::VectorConvectionNLFIntegrator, mfem::VectorDiffusionIntegrator, and mfem::VectorMassIntegrator.

Definition at line 69 of file nonlininteg.cpp.

◆ AddMultPA()

◆ AssembleElementGrad()

◆ AssembleElementVector()

◆ AssembleFaceGrad()

void mfem::NonlinearFormIntegrator::AssembleFaceGrad ( const FiniteElement & el1,
const FiniteElement & el2,
FaceElementTransformations & Tr,
const Vector & elfun,
DenseMatrix & elmat )
virtual

Assemble the local action of the gradient of the NonlinearFormIntegrator resulting from a face integral term.

Reimplemented in mfem::BilinearFormIntegrator, and mfem::HyperbolicFormIntegrator.

Definition at line 99 of file nonlininteg.cpp.

◆ AssembleFaceVector()

void mfem::NonlinearFormIntegrator::AssembleFaceVector ( const FiniteElement & el1,
const FiniteElement & el2,
FaceElementTransformations & Tr,
const Vector & elfun,
Vector & elvect )
virtual

Perform the local action of the NonlinearFormIntegrator resulting from a face integral term.

Reimplemented in mfem::BilinearFormIntegrator, and mfem::HyperbolicFormIntegrator.

Definition at line 83 of file nonlininteg.cpp.

◆ AssembleGradDiagonalPA()

void mfem::NonlinearFormIntegrator::AssembleGradDiagonalPA ( Vector & diag) const
virtual

Method for computing the diagonal of the gradient with partial assembly.

The result Vector diag is an E-Vector. This method can be called only after the method AssembleGradPA() has been called.

Parameters
[in,out]diagThe result Vector: \( diag += diag(G) \).

Reimplemented in mfem::TMOP_Integrator, and mfem::TMOPComboIntegrator.

Definition at line 57 of file nonlininteg.cpp.

◆ AssembleGradPA()

void mfem::NonlinearFormIntegrator::AssembleGradPA ( const Vector & x,
const FiniteElementSpace & fes )
virtual

Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at the state x.

The result of the partial assembly is stored internally so that it can be used later in the methods AddMultGradPA() and AssembleGradDiagonalPA(). The state Vector x is an E-vector.

Reimplemented in mfem::TMOP_Integrator, and mfem::TMOPComboIntegrator.

Definition at line 38 of file nonlininteg.cpp.

◆ AssembleMF()

void mfem::NonlinearFormIntegrator::AssembleMF ( const FiniteElementSpace & fes)
virtual

◆ AssemblePA() [1/2]

◆ AssemblePA() [2/2]

◆ GetCeedOp()

ceed::Operator & mfem::NonlinearFormIntegrator::GetCeedOp ( )
inline

Definition at line 152 of file nonlininteg.hpp.

◆ GetElementEnergy()

◆ GetLocalStateEnergyPA()

real_t mfem::NonlinearFormIntegrator::GetLocalStateEnergyPA ( const Vector & x) const
virtual

Compute the local (to the MPI rank) energy with partial assembly.

Here the state x is an E-vector. This method can be called only after the method AssemblePA() has been called.

Reimplemented in mfem::TMOP_Integrator, and mfem::TMOPComboIntegrator.

Definition at line 18 of file nonlininteg.cpp.

◆ Patchwise()

bool mfem::NonlinearFormIntegrator::Patchwise ( ) const
inline

Definition at line 55 of file nonlininteg.hpp.

◆ SetIntegrationMode()

void mfem::NonlinearFormIntegrator::SetIntegrationMode ( Mode m)
inline

Definition at line 52 of file nonlininteg.hpp.

◆ SetPAMemoryType()

void mfem::NonlinearFormIntegrator::SetPAMemoryType ( MemoryType mt)
inline

Set the memory type used for GeometricFactors and other large allocations in PA extensions.

Definition at line 59 of file nonlininteg.hpp.

◆ SupportsCeed()

virtual bool mfem::NonlinearFormIntegrator::SupportsCeed ( ) const
inlinevirtual

Indicates whether this integrator can use a Ceed backend.

Reimplemented in mfem::ConvectionIntegrator, mfem::DiffusionIntegrator, mfem::MassIntegrator, mfem::VectorDiffusionIntegrator, and mfem::VectorMassIntegrator.

Definition at line 139 of file nonlininteg.hpp.

Member Data Documentation

◆ ceedOp

ceed::Operator* mfem::NonlinearFormIntegrator::ceedOp
protected

Definition at line 43 of file nonlininteg.hpp.

◆ integrationMode

Mode mfem::NonlinearFormIntegrator::integrationMode = Mode::ELEMENTWISE
protected

Definition at line 40 of file nonlininteg.hpp.

◆ pa_mt

MemoryType mfem::NonlinearFormIntegrator::pa_mt = MemoryType::DEFAULT
protected

Definition at line 45 of file nonlininteg.hpp.


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