LCOV - code coverage report
Current view: top level - src/userobjects - SideIntegralVariableUserObject.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 15 16 93.8 %
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 "SideIntegralVariableUserObject.h"
      11             : 
      12             : InputParameters
      13      172832 : SideIntegralVariableUserObject::validParams()
      14             : {
      15      172832 :   InputParameters params = SideIntegralUserObject::validParams();
      16      172832 :   params.addRequiredCoupledVar("variable",
      17             :                                "The name of the variable that this boundary condition applies to");
      18      172832 :   return params;
      19           0 : }
      20             : 
      21         714 : SideIntegralVariableUserObject::SideIntegralVariableUserObject(const InputParameters & parameters)
      22             :   : SideIntegralUserObject(parameters),
      23             :     MooseVariableInterface<Real>(this,
      24             :                                  false,
      25             :                                  "variable",
      26             :                                  Moose::VarKindType::VAR_ANY,
      27             :                                  Moose::VarFieldType::VAR_FIELD_STANDARD),
      28         714 :     _u(coupledValue("variable")),
      29         714 :     _grad_u(coupledGradient("variable")),
      30         714 :     _fv(_fv_variable)
      31             : {
      32         714 :   addMooseVariableDependency(&mooseVariableField());
      33         714 : }
      34             : 
      35             : Real
      36      404148 : SideIntegralVariableUserObject::computeQpIntegral()
      37             : {
      38      404148 :   if (_fv)
      39             :   {
      40             :     // We should be at the edge of the domain for this variable
      41        1152 :     const FaceInfo * const fi = _mesh.faceInfo(_current_elem, _current_side);
      42             :     mooseAssert(fi, "We should have a face info");
      43             : 
      44        1152 :     return MetaPhysicL::raw_value(_fv_variable->getBoundaryFaceValue(*fi, determineState()));
      45             :   }
      46             :   else
      47      402996 :     return _u[_qp];
      48             : }

Generated by: LCOV version 1.14