libMesh
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
libMesh::PatchRecoveryErrorEstimator Class Reference

This class implements the Patch Recovery error indicator. More...

#include <patch_recovery_error_estimator.h>

Inheritance diagram for libMesh::PatchRecoveryErrorEstimator:
[legend]

Classes

class  EstimateError
 Class to compute the error contribution for a range of elements. More...
 

Public Types

typedef std::map< std::pair< const System *, unsigned int >, ErrorVector * > ErrorMap
 When calculating many error vectors at once, we need a data structure to hold them all. More...
 

Public Member Functions

 PatchRecoveryErrorEstimator ()
 Constructor. More...
 
 PatchRecoveryErrorEstimator (const PatchRecoveryErrorEstimator &)=default
 Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this class. More...
 
 PatchRecoveryErrorEstimator (PatchRecoveryErrorEstimator &&)=default
 
PatchRecoveryErrorEstimatoroperator= (const PatchRecoveryErrorEstimator &)=default
 
PatchRecoveryErrorEstimatoroperator= (PatchRecoveryErrorEstimator &&)=default
 
virtual ~PatchRecoveryErrorEstimator ()=default
 
virtual void estimate_error (const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false) override
 This function uses the Patch Recovery error estimate to estimate the error on each cell. More...
 
void set_patch_reuse (bool)
 
virtual ErrorEstimatorType type () const override
 
virtual void estimate_errors (const EquationSystems &equation_systems, ErrorVector &error_per_cell, const std::map< const System *, SystemNorm > &error_norms, const std::map< const System *, const NumericVector< Number > *> *solution_vectors=nullptr, bool estimate_parent_error=false)
 This virtual function can be redefined in derived classes, but by default computes the sum of the error_per_cell for each system in the equation_systems. More...
 
virtual void estimate_errors (const EquationSystems &equation_systems, ErrorMap &errors_per_cell, const std::map< const System *, const NumericVector< Number > *> *solution_vectors=nullptr, bool estimate_parent_error=false)
 This virtual function can be redefined in derived classes, but by default it calls estimate_error repeatedly to calculate the requested error vectors. More...
 

Public Attributes

unsigned int target_patch_size
 The PatchErrorEstimator will build patches of at least this many elements to perform estimates. More...
 
Patch::PMF patch_growth_strategy
 The PatchErrorEstimator will use this pointer to a Patch member function when growing patches. More...
 
SystemNorm error_norm
 When estimating the error in a single system, the error_norm is used to control the scaling and norm choice for each variable. More...
 

Protected Member Functions

void reduce_error (std::vector< ErrorVectorReal > &error_per_cell, const Parallel::Communicator &comm) const
 This method takes the local error contributions in error_per_cell from each processor and combines them to get the global error vector. More...
 

Static Protected Member Functions

static std::vector< Realspecpoly (const unsigned int dim, const Order order, const Point p, const unsigned int matsize)
 

Protected Attributes

bool patch_reuse
 

Friends

class EstimateError
 

Detailed Description

This class implements the Patch Recovery error indicator.

Author
Varis Carey
Benjamin S. Kirk
Date
2004

Definition at line 55 of file patch_recovery_error_estimator.h.

Member Typedef Documentation

◆ ErrorMap

typedef std::map<std::pair<const System *, unsigned int>, ErrorVector *> libMesh::ErrorEstimator::ErrorMap
inherited

When calculating many error vectors at once, we need a data structure to hold them all.

Definition at line 124 of file error_estimator.h.

Constructor & Destructor Documentation

◆ PatchRecoveryErrorEstimator() [1/3]

libMesh::PatchRecoveryErrorEstimator::PatchRecoveryErrorEstimator ( )

Constructor.

Defaults to H1 seminorm. All Hilbert norms and seminorms should be supported now. W1,p and W2,p norms would be natural to support if any contributors make the effort.

◆ PatchRecoveryErrorEstimator() [2/3]

libMesh::PatchRecoveryErrorEstimator::PatchRecoveryErrorEstimator ( const PatchRecoveryErrorEstimator )
default

Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this class.

◆ PatchRecoveryErrorEstimator() [3/3]

libMesh::PatchRecoveryErrorEstimator::PatchRecoveryErrorEstimator ( PatchRecoveryErrorEstimator &&  )
default

◆ ~PatchRecoveryErrorEstimator()

virtual libMesh::PatchRecoveryErrorEstimator::~PatchRecoveryErrorEstimator ( )
virtualdefault

Member Function Documentation

◆ estimate_error()

virtual void libMesh::PatchRecoveryErrorEstimator::estimate_error ( const System system,
ErrorVector error_per_cell,
const NumericVector< Number > *  solution_vector = nullptr,
bool  estimate_parent_error = false 
)
overridevirtual

