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 "HDGKernel.h" 13 : 14 : class IPHDGAssemblyHelper; 15 : 16 : /** 17 : * Base kernel for implementing an interior penalty hybridized discretization 18 : */ 19 : class IPHDGKernel : public HDGKernel 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : IPHDGKernel(const InputParameters & params); 25 : virtual void computeResidual() override; 26 : /** 27 : * Compute this object's entire element interior Jacobian, both on- and off-diagonal 28 : */ 29 : virtual void computeJacobian() override; 30 : /** 31 : * Forwards to \p computeJacobian() the first time this is called for a given element 32 : */ 33 : virtual void computeOffDiagJacobian(unsigned int jvar) override; 34 : virtual void computeResidualAndJacobian() override; 35 : virtual void jacobianSetup() override; 36 : virtual void computeResidualOnSide() override; 37 : virtual void computeJacobianOnSide() override; 38 : virtual void computeResidualAndJacobianOnSide() override; 39 : 40 : virtual std::set<std::string> additionalROVariables() override; 41 : virtual const std::unordered_set<unsigned int> & getMatPropDependencies() const override; 42 : virtual bool getMaterialPropertyCalled() const override; 43 : 44 : protected: 45 : virtual IPHDGAssemblyHelper & iphdgHelper() = 0; 46 : const IPHDGAssemblyHelper & iphdgHelper() const; 47 : 48 : /** 49 : * compute the AD residuals on the element interior 50 : */ 51 : void compute(); 52 : 53 : /** 54 : * compute the AD residuals on the element sides 55 : */ 56 : void computeOnSide(); 57 : 58 : /// A data member used for determining when to compute the Jacobian 59 : const Elem * _cached_elem; 60 : }; 61 : 62 : inline const IPHDGAssemblyHelper & 63 2468 : IPHDGKernel::iphdgHelper() const 64 : { 65 2468 : return const_cast<IPHDGKernel *>(this)->iphdgHelper(); 66 : }