LCOV - code coverage report
Current view: top level - src/auxkernels - MaterialStdVectorRealGradientAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 13 16 81.2 %
Date: 2025-08-08 20:01:16 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       14481 : MaterialStdVectorRealGradientAux::validParams()
      16             : {
      17       14481 :   InputParameters params = MaterialStdVectorAuxBase<>::validParams();
      18       14481 :   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       43443 :   params.addParam<unsigned int>(
      22       28962 :       "component", 0, "The gradient component to be extracted for this kernel");
      23       14481 :   return params;
      24           0 : }
      25             : 
      26         114 : MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(
      27         114 :     const InputParameters & parameters)
      28             :   : MaterialStdVectorAuxBase<RealGradient>(parameters),
      29         114 :     _component(getParam<unsigned int>("component"))
      30             : {
      31         114 :   if (_component > LIBMESH_DIM)
      32           0 :     mooseError(
      33           0 :         "The component ", _component, " does not exist for ", LIBMESH_DIM, " dimensional problems");
      34         114 : }
      35             : 
      36             : Real
      37        5856 : MaterialStdVectorRealGradientAux::getRealValue()
      38             : {
      39        5856 :   return this->_full_value[_index](_component);
      40             : }

Generated by: LCOV version 1.14