25 "Demonstrates the multiple ways that scalar values can be introduced " 26 "into RayKernels, e.g. (controllable) constants, functions, " 27 "postprocessors, and data on rays. Implements the weak form $(\\psi_i, -f)$ along a line.");
29 params.
addParam<
Real>(
"value", 1.0,
"Coefficient to multiply by the line source term");
30 params.
addParam<FunctionName>(
"function",
"1",
"A function that describes the line source");
32 "postprocessor", 1,
"A postprocessor whose value is multiplied by the line source");
33 params.
addParam<std::vector<std::string>>(
34 "ray_data_factor_names", {},
"The names of the Ray data to scale the source by (if any)");
35 params.
addParam<std::vector<std::string>>(
36 "ray_aux_data_factor_names",
38 "The names of the Ray aux data to scale the source by (if any)");
48 _scale(this->template getParam<
Real>(
"value")),
49 _function(getFunction(
"function")),
50 _postprocessor(getPostprocessorValue(
"postprocessor")),
51 _ray_data_factor_indices(this->_study.getRayDataIndices(
52 this->template getParam<
std::vector<
std::string>>(
"ray_data_factor_names"))),
53 _ray_aux_data_factor_indices(this->_study.getRayAuxDataIndices(
54 this->template getParam<
std::vector<
std::string>>(
"ray_aux_data_factor_names")))
62 Real factor = _scale * _postprocessor * _function.value(_t, _q_point[_qp]);
65 for (
const auto index : _ray_data_factor_indices)
66 factor *= currentRay()->data(index);
67 for (
const auto index : _ray_aux_data_factor_indices)
68 factor *= currentRay()->auxData(index);
70 return _test[_i][_qp] * -factor;
Moose::GenericType< Real, is_ad > GenericReal
static InputParameters validParams()
LineSourceRayKernelTempl(const InputParameters ¶ms)
virtual GenericReal< is_ad > computeQpResidual() override
Compute this RayKernel's contribution to the residual at _qp and _i.
registerMooseObject("RayTracingApp", LineSourceRayKernel)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()