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 "RayKernel.h" 13 : #include "ADRayKernel.h" 14 : 15 : template <bool is_ad> 16 : class GenericRayKernel : public RayKernel 17 : { 18 : public: 19 682 : static InputParameters validParams() { return RayKernel::validParams(); }; 20 368 : GenericRayKernel(const InputParameters & parameters) : RayKernel(parameters) {} 21 : }; 22 : 23 : template <> 24 : class GenericRayKernel<true> : public ADRayKernel 25 : { 26 : public: 27 105 : static InputParameters validParams() { return ADRayKernel::validParams(); }; 28 59 : GenericRayKernel(const InputParameters & parameters) : ADRayKernel(parameters) {} 29 : 30 : protected: 31 : /** 32 : * Dummy virtual that will never be called but is used in derived classes that 33 : * override computeJacobian() for the non-AD case. 34 : */ 35 0 : virtual ADReal computeQpJacobian() { return 0; } 36 : 37 : /** 38 : * Dummy virtual that will never be called but is used in derived classes that 39 : * override computeQpOffDiagJacobian() for the non-AD case. 40 : */ 41 0 : virtual ADReal computeQpOffDiagJacobian(const unsigned int) { return 0; } 42 : 43 : /** 44 : * Dummy virtual that will never be called but is used in derived classes that 45 : * override precalculateJacobian() for the non-AD case. 46 : */ 47 0 : virtual void precalculateJacobian() {} 48 : 49 : /** 50 : * Dummy virtual that will never be called but is used in derived classes that 51 : * override precalculateOffDiagJacobian() for the non-AD case. 52 : */ 53 0 : virtual void precalculateOffDiagJacobian(const unsigned int) {} 54 : }; 55 : 56 : #define usingGenericRayKernelMembers \ 57 : usingRayKernelBaseMembers; \ 58 : usingTaggingInterfaceMembers; \ 59 : using GenericRayKernel<is_ad>::_qp; \ 60 : using GenericRayKernel<is_ad>::_i; \ 61 : using GenericRayKernel<is_ad>::_j; \ 62 : using GenericRayKernel<is_ad>::_u; \ 63 : using GenericRayKernel<is_ad>::_phi; \ 64 : using GenericRayKernel<is_ad>::_test; \ 65 : using GenericRayKernel<is_ad>::_q_point; \ 66 : using GenericRayKernel<is_ad>::_var; \ 67 : using GenericRayKernel<is_ad>::getVar; \ 68 : using Coupleable::coupled; \ 69 : using Coupleable::coupledComponents; \ 70 : using Coupleable::coupledGenericValue