17 #include "libmesh/point_locator_base.h" 18 #include "libmesh/elem.h" 19 #include "libmesh/enum_point_locator_type.h" 20 #include "libmesh/point.h" 36 std::pair<std::vector<Point>, std::vector<Real>> & multi_point_list =
_points[elem];
38 const unsigned int npoint = multi_point_list.first.size();
39 mooseAssert(npoint == multi_point_list.second.size(),
40 "Different sizes for location and point value data");
42 for (
unsigned int i = 0; i < npoint; ++i)
46 multi_point_list.second[i] +=
value;
51 multi_point_list.first.push_back(p);
52 multi_point_list.second.push_back(
value);
65 std::vector<Point> & point_list =
_points[elem].first;
67 for (
const auto & pt : point_list)
88 unsigned pl_needs_rebuild =
_elements.size();
118 const std::set<SubdomainID> &
blocks,
119 const PointNotFoundBehavior point_not_found_behavior,
134 consumer.
mooseError(
"PointLocator is not initialized!");
141 const Elem * elem = (*_point_locator)(p, &
blocks);
147 dof_id_type elem_id = elem ? elem->
id() : DofObject::invalid_id;
154 if (min_elem_id == DofObject::invalid_id)
156 std::stringstream msg;
158 switch (point_not_found_behavior)
160 case PointNotFoundBehavior::ERROR:
163 case PointNotFoundBehavior::WARNING:
164 mooseDoOnce(consumer.
mooseWarning(msg.str() +
"This message will not be repeated."));
166 case PointNotFoundBehavior::IGNORE:
174 if (min_elem_id != DofObject::invalid_id)
175 if (
const auto min_elem =
mesh.queryElemPtr(min_elem_id);
bool hasPoint(const Elem *elem, const Point &p)
Return true if we have Point 'p' in Element 'elem'.
void addPoint(const Elem *elem, const Point &p, const Real &value=1)
Adds a point source.
Base class for everything in MOOSE with a name and a type.
std::set< const Elem * > _elements
The list of elements that need distributions.
static constexpr Real TOLERANCE
const Parallel::Communicator & comm() const
MultiPointMap _points
The list of physical xyz Points that need to be evaluated in each element.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
std::unique_ptr< libMesh::PointLocatorBase > _point_locator
The DiracKernelInfo object manages a PointLocator object which is used by all DiracKernels to find Po...
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void min(const T &r, T &o, Request &req) const
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
void clearPoints()
Remove all of the current points and elements.
std::string stringify(const T &t)
conversion to string
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Elem * findPoint(const Point &p, const MooseMesh &mesh, const std::set< SubdomainID > &blocks, const PointNotFoundBehavior point_not_found_behavior, const MooseBase &consumer)
Used by client DiracKernel classes to determine the Elem in which the Point p resides.
void max(const T &r, T &o, Request &req) const
const Real _point_equal_distance_sq
threshold distance squared below which two points are considered identical
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
processor_id_type processor_id() const
void updatePointLocator(const MooseMesh &mesh)
Called during FEProblemBase::meshChanged() to update the PointLocator object used by the DiracKernels...
virtual ~DiracKernelInfo()
bool pointsFuzzyEqual(const Point &, const Point &)
Check if two points are equal with respect to a tolerance.