LCOV - code coverage report
Current view: top level - src/postprocessors - RichardsMass.C (source / functions) Hit Total Coverage
Test: idaholab/moose richards: #31405 (292dce) with base fef103 Lines: 12 13 92.3 %
Date: 2025-09-04 07:56:35 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             : //  This post processor returns the mass value of a region.  It is used
      11             : //  to check that mass is conserved
      12             : //
      13             : #include "RichardsMass.h"
      14             : 
      15             : registerMooseObject("RichardsApp", RichardsMass);
      16             : 
      17             : InputParameters
      18         604 : RichardsMass::validParams()
      19             : {
      20         604 :   InputParameters params = ElementIntegralVariablePostprocessor::validParams();
      21        1208 :   params.addRequiredParam<UserObjectName>(
      22             :       "richardsVarNames_UO", "The UserObject that holds the list of Richards variable names.");
      23         604 :   params.addClassDescription("Returns the mass in a region.");
      24         604 :   return params;
      25           0 : }
      26             : 
      27         286 : RichardsMass::RichardsMass(const InputParameters & parameters)
      28             :   : ElementIntegralVariablePostprocessor(parameters),
      29             : 
      30         286 :     _richards_name_UO(getUserObject<RichardsVarNames>("richardsVarNames_UO")),
      31         286 :     _pvar(_richards_name_UO.richards_var_num(coupled("variable"))),
      32             : 
      33         858 :     _mass(getMaterialProperty<std::vector<Real>>("mass"))
      34             : {
      35         286 : }
      36             : 
      37             : Real
      38      276080 : RichardsMass::computeQpIntegral()
      39             : {
      40      276080 :   return _mass[_qp][_pvar];
      41             : }

Generated by: LCOV version 1.14