20#ifndef LIBMESH_MESH_FUNCTION_H
21#define LIBMESH_MESH_FUNCTION_H
24#include "libmesh/function_base.h"
25#include "libmesh/dense_vector.h"
26#include "libmesh/vector_value.h"
27#include "libmesh/tensor_value.h"
28#include "libmesh/tree_base.h"
29#include "libmesh/parallel_object.h"
41template <
typename T>
class DenseVector;
43template <
typename T>
class NumericVector;
45class PointLocatorBase;
70 std::vector<unsigned int> vars,
84 const unsigned int var,
110 virtual void init ()
override;
115 virtual void clear ()
override;
126 virtual std::unique_ptr<FunctionBase<Number>>
clone ()
const override;
133 const Real time=0.)
override;
162#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
189 const std::set<subdomain_id_type> * subdomain_ids);
208 const std::set<subdomain_id_type> * subdomain_ids);
217 std::vector<Gradient> & output);
227 std::vector<Gradient> & output,
228 const std::set<subdomain_id_type> * subdomain_ids);
237 std::map<
const Elem *, std::vector<Gradient>> & output);
246 std::map<
const Elem *, std::vector<Gradient>> & output,
247 const std::set<subdomain_id_type> * subdomain_ids);
256 std::vector<Tensor> & output);
266 std::vector<Tensor> & output,
267 const std::set<subdomain_id_type> * subdomain_ids);
335 const std::set<subdomain_id_type> * subdomain_ids =
nullptr)
const;
344 const std::set<subdomain_id_type> * subdomain_ids =
nullptr)
const;
359 const Elem * element,
360 std::vector<Gradient> & output);
Defines a dense vector for use in Finite Element-type computations.
This class handles the numbering of degrees of freedom on a mesh.
This is the base class from which all geometric element types are derived.
This is the EquationSystems class.
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.
Tensor hessian(const Point &p, const Real time=0.)
const EquationSystems & _eqn_systems
The equation systems handler, from which the data are gathered.
std::map< const Elem *, Number > discontinuous_value(const Point &p, const Real time=0.)
std::unique_ptr< PointLocatorBase > _point_locator
A point locator is needed to locate the points in the mesh.
const std::vector< unsigned int > _system_vars
The indices of the variables within the other system for which data are to be gathered.
void set_subdomain_ids(const std::set< subdomain_id_type > *subdomain_ids)
Choose a default list of subdomain ids to be searched for points.
std::set< const Elem * > find_elements(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
virtual void init() override
Override the FunctionBase::init() member function.
MeshFunction & operator=(const MeshFunction &)=delete
MeshFunction(MeshFunction &&)=default
Special functions.
std::unique_ptr< std::set< subdomain_id_type > > _subdomain_ids
A default set of subdomain ids in which to search for points.
~MeshFunction()
Destructor.
void set_point_locator_tolerance(Real tol)
We may want to specify a tolerance for the PointLocator to use, since in some cases the point we want...
void _gradient_on_elem(const Point &p, const Elem *element, std::vector< Gradient > &output)
Helper function for finding a gradient as evaluated from a specific element.
bool _out_of_mesh_mode
true if out-of-mesh mode is enabled.
void disable_out_of_mesh_mode()
Disables out-of-mesh mode.
virtual void clear() override
Clears the function.
DenseVector< Number > _out_of_mesh_value
Value to return outside the mesh if out-of-mesh mode is enabled.
Gradient gradient(const Point &p, const Real time=0.)
const NumericVector< Number > & _vector
A reference to the vector that holds the data that is to be interpolated.
const PointLocatorBase & get_point_locator() const
virtual std::unique_ptr< FunctionBase< Number > > clone() const override
const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Helper function to reduce code duplication.
void enable_out_of_mesh_mode(const DenseVector< Number > &value)
Enables out-of-mesh mode.
void unset_point_locator_tolerance()
Turn off the user-specified PointLocator tolerance.
const DofMap & _dof_map
Need access to the DofMap of the other system.
std::map< const Elem *, Gradient > discontinuous_gradient(const Point &p, const Real time=0.)
virtual Number operator()(const Point &p, const Real time=0.) override
const Elem * check_found_elem(const Elem *element, const Point &p) const
Helper function that is called by MeshFunction::find_element() and MeshFunction::find_elements() to e...
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
An object whose state is distributed along a set of processors.
This is the base class for point locators.
A Point defines a location in LIBMESH_DIM dimensional Real space.
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real