https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Moose::MFEM::NLScaleIntegrator Class Reference

NonlinearFormIntegrator which scales its results by a constant value. More...

#include <NLScaleIntegrator.h>

Inheritance diagram for Moose::MFEM::NLScaleIntegrator:
[legend]

Public Member Functions

 NLScaleIntegrator (mfem::NonlinearFormIntegrator *integ)
 
 NLScaleIntegrator (mfem::NonlinearFormIntegrator *integ, mfem::real_t scale)
 
 NLScaleIntegrator (mfem::NonlinearFormIntegrator *integ, mfem::real_t scale, bool own)
 
void SetIntegrator (mfem::NonlinearFormIntegrator *integ)
 
void SetScale (mfem::real_t scale)
 
void SetOwn (bool own)
 
void CheckIntegrator ()
 
void SetIntegrationMode (mfem::NonlinearFormIntegrator::Mode m)
 
bool Patchwise () const
 
void SetPAMemoryType (mfem::MemoryType mt)
 Set the memory type used for GeometricFactors and other large allocations in PA extensions.
 
virtual void AssembleElementVector (const mfem::FiniteElement &el, mfem::ElementTransformation &Tr, const mfem::Vector &elfun, mfem::Vector &elvect) override
 
virtual void AssembleFaceVector (const mfem::FiniteElement &el1, const mfem::FiniteElement &el2, mfem::FaceElementTransformations &Tr, const mfem::Vector &elfun, mfem::Vector &elvect) override
 
virtual void AssembleElementGrad (const mfem::FiniteElement &el, mfem::ElementTransformation &Tr, const mfem::Vector &elfun, mfem::DenseMatrix &elmat) override
 
virtual void AssembleFaceGrad (const mfem::FiniteElement &el1, const mfem::FiniteElement &el2, mfem::FaceElementTransformations &Tr, const mfem::Vector &elfun, mfem::DenseMatrix &elmat) override
 
virtual mfem::real_t GetElementEnergy (const mfem::FiniteElement &el, mfem::ElementTransformation &Tr, const mfem::Vector &elfun) override
 
virtual ~NLScaleIntegrator ()
 

Private Attributes

mfem::NonlinearFormIntegrator * _integrator {nullptr}
 
mfem::real_t _scale
 
bool _own_integrator
 

Detailed Description

NonlinearFormIntegrator which scales its results by a constant value.

Definition at line 24 of file NLScaleIntegrator.h.

Constructor & Destructor Documentation

◆ NLScaleIntegrator() [1/3]

Moose::MFEM::NLScaleIntegrator::NLScaleIntegrator ( mfem::NonlinearFormIntegrator *  integ)
inline

Definition at line 32 of file NLScaleIntegrator.h.

33 : _integrator{integ}, _scale{1}, _own_integrator{true}
34 {
35 }
mfem::NonlinearFormIntegrator * _integrator

◆ NLScaleIntegrator() [2/3]

Moose::MFEM::NLScaleIntegrator::NLScaleIntegrator ( mfem::NonlinearFormIntegrator *  integ,
mfem::real_t  scale 
)
inline

Definition at line 36 of file NLScaleIntegrator.h.

37 : _integrator{integ}, _scale{scale}, _own_integrator{true}
38 {
39 }
Real scale
Definition MortarUtils.C:62

◆ NLScaleIntegrator() [3/3]

Moose::MFEM::NLScaleIntegrator::NLScaleIntegrator ( mfem::NonlinearFormIntegrator *  integ,
mfem::real_t  scale,
bool  own 
)
inline

Definition at line 40 of file NLScaleIntegrator.h.

42 {
43 }

◆ ~NLScaleIntegrator()

virtual Moose::MFEM::NLScaleIntegrator::~NLScaleIntegrator ( )
inlinevirtual

Definition at line 107 of file NLScaleIntegrator.h.

108 {
109 if (_own_integrator)
110 delete _integrator;
111 };

Member Function Documentation

◆ AssembleElementGrad()

void Moose::MFEM::NLScaleIntegrator::AssembleElementGrad ( const mfem::FiniteElement &  el,
mfem::ElementTransformation &  Tr,
const mfem::Vector &  elfun,
mfem::DenseMatrix &  elmat 
)
overridevirtual

Definition at line 41 of file NLScaleIntegrator.C.

45{
47 _integrator->AssembleElementGrad(el, Tr, elfun, elmat);
48 elmat *= _scale;
49}

◆ AssembleElementVector()

