https://mooseframework.inl.gov
ParallelRayStudy.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "ParallelStudy.h"
13 
14 // Local includes
15 #include "Ray.h"
16 
17 // Forward declarations
18 class RayTracingStudy;
19 class TraceRay;
20 
21 class ParallelRayStudy : public ParallelStudy<std::shared_ptr<Ray>, Ray>
22 {
23 public:
25  const std::vector<std::shared_ptr<TraceRay>> & threaded_trace_ray);
26 
34 
35 protected:
36  void executeWork(const std::shared_ptr<Ray> & ray, const THREAD_ID tid) override;
37  void moveWorkError(const MoveWorkError error, const std::shared_ptr<Ray> * ray) const override;
39  const parallel_data_iterator end) override;
40  bool workIsComplete(const std::shared_ptr<Ray> & ray) override;
41  void postExecuteChunk(const work_iterator begin, const work_iterator end) override;
42 
46  const std::vector<std::shared_ptr<TraceRay>> & _threaded_trace_ray;
47 };
const std::vector< std::shared_ptr< TraceRay > > & _threaded_trace_ray
The TraceRay objects that do the tracing for each thread.
bool workIsComplete(const std::shared_ptr< Ray > &ray) override
Can be overridden to denote if a piece of work is not complete yet.
RayTracingStudy & rayTracingStudy()
Get the RayTracingStudy associated with this ParallelRayStudy.
MoveWorkError
Enum for providing useful errors during work addition in moveWorkError().
void moveWorkError(const MoveWorkError error, const std::shared_ptr< Ray > *ray) const override
const RayTracingStudy & rayTracingStudy() const
RayTracingStudy & _ray_tracing_study
The RayTracingStudy.
ParallelRayStudy(RayTracingStudy &study, const std::vector< std::shared_ptr< TraceRay >> &threaded_trace_ray)
MooseUtils::Buffer< std::shared_ptr< Ray > >::iterator work_iterator
Definition: ParallelStudy.h:32
MooseUtils::Buffer< std::shared_ptr< Ray > >::iterator parallel_data_iterator
Definition: ParallelStudy.h:34
void executeWork(const std::shared_ptr< Ray > &ray, const THREAD_ID tid) override
Pure virtual to be overridden that executes a single object of work on a given thread.
void postReceiveParallelData(const parallel_data_iterator begin, const parallel_data_iterator end) override
Traces Rays through the mesh on a single processor.
Definition: TraceRay.h:46
void postExecuteChunk(const work_iterator begin, const work_iterator end) override
unsigned int THREAD_ID
Base class for Ray tracing studies that will generate Rays and then propagate all of them to terminat...