LCOV - code coverage report
Current view: top level - src/auxkernels - MaterialStdVectorRealGradientAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 13 16 81.2 %
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 "MaterialStdVectorRealGradientAux.h"
      11             : 
      12             : registerMooseObject("MooseApp", MaterialStdVectorRealGradientAux);
      13             : 
      14             : InputParameters
      15       14469 : MaterialStdVectorRealGradientAux::validParams()
      16             : {
      17       14469 :   InputParameters params = MaterialStdVectorAuxBase<>::validParams();
      18       14469 :   params.addClassDescription("Extracts a component of a material's std::vector<RealGradient> to an "
      19             :                              "aux variable.  If the std::vector is not of sufficient size then "
      20             :                              "zero is returned");
      21       43407 :   params.addParam<unsigned int>(
      22       28938 :       "component", 0, "The gradient component to be extracted for this kernel");
      23       14469 :   return params;
      24           0 : }
      25             : 
      26         108 : MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(
      27         108 :     const InputParameters & parameters)
      28             :   : MaterialStdVectorAuxBase<RealGradient>(parameters),
      29         108 :     _component(getParam<unsigned int>("component"))
      30             : {
      31         108 :   if (_component > LIBMESH_DIM)
      32           0 :     mooseError(
      33           0 :         "The component ", _component, " does not exist for ", LIBMESH_DIM, " dimensional problems");
      34         108 : }
      35             : 
      36             : Real
      37        5376 : MaterialStdVectorRealGradientAux::getRealValue()
      38             : {
      39        5376 :   return this->_full_value[_index](_component);
      40             : }

Generated by: LCOV version 1.14