void Moose::MFEM::NLScaleIntegrator::AssembleElementVector ( const mfem::FiniteElement &  el,
mfem::ElementTransformation &  Tr,
const mfem::Vector &  elfun,
mfem::Vector &  elvect 
)
overridevirtual

Definition at line 18 of file NLScaleIntegrator.C.

22{
24 _integrator->AssembleElementVector(el, Tr, elfun, elvect);
25 elvect *= _scale;
26}

◆ AssembleFaceGrad()

void Moose::MFEM::NLScaleIntegrator::AssembleFaceGrad ( const mfem::FiniteElement &  el1,
const mfem::FiniteElement &  el2,
mfem::FaceElementTransformations &  Tr,
const mfem::Vector &  elfun,
mfem::DenseMatrix &  elmat 
)
overridevirtual

Definition at line 52 of file NLScaleIntegrator.C.

57{
59 _integrator->AssembleFaceGrad(el1, el2, Tr, elfun, elmat);
60 elmat *= _scale;
61}

◆ AssembleFaceVector()

void Moose::MFEM::NLScaleIntegrator::AssembleFaceVector ( const mfem::FiniteElement &  el1,
const mfem::FiniteElement &  el2,
mfem::FaceElementTransformations &  Tr,
const mfem::Vector &  elfun,
mfem::Vector &  elvect 
)
overridevirtual

Definition at line 29 of file NLScaleIntegrator.C.

34{
36 _integrator->AssembleFaceVector(el1, el2, Tr, elfun, elvect);
37 elvect *= _scale;
38}

◆ CheckIntegrator()

void Moose::MFEM::NLScaleIntegrator::CheckIntegrator ( )
inline

Definition at line 59 of file NLScaleIntegrator.h.

60 {
61 if (!_integrator)
62 mooseError("Integrator not set");
63 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311

Referenced by AssembleElementGrad(), AssembleElementVector(), AssembleFaceGrad(), AssembleFaceVector(), and GetElementEnergy().

◆ GetElementEnergy()

mfem::real_t Moose::MFEM::NLScaleIntegrator::GetElementEnergy ( const mfem::FiniteElement &  el,
mfem::ElementTransformation &  Tr,
const mfem::Vector &  elfun 
)
overridevirtual

Definition at line 64 of file NLScaleIntegrator.C.

67{
69 return _scale * _integrator->GetElementEnergy(el, Tr, elfun);
70}

◆ Patchwise()

bool Moose::MFEM::NLScaleIntegrator::Patchwise ( ) const
inline

Definition at line 71 of file NLScaleIntegrator.h.

71{ return integrationMode != Mode::ELEMENTWISE; }

◆ SetIntegrationMode()

void Moose::MFEM::NLScaleIntegrator::SetIntegrationMode ( mfem::NonlinearFormIntegrator::Mode  m)
inline

Definition at line 65 of file NLScaleIntegrator.h.

66 {
67 integrationMode = m;
68 _integrator->SetIntegrationMode(m);
69 }

◆ SetIntegrator()

void Moose::MFEM::NLScaleIntegrator::SetIntegrator ( mfem::NonlinearFormIntegrator *  integ)
inline

Definition at line 45 of file NLScaleIntegrator.h.

46 {
48 {
49 delete _integrator;
50 }
51
52 _integrator = integ;
53 }

◆ SetOwn()

void Moose::MFEM::NLScaleIntegrator::SetOwn ( bool  own)
inline

Definition at line 57 of file NLScaleIntegrator.h.

57{ _own_integrator = own; }

◆ SetPAMemoryType()

void Moose::MFEM::NLScaleIntegrator::SetPAMemoryType ( mfem::MemoryType  mt)
inline

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

Definition at line 75 of file NLScaleIntegrator.h.

76 {
77 pa_mt = mt;
78 _integrator->SetPAMemoryType(mt);
79 }

◆ SetScale()

void Moose::MFEM::NLScaleIntegrator::SetScale ( mfem::real_t  scale)
inline

Definition at line 55 of file NLScaleIntegrator.h.

55{ _scale = scale; }

Member Data Documentation

◆ _integrator

mfem::NonlinearFormIntegrator* Moose::MFEM::NLScaleIntegrator::_integrator {nullptr}
private

◆ _own_integrator

bool Moose::MFEM::NLScaleIntegrator::_own_integrator
private

Definition at line 29 of file NLScaleIntegrator.h.

Referenced by SetIntegrator(), SetOwn(), and ~NLScaleIntegrator().

◆ _scale

mfem::real_t Moose::MFEM::NLScaleIntegrator::_scale
private

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