Go to the documentation of this file.
20 #include "libmesh/meshfree_solution_transfer.h"
22 #include "libmesh/mesh.h"
23 #include "libmesh/system.h"
24 #include "libmesh/numeric_vector.h"
25 #include "libmesh/threads.h"
26 #include "libmesh/meshfree_interpolation.h"
27 #include "libmesh/function_base.h"
28 #include "libmesh/node.h"
41 class MeshlessInterpolationFunction :
public FunctionBase<Number>
66 virtual std::unique_ptr<FunctionBase<Number>>
clone ()
const
68 return libmesh_make_unique<MeshlessInterpolationFunction>(
_mfi,
_mutex);
78 Threads::spin_mutex::scoped_lock lock(
_mutex);
91 output(0) = (*this)(p,time);
97 mutable std::vector<Point>
_pts;
98 mutable std::vector<Number>
_vals;
106 libmesh_experimental();
116 (from_mesh.
comm(), 4, 2);
118 std::vector<Point> & src_pts (idi.get_source_points());
119 std::vector<Number> & src_vals (idi.get_source_vals());
121 std::vector<std::string> field_vars;
122 field_vars.push_back(from_var.
name());
129 src_pts.push_back(*node);
130 src_vals.push_back((*from_sys->
solution)(node->dof_number(from_sys->
number(),from_var.
number(),0)));
134 idi.prepare_for_use();
Manages consistently variables, degrees of freedom, and coefficient vectors.
const EquationSystems & get_equation_systems() const
const MeshBase & get_mesh() const
unsigned int number() const
Number operator()(const Point &p, const Real time=0.)
MeshlessInterpolationFunction & operator=(const MeshlessInterpolationFunction &)=delete
This class contains const references so it can't be assigned.
The libMesh namespace provides an interface to certain functionality in the library.
const Parallel::Communicator & comm() const
unsigned int number() const
void init()
The actual initialization process.
const std::vector< std::string > & field_variables() const
const std::string & name() const
const MeshfreeInterpolation & _mfi
void clear()
Clears the function.
This is the MeshBase class.
std::vector< Point > _pts
virtual std::unique_ptr< FunctionBase< Number > > clone() const
virtual SimpleRange< node_iterator > local_node_ptr_range()=0
A Point defines a location in LIBMESH_DIM dimensional Real space.
This class defines the notion of a variable in the system.
This is the EquationSystems class.
void resize(const unsigned int n)
Resize the vector.
Inverse distance interpolation.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
Threads::spin_mutex & _mutex
virtual void interpolate_field_data(const std::vector< std::string > &field_names, const std::vector< Point > &tgt_pts, std::vector< Number > &tgt_vals) const =0
Interpolate source data at target points.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_field_variables(const std::vector< std::string > &names)
Defines the field variable(s) we are responsible for, and importantly their assumed ordering.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr) const
Projects arbitrary functions onto the current solution.
std::vector< Number > _vals
MeshlessInterpolationFunction(const MeshfreeInterpolation &mfi, Threads::spin_mutex &mutex)
Base class to support various mesh-free interpolation methods.
virtual void transfer(const Variable &from_var, const Variable &to_var) override
Transfer the values of a variable to another.
virtual ~MeshlessInterpolationFunction()=default