MFEM  v4.2.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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. More...
 
bool Stop () const
 Check if STOP action is requested, e.g. stopping criterion is satisfied. More...
 
bool Repeat () const
 Check if REPEAT action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated, and Apply() must be called again. More...
 
bool Continue () const
 Check if CONTINUE action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated and computations should continue. More...
 
bool Refined () const
 Check if the mesh was refined. More...
 
bool Derefined () const
 Check if the mesh was de-refined. More...
 
bool Rebalanced () const
 Check if the mesh was rebalanced. More...
 
int GetActionInfo () const
 Get the full ActionInfo value generated by the last call to Apply(). More...
 
virtual void Reset ()=0
 Reset the MeshOperator. More...
 
virtual ~MeshOperator ()
 The destructor is virtual. More...
 

Protected Member Functions

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

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

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

mfem::MeshOperator::MeshOperator ( )
inlineprotected

Constructor to be used by derived classes.

Definition at line 60 of file mesh_operators.hpp.

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

The destructor is virtual.

Definition at line 120 of file mesh_operators.hpp.

Member Function Documentation

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.

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::Rebalancer, mfem::ThresholdDerefiner, mfem::ThresholdRefiner, and mfem::MeshOperatorSequence.

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.

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

Check if the mesh was de-refined.

Definition at line 108 of file mesh_operators.hpp.

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.

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

Check if the mesh was rebalanced.

Definition at line 110 of file mesh_operators.hpp.

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

Check if the mesh was refined.

Definition at line 106 of file mesh_operators.hpp.

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.

virtual void mfem::MeshOperator::Reset ( )
pure virtual
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

friend class MeshOperatorSequence
friend

Definition at line 52 of file mesh_operators.hpp.


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