MFEM v4.7.0
Finite element discretization library
|
Mesh refinement operator using an error threshold. More...
#include <mesh_operators.hpp>
Public Member Functions | |
ThresholdRefiner (ErrorEstimator &est) | |
Construct a ThresholdRefiner using the given ErrorEstimator. | |
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 errors. | |
void | SetTotalErrorGoal (real_t err_goal) |
Set the total error stopping criterion: stop when total_err <= total_err_goal. The default value is zero. | |
void | SetTotalErrorFraction (real_t fraction) |
Set the total fraction used in the computation of the threshold. The default value is 1/2. | |
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 | SetMaxElements (long long max_elem) |
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= max_elem. The default value is LONG_MAX. | |
void | PreferNonconformingRefinement () |
Use nonconforming refinement, if possible (triangles, quads, hexes). | |
void | PreferConformingRefinement () |
Use conforming refinement, if possible (triangles, tetrahedra) – this is the default. | |
void | SetNCLimit (int nc_limit_) |
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited). | |
long long | GetNumMarkedElements () const |
Get the number of marked elements in the last Apply() call. | |
real_t | GetThreshold () const |
Get the threshold used in the last Apply() call. | |
virtual void | Reset () |
Reset the associated estimator. | |
Public Member Functions inherited from mfem::MeshOperator | |
bool | Apply (Mesh &mesh) |
Perform the mesh operation. | |
bool | Stop () const |
Check if STOP action is requested, e.g. stopping criterion is satisfied. | |
bool | Repeat () const |
Check if REPEAT action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated, and Apply() must be called again. | |
bool | Continue () const |
Check if CONTINUE action is requested, i.e. FiniteElementSpaces and GridFunctions need to be updated and computations should continue. | |
bool | Refined () const |
Check if the mesh was refined. | |
bool | Derefined () const |
Check if the mesh was de-refined. | |
bool | Rebalanced () const |
Check if the mesh was rebalanced. | |
int | GetActionInfo () const |
Get the full ActionInfo value generated by the last call to Apply(). | |
virtual | ~MeshOperator () |
The destructor is virtual. | |
Protected Member Functions | |
real_t | GetNorm (const Vector &local_err, Mesh &mesh) const |
virtual int | ApplyImpl (Mesh &mesh) |
Apply the operator to the mesh. | |
Protected Member Functions inherited from mfem::MeshOperator | |
MeshOperator () | |
Constructor to be used by derived classes. | |
Protected Attributes | |
ErrorEstimator & | estimator |
AnisotropicErrorEstimator * | aniso_estimator |
real_t | total_norm_p |
real_t | total_err_goal |
real_t | total_fraction |
real_t | local_err_goal |
long long | max_elements |
real_t | threshold |
long long | num_marked_elements |
Array< Refinement > | marked_elements |
long | current_sequence |
int | non_conforming |
int | nc_limit |
Additional Inherited Members | |
Public Types inherited from mfem::MeshOperator | |
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 } |
Mesh refinement operator using an error threshold.
This class uses the given ErrorEstimator to estimate local element errors and then marks for refinement all elements i such that loc_err_i > threshold. The threshold is computed as
where p (=total_norm_p), total_fraction, and local_err_goal are settable parameters, total_err = (sum_i local_err_i^p)^{1/p}, when p < inf, or total_err = max_i local_err_i, when p = inf.
Definition at line 175 of file mesh_operators.hpp.
mfem::ThresholdRefiner::ThresholdRefiner | ( | ErrorEstimator & | est | ) |
Construct a ThresholdRefiner using the given ErrorEstimator.
Definition at line 54 of file mesh_operators.cpp.
|
protectedvirtual |
Apply the operator to the mesh.
Implements mfem::MeshOperator.
Definition at line 84 of file mesh_operators.cpp.
Definition at line 72 of file mesh_operators.cpp.
|
inline |
Get the number of marked elements in the last Apply() call.
Definition at line 251 of file mesh_operators.hpp.
|
inline |
Get the threshold used in the last Apply() call.
Definition at line 254 of file mesh_operators.hpp.
|
inline |
Use conforming refinement, if possible (triangles, tetrahedra) – this is the default.
Definition at line 240 of file mesh_operators.hpp.
|
inline |
Use nonconforming refinement, if possible (triangles, quads, hexes).
Definition at line 236 of file mesh_operators.hpp.
|
virtual |
Reset the associated estimator.
Implements mfem::MeshOperator.
Definition at line 140 of file mesh_operators.cpp.
|
inline |
Set the local stopping criterion: stop when local_err_i <= local_err_goal. The default value is zero.
Definition at line 228 of file mesh_operators.hpp.
|
inline |
Set the maximum number of elements stopping criterion: stop when the input mesh has num_elements >= max_elem. The default value is LONG_MAX.
Definition at line 233 of file mesh_operators.hpp.
|
inline |
Set the maximum ratio of refinement levels of adjacent elements (0 = unlimited).
Definition at line 244 of file mesh_operators.hpp.
|
inline |
Set the total fraction used in the computation of the threshold. The default value is 1/2.
Definition at line 222 of file mesh_operators.hpp.
|
inline |
Set the total error stopping criterion: stop when total_err <= total_err_goal. The default value is zero.
Definition at line 216 of file mesh_operators.hpp.
Set the exponent, p, of the discrete p-norm used to compute the total error from the local element errors.
Definition at line 211 of file mesh_operators.hpp.
|
protected |
Definition at line 179 of file mesh_operators.hpp.
|
protected |
Definition at line 191 of file mesh_operators.hpp.
|
protected |
Definition at line 178 of file mesh_operators.hpp.
|
protected |
Definition at line 184 of file mesh_operators.hpp.
|
protected |
Definition at line 190 of file mesh_operators.hpp.
|
protected |
Definition at line 185 of file mesh_operators.hpp.
|
protected |
Definition at line 194 of file mesh_operators.hpp.
|
protected |
Definition at line 193 of file mesh_operators.hpp.
|
protected |
Definition at line 188 of file mesh_operators.hpp.
|
protected |
Definition at line 187 of file mesh_operators.hpp.
|
protected |
Definition at line 182 of file mesh_operators.hpp.
|
protected |
Definition at line 183 of file mesh_operators.hpp.
|
protected |
Definition at line 181 of file mesh_operators.hpp.