LCOV - code coverage report
Current view: top level - src/bcs - FunctionGradientNeumannBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 12 13 92.3 %
Date: 2025-07-17 01:28:37 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 "FunctionGradientNeumannBC.h"
      11             : #include "Function.h"
      12             : 
      13             : registerMooseObject("MooseApp", FunctionGradientNeumannBC);
      14             : 
      15             : InputParameters
      16       15019 : FunctionGradientNeumannBC::validParams()
      17             : {
      18       15019 :   InputParameters params = IntegratedBC::validParams();
      19       15019 :   params.addRequiredParam<FunctionName>("exact_solution", "The exact solution.");
      20       15019 :   params.addParam<Real>("coeff", 1, "The diffusion, thermal conductivity, etc. coefficient");
      21       15019 :   params.addClassDescription("Imposes the integrated boundary condition "
      22             :                              "arising from integration by parts of a diffusion/heat conduction "
      23             :                              "operator, and where the exact solution can be specified.");
      24       15019 :   return params;
      25           0 : }
      26             : 
      27         392 : FunctionGradientNeumannBC::FunctionGradientNeumannBC(const InputParameters & parameters)
      28             :   : IntegratedBC(parameters),
      29         392 :     _exact_solution(getFunction("exact_solution")),
      30         784 :     _coeff(getParam<Real>("coeff"))
      31             : {
      32         392 : }
      33             : 
      34             : Real
      35     3317842 : FunctionGradientNeumannBC::computeQpResidual()
      36             : {
      37     3317842 :   return -_test[_i][_qp] * _normals[_qp] * _coeff * _exact_solution.gradient(_t, _q_point[_qp]);
      38             : }

Generated by: LCOV version 1.14