LCOV - code coverage report
Current view: top level - src/bcs - FunctorNeumannBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 18 19 94.7 %
Date: 2026-05-29 20:35:17 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          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             : #include "FunctorNeumannBC.h"
      11             : 
      12             : registerMooseObject("MooseApp", FunctorNeumannBC);
      13             : 
      14             : InputParameters
      15        3443 : FunctorNeumannBC::validParams()
      16             : {
      17        3443 :   InputParameters params = ADIntegratedBC::validParams();
      18             : 
      19        6886 :   params.addClassDescription("Imposes the integrated boundary condition "
      20             :                              "$\\frac{\\partial u}{\\partial n}=h(t,\\vec{x})$, "
      21             :                              "where $h$ is a functor.");
      22             : 
      23       13772 :   params.addRequiredParam<MooseFunctorName>("functor", "The functor to impose");
      24       10329 :   params.addParam<MooseFunctorName>(
      25        6886 :       "coefficient", 1.0, "An optional functor coefficient to multiply the imposed functor");
      26        6886 :   params.addParam<bool>("flux_is_inward",
      27        6886 :                         true,
      28             :                         "Set to true if a positive evaluation of the provided functor corresponds "
      29             :                         "to a flux in the inward direction; else the outward direction");
      30             : 
      31        3443 :   return params;
      32           0 : }
      33             : 
      34         142 : FunctorNeumannBC::FunctorNeumannBC(const InputParameters & parameters)
      35             :   : ADIntegratedBC(parameters),
      36         142 :     _functor(getFunctor<ADReal>("functor")),
      37         284 :     _coef(getFunctor<ADReal>("coefficient")),
      38         426 :     _sign(getParam<bool>("flux_is_inward") ? -1.0 : 1.0)
      39             : {
      40         142 : }
      41             : 
      42             : ADReal
      43       65976 : FunctorNeumannBC::computeQpResidual()
      44             : {
      45       65976 :   const Moose::ElemSideQpArg space_arg = {_current_elem, _current_side, _qp, _qrule, _q_point[_qp]};
      46      131952 :   return _sign * _coef(space_arg, Moose::currentState()) *
      47      197928 :          _functor(space_arg, Moose::currentState()) * _test[_i][_qp];
      48             : }

Generated by: LCOV version 1.14