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 "KokkosIntegratedBC.h" 13 : 14 : /** 15 : * Implements a constant Neumann BC where grad(u) is a equal to a postprocessor on the boundary. 16 : * Uses the term produced from integrating the diffusion operator by parts. 17 : */ 18 : class KokkosPostprocessorNeumannBC final 19 : : public Moose::Kokkos::IntegratedBC<KokkosPostprocessorNeumannBC> 20 : { 21 : public: 22 : /** 23 : * Factory constructor, takes parameters so that all derived classes can be built using the same 24 : * constructor. 25 : */ 26 : static InputParameters validParams(); 27 : 28 : KokkosPostprocessorNeumannBC(const InputParameters & parameters); 29 : 30 : KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i, 31 : const unsigned int qp, 32 : ResidualDatum & datum) const; 33 : 34 : protected: 35 : /// Value of grad(u) on the boundary. 36 : Moose::Kokkos::PostprocessorValue _value; 37 : }; 38 : 39 : KOKKOS_FUNCTION inline Real 40 6240 : KokkosPostprocessorNeumannBC::computeQpResidual(const unsigned int i, 41 : const unsigned int qp, 42 : ResidualDatum & datum) const 43 : { 44 6240 : return -_test(datum, i, qp) * _value; 45 : }