12#ifndef MFEM_MESH_OPERATORS
13#define MFEM_MESH_OPERATORS
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();
The AnisotropicErrorEstimator class is the base class for all error estimators that compute one non-n...
Refinement operator to control data oscillation.
virtual int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh once.
virtual void Reset()
Reset.
const IntegrationRule * ir_default[Geometry::NumGeom]
void SetOrder(int order_)
Reset the oscillation order.
void SetNCLimit(int nc_limit_)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited). The default value is...
void SetMaxElements(long long max_elements_)
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= m...
const Vector & GetLocalOscs() const
void SetIntRule(const IntegrationRule *irs_[])
int PreprocessMesh(Mesh &mesh)
virtual int PreprocessMesh(Mesh &mesh, int max_it)
Apply the operator to the mesh max_it times or until tolerance achieved.
Array< int > mesh_refinements
CoefficientRefiner(Coefficient &coeff_, int order_)
Constructor.
const IntegrationRule ** irs
void SetThreshold(real_t threshold_)
Set the refinement threshold. The default value is 1.0e-2.
void ResetCoefficient(Coefficient &coeff_)
Reset the function f.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
Base class for all element based error estimators.
virtual void Reset()=0
Force recomputation of the estimates on the next call to GetLocalErrors.
Class for an integration rule - an Array of IntegrationPoint.
MeshOperatorSequence(const MeshOperatorSequence &)
Do not allow copy construction, due to assumed ownership.
Array< MeshOperator * > sequence
MeshOperators sequence, owned by us.
Array< MeshOperator * > & GetSequence()
Access the underlying sequence.
virtual void Reset()
Reset all MeshOperators in the sequence.
virtual int ApplyImpl(Mesh &mesh)
Apply the MeshOperatorSequence.
void Append(MeshOperator *mc)
Add an operator to the end of the sequence. The MeshOperatorSequence assumes ownership of the operato...
MeshOperatorSequence & operator=(const MeshOperatorSequence &s)=delete
Do not allow copy assignment, due to assumed ownership.
virtual ~MeshOperatorSequence()
Delete all operators from the sequence.
MeshOperatorSequence()
Constructor. Use the Append() method to create the sequence.
The MeshOperator class serves as base for mesh manipulation classes.
virtual void Reset()=0
Reset the MeshOperator.
bool Derefined() const
Check if the mesh was de-refined.
bool Repeat() const
Check if REPEAT action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated,...
bool Apply(Mesh &mesh)
Perform the mesh operation.
int GetActionInfo() const
Get the full ActionInfo value generated by the last call to Apply().
virtual int ApplyImpl(Mesh &mesh)=0
Implementation of the mesh operation. Invoked by the Apply() public method.
bool Stop() const
Check if STOP action is requested, e.g. stopping criterion is satisfied.
Action
Action and information constants and masks.
@ MASK_ACTION
bit mask for all "action" bits
@ STOP
a stopping criterion was satisfied
@ MASK_UPDATE
bit mask for the "update" bit
bool Rebalanced() const
Check if the mesh was rebalanced.
MeshOperator()
Constructor to be used by derived classes.
@ MASK_INFO
bit mask for all "info" bits
@ REFINED
the mesh was refined
@ REBALANCED
the mesh was rebalanced
@ DEREFINED
the mesh was de-refined
bool Continue() const
Check if CONTINUE action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated ...
virtual ~MeshOperator()
The destructor is virtual.
bool Refined() const
Check if the mesh was refined.
ParMesh rebalancing operator.
virtual void Reset()
Empty.
virtual int ApplyImpl(Mesh &mesh)
Rebalance a parallel mesh (only non-conforming parallel meshes are supported).
De-refinement operator using an error threshold.
virtual int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh.
void SetThreshold(real_t thresh)
Set the de-refinement threshold. The default value is zero.
void SetNCLimit(int nc_limit_)
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited).
ThresholdDerefiner(ErrorEstimator &est)
Construct a ThresholdDerefiner using the given ErrorEstimator.
ErrorEstimator & estimator
virtual void Reset()
Reset the associated estimator.
Mesh refinement operator using an error threshold.
Array< Refinement > marked_elements
void PreferNonconformingRefinement()
Use nonconforming refinement, if possible (triangles, quads, hexes).
void SetTotalErrorNormP(real_t norm_p=infinity())
Set the exponent, p, of the discrete p-norm used to compute the total error from the local element er...
ThresholdRefiner(ErrorEstimator &est)
Construct a ThresholdRefiner using the given ErrorEstimator.
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).
AnisotropicErrorEstimator * aniso_estimator
void SetMaxElements(long long max_elem)
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= m...
long long GetNumMarkedElements() const
Get the number of marked elements in the last Apply() call.
long long num_marked_elements
real_t GetThreshold() const
Get the threshold used in the last Apply() call.
void SetTotalErrorFraction(real_t fraction)
Set the total fraction used in the computation of the threshold. The default value is 1/2.
virtual void Reset()
Reset the associated estimator.
real_t GetNorm(const Vector &local_err, Mesh &mesh) const
void PreferConformingRefinement()
Use conforming refinement, if possible (triangles, tetrahedra) – this is the default.
void SetTotalErrorGoal(real_t err_goal)
Set the total error stopping criterion: stop when total_err <= total_err_goal. The default value is z...
ErrorEstimator & estimator
void SetLocalErrorGoal(real_t err_goal)
Set the local stopping criterion: stop when local_err_i <= local_err_goal. The default value is zero.
void Destroy()
Destroy a vector.
int Size() const
Returns the size of the vector.
real_t infinity()
Define a shortcut for std::numeric_limits<double>::infinity()