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