LCOV - code coverage report
Current view: top level - src/auxkernels - MaterialRealTensorValueAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 14 20 70.0 %
Date: 2025-07-17 01:28:37 Functions: 6 6 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 "MaterialRealTensorValueAux.h"
      11             : 
      12             : registerMooseObject("MooseApp", MaterialRealTensorValueAux);
      13             : registerMooseObject("MooseApp", ADMaterialRealTensorValueAux);
      14             : 
      15             : template <bool is_ad>
      16             : InputParameters
      17       32817 : MaterialRealTensorValueAuxTempl<is_ad>::validParams()
      18             : {
      19       32817 :   InputParameters params = MaterialAuxBaseTempl<RealTensorValue, is_ad>::validParams();
      20       32817 :   params.addClassDescription("Object for extracting a component of a rank two tensor material "
      21             :                              "property to populate an auxiliary variable.");
      22       32817 :   params.addParam<unsigned int>("row", 0, "The row component to consider for this kernel");
      23       32817 :   params.addParam<unsigned int>("column", 0, "The column component to consider for this kernel");
      24       32817 :   return params;
      25           0 : }
      26             : 
      27             : template <bool is_ad>
      28        2241 : MaterialRealTensorValueAuxTempl<is_ad>::MaterialRealTensorValueAuxTempl(
      29             :     const InputParameters & parameters)
      30             :   : MaterialAuxBaseTempl<RealTensorValue, is_ad>(parameters),
      31        2241 :     _row(this->template getParam<unsigned int>("row")),
      32        4482 :     _col(this->template getParam<unsigned int>("column"))
      33             : {
      34        2241 :   if (_row > LIBMESH_DIM)
      35           0 :     mooseError(
      36           0 :         "The row component ", _row, " does not exist for ", LIBMESH_DIM, " dimensional problems");
      37        2241 :   if (_col > LIBMESH_DIM)
      38           0 :     mooseError("The column component ",
      39           0 :                _col,
      40             :                " does not exist for ",
      41           0 :                LIBMESH_DIM,
      42             :                " dimensional problems");
      43        2241 : }
      44             : 
      45             : template <bool is_ad>
      46             : Real
      47     1394160 : MaterialRealTensorValueAuxTempl<is_ad>::getRealValue()
      48             : {
      49     1394160 :   return MetaPhysicL::raw_value(this->_full_value(_row, _col));
      50             : }

Generated by: LCOV version 1.14