26 #include "libmesh/libmesh_common.h" 27 #include "libmesh/kelly_error_estimator.h" 28 #include "libmesh/error_vector.h" 29 #include "libmesh/fe_base.h" 30 #include "libmesh/libmesh_logging.h" 31 #include "libmesh/elem.h" 32 #include "libmesh/system.h" 33 #include "libmesh/dense_vector.h" 34 #include "libmesh/tensor_tools.h" 35 #include "libmesh/enum_error_estimator_type.h" 36 #include "libmesh/enum_norm_type.h" 62 for (
unsigned int v=0; v<
n_vars; v++)
68 FEBase * side_fe =
nullptr;
70 const std::set<unsigned char> & elem_dims =
73 for (
const auto &
dim : elem_dims)
95 FEBase * fe_fine =
nullptr;
98 FEBase * fe_coarse =
nullptr;
104 const std::vector<Point> & face_normals = fe_fine->
get_normals();
105 const std::vector<Real> & JxW_face = fe_fine->
get_JxW();
107 for (
unsigned int qp=0; qp != n_qp; ++qp)
117 const Number jump = (grad_fine - grad_coarse)*face_normals[qp];
121 error += JxW_face[qp] * jump2;
137 FEBase * fe_fine =
nullptr;
140 const std::string & var_name =
143 const std::vector<Point> & face_normals = fe_fine->
get_normals();
144 const std::vector<Real> & JxW_face = fe_fine->
get_JxW();
145 const std::vector<Point> & qface_point = fe_fine->
get_xyz();
154 qface_point[0], var_name).first)
165 for (
unsigned int qp=0; qp<n_qp; qp++)
168 const std::pair<bool,Real> flux_bc =
170 qface_point[qp], var_name);
174 libmesh_assert_equal_to (flux_bc.first,
true);
180 const Number jump = flux_bc.second - grad_fine*face_normals[qp];
190 error += JxW_face[qp]*jump2;
206 const std::string & var_name))
void attach_flux_bc_function(std::pair< bool, Real > fptr(const System &system, const Point &p, const std::string &var_name))
Register a user function to use in computing the flux BCs.
std::pair< bool, Real >(* _bc_function)(const System &system, const Point &p, const std::string &var_name)
Pointer to function that provides BC information.
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
SystemNorm error_norm
When estimating the error in a single system, the error_norm is used to control the scaling and norm ...
std::unique_ptr< FEMContext > fine_context
Context objects for integrating on the fine and coarse elements sharing a face.
ErrorEstimatorType
Defines an enum for the different types of error estimators which are available.
This abstract base class implements utility functions for error estimators which are based on integra...
This is the base class from which all geometric element types are derived.
virtual void init_context(FEMContext &c) override
An initialization function, for requesting specific data from the FE objects.
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
The libMesh namespace provides an interface to certain functionality in the library.
virtual Real hmax() const
Number fptr(const Point &p, const Parameters &, const std::string &libmesh_dbg_var(sys_name), const std::string &unknown_name)
const std::vector< std::vector< OutputGradient > > & get_dphi() const
virtual void internal_side_integration() override
The function which calculates a normal derivative jump based error term on an internal side...
virtual unsigned int n_quadrature_points() const
Manages consistently variables, degrees of freedom, and coefficient vectors.
virtual_for_inffe const std::vector< Real > & get_JxW() const
This class provides all data required for a physics package (e.g.
virtual_for_inffe const std::vector< Point > & get_xyz() const
std::unique_ptr< FEMContext > coarse_context
Real fine_error
The fine and coarse error values to be set by each side_integration();.
KellyErrorEstimator()
Constructor.
Real weight(unsigned int var) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual_for_inffe const std::vector< Point > & get_normals() const
virtual unsigned short dim() const =0
unsigned int var
The variable number currently being evaluated.
virtual bool boundary_side_integration() override
The function which calculates a normal derivative jump based error term on a boundary side...
unsigned int n_vars() const
Number of variables in solution.
bool integrate_boundary_sides
A boolean flag, by default false, to be set to true if integrations with boundary_side_integration() ...
A Point defines a location in LIBMESH_DIM dimensional Real space.
virtual ErrorEstimatorType type() const override
This class forms the foundation from which generic finite elements may be derived.
const std::set< unsigned char > & elem_dimensions() const