Line data Source code
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 : 14 : template <typename> 15 : class ADKernelValueTempl; 16 : 17 : using ADKernelValue = ADKernelValueTempl<Real>; 18 : using ADVectorKernelValue = ADKernelValueTempl<RealVectorValue>; 19 : 20 : template <typename T> 21 : class ADKernelValueTempl : public ADKernelTempl<T> 22 : { 23 : public: 24 : static InputParameters validParams(); 25 : 26 : ADKernelValueTempl(const InputParameters & parameters); 27 : 28 : // See KernelBase base for documentation of these overridden methods 29 : virtual void computeResidual() override; 30 : 31 : protected: 32 : void computeResidualsForJacobian() override; 33 : 34 : /** 35 : * Called before forming the residual for an element 36 : */ 37 : virtual typename OutputTools<typename Moose::ADType<T>::type>::OutputValue 38 : precomputeQpResidual() = 0; 39 : 40 : virtual ADReal computeQpResidual() override final; 41 : 42 : /// Unused method to enable downstream generic object creation 43 0 : virtual Real precomputeQpJacobian() 44 : { 45 0 : mooseError("precomputeQpJacobian should not be called for AD methods"); 46 : } 47 : 48 : using ADKernelTempl<T>::_assembly; 49 : using ADKernelTempl<T>::_var; 50 : using ADKernelTempl<T>::precalculateResidual; 51 : using ADKernelTempl<T>::_grad_test; 52 : using ADKernelTempl<T>::_use_displaced_mesh; 53 : using ADKernelTempl<T>::_qp; 54 : using ADKernelTempl<T>::_qrule; 55 : using ADKernelTempl<T>::_ad_JxW; 56 : using ADKernelTempl<T>::_ad_coord; 57 : using ADKernelTempl<T>::_i; 58 : using ADKernelTempl<T>::_JxW; 59 : using ADKernelTempl<T>::_coord; 60 : using ADKernelTempl<T>::_regular_grad_test; 61 : using ADKernelTempl<T>::accumulateTaggedLocalResidual; 62 : using ADKernelTempl<T>::_has_save_in; 63 : using ADKernelTempl<T>::_save_in; 64 : using ADKernelTempl<T>::_sys; 65 : using ADKernelTempl<T>::_j; 66 : using ADKernelTempl<T>::accumulateTaggedLocalMatrix; 67 : using ADKernelTempl<T>::prepareVectorTag; 68 : using ADKernelTempl<T>::_local_re; 69 : using ADKernelTempl<T>::_local_ke; 70 : using ADKernelTempl<T>::_diag_save_in; 71 : using ADKernelTempl<T>::_has_diag_save_in; 72 : using ADKernelTempl<T>::prepareMatrixTag; 73 : using ADKernelTempl<T>::_test; 74 : using ADKernelTempl<T>::_residuals; 75 : using ADKernelTempl<T>::getVar; 76 : };