https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
19public:
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
30protected:
32 virtual Real computeQpJacobian() { mooseError("Should not be called for AD scalar kernels"); };
33
36
38 std::vector<ADReal> _residuals;
39
40private:
44 void computeADJacobian();
45
48};
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
Base class for AD scalar kernels.
std::vector< ADReal > _residuals
Residuals for each order.
void computeADJacobian()
Computes the Jacobian using automatic differentiation.
virtual void computeResidual() override
Compute this object's contribution to the residual.
virtual void computeOffDiagJacobianScalar(unsigned int jvar) override
Computes jacobian block with respect to a scalar variable.
bool _jacobian_already_computed
Flag indicating that the Jacobian has already been computed.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes this object's contribution to off-diagonal blocks of the system Jacobian matrix.
virtual Real computeQpJacobian()
virtual ADReal computeQpResidual()=0
virtual void reinit() override
Reinitialization method called before each call to computeResidual()
virtual void computeJacobian() override
Compute this object's contribution to the diagonal Jacobian entries.
const ADVariableValue & _u
The current solution.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Base class shared by AD and non-AD scalar kernels.