https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADDiracKernel.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 "DiracKernelBase.h"
14#include "ADFunctorInterface.h"
15
20 public MooseVariableInterface<Real>,
22{
23public:
25
27
28 virtual void jacobianSetup() override;
29
30 virtual void computeResidual() override;
31 virtual void computeJacobian() override;
32 virtual void computeOffDiagJacobian(unsigned int jvar) override;
33 virtual void computeResidualAndJacobian() override;
34
35 virtual const MooseVariableField<Real> & variable() const override { return _var; }
36
37protected:
42
45
48
51
56
57private:
59 void computeADResiduals();
62
64 std::vector<ADReal> _ad_residuals;
66 const Elem * _last_jacobian_elem;
67};
DualNumber< Real, DNDerivativeType, true > ADReal
typename OutputTools< T >::VariablePhiValue ADTemplateVariablePhiValue
Definition MooseTypes.h:675
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
Definition MooseTypes.h:653
typename OutputTools< T >::VariableTestValue ADTemplateVariableTestValue
Definition MooseTypes.h:673
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
Definition MooseTypes.h:656
AD version of DiracKernel.
virtual void computeResidual() override
Compute this object's contribution to the residual.
static InputParameters validParams()
const ADTemplateVariableTestValue< Real > & _test
Values of test functions at QPs.
virtual ADReal computeQpResidual()=0
Computes the residual contribution at the current quadrature point.
void computeADResiduals()
Computes the AD residuals for the current element.
const ADTemplateVariableGradient< Real > & _grad_u
Holds the solution gradient at the current quadrature points.
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job.
void computeFullJacobian()
Computes the full Jacobian for the current element.
virtual void computeResidualAndJacobian() override
Compute this object's contribution to the residual and Jacobian simultaneously.
const Elem * _last_jacobian_elem
The element corresponding to previous Jacobian calculation.
virtual void computeJacobian() override
Compute this object's contribution to the diagonal Jacobian entries.
std::vector< ADReal > _ad_residuals
AD residuals for the current element.
MooseVariableField< Real > & _var
Variable this kernel acts on.
virtual const MooseVariableField< Real > & variable() const override
Returns the variable that this object operates on.
const ADTemplateVariablePhiValue< Real > & _phi
Values of shape functions at QPs.
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes the off-diagonal Jacobian for variable jvar.
const ADTemplateVariableValue< Real > & _u
Holds the solution at current quadrature points.
An interface for accessing Moose::Functors for systems that care about automatic differentiation,...
DiracKernelBase is the base class for all DiracKernel type classes.
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
Class for stuff related to variables.
Interface for objects that need to get values of MooseVariables.