This function uses the Patch Recovery error estimate to estimate the error on each cell.

The estimated error is output in the vector error_per_cell

Implements libMesh::ErrorEstimator.

Reimplemented in libMesh::WeightedPatchRecoveryErrorEstimator.

◆ estimate_errors() [1/2]

virtual void libMesh::ErrorEstimator::estimate_errors ( const EquationSystems equation_systems,
ErrorVector error_per_cell,
const std::map< const System *, SystemNorm > &  error_norms,
const std::map< const System *, const NumericVector< Number > *> *  solution_vectors = nullptr,
bool  estimate_parent_error = false 
)
virtualinherited

This virtual function can be redefined in derived classes, but by default computes the sum of the error_per_cell for each system in the equation_systems.

Currently this function ignores the error_norm member variable, and uses the function argument error_norms instead.

This function is named estimate_errors instead of estimate_error because otherwise C++ can get confused.

Reimplemented in libMesh::UniformRefinementEstimator.

◆ estimate_errors() [2/2]

virtual void libMesh::ErrorEstimator::estimate_errors ( const EquationSystems equation_systems,
ErrorMap errors_per_cell,
const std::map< const System *, const NumericVector< Number > *> *  solution_vectors = nullptr,
bool  estimate_parent_error = false 
)
virtualinherited

This virtual function can be redefined in derived classes, but by default it calls estimate_error repeatedly to calculate the requested error vectors.

Currently this function ignores the error_norm.weight() values because it calculates each variable's error individually, unscaled.

The user selects which errors get computed by filling a map with error vectors: If errors_per_cell[&system][v] exists, it will be filled with the error values in variable v of system

Reimplemented in libMesh::UniformRefinementEstimator.

◆ operator=() [1/2]

PatchRecoveryErrorEstimator& libMesh::PatchRecoveryErrorEstimator::operator= ( const PatchRecoveryErrorEstimator )
default

◆ operator=() [2/2]

PatchRecoveryErrorEstimator& libMesh::PatchRecoveryErrorEstimator::operator= ( PatchRecoveryErrorEstimator &&  )
default

◆ reduce_error()

void libMesh::ErrorEstimator::reduce_error ( std::vector< ErrorVectorReal > &  error_per_cell,
const Parallel::Communicator comm 
) const
protectedinherited

This method takes the local error contributions in error_per_cell from each processor and combines them to get the global error vector.

◆ set_patch_reuse()

void libMesh::PatchRecoveryErrorEstimator::set_patch_reuse ( bool  )

◆ specpoly()

static std::vector<Real> libMesh::PatchRecoveryErrorEstimator::specpoly ( const unsigned int  dim,
const Order  order,
const Point  p,
const unsigned int  matsize 
)
staticprotected
Returns
The spectral polynomial basis function values at a point (x,y,z).

◆ type()

virtual ErrorEstimatorType libMesh::PatchRecoveryErrorEstimator::type ( ) const
overridevirtual
Returns
The type for the ErrorEstimator subclass.

Implements libMesh::ErrorEstimator.

Reimplemented in libMesh::WeightedPatchRecoveryErrorEstimator.

Friends And Related Function Documentation

◆ EstimateError

friend class EstimateError
friend

Definition at line 142 of file patch_recovery_error_estimator.h.

Member Data Documentation

◆ error_norm

SystemNorm libMesh::ErrorEstimator::error_norm
inherited

When estimating the error in a single system, the error_norm is used to control the scaling and norm choice for each variable.

Not all estimators will support all norm choices. The default scaling is for all variables to be weighted equally. The default norm choice depends on the error estimator.

Part of this functionality was supported via component_scale and sobolev_order in older libMesh versions, and a small part was supported via component_mask in even older versions. Hopefully the encapsulation here will allow us to avoid changing this API again.

Definition at line 161 of file error_estimator.h.

◆ patch_growth_strategy

Patch::PMF libMesh::PatchRecoveryErrorEstimator::patch_growth_strategy

The PatchErrorEstimator will use this pointer to a Patch member function when growing patches.

The default strategy used is Patch::add_local_face_neighbors. Patch::add_local_point_neighbors may be more reliable but slower.

Definition at line 99 of file patch_recovery_error_estimator.h.

◆ patch_reuse

bool libMesh::PatchRecoveryErrorEstimator::patch_reuse
protected

Definition at line 115 of file patch_recovery_error_estimator.h.

◆ target_patch_size

unsigned int libMesh::PatchRecoveryErrorEstimator::target_patch_size

The PatchErrorEstimator will build patches of at least this many elements to perform estimates.

Definition at line 91 of file patch_recovery_error_estimator.h.


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