https://mooseframework.inl.gov
CoupledLineSourceRayKernelTestTempl.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 
10 // * This file is part of the MOOSE framework
11 // * https://mooseframework.inl.gov
12 // *
13 // * All rights reserved, see COPYRIGHT for full restrictions
14 // * https://github.com/idaholab/moose/blob/master/COPYRIGHT
15 // *
16 // * Licensed under LGPL 2.1, please see LICENSE for details
17 // * https://www.gnu.org/licenses/lgpl-2.1.html
18 
20 
23 
24 template <bool is_ad>
27 {
29  params.addRequiredCoupledVar("coupled", "The coupled variable");
30  return params;
31 }
32 
33 template <bool is_ad>
35  const InputParameters & params)
36  : GenericRayKernel<is_ad>(params),
37  _coupled(coupled("coupled")),
38  _coupled_val(this->template coupledGenericValue<is_ad>("coupled"))
39 {
40 }
41 
42 template <bool is_ad>
45 {
46  return -_test[_i][_qp] * _coupled_val[_qp] * _coupled_val[_qp];
47 }
48 
49 template <bool is_ad>
52 {
53  if (jvar_num == _coupled)
54  return -2.0 * _phi[_j][_qp] * _test[_i][_qp] * _coupled_val[_qp];
55  return 0;
56 }
57 
CoupledLineSourceRayKernelTestTempl(const InputParameters &params)
Moose::GenericType< Real, is_ad > GenericReal
static InputParameters validParams()
registerMooseObject("RayTracingTestApp", CoupledLineSourceRayKernelTest)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
virtual GenericReal< is_ad > computeQpOffDiagJacobian(const unsigned int jvar_num) override
Compute this RayKernel&#39;s contribution to the off diagonal jacobian for the variable numbered jvar_num...
virtual GenericReal< is_ad > computeQpResidual() override
Compute this RayKernel&#39;s contribution to the residual at _qp and _i.