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" 41 template <
typename T>
class DenseVector;
42 class EquationSystems;
43 template <
typename T>
class NumericVector;
45 class PointLocatorBase;
70 std::vector<unsigned int> vars,
84 const unsigned int var,
110 virtual void init ()
override;
112 #ifdef LIBMESH_ENABLE_DEPRECATED 122 #endif // LIBMESH_ENABLE_DEPRECATED 127 virtual void clear ()
override;
138 virtual std::unique_ptr<FunctionBase<Number>>
clone ()
const override;
145 const Real time=0.)
override;
174 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 201 const std::set<subdomain_id_type> * subdomain_ids);
220 const std::set<subdomain_id_type> * subdomain_ids);
229 std::vector<Gradient> & output);
239 std::vector<Gradient> & output,
240 const std::set<subdomain_id_type> * subdomain_ids);
249 std::map<
const Elem *, std::vector<Gradient>> & output);
258 std::map<
const Elem *, std::vector<Gradient>> & output,
259 const std::set<subdomain_id_type> * subdomain_ids);
268 std::vector<Tensor> & output);
278 std::vector<Tensor> & output,
279 const std::set<subdomain_id_type> * subdomain_ids);
347 const std::set<subdomain_id_type> * subdomain_ids =
nullptr)
const;
356 const std::set<subdomain_id_type> * subdomain_ids =
nullptr)
const;
371 const Elem * element,
372 std::vector<Gradient> & output);
425 #endif // LIBMESH_MESH_FUNCTION_H std::unique_ptr< std::set< subdomain_id_type > > _subdomain_ids
A default set of subdomain ids in which to search for points.
This is the EquationSystems class.
const EquationSystems & _eqn_systems
The equation systems handler, from which the data are gathered.
virtual std::unique_ptr< FunctionBase< Number > > clone() const override
BuildType
enum defining how to build the tree.
const NumericVector< Number > & _vector
A reference to the vector that holds the data that is to be interpolated.
bool _out_of_mesh_mode
true if out-of-mesh mode is enabled.
MeshFunction & operator=(const MeshFunction &)=delete
const DofMap & _dof_map
Need access to the DofMap of the other system.
const Elem * find_element(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Helper function to reduce code duplication.
This is the base class from which all geometric element types are derived.
Gradient gradient(const Point &p, const Real time=0.)
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
~MeshFunction()
Destructor.
The libMesh namespace provides an interface to certain functionality in the library.
void disable_out_of_mesh_mode()
Disables out-of-mesh mode.
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.
This class handles the numbering of degrees of freedom on a mesh.
DenseVector< Number > _out_of_mesh_value
Value to return outside the mesh if out-of-mesh mode is enabled.
void enable_out_of_mesh_mode(const DenseVector< Number > &value)
Enables out-of-mesh mode.
virtual void clear() override
Clears the function.
std::set< const Elem * > find_elements(const Point &p, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
std::map< const Elem *, Number > discontinuous_value(const Point &p, const Real time=0.)
void unset_point_locator_tolerance()
Turn off the user-specified PointLocator tolerance.
virtual void init() override
Override the FunctionBase::init() member function.
const PointLocatorBase & get_point_locator() const
This is the base class for point locators.
An object whose state is distributed along a set of processors.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Number operator()(const Point &p, const Real time=0.) override
MeshFunction(const EquationSystems &eqn_systems, const NumericVector< Number > &vec, const DofMap &dof_map, std::vector< unsigned int > vars, const FunctionBase< Number > *master=nullptr)
Constructor for mesh based functions with vectors as return value.
This class provides function-like objects for data distributed over a mesh.
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...
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...
Base class for functors that can be evaluated at a point and (optionally) time.
std::map< const Elem *, Gradient > discontinuous_gradient(const Point &p, const Real time=0.)
A Point defines a location in LIBMESH_DIM dimensional Real space.
Tensor hessian(const Point &p, const Real time=0.)
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::unique_ptr< PointLocatorBase > _point_locator
A point locator is needed to locate the points in the mesh.
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.
const std::vector< unsigned int > _system_vars
The indices of the variables within the other system for which data are to be gathered.