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 "ADIntegratedBC.h" 13 : 14 : class IPHDGAssemblyHelper; 15 : 16 : /** 17 : * Implements a prescribed flux for an IP-HDG discretization 18 : */ 19 : class IPHDGBC : public ADIntegratedBC 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : IPHDGBC(const InputParameters & parameters); 25 : 26 : virtual void computeResidual() override; 27 : virtual void computeJacobian() override; 28 : virtual void computeOffDiagJacobian(unsigned int jvar) override; 29 : virtual void computeResidualAndJacobian() override; 30 : virtual void jacobianSetup() override; 31 : virtual const std::unordered_set<unsigned int> & getMatPropDependencies() const override; 32 : 33 : protected: 34 : /** 35 : * compute the AD residuals 36 : */ 37 : virtual void compute() = 0; 38 : 39 : virtual IPHDGAssemblyHelper & iphdgHelper() = 0; 40 : const IPHDGAssemblyHelper & iphdgHelper() const; 41 : 42 0 : virtual ADReal computeQpResidual() override { mooseError("this will never be called"); } 43 : 44 : /// A data member used for determining when to compute the Jacobian 45 : const Elem * _cached_elem; 46 : 47 : /// A cache variable to prevent multiple computations of Jacobians 48 : unsigned int _cached_side; 49 : }; 50 : 51 : inline const IPHDGAssemblyHelper & 52 8748 : IPHDGBC::iphdgHelper() const 53 : { 54 8748 : return const_cast<IPHDGBC *>(this)->iphdgHelper(); 55 : }