libMesh
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
libMesh::LaplacianErrorEstimator Class Reference

This class is an error indicator based on laplacian jumps between elements. More...

#include <fourth_error_estimators.h>

Inheritance diagram for libMesh::LaplacianErrorEstimator:
[legend]

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

 LaplacianErrorEstimator ()
 Constructor. More...
 
 LaplacianErrorEstimator (const LaplacianErrorEstimator &)=delete
 This class cannot be (default) copy constructed/assigned because its base class has unique_ptr members. More...
 
LaplacianErrorEstimatoroperator= (const LaplacianErrorEstimator &)=delete
 
 LaplacianErrorEstimator (LaplacianErrorEstimator &&)=default
 Defaulted move ctor, move assignment operator, and destructor. More...
 
LaplacianErrorEstimatoroperator= (LaplacianErrorEstimator &&)=default
 
virtual ~LaplacianErrorEstimator ()=default
 
virtual ErrorEstimatorType type () const override
 
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 derived class's jump error estimate formula to estimate the error on each cell. More...
 
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

bool scale_by_n_flux_faces
 This boolean flag allows you to scale the error indicator result for each element by the number of "flux faces" the element actually has. 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

virtual void init_context (FEMContext &c) override
 An initialization function, for requesting specific data from the FE objects. More...
 
virtual void internal_side_integration () override
 The function which calculates a laplacian jump based error term on an internal side. More...
 
void reinit_sides ()
 A utility function to reinit the finite element data on elements sharing a side. More...
 
float coarse_n_flux_faces_increment ()
 A utility function to correctly increase n_flux_faces for the coarse element. More...
 
virtual bool boundary_side_integration ()
 The function, to be implemented by derived classes, which calculates an error term on a boundary side. More...
 
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...
 

Protected Attributes

bool integrate_boundary_sides
 A boolean flag, by default false, to be set to true if integrations with boundary_side_integration() should be performed. More...
 
std::unique_ptr< FEMContextfine_context
 Context objects for integrating on the fine and coarse elements sharing a face. More...
 
std::unique_ptr< FEMContextcoarse_context
 
Real fine_error
 The fine and coarse error values to be set by each side_integration();. More...
 
Real coarse_error
 
unsigned int var
 The variable number currently being evaluated. More...
 

Detailed Description

This class is an error indicator based on laplacian jumps between elements.

See the JumpErrorEstimator class for most user APIs

Author
Roy H. Stogner
Date
2005

Definition at line 41 of file fourth_error_estimators.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

◆ LaplacianErrorEstimator() [1/3]

libMesh::LaplacianErrorEstimator::LaplacianErrorEstimator ( )

Constructor.

Defaults to H2 seminorm; changes to error_norm are ignored.

◆ LaplacianErrorEstimator() [2/3]

libMesh::LaplacianErrorEstimator::LaplacianErrorEstimator ( const LaplacianErrorEstimator )
delete

This class cannot be (default) copy constructed/assigned because its base class has unique_ptr members.

◆ LaplacianErrorEstimator() [3/3]

libMesh::LaplacianErrorEstimator::LaplacianErrorEstimator ( LaplacianErrorEstimator &&  )
default

Defaulted move ctor, move assignment operator, and destructor.

◆ ~LaplacianErrorEstimator()

virtual libMesh::LaplacianErrorEstimator::~LaplacianErrorEstimator ( )
virtualdefault

Member Function Documentation

◆ boundary_side_integration()

virtual bool libMesh::JumpErrorEstimator::boundary_side_integration ( )
protectedvirtualinherited

The function, to be implemented by derived classes, which calculates an error term on a boundary side.

Returns
true if the flux bc function is in fact defined on the current side.

Reimplemented in libMesh::KellyErrorEstimator, and libMesh::DiscontinuityMeasure.

Definition at line 132 of file jump_error_estimator.h.

132 { return false; }

◆ coarse_n_flux_faces_increment()

float libMesh::JumpErrorEstimator::coarse_n_flux_faces_increment ( )
protectedinherited

A utility function to correctly increase n_flux_faces for the coarse element.

◆ estimate_error()

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

This function uses the derived class's jump error estimate formula to estimate the error on each cell.

The estimated error is output in the vector error_per_cell

Implements libMesh::ErrorEstimator.

◆ 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.

◆ init_context()

virtual void libMesh::LaplacianErrorEstimator::init_context ( FEMContext c)
overrideprotectedvirtual

An initialization function, for requesting specific data from the FE objects.

Reimplemented from libMesh::JumpErrorEstimator.

◆ internal_side_integration()

virtual void libMesh::LaplacianErrorEstimator::internal_side_integration ( )
overrideprotectedvirtual

The function which calculates a laplacian jump based error term on an internal side.

Implements libMesh::JumpErrorEstimator.

◆ operator=() [1/2]

LaplacianErrorEstimator& libMesh::LaplacianErrorEstimator::operator= ( const LaplacianErrorEstimator )
delete

◆ operator=() [2/2]

LaplacianErrorEstimator& libMesh::LaplacianErrorEstimator::operator= ( LaplacianErrorEstimator &&  )
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.

◆ reinit_sides()

void libMesh::JumpErrorEstimator::reinit_sides ( )
protectedinherited

A utility function to reinit the finite element data on elements sharing a side.

◆ type()

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

Implements libMesh::ErrorEstimator.

Member Data Documentation

◆ coarse_context

std::unique_ptr<FEMContext> libMesh::JumpErrorEstimator::coarse_context
protectedinherited

Definition at line 144 of file jump_error_estimator.h.

◆ coarse_error

Real libMesh::JumpErrorEstimator::coarse_error
protectedinherited

Definition at line 149 of file jump_error_estimator.h.

◆ 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.

◆ fine_context

std::unique_ptr<FEMContext> libMesh::JumpErrorEstimator::fine_context
protectedinherited

Context objects for integrating on the fine and coarse elements sharing a face.

Definition at line 144 of file jump_error_estimator.h.

◆ fine_error

Real libMesh::JumpErrorEstimator::fine_error
protectedinherited

The fine and coarse error values to be set by each side_integration();.

Definition at line 149 of file jump_error_estimator.h.

◆ integrate_boundary_sides

bool libMesh::JumpErrorEstimator::integrate_boundary_sides
protectedinherited

A boolean flag, by default false, to be set to true if integrations with boundary_side_integration() should be performed.

Definition at line 138 of file jump_error_estimator.h.

◆ scale_by_n_flux_faces

bool libMesh::JumpErrorEstimator::scale_by_n_flux_faces
inherited

This boolean flag allows you to scale the error indicator result for each element by the number of "flux faces" the element actually has.

This tends to weight more evenly cells which are on the boundaries and thus have fewer contributions to their flux. The value is initialized to false, simply set it to true if you want to use the feature.

Definition at line 99 of file jump_error_estimator.h.

◆ var

unsigned int libMesh::JumpErrorEstimator::var
protectedinherited

The variable number currently being evaluated.

Definition at line 154 of file jump_error_estimator.h.


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