LCOV - code coverage report
Current view: top level - src/postprocessors - SideIntegralVariablePostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 19 20 95.0 %
Date: 2025-07-17 01:28:37 Functions: 5 5 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 "SideIntegralVariablePostprocessor.h"
      11             : #include "MathFVUtils.h"
      12             : 
      13             : #include "metaphysicl/raw_type.h"
      14             : 
      15             : registerMooseObject("MooseApp", SideIntegralVariablePostprocessor);
      16             : 
      17             : InputParameters
      18      189549 : SideIntegralVariablePostprocessor::validParams()
      19             : {
      20      189549 :   InputParameters params = SideIntegralPostprocessor::validParams();
      21      189549 :   params.addRequiredCoupledVar("variable",
      22             :                                "The name of the variable which this postprocessor integrates");
      23      189549 :   params.addClassDescription("Computes a surface integral of the specified variable");
      24      189549 :   return params;
      25           0 : }
      26             : 
      27        2121 : SideIntegralVariablePostprocessor::SideIntegralVariablePostprocessor(
      28        2121 :     const InputParameters & parameters)
      29             :   : SideIntegralPostprocessor(parameters),
      30             :     MooseVariableInterface<Real>(this,
      31             :                                  false,
      32             :                                  "variable",
      33             :                                  Moose::VarKindType::VAR_ANY,
      34             :                                  Moose::VarFieldType::VAR_FIELD_STANDARD),
      35        2121 :     _u(coupledValue("variable")),
      36        2121 :     _grad_u(coupledGradient("variable")),
      37        4242 :     _fv(_fv_variable || _linear_fv_variable)
      38             : {
      39        2121 :   addMooseVariableDependency(&mooseVariableField());
      40             : 
      41        2121 :   _qp_integration = !_fv;
      42        2121 : }
      43             : 
      44             : Real
      45         240 : SideIntegralVariablePostprocessor::computeFaceInfoIntegral(const FaceInfo * const fi)
      46             : {
      47         240 :   return MetaPhysicL::raw_value((*_field_variable)(makeCDFace(*fi), determineState()));
      48             : }
      49             : 
      50             : Real
      51      741589 : SideIntegralVariablePostprocessor::computeQpIntegral()
      52             : {
      53      741589 :   return _u[_qp];
      54             : }
      55             : 
      56             : bool
      57        2400 : SideIntegralVariablePostprocessor::hasFaceSide(const FaceInfo & fi, const bool fi_elem_side) const
      58             : {
      59        2400 :   return _field_variable->hasFaceSide(fi, fi_elem_side);
      60             : }

Generated by: LCOV version 1.14