22 params.addRequiredParam<std::vector<Point>>(
"start_points",
23 "The point(s) where the ray(s) start");
24 params.addRequiredParam<std::vector<Point>>(
26 "The direction(s) that the ray(s) start in (does not need to be normalized)");
27 params.addRequiredParam<FunctionName>(
28 "velocity_function",
"A function that describes the velocity field for the ray(s)");
32 params.set<
bool>(
"_use_ray_registration") =
false;
39 _start_points(getParam<
std::vector<Point>>(
"start_points")),
40 _start_directions(getParam<
std::vector<Point>>(
"start_directions")),
41 _velocity_function(getFunction(
"velocity_function")),
42 _has_generated(declareRestartableData<bool>(
"has_generated", false)),
44 declareRestartableDataWithContext<
std::vector<
std::shared_ptr<
Ray>>>(
"_banked_rays", this))
47 paramError(
"start_directions",
"Must be the same size as 'start_points'");
77 rays[i]->setStartingMaxDistance(
maxDistance(*rays[i]));
81 std::vector<std::shared_ptr<Ray>> claimed_rays;
82 ClaimRays claim_rays(*
this, rays, claimed_rays,
false);
94 const auto start_point = ray->currentPoint();
95 const auto direction = ray->direction();
96 const auto elem = ray->currentElem();
100 ray->clearStartingInfo();
103 ray->setStart(start_point, elem);
104 ray->setStartingDirection(direction);
registerMooseObject("RayTracingTestApp", TestPICRayStudy)
const std::vector< std::shared_ptr< Ray > > & rayBank() const
Get the Ray bank.
virtual Real & time() const
Real maxDistance(const Ray &ray) const
static InputParameters validParams()
std::shared_ptr< Ray > acquireReplicatedRay()
Acquire a Ray from the pool of Rays within generateRays() in a replicated fashion.
const Point & currentPoint() const
Gets the point that the Ray is currently at.
virtual void generateRays() override
Subclasses should override this to determine how to generate Rays.
std::vector< std::shared_ptr< Ray > > & _banked_rays
The banked rays to be used on the next timestep (restartable)
virtual void postExecuteStudy() override
Entry point after study execution.
bool & _has_generated
Whether or not we've generated rays yet (restartable)
static InputParameters validParams()
Basic datastructure for a ray that will traverse the mesh.
void paramError(const std::string ¶m, Args... args) const
Test study for generating rays for a basic particle-in-cell capability, where Rays propagate a bit ea...
void claim()
Claim the Rays.
Helper object for claiming Rays.
TestPICRayStudy(const InputParameters ¶meters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
virtual Real value(Real t, const Point &p) const
const std::vector< Point > & _start_points
The starting points.
void moveRaysToBuffer(std::vector< std::shared_ptr< Ray >> &rays)
Moves rays to the buffer to be traced during generateRays().
const Function & _velocity_function
The function that represents the velocity field.
virtual Real & dt() const
auto index_range(const T &sizable)
const std::vector< Point > & _start_directions
The starting directions.
Base class for Ray tracing studies that will generate Rays and then propagate all of them to terminat...