MFEM
v4.3.0
Finite element discretization library
|
The MeshOperator class serves as base for mesh manipulation classes. More...
#include <mesh_operators.hpp>
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 |
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:
Definition at line 46 of file mesh_operators.hpp.
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.
|
inlineprotected |
Constructor to be used by derived classes.
Definition at line 60 of file mesh_operators.hpp.
|
inlinevirtual |
The destructor is virtual.
Definition at line 120 of file mesh_operators.hpp.
|
inline |
Perform the mesh operation.
Definition at line 93 of file mesh_operators.hpp.
|
protectedpure virtual |
Implementation of the mesh operation. Invoked by the Apply() public method.
Implemented in mfem::Rebalancer, mfem::ThresholdDerefiner, mfem::ThresholdRefiner, and mfem::MeshOperatorSequence.
|
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.
|
inline |
Check if the mesh was de-refined.
Definition at line 108 of file mesh_operators.hpp.
|
inline |
Get the full ActionInfo value generated by the last call to Apply().
Definition at line 114 of file mesh_operators.hpp.
|
inline |
Check if the mesh was rebalanced.
Definition at line 110 of file mesh_operators.hpp.
|
inline |
Check if the mesh was refined.
Definition at line 106 of file mesh_operators.hpp.
|
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.
|
pure virtual |
Reset the MeshOperator.
Implemented in mfem::Rebalancer, mfem::ThresholdDerefiner, mfem::ThresholdRefiner, and mfem::MeshOperatorSequence.
|
inline |
Check if STOP action is requested, e.g. stopping criterion is satisfied.
Definition at line 97 of file mesh_operators.hpp.
|
friend |
Definition at line 52 of file mesh_operators.hpp.