LCOV - code coverage report
Current view: top level - src/postprocessors - ElementIntegralArrayVariablePostprocessor.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 "ElementIntegralArrayVariablePostprocessor.h"
      11             : 
      12             : registerMooseObject("MooseApp", ElementIntegralArrayVariablePostprocessor);
      13             : 
      14             : InputParameters
      15       30244 : ElementIntegralArrayVariablePostprocessor::validParams()
      16             : {
      17       30244 :   InputParameters params = ElementIntegralPostprocessor::validParams();
      18       30244 :   params.addRequiredCoupledVar("variable",
      19             :                                "The name of the array variable that this object operates on");
      20       30244 :   params.addParam<unsigned int>("component", 0, "Component of the array variable to be integrated");
      21       30244 :   params.addClassDescription("Integral of one component of an array variable.");
      22       30244 :   return params;
      23           0 : }
      24             : 
      25         842 : ElementIntegralArrayVariablePostprocessor::ElementIntegralArrayVariablePostprocessor(
      26         842 :     const InputParameters & parameters)
      27             :   : ElementIntegralPostprocessor(parameters),
      28             :     MooseVariableInterface<RealEigenVector>(
      29             :         this, false, "variable", Moose::VarKindType::VAR_ANY, Moose::VarFieldType::VAR_FIELD_ARRAY),
      30         842 :     _u(coupledArrayValue("variable")),
      31         842 :     _grad_u(coupledArrayGradient("variable")),
      32        1684 :     _component(getParam<unsigned int>("component"))
      33             : {
      34         842 :   addMooseVariableDependency(&mooseVariableField());
      35         842 : }
      36             : 
      37             : Real
      38     1583848 : ElementIntegralArrayVariablePostprocessor::computeQpIntegral()
      39             : {
      40     1583848 :   return _u[_qp](_component);
      41             : }

Generated by: LCOV version 1.14