https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADKernelStabilized.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 virtual void computeResidual() override;
29
30protected:
31 void computeResidualsForJacobian() override;
32
36 virtual typename OutputTools<typename Moose::ADType<T>::type>::OutputValue
38
40
41 virtual ADReal computeQpResidual() override final;
42
43 using ADKernelTempl<T>::_assembly;
44 using ADKernelTempl<T>::_var;
46 using ADKernelTempl<T>::_grad_test;
48 using ADKernelTempl<T>::_qp;
49 using ADKernelTempl<T>::_qrule;
50 using ADKernelTempl<T>::_ad_JxW;
51 using ADKernelTempl<T>::_ad_coord;
52 using ADKernelTempl<T>::_i;
53 using ADKernelTempl<T>::_JxW;
54 using ADKernelTempl<T>::_coord;
58 using ADKernelTempl<T>::_save_in;
59 using ADKernelTempl<T>::_sys;
60 using ADKernelTempl<T>::_j;
63 using ADKernelTempl<T>::_local_re;
64 using ADKernelTempl<T>::_local_ke;
68 using ADKernelTempl<T>::_residuals;
69};
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
virtual OutputTools< typenameMoose::ADType< T >::type >::OutputValue precomputeQpStrongResidual()=0
Called before forming the residual for an element.
void computeResidualsForJacobian() override
compute the _residuals member for filling the Jacobian.
virtual ADRealVectorValue computeQpStabilization()=0
virtual void computeResidual() override
Compute this object's contribution to the residual.
virtual ADReal computeQpResidual() override final
Compute this Kernel's contribution to the residual at the current quadrature point.
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
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.