Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
ADScalarKernel.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 #include "ScalarKernelBase.h"
13 
18 {
19 public:
21 
23 
24  virtual void reinit() override;
25  virtual void computeResidual() override;
26  virtual void computeJacobian() override;
27  virtual void computeOffDiagJacobian(unsigned int jvar) override;
28  virtual void computeOffDiagJacobianScalar(unsigned int jvar) override;
29 
30 protected:
31  virtual ADReal computeQpResidual() = 0;
32 
35 
37  std::vector<ADReal> _residuals;
38 
39 private:
43  void computeADJacobian();
44 
47 };
ADScalarKernel(const InputParameters &parameters)
std::vector< ADReal > _residuals
Residuals for each order.
bool _jacobian_already_computed
Flag indicating that the Jacobian has already been computed.
Base class for AD scalar kernels.
virtual void computeJacobian() override
Compute this object&#39;s contribution to the diagonal Jacobian entries.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:47
virtual void computeOffDiagJacobianScalar(unsigned int jvar) override
Computes jacobian block with respect to a scalar variable.
void computeADJacobian()
Computes the Jacobian using automatic differentiation.
virtual void computeResidual() override
Compute this object&#39;s contribution to the residual.
static InputParameters validParams()
virtual void reinit() override
Reinitialization method called before each call to computeResidual()
forward declarations
const ADVariableValue & _u
The current solution.
virtual ADReal computeQpResidual()=0
Base class shared by AD and non-AD scalar kernels.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes this object&#39;s contribution to off-diagonal blocks of the system Jacobian matrix...