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 bool Refined() const
Check if the mesh was refined.
const IntegrationRule * ir_default[Geometry::NumGeom]
bool Derefined() const
Check if the mesh was de-refined.
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...
MeshOperatorSequence(const MeshOperatorSequence &)
Do not allow copy construction, due to assumed ownership.
virtual void Reset()=0
Reset the MeshOperator.
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).
void ResetCoefficient(Coefficient &coeff_)
Reset the function f.
int Size() const
Returns the size of the vector.
Action
Action and information constants and masks.
double GetThreshold() const
Get the threshold used in the last Apply() call.
void SetIntRule(const IntegrationRule *irs_[])
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).
virtual int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh.
bool Continue() const
Check if CONTINUE action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated ...
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)
void SetOrder(int order_)
Reset the oscillation order.
bool Rebalanced() const
Check if the mesh was rebalanced.
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
long long GetNumMarkedElements() const
Get the number of marked elements in the last Apply() call.
void SetNCLimit(int nc_limit_)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited). The default value is...
int GetActionInfo() const
Get the full ActionInfo value generated by the last call to Apply().
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 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...
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()
void SetThreshold(double thresh)
Set the de-refinement threshold. The default value is zero.
const Vector & GetLocalOscs() const
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.
double GetNorm(const Vector &local_err, Mesh &mesh) const
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.
bool Stop() const
Check if STOP action is requested, e.g. stopping criterion is satisfied.
Array< MeshOperator * > sequence
MeshOperators sequence, owned by us.
bool Repeat() const
Check if REPEAT action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated...
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.