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 : public Moose::Kokkos::IntegratedBC 19 : { 20 : public: 21 : /** 22 : * Factory constructor, takes parameters so that all derived classes can be built using the same 23 : * constructor. 24 : */ 25 : static InputParameters validParams(); 26 : 27 : KokkosPostprocessorNeumannBC(const InputParameters & parameters); 28 : 29 : KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i, 30 : const unsigned int qp, 31 : AssemblyDatum & datum) const; 32 : 33 : protected: 34 : /// Value of grad(u) on the boundary. 35 : Moose::Kokkos::PostprocessorValue _value; 36 : }; 37 : 38 : KOKKOS_FUNCTION inline Real 39 6240 : KokkosPostprocessorNeumannBC::computeQpResidual(const unsigned int i, 40 : const unsigned int qp, 41 : AssemblyDatum & datum) const 42 : { 43 6240 : return -_test(datum, i, qp) * _value; 44 : }