https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FunctionAuxRayKernelTest.C
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
11
12#include "Function.h"
13
15
18{
19 auto params = AuxRayKernel::validParams();
20 params.addRequiredParam<FunctionName>("function", "The function to use as the value");
21 return params;
22}
23
25 : AuxRayKernel(params), _func(getFunction("function"))
26{
27}
28
29void
31{
32 const Point midpoint = 0.5 * (_current_segment_start + _current_segment_end);
33 addValue(_func.value(_t, midpoint));
34}
registerMooseObject("RayTracingTestApp", FunctionAuxRayKernelTest)
static InputParameters validParams()
void addValue(const Real value)
Use to accumulate a value into the corresponding AuxVariable from this AuxRayKernel.
Test AuxRayKernel that appends a function value on each Ray segment.
virtual void onSegment() override
Called on each segment of a Ray.
static InputParameters validParams()
FunctionAuxRayKernelTest(const InputParameters &params)
const Function & _func
Function being used to compute the value to append.
virtual Real value(Real t, const Point &p) const
const Point & _current_segment_start
The start point of the current Ray's segment.
const Point & _current_segment_end
The end point of the current Ray's segment.