27 params.template addRequiredParam<NonlinearVariableName>(
28 "variable",
"The name of the variable that this ADRayKernel operates on");
43 _var(this->mooseVariableField()),
46 _grad_u(_var.adGradSln()),
47 _phi(_assembly.phi(_var))
56 mooseError(
"Not valid on coordinate systems other than XYZ");
63 mooseError(
"ADRayKernels do not currently support explicit solves.");
70 mooseAssert(_current_subdomain_id == _assembly.currentSubdomainID(),
"Subdomain IDs not in sync");
71 mooseAssert(_fe_problem.currentlyComputingJacobian() || _fe_problem.currentlyComputingResidual(),
72 "Not computing residual or Jacobian");
74 if (_fe_problem.currentlyComputingJacobian())
76 else if (_fe_problem.currentlyComputingResidual())
84 prepareVectorTag(_assembly, _var.number());
86 precalculateResidual();
87 for (_qp = 0; _qp < _JxW.size(); _qp++)
88 for (_i = 0; _i < _test.size(); _i++)
89 _local_re(_i) +=
raw_value(_JxW[_qp] * computeQpResidual());
91 accumulateTaggedLocalResidual();
98 _subproblem.prepareShapes(_var.number(), _tid);
100 for (
auto & r : _residuals)
102 _residuals.resize(_test.size(), 0);
104 precalculateResidual();
105 for (_qp = 0; _qp < _JxW.size(); _qp++)
106 for (_i = 0; _i < _test.size(); _i++)
107 _residuals[_i] += _JxW[_qp] * computeQpResidual();
109 addJacobian(_assembly, _residuals, _var.dofIndices(), _var.scalingFactor());
Base class for a RayKernel that integrates along a Ray segment.
virtual void haveADObjects(bool have_ad_objects)
Base class for an AD ray kernel that contributes to the residual and/or Jacobian. ...
FEProblemBase & _fe_problem
The FEProblemBase.
void onSegment() override final
Called on each segment of a Ray.
static InputParameters validParams()
MooseVariableField< T > & variable()
The MooseVariable this RayKernel contributes to.
ADRayKernelTempl(const InputParameters ¶ms)
MooseMesh & _mesh
The MooseMesh.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void computeResidual()
Computes and contributes to the residual for a segment.
static InputParameters validParams()
void addMooseVariableDependency(MooseVariableFieldBase *var)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
static InputParameters validParams()
void computeJacobian()
Computes and contributes to the Jacobian for a segment.
const std::set< SubdomainID > & meshSubdomains() const