https://mooseframework.inl.gov
RayKernelBase.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 // Local Includes
13 #include "RayTracingObject.h"
14 
15 // MOOSE includes
17 #include "BlockRestrictable.h"
18 #include "RandomInterface.h"
20 #include "Restartable.h"
21 
29  public BlockRestrictable,
30  public RandomInterface,
32  public Restartable
33 {
34 public:
35  RayKernelBase(const InputParameters & params);
36  virtual ~RayKernelBase();
37 
39 
55  virtual void onSegment() = 0;
56 
64  virtual void preTrace();
65 
69  virtual void postTrace();
70 
74  bool needSegmentReinit() const { return _need_segment_reinit; }
75 
76 protected:
82  void changeRayStartDirection(const Point & start, const Point & direction);
83 
94  std::shared_ptr<Ray> acquireRay(const Point & start, const Point & direction);
95 
100  void moveRayToBuffer(std::shared_ptr<Ray> & ray);
101 
103  const Point & _current_segment_start;
105  const Point & _current_segment_end;
109  const unsigned short & _current_incoming_side;
110 
113 };
114 
115 #define usingRayKernelBaseMembers \
116  usingRayTracingObjectMembers; \
117  usingBlockRestrictableMembers; \
118  using RayKernelBase::changeRayStartDirection; \
119  using RayKernelBase::acquireRay; \
120  using RayKernelBase::moveRayToBuffer
const bool _need_segment_reinit
Whether or not this RayKernel needs a segment reinit.
const Real & _current_segment_length
The length of the current Ray&#39;s segment.
const unsigned short & _current_incoming_side
The current side of _current_elem that _current_segment_start is on (if any)
Base class for a MooseObject used in ray tracing.
void moveRayToBuffer(std::shared_ptr< Ray > &ray)
Moves a Ray into the working buffer to be traced during tracing with a meaningful error on verificati...
virtual void preTrace()
Called at the beginning of the trace on this processor/thread for a Ray.
Base object for the RayKernel syntax.
Definition: RayKernelBase.h:27
std::shared_ptr< Ray > acquireRay(const Point &start, const Point &direction)
Acquires a Ray to be used for generating a new Ray while tracing on the boundary. ...
Definition: RayKernelBase.C:98
static InputParameters validParams()
Definition: RayKernelBase.C:17
RayKernelBase(const InputParameters &params)
Definition: RayKernelBase.C:38
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void changeRayStartDirection(const Point &start, const Point &direction)
Changes the current Ray&#39;s start point and direction.
Definition: RayKernelBase.C:63
const Point & _current_segment_end
The end point of the current Ray&#39;s segment.
virtual void postTrace()
This method is called once a ray has reached the end of its trace.
virtual ~RayKernelBase()
Definition: RayKernelBase.C:60
bool needSegmentReinit() const
Whether or not this RayKernel needs a segment reinit.
Definition: RayKernelBase.h:74
const Point & _current_segment_start
The start point of the current Ray&#39;s segment.
virtual void onSegment()=0
Called on each segment of a Ray.