https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADScalarKernel.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#include "ADScalarKernel.h"
11
12#include "Assembly.h"
13
20
22 : ScalarKernelBase(parameters), _u(_var.adSln()), _jacobian_already_computed(false)
23{
24}
25
26void
31
32void
42
43void
48
49void
58
59void
61{
62}
63
64void
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.
ADScalarKernel(const InputParameters &parameters)
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes this object's contribution to off-diagonal blocks of the system Jacobian matrix.
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.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
void scalingFactor(const std::vector< Real > &factor)
Set the scaling factor for this variable.
libMesh::Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int.
unsigned int number() const
Get variable number coming from libMesh.
Assembly & _assembly
Reference to this Kernel's assembly object.
Base class shared by AD and non-AD scalar kernels.
MooseVariableScalar & _var
Scalar variable.
static InputParameters validParams()
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Add the provided residual derivatives into the Jacobian for the provided dof indices.
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.