https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADKernelValue.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 "ADKernel.h"
13
14template <typename>
16
19
20template <typename T>
22{
23public:
25
27
28 // See KernelBase base for documentation of these overridden methods
29 virtual void computeResidual() override;
30
31protected:
32 void computeResidualsForJacobian() override;
33
37 virtual typename OutputTools<typename Moose::ADType<T>::type>::OutputValue
39
40 virtual ADReal computeQpResidual() override final;
41
43 virtual Real precomputeQpJacobian()
44 {
45 mooseError("precomputeQpJacobian should not be called for AD methods");
46 }
47
49 using ADKernelTempl<T>::_var;
53 using ADKernelTempl<T>::_qp;
54 using ADKernelTempl<T>::_qrule;
57 using ADKernelTempl<T>::_i;
58 using ADKernelTempl<T>::_JxW;
59 using ADKernelTempl<T>::_coord;
64 using ADKernelTempl<T>::_sys;
65 using ADKernelTempl<T>::_j;
73 using ADKernelTempl<T>::_test;
75 using ADKernelTempl<T>::getVar;
76};
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
const ADTemplateVariableTestValue< T > & _test
the current test function
Definition ADKernel.h:83
const ADTemplateVariableTestGradient< T > & _grad_test
gradient of the test function
Definition ADKernel.h:86
std::vector< ADReal > _residuals
Definition ADKernel.h:111
MooseVariableFE< T > & _var
This is a regular kernel so we cast to a regular MooseVariable.
Definition ADKernel.h:80
const OutputTools< T >::VariableTestGradient & _regular_grad_test
Definition ADKernel.h:89
const MooseArray< ADReal > & _ad_JxW
The ad version of JxW.
Definition ADKernel.h:98
const MooseArray< ADReal > & _ad_coord
The ad version of coord.
Definition ADKernel.h:101
virtual Real precomputeQpJacobian()
Unused method to enable downstream generic object creation.
virtual ADReal computeQpResidual() override final
Compute this Kernel's contribution to the residual at the current quadrature point.
virtual void computeResidual() override
Compute this object's contribution to the residual.
static InputParameters validParams()
virtual OutputTools< typenameMoose::ADType< T >::type >::OutputValue precomputeQpResidual()=0
Called before forming the residual for an element.
void computeResidualsForJacobian() override
compute the _residuals member for filling the Jacobian.
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition Coupleable.C:319
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
std::vector< MooseVariableFEBase * > _save_in
Definition KernelBase.h:65
bool _has_diag_save_in
The aux variables to save the diagonal Jacobian contributions to.
Definition KernelBase.h:69
const bool _use_displaced_mesh
Whether this object is acting on the displaced mesh.
Definition KernelBase.h:76
const MooseArray< Real > & _coord
The scaling factor to convert from cartesian to another coordinate system (e.g rz,...
Definition KernelBase.h:55
unsigned int _qp
The current quadrature point index.
Definition KernelBase.h:43
bool _has_save_in
The aux variables to save the residual contributions to.
Definition KernelBase.h:64
const MooseArray< Real > & _JxW
The current quadrature point weight value.
Definition KernelBase.h:52
unsigned int _j
current index for the shape function
Definition KernelBase.h:61
std::vector< MooseVariableFEBase * > _diag_save_in
Definition KernelBase.h:70
unsigned int _i
current index for the test function
Definition KernelBase.h:58
const QBase *const & _qrule
active quadrature rule
Definition KernelBase.h:49
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Assembly & _assembly
Reference to this Kernel's assembly object.
SystemBase & _sys
Reference to the EquationSystem object.
virtual void precalculateResidual()
DenseMatrix< Number > _local_ke
Holds local Jacobian entries as they are accumulated by this Kernel.
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
Prepare data for computing element jacobian according to the active tags.
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.