20 #include <unordered_map> 23 #include "libmesh/bounding_box.h" 24 #include "libmesh/parallel_object.h" 25 #include "libmesh/point_locator_base.h" 48 const std::vector<std::shared_ptr<Ray>> & rays,
49 std::vector<std::shared_ptr<Ray>> & local_rays,
50 const bool do_exchange);
86 virtual void postClaimRay(std::shared_ptr<Ray> & ray,
const Elem * elem);
99 virtual RayID getID(
const std::shared_ptr<Ray> & ray)
const {
return ray->id(); }
154 const Elem *
claimPoint(
const Point & point,
const RayID id,
const Elem * elem);
157 const std::vector<std::shared_ptr<Ray>> &
_rays;
bool _needs_init
Whether or not an init is needed (bounding boxes, neighbors)
unsigned long int RayID
Type for a Ray's ID.
ClaimRays(RayTracingStudy &study, const std::vector< std::shared_ptr< Ray >> &rays, std::vector< std::shared_ptr< Ray >> &local_rays, const bool do_exchange)
Constructor.
void verifyClaiming()
Verifies that the claiming process succeeded.
virtual void postClaimRay(std::shared_ptr< Ray > &ray, const Elem *elem)
Entry point for acting on a Ray after it is claimed.
ParallelStudy< std::shared_ptr< Ray >, Ray > & _parallel_study
The ParallelStudy, used as the context for communicating rays.
virtual void postClaim()
Entry point after claim()
const processor_id_type _pid
This processor ID.
void buildPointNeighbors()
Build the map of elements to all of their point neighbors.
const std::vector< std::shared_ptr< Ray > > & _rays
The Rays that need to be searched to possibly claimed.
uint8_t processor_id_type
std::vector< libMesh::BoundingBox > _inflated_bboxes
The inflated bounding boxes for all processors.
MooseMesh & _mesh
The mesh.
std::vector< std::shared_ptr< Ray > > & _local_rays
The local Rays that are claimed.
Basic datastructure for a ray that will traverse the mesh.
RayTracingStudy & _study
The RayTracingStudy.
virtual RayID getID(const std::shared_ptr< Ray > &ray) const
Gets an ID associated with the Ray for claiming purposes.
void buildBoundingBoxes()
Builds the bounding boxes (_inflated_bboxes).
void claim()
Claim the Rays.
void possiblyClaim(const std::shared_ptr< Ray > &obj)
Possibly claim a Ray.
Helper object for claiming Rays.
const bool _do_exchange
Whether or not the Rays need to be initially exchanged.
virtual void preClaim()
Entry point before claim()
virtual void meshChanged() override
Call on mesh changes to reinit the necessary data structures.
std::unordered_map< dof_id_type, std::vector< const Elem * > > _elem_point_neighbors
Map of point neighbors for each element.
const libMesh::BoundingBox & inflatedBoundingBox(const processor_id_type pid) const
Get the inflated bounding box for rank .
std::unique_ptr< libMesh::PointLocatorBase > _point_locator
The point locator.
const Elem * claimPoint(const Point &point, const RayID id, const Elem *elem)
Try to claim a spatial point.
virtual void prePossiblyClaimRay(const std::shared_ptr< Ray > &)
Entry point before possibly claiming a Ray.
virtual void init()
Initialize the object.
Base class for Ray tracing studies that will generate Rays and then propagate all of them to terminat...