MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::LpErrorEstimator Class Reference

The LpErrorEstimator class compares the solution to a known coefficient. More...

#include <estimators.hpp>

Inheritance diagram for mfem::LpErrorEstimator:
[legend]
Collaboration diagram for mfem::LpErrorEstimator:
[legend]

Public Member Functions

 LpErrorEstimator (int p, GridFunction &sol)
 Construct a new LpErrorEstimator object for a scalar field.
 
 LpErrorEstimator (int p, Coefficient &coef, GridFunction &sol)
 Construct a new LpErrorEstimator object for a scalar field.
 
 LpErrorEstimator (int p, VectorCoefficient &coef, GridFunction &sol)
 Construct a new LpErrorEstimator object for a vector field.
 
void SetLocalErrorNormP (int p)
 Set the exponent, p, of the Lp norm used for computing the local element errors.
 
void SetCoef (Coefficient &A)
 
void SetCoef (VectorCoefficient &A)
 
virtual void Reset () override
 Reset the error estimator.
 
virtual const VectorGetLocalErrors () override
 Get a Vector with all element errors.
 
virtual ~LpErrorEstimator ()
 Destructor.
 
- Public Member Functions inherited from mfem::ErrorEstimator
virtual real_t GetTotalError () const
 Return the total error from the last error estimate.
 
virtual ~ErrorEstimator ()
 Destruct the error estimator.
 
- Public Member Functions inherited from mfem::AbstractErrorEstimator
virtual ~AbstractErrorEstimator ()
 

Protected Member Functions

bool MeshIsModified ()
 Check if the mesh of the solution was modified.
 
void ComputeEstimates ()
 Compute the element error estimates.
 

Protected Attributes

long current_sequence
 
int local_norm_p
 
Vector error_estimates
 
real_t total_error = 0.0
 
Coefficientcoef
 
VectorCoefficientvcoef
 
GridFunctionsol
 

Detailed Description

The LpErrorEstimator class compares the solution to a known coefficient.

This class can be used, for example, to adapt a mesh to a non-trivial initial condition in a time-dependent simulation. It can also be used to force refinement in the neighborhood of small features before switching to a more traditional error estimator.

The LpErrorEstimator supports either scalar or vector coefficients and works both in serial and in parallel.

Definition at line 448 of file estimators.hpp.

Constructor & Destructor Documentation

◆ LpErrorEstimator() [1/3]

mfem::LpErrorEstimator::LpErrorEstimator ( int p,
GridFunction & sol )
inline

Construct a new LpErrorEstimator object for a scalar field.

Parameters
pInteger which selects which Lp norm to use.
solThe GridFunction representation of the scalar field. Note: the coefficient must be set before use with the SetCoef method.

Definition at line 478 of file estimators.hpp.

◆ LpErrorEstimator() [2/3]

mfem::LpErrorEstimator::LpErrorEstimator ( int p,
Coefficient & coef,
GridFunction & sol )
inline

Construct a new LpErrorEstimator object for a scalar field.

Parameters
pInteger which selects which Lp norm to use.
coefThe scalar Coefficient to compare to the solution.
solThe GridFunction representation of the scalar field.

Definition at line 487 of file estimators.hpp.

◆ LpErrorEstimator() [3/3]

mfem::LpErrorEstimator::LpErrorEstimator ( int p,
VectorCoefficient & coef,
GridFunction & sol )
inline

Construct a new LpErrorEstimator object for a vector field.

Parameters
pInteger which selects which Lp norm to use.
coefThe vector VectorCoefficient to compare to the solution.
solThe GridFunction representation of the vector field.

Definition at line 496 of file estimators.hpp.

◆ ~LpErrorEstimator()

virtual mfem::LpErrorEstimator::~LpErrorEstimator ( )
inlinevirtual

Destructor.

Definition at line 518 of file estimators.hpp.

Member Function Documentation

◆ ComputeEstimates()

void mfem::LpErrorEstimator::ComputeEstimates ( )
protected

Compute the element error estimates.

Definition at line 473 of file estimators.cpp.

◆ GetLocalErrors()

virtual const Vector & mfem::LpErrorEstimator::GetLocalErrors ( )
inlineoverridevirtual

Get a Vector with all element errors.

Implements mfem::ErrorEstimator.

Definition at line 511 of file estimators.hpp.

◆ MeshIsModified()

bool mfem::LpErrorEstimator::MeshIsModified ( )
inlineprotected

Check if the mesh of the solution was modified.

Definition at line 462 of file estimators.hpp.

◆ Reset()

virtual void mfem::LpErrorEstimator::Reset ( )
inlineoverridevirtual

Reset the error estimator.

Implements mfem::ErrorEstimator.

Definition at line 508 of file estimators.hpp.

◆ SetCoef() [1/2]

void mfem::LpErrorEstimator::SetCoef ( Coefficient & A)
inline

Definition at line 504 of file estimators.hpp.

◆ SetCoef() [2/2]

void mfem::LpErrorEstimator::SetCoef ( VectorCoefficient & A)
inline

Definition at line 505 of file estimators.hpp.

◆ SetLocalErrorNormP()

void mfem::LpErrorEstimator::SetLocalErrorNormP ( int p)
inline

Set the exponent, p, of the Lp norm used for computing the local element errors.

Definition at line 502 of file estimators.hpp.

Member Data Documentation

◆ coef

Coefficient* mfem::LpErrorEstimator::coef
protected

Definition at line 457 of file estimators.hpp.

◆ current_sequence

long mfem::LpErrorEstimator::current_sequence
protected

Definition at line 451 of file estimators.hpp.

◆ error_estimates

Vector mfem::LpErrorEstimator::error_estimates
protected

Definition at line 453 of file estimators.hpp.

◆ local_norm_p

int mfem::LpErrorEstimator::local_norm_p
protected

Definition at line 452 of file estimators.hpp.

◆ sol

GridFunction* mfem::LpErrorEstimator::sol
protected

Definition at line 459 of file estimators.hpp.

◆ total_error

real_t mfem::LpErrorEstimator::total_error = 0.0
protected

Definition at line 455 of file estimators.hpp.

◆ vcoef

VectorCoefficient* mfem::LpErrorEstimator::vcoef
protected

Definition at line 458 of file estimators.hpp.


The documentation for this class was generated from the following files: