12 #ifndef MFEM_MESH_OPERATORS
13 #define MFEM_MESH_OPERATORS
15 #include "../config/config.hpp"
16 #include "../general/array.hpp"
18 #include "../fem/estimators.hpp"
117 virtual void Reset() = 0;
155 virtual void Reset();
243 MFEM_ASSERT(nc_limit >= 0,
"Invalid NC limit");
254 virtual void Reset();
302 MFEM_ASSERT(nc_limit >= 0,
"Invalid NC limit");
330 #endif // MFEM_MESH_OPERATORS
void SetTotalErrorNormP(double norm_p=infinity())
Set the exponent, p, of the discrete p-norm used to compute the total error from the local element er...
bool Continue() const
Check if CONTINUE action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated ...
MeshOperatorSequence(const MeshOperatorSequence &)
Do not allow copy construction, due to assumed ownership.
virtual void Reset()=0
Reset the MeshOperator.
bool Repeat() const
Check if REPEAT action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated...
virtual int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh.
Action
Action and information constants and masks.
void SetNCLimit(int nc_limit)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited).
bool Stop() const
Check if STOP action is requested, e.g. stopping criterion is satisfied.
void PreferNonconformingRefinement()
Use nonconforming refinement, if possible (triangles, quads, hexes).
double GetNorm(const Vector &local_err, Mesh &mesh) const
virtual int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh.
int GetActionInfo() const
Get the full ActionInfo value generated by the last call to Apply().
virtual void Reset()
Reset all MeshOperators in the sequence.
virtual int ApplyImpl(Mesh &mesh)
Apply the MeshOperatorSequence.
bit mask for all "action" bits
long GetNumMarkedElements() const
Get the number of marked elements in the last Apply() call.
bool Apply(Mesh &mesh)
Perform the mesh operation.
virtual void Reset()
Reset the associated estimator.
bit mask for the "update" bit
virtual void Reset()
Reset the associated estimator.
Mesh refinement operator using an error threshold.
MeshOperator()
Constructor to be used by derived classes.
virtual int ApplyImpl(Mesh &mesh)
Rebalance a parallel mesh (only non-conforming parallel meshes are supported).
bit mask for all "info" bits
Base class for all element based error estimators.
Array< Refinement > marked_elements
ErrorEstimator & estimator
virtual void Reset()=0
Force recomputation of the estimates on the next call to GetLocalErrors.
void SetNCLimit(int nc_limit)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited).
bool Derefined() const
Check if the mesh was de-refined.
void SetTotalErrorGoal(double err_goal)
Set the total error stopping criterion: stop when total_err <= total_err_goal. The default value is z...
virtual ~MeshOperator()
The destructor is virtual.
The MeshOperator class serves as base for mesh manipulation classes.
void PreferConformingRefinement()
Use conforming refinement, if possible (triangles, tetrahedra) – this is the default.
virtual ~MeshOperatorSequence()
Delete all operators from the sequence.
a stopping criterion was satisfied
ThresholdDerefiner(ErrorEstimator &est)
Construct a ThresholdDerefiner using the given ErrorEstimator.
AnisotropicErrorEstimator * aniso_estimator
ErrorEstimator & estimator
void Append(MeshOperator *mc)
Add an operator to the end of the sequence. The MeshOperatorSequence assumes ownership of the operato...
void SetMaxElements(long max_elem)
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= m...
bool Refined() const
Check if the mesh was refined.
Array< MeshOperator * > & GetSequence()
Access the underlying sequence.
MeshOperatorSequence()
Constructor. Use the Append() method to create the sequence.
The AnisotropicErrorEstimator class is the base class for all error estimators that compute one non-n...
double infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
double GetThreshold() const
Get the threshold used in the last Apply() call.
void SetThreshold(double thresh)
Set the de-refinement threshold. The default value is zero.
bool Rebalanced() const
Check if the mesh was rebalanced.
void SetLocalErrorGoal(double err_goal)
Set the local stopping criterion: stop when local_err_i <= local_err_goal. The default value is zero...
ThresholdRefiner(ErrorEstimator &est)
Construct a ThresholdRefiner using the given ErrorEstimator.
void SetTotalErrorFraction(double fraction)
Set the total fraction used in the computation of the threshold. The default value is 1/2...
virtual void Reset()
Empty.
Array< MeshOperator * > sequence
MeshOperators sequence, owned by us.
virtual int ApplyImpl(Mesh &mesh)=0
Implementation of the mesh operation. Invoked by the Apply() public method.
ParMesh rebalancing operator.
De-refinement operator using an error threshold.