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 : 43 : protected: 44 : virtual IPHDGAssemblyHelper & iphdgHelper() = 0; 45 : const IPHDGAssemblyHelper & iphdgHelper() const; 46 : 47 : /** 48 : * compute the AD residuals on the element interior 49 : */ 50 : void compute(); 51 : 52 : /** 53 : * compute the AD residuals on the element sides 54 : */ 55 : void computeOnSide(); 56 : 57 : /// A data member used for determining when to compute the Jacobian 58 : const Elem * _cached_elem; 59 : }; 60 : 61 : inline const IPHDGAssemblyHelper & 62 2181 : IPHDGKernel::iphdgHelper() const 63 : { 64 2181 : return const_cast<IPHDGKernel *>(this)->iphdgHelper(); 65 : }