21 for (
int i =
sequence.Size()-1; i >= 0; i--)
36 case NONE:
if (last) {
return NONE; }
goto next_step;
46 for (
int i = 0; i <
sequence.Size(); i++)
94 const int NE = mesh.
GetNE();
96 MFEM_ASSERT(local_err.
Size() == NE,
"invalid size of local_err");
112 for (
int el = 0; el < NE; el++)
123 if (aniso_flags.
Size() > 0)
169 MFEM_VERIFY(max_it > 0,
"max_it must be strictly positive")
197 int order_quad = 2*
order + 3;
205 for (
int i = 0; i < max_it; i++)
208 int NE = mesh.
GetNE();
210 real_t norm_of_coeff = 0.0;
225 real_t av_norm_of_coeff = norm_of_coeff / sqrt(globalNE);
228 Vector element_norms_of_fine_scale(NE);
240 for (
int j = 0; j < NE; j++)
243 real_t element_osc = h * element_norms_of_fine_scale(j);
244 if ( element_osc >
threshold * av_norm_of_coeff )
254 MPI_Comm comm = pmesh->
GetComm();
257 MPI_Comm_rank(comm, &rank);
268 MFEM_WARNING(
"Reached maximum number of elements "
269 "before resolving data to tolerance.");
The AnisotropicErrorEstimator class is the base class for all error estimators that compute one non-n...
virtual const Array< int > & GetAnisotropicFlags()=0
Get an Array<int> with anisotropic flags for all mesh elements.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
int Append(const T &el)
Append element 'el' to array, resize if necessary.
virtual int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh once.
virtual void Reset()
Reset.
const IntegrationRule * ir_default[Geometry::NumGeom]
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
const IntegrationRule ** irs
Base class for all element based error estimators.
virtual void Reset()=0
Force recomputation of the estimates on the next call to GetLocalErrors.
virtual const Vector & GetLocalErrors()=0
Get a Vector with all element errors.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
virtual void Update(bool want_transform=true)
Reflect changes in the mesh: update number of DOFs, etc. Also, calculate GridFunction transformation ...
Class for grid function - Vector with associated FE space.
virtual void ComputeElementL2Errors(Coefficient &exsol, Vector &error, const IntegrationRule *irs[]=NULL) const
virtual void Update()
Transform by the Space UpdateMatrix (e.g., on Mesh change).
virtual void ProjectCoefficient(Coefficient &coeff)
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
virtual void SetSpace(FiniteElementSpace *f)
Associate a new FiniteElementSpace with the GridFunction.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
Arbitrary order "L2-conforming" discontinuous finite elements.
Array< MeshOperator * > sequence
MeshOperators sequence, owned by us.
virtual void Reset()
Reset all MeshOperators in the sequence.
virtual int ApplyImpl(Mesh &mesh)
Apply the MeshOperatorSequence.
virtual ~MeshOperatorSequence()
Delete all operators from the sequence.
@ MASK_ACTION
bit mask for all "action" bits
@ STOP
a stopping criterion was satisfied
@ MASK_INFO
bit mask for all "info" bits
@ REFINED
the mesh was refined
@ REBALANCED
the mesh was rebalanced
@ DEREFINED
the mesh was de-refined
virtual long long ReduceInt(int value) const
Utility function: sum integers from all processors (Allreduce).
void GeneralRefinement(const Array< Refinement > &refinements, int nonconforming=-1, int nc_limit=0)
bool Nonconforming() const
int GetNE() const
Returns number of elements.
int Dimension() const
Dimension of the reference space used within the elements.
real_t GetElementSize(int i, int type=0)
Get the size of the i-th element relative to the perfect reference element.
bool DerefineByError(Array< real_t > &elem_error, real_t threshold, int nc_limit=0, int op=1)
long long GetGlobalNE() const
Return the total (global) number of elements.
Abstract parallel finite element space.
Class for parallel grid function.
Class for parallel meshes.
virtual int ApplyImpl(Mesh &mesh)
Rebalance a parallel mesh (only non-conforming parallel meshes are supported).
virtual int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh.
ErrorEstimator & estimator
Array< Refinement > marked_elements
ThresholdRefiner(ErrorEstimator &est)
Construct a ThresholdRefiner using the given ErrorEstimator.
virtual int ApplyImpl(Mesh &mesh)
Apply the operator to the mesh.
AnisotropicErrorEstimator * aniso_estimator
long long num_marked_elements
virtual void Reset()
Reset the associated estimator.
real_t GetNorm(const Vector &local_err, Mesh &mesh) const
ErrorEstimator & estimator
void Destroy()
Destroy a vector.
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
real_t Normlp(real_t p) const
Returns the l_p norm of the vector.
real_t infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
real_t ParNormlp(const Vector &vec, real_t p, MPI_Comm comm)
Compute the l_p norm of the Vector which is split without overlap across the given communicator.
real_t ComputeGlobalLpNorm(real_t p, Coefficient &coeff, ParMesh &pmesh, const IntegrationRule *irs[])
Compute the global Lp norm of a function f. .
real_t ComputeLpNorm(real_t p, Coefficient &coeff, Mesh &mesh, const IntegrationRule *irs[])
Compute the Lp norm of a function f. .
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
Helper struct to convert a C++ type to an MPI type.
char ref_type
refinement XYZ bit mask (7 = full isotropic)
int index
Mesh element number.