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 "IntegratedBC.h" 13 : #include "DiffusionLHDGAssemblyHelper.h" 14 : 15 : /** 16 : * Implements a fixed normal gradient boundary condition for use with a hybridized discretization of 17 : * the diffusion equation 18 : */ 19 : class DiffusionLHDGPrescribedGradientBC : public IntegratedBC, public DiffusionLHDGAssemblyHelper 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : DiffusionLHDGPrescribedGradientBC(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 jacobianSetup() override; 30 : virtual void initialSetup() override; 31 : 32 : protected: 33 0 : virtual Real computeQpResidual() override { mooseError("this will never be called"); } 34 : 35 : /// Prescribed normal gradient along the boundary. The default is 0 for a natural boundary 36 : /// condition 37 : const Moose::Functor<Real> & _normal_gradient; 38 : 39 : /// A cache variable to prevent multiple computations of Jacobians 40 : unsigned int _cached_side; 41 : };