https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
34public:
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
76protected:
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
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
Base object for the RayKernel syntax.
virtual ~RayKernelBase()
const Point & _current_segment_start
The start point of the current Ray's segment.
const unsigned short & _current_incoming_side
The current side of _current_elem that _current_segment_start is on (if any)
virtual void preTrace()
Called at the beginning of the trace on this processor/thread for a Ray.
virtual void postTrace()
This method is called once a ray has reached the end of its trace.
void changeRayStartDirection(const Point &start, const Point &direction)
Changes the current Ray's start point and direction.
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...
const bool _need_segment_reinit
Whether or not this RayKernel needs a segment reinit.
virtual void onSegment()=0
Called on each segment of a Ray.
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.
static InputParameters validParams()
const Real & _current_segment_length
The length of the current Ray's segment.
bool needSegmentReinit() const
Whether or not this RayKernel needs a segment reinit.
const Point & _current_segment_end
The end point of the current Ray's segment.
Base class for a MooseObject used in ray tracing.