LCOV - code coverage report
Current view: top level - src/auxkernels - VectorVariableComponentAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 17 17 100.0 %
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 "VectorVariableComponentAux.h"
      11             : 
      12             : registerMooseObject("MooseApp", VectorVariableComponentAux);
      13             : 
      14             : InputParameters
      15       14504 : VectorVariableComponentAux::validParams()
      16             : {
      17       14504 :   MooseEnum component("x=0 y=1 z=2");
      18       14504 :   InputParameters params = AuxKernel::validParams();
      19       14504 :   params.addClassDescription(
      20             :       "Creates a field consisting of one component of a coupled vector variable.");
      21       14504 :   params.addRequiredCoupledVar("vector_variable",
      22             :                                "The variable from which to compute the component");
      23       14504 :   params.addParam<MooseEnum>("component", component, "The component to compute");
      24       29008 :   return params;
      25       14504 : }
      26             : 
      27         124 : VectorVariableComponentAux::VectorVariableComponentAux(const InputParameters & parameters)
      28             :   : AuxKernel(parameters),
      29         124 :     _nodal_variable_value(_nodal ? &coupledNodalValue<RealVectorValue>("vector_variable")
      30             :                                  : nullptr),
      31         124 :     _elemental_variable_value(_nodal ? nullptr : &coupledVectorValue("vector_variable")),
      32         248 :     _component(getParam<MooseEnum>("component"))
      33             : {
      34         124 : }
      35             : 
      36             : Real
      37       23912 : VectorVariableComponentAux::computeValue()
      38             : {
      39       23912 :   if (_nodal)
      40        5832 :     return (*_nodal_variable_value)(_component);
      41             :   else
      42       18080 :     return (*_elemental_variable_value)[_qp](_component);
      43             : }

Generated by: LCOV version 1.14