MFEM  v4.2.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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. More...
 
 LpErrorEstimator (int p, Coefficient &coef, GridFunction &sol)
 Construct a new LpErrorEstimator object for a scalar field. More...
 
 LpErrorEstimator (int p, VectorCoefficient &coef, GridFunction &sol)
 Construct a new LpErrorEstimator object for a vector field. More...
 
void SetLocalErrorNormP (int p)
 Set the exponent, p, of the Lp norm used for computing the local element errors. More...
 
void SetCoef (Coefficient &A)
 
void SetCoef (VectorCoefficient &A)
 
virtual void Reset ()
 Reset the error estimator. More...
 
virtual const VectorGetLocalErrors ()
 Get a Vector with all element errors. More...
 
virtual ~LpErrorEstimator ()
 Destructor. More...
 
- Public Member Functions inherited from mfem::ErrorEstimator
virtual ~ErrorEstimator ()
 Destruct the error estimator. More...
 
- Public Member Functions inherited from mfem::AbstractErrorEstimator
virtual ~AbstractErrorEstimator ()
 

Protected Member Functions

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

Protected Attributes

long current_sequence
 
int local_norm_p
 
Vector error_estimates
 
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 328 of file estimators.hpp.

Constructor & Destructor Documentation

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 356 of file estimators.hpp.

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 365 of file estimators.hpp.

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 374 of file estimators.hpp.

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

Destructor.

Definition at line 396 of file estimators.hpp.

Member Function Documentation

void mfem::LpErrorEstimator::ComputeEstimates ( )
protected

Compute the element error estimates.

Definition at line 53 of file estimators.cpp.

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

Get a Vector with all element errors.

Implements mfem::ErrorEstimator.

Definition at line 389 of file estimators.hpp.

bool mfem::LpErrorEstimator::MeshIsModified ( )
inlineprotected

Check if the mesh of the solution was modified.

Definition at line 340 of file estimators.hpp.

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

Reset the error estimator.

Implements mfem::ErrorEstimator.

Definition at line 386 of file estimators.hpp.

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

Definition at line 382 of file estimators.hpp.

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

Definition at line 383 of file estimators.hpp.

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 380 of file estimators.hpp.

Member Data Documentation

Coefficient* mfem::LpErrorEstimator::coef
protected

Definition at line 335 of file estimators.hpp.

long mfem::LpErrorEstimator::current_sequence
protected

Definition at line 331 of file estimators.hpp.

Vector mfem::LpErrorEstimator::error_estimates
protected

Definition at line 333 of file estimators.hpp.

int mfem::LpErrorEstimator::local_norm_p
protected

Definition at line 332 of file estimators.hpp.

GridFunction* mfem::LpErrorEstimator::sol
protected

Definition at line 337 of file estimators.hpp.

VectorCoefficient* mfem::LpErrorEstimator::vcoef
protected

Definition at line 336 of file estimators.hpp.


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