MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
mfem::MeshOperator Class Referenceabstract

The MeshOperator class serves as base for mesh manipulation classes. More...

#include <mesh_operators.hpp>

Inheritance diagram for mfem::MeshOperator:
[legend]

Public Types

enum  Action {
  NONE = 0 , CONTINUE = 1 , STOP = 2 , REPEAT = 3 ,
  MASK_UPDATE = 1 , MASK_ACTION = 3
}
 Action and information constants and masks. More...
 
enum  Info { REFINED = 4*1 , DEREFINED = 4*2 , REBALANCED = 4*3 , MASK_INFO = ~3 }
 

Public Member Functions

bool Apply (Mesh &mesh)
 Perform the mesh operation.
 
bool Stop () const
 Check if STOP action is requested, e.g. stopping criterion is satisfied.
 
bool Repeat () const
 Check if REPEAT action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated, and Apply() must be called again.
 
bool Continue () const
 Check if CONTINUE action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated and computations should continue.
 
bool Refined () const
 Check if the mesh was refined.
 
bool Derefined () const
 Check if the mesh was de-refined.
 
bool Rebalanced () const
 Check if the mesh was rebalanced.
 
int GetActionInfo () const
 Get the full ActionInfo value generated by the last call to Apply().
 
virtual void Reset ()=0
 Reset the MeshOperator.
 
virtual ~MeshOperator ()
 The destructor is virtual.
 

Protected Member Functions

virtual int ApplyImpl (Mesh &mesh)=0
 Implementation of the mesh operation. Invoked by the Apply() public method.
 
 MeshOperator ()
 Constructor to be used by derived classes.
 

Friends

class MeshOperatorSequence
 

Detailed Description

The MeshOperator class serves as base for mesh manipulation classes.

The purpose of the class is to provide a common abstraction for various AMR mesh control schemes. The typical use in an AMR loop is illustrated in examples 6/6p and 15/15p.

A more general loop that also supports sequences of mesh operators with multiple updates looks like this:

for (...)
{
// computations on the current mesh ...
while (mesh_operator->Apply(mesh))
{
// update FiniteElementSpaces and interpolate GridFunctions ...
if (mesh_operator->Continue()) { break; }
}
if (mesh_operator->Stop()) { break; }
}

Definition at line 46 of file mesh_operators.hpp.

Member Enumeration Documentation

◆ Action

Action and information constants and masks.

Combinations of constants are returned by the Apply() virtual method and can be accessed directly with GetActionInfo() or indirectly with methods like Stop(), Continue(), etc. The information bits (MASK_INFO) can be set only when the update bit is set (see MASK_UPDATE).

Enumerator
NONE 

continue with computations without updating spaces or grid-functions, i.e. the mesh was not modified

CONTINUE 

update spaces and grid-functions and continue computations with the new mesh

STOP 

a stopping criterion was satisfied

REPEAT 

update spaces and grid-functions and call the operator Apply() method again

MASK_UPDATE 

bit mask for the "update" bit

MASK_ACTION 

bit mask for all "action" bits

Definition at line 69 of file mesh_operators.hpp.

◆ Info

Enumerator
REFINED 

the mesh was refined

DEREFINED 

the mesh was de-refined

REBALANCED 

the mesh was rebalanced

MASK_INFO 

bit mask for all "info" bits

Definition at line 82 of file mesh_operators.hpp.

Constructor & Destructor Documentation

◆ MeshOperator()

mfem::MeshOperator::MeshOperator ( )
inlineprotected

Constructor to be used by derived classes.

Definition at line 60 of file mesh_operators.hpp.

◆ ~MeshOperator()

virtual mfem::MeshOperator::~MeshOperator ( )
inlinevirtual

The destructor is virtual.

Definition at line 120 of file mesh_operators.hpp.

Member Function Documentation

◆ Apply()

bool mfem::MeshOperator::Apply ( Mesh mesh)
inline

Perform the mesh operation.

Returns
true if FiniteElementSpaces and GridFunctions need to be updated.

Definition at line 93 of file mesh_operators.hpp.

◆ ApplyImpl()

virtual int mfem::MeshOperator::ApplyImpl ( Mesh mesh)
protectedpure virtual

Implementation of the mesh operation. Invoked by the Apply() public method.

Returns
Combination of ActionInfo constants.

Implemented in mfem::MeshOperatorSequence, mfem::ThresholdRefiner, mfem::ThresholdDerefiner, mfem::CoefficientRefiner, and mfem::Rebalancer.

◆ Continue()

bool mfem::MeshOperator::Continue ( ) const
inline

Check if CONTINUE action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated and computations should continue.

Definition at line 103 of file mesh_operators.hpp.

◆ Derefined()

bool mfem::MeshOperator::Derefined ( ) const
inline

Check if the mesh was de-refined.

Definition at line 108 of file mesh_operators.hpp.

◆ GetActionInfo()

int mfem::MeshOperator::GetActionInfo ( ) const
inline

Get the full ActionInfo value generated by the last call to Apply().

Definition at line 114 of file mesh_operators.hpp.

◆ Rebalanced()

bool mfem::MeshOperator::Rebalanced ( ) const
inline

Check if the mesh was rebalanced.

Definition at line 110 of file mesh_operators.hpp.

◆ Refined()

bool mfem::MeshOperator::Refined ( ) const
inline

Check if the mesh was refined.

Definition at line 106 of file mesh_operators.hpp.

◆ Repeat()

bool mfem::MeshOperator::Repeat ( ) const
inline

Check if REPEAT action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated, and Apply() must be called again.

Definition at line 100 of file mesh_operators.hpp.

◆ Reset()

virtual void mfem::MeshOperator::Reset ( )
pure virtual

◆ Stop()

bool mfem::MeshOperator::Stop ( ) const
inline

Check if STOP action is requested, e.g. stopping criterion is satisfied.

Definition at line 97 of file mesh_operators.hpp.

Friends And Related Function Documentation

◆ MeshOperatorSequence

friend class MeshOperatorSequence
friend

Definition at line 52 of file mesh_operators.hpp.


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