20#ifndef LIBMESH_EXACT_ERROR_ESTIMATOR_H
21#define LIBMESH_EXACT_ERROR_ESTIMATOR_H
24#include "libmesh/error_estimator.h"
25#include "libmesh/function_base.h"
26#include "libmesh/vector_value.h"
27#include "libmesh/tensor_value.h"
39template <
typename T>
class FEGenericBase;
101 const std::string & sys_name,
102 const std::string & unknown_name);
124 const std::string & sys_name,
125 const std::string & unknown_name);
147 const std::string & sys_name,
148 const std::string & unknown_name);
184 bool estimate_parent_error =
false)
override;
236 const std::string & var_name,
Defines a dense vector for use in Finite Element-type computations.
This is the base class from which all geometric element types are derived.
This is the EquationSystems class.
This class holds functions that will estimate the error in a finite element solution on a given mesh.
The ErrorVector is a specialization of the StatisticsVector for error data computed on a finite eleme...
This class implements an "error estimator" based on the difference between the approximate and exact ...
void attach_exact_hessians(std::vector< FunctionBase< Tensor > * > h)
Clone and attach arbitrary functors which compute the exact second derivatives of the EquationSystems...
ExactErrorEstimator & operator=(const ExactErrorEstimator &)=delete
void extra_quadrature_order(const int extraorder)
Increases or decreases the order of the quadrature rule used for numerical integration.
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 exact solution function to estimate the error on each cell.
virtual ErrorEstimatorType type() const override
void attach_exact_derivs(std::vector< FunctionBase< Gradient > * > g)
Clone and attach arbitrary functors which compute the exact gradients of the EquationSystems' solutio...
Number(* ValueFunctionPointer)(const Point &p, const Parameters &Parameters, const std::string &sys_name, const std::string &unknown_name)
Attach an arbitrary function which computes the exact value of the solution at any point.
void attach_exact_deriv(unsigned int sys_num, FunctionBase< Gradient > *g)
Clone and attach an arbitrary functor which computes the exact gradient of the system sys_num solutio...
void attach_exact_hessian(unsigned int sys_num, FunctionBase< Tensor > *h)
Clone and attach an arbitrary functor which computes the exact second derivatives of the system sys_n...
EquationSystems * _equation_systems_fine
Constant pointer to the EquationSystems object containing a fine grid solution.
void attach_exact_values(std::vector< FunctionBase< Number > * > f)
Clone and attach arbitrary functors which compute the exact values of the EquationSystems' solutions ...
std::vector< std::unique_ptr< FunctionBase< Tensor > > > _exact_hessians
User-provided functors which compute the exact hessians of the solution for each system.
void clear_functors()
Helper method for cleanup.
std::vector< std::unique_ptr< FunctionBase< Number > > > _exact_values
User-provided functors which compute the exact value of the solution for each system.
void attach_exact_value(unsigned int sys_num, FunctionBase< Number > *f)
Clone and attach an arbitrary functor which computes the exact value of the system sys_num solution a...
void attach_reference_solution(EquationSystems *es_fine)
Attach function similar to system.h which allows the user to attach a second EquationSystems object w...
virtual ~ExactErrorEstimator()=default
GradientFunctionPointer _exact_deriv
Function pointer to user-provided function which computes the exact derivative of the solution.
Tensor(* HessianFunctionPointer)(const Point &p, const Parameters ¶meters, const std::string &sys_name, const std::string &unknown_name)
Attach an arbitrary function which computes the exact second derivatives of the solution at any point...
Real find_squared_element_error(const System &system, const std::string &var_name, const Elem *elem, const DenseVector< Number > &Uelem, FEBase *fe, MeshFunction *fine_values) const
Helper method for calculating on each element.
ExactErrorEstimator()
Constructor.
ExactErrorEstimator(const ExactErrorEstimator &)=delete
This class cannot be (default) copy constructed/assigned because it has containers of unique_ptrs.
std::vector< std::unique_ptr< FunctionBase< Gradient > > > _exact_derivs
User-provided functors which compute the exact derivative of the solution for each system.
int _extra_order
Extra order to use for quadrature rule.
Gradient(* GradientFunctionPointer)(const Point &p, const Parameters ¶meters, const std::string &sys_name, const std::string &unknown_name)
Attach an arbitrary function which computes the exact gradient of the solution at any point.
HessianFunctionPointer _exact_hessian
Function pointer to user-provided function which computes the exact hessian of the solution.
ExactErrorEstimator(ExactErrorEstimator &&)=default
Defaulted move ctor, move assignment operator, and destructor.
ValueFunctionPointer _exact_value
Function pointer to user-provided function which computes the exact value of the solution.
This class forms the foundation from which generic finite elements may be derived.
Base class for functors that can be evaluated at a point and (optionally) time.
This class provides function-like objects for data distributed over a mesh.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
This class provides the ability to map between arbitrary, user-defined strings and several data types...
A Point defines a location in LIBMESH_DIM dimensional Real space.
Manages consistently variables, degrees of freedom, and coefficient vectors.
The libMesh namespace provides an interface to certain functionality in the library.
ErrorEstimatorType
Defines an enum for the different types of error estimators which are available.
NumberVectorValue Gradient
FEGenericBase< Real > FEBase
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Gradient gptr(const Point &p, const Parameters &, const std::string &libmesh_dbg_var(sys_name), const std::string &unknown_name)
Number fptr(const Point &p, const Parameters &, const std::string &libmesh_dbg_var(sys_name), const std::string &unknown_name)