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;
158 virtual void Reset();
246 MFEM_ASSERT(nc_limit_ >= 0,
"Invalid NC limit");
257 virtual void Reset();
305 MFEM_ASSERT(nc_limit_ >= 0,
"Invalid NC limit");
400 MFEM_ASSERT(nc_limit_ >= 0,
"Invalid NC limit");
417 "Local oscillations have not been computed yet")
422 virtual void Reset();
445 #endif // MFEM_MESH_OPERATORS
const IntegrationRule * ir_default[Geometry::NumGeom]
Class for an integration rule - an Array of IntegrationPoint.
Array< int > mesh_refinements
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.
void SetNCLimit(int nc_limit_)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited).
const Vector & GetLocalOscs() const
void ResetCoefficient(Coefficient &coeff_)
Reset the function f.
Action
Action and information constants and masks.
int Size() const
Returns the size of the vector.
void SetIntRule(const IntegrationRule *irs_[])
bool Stop() const
Check if STOP action is requested, e.g. stopping criterion is satisfied.
virtual int PreprocessMesh(Mesh &mesh, int max_it)
Apply the operator to the mesh max_it times or until tolerance achieved.
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().
MeshOperatorSequence & operator=(const MeshOperatorSequence &s)=delete
Do not allow copy assignment, due to assumed ownership.
virtual void Reset()
Reset all MeshOperators in the sequence.
void SetMaxElements(long long max_elements_)
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= m...
virtual int ApplyImpl(Mesh &mesh)
Apply the MeshOperatorSequence.
bit mask for all "action" bits
bool Apply(Mesh &mesh)
Perform the mesh operation.
int PreprocessMesh(Mesh &mesh)
long long GetNumMarkedElements() const
Get the number of marked elements in the last Apply() call.
void SetOrder(int order_)
Reset the oscillation order.
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.
const IntegrationRule ** irs
void SetNCLimit(int nc_limit_)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited). The default value is...
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.
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 int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh once.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
Refinement operator to control data oscillation.
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 SetThreshold(double threshold_)
Set the refinement threshold. The default value is 1.0e-2.
void Append(MeshOperator *mc)
Add an operator to the end of the sequence. The MeshOperatorSequence assumes ownership of the operato...
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.
void Destroy()
Destroy a vector.
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.
long long num_marked_elements
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.
virtual void Reset()
Reset.
void SetMaxElements(long long max_elem)
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= m...
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.
CoefficientRefiner(Coefficient &coeff_, int order_)
Constructor.
void SetNCLimit(int nc_limit_)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited).
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.