LCOV - code coverage report
Current view: top level - src/auxkernels - MaterialRankTwoTensorAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 12 13 92.3 %
Date: 2025-07-17 01:28:37 Functions: 12 12 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 "MaterialRankTwoTensorAux.h"
      11             : 
      12             : #include "metaphysicl/raw_type.h"
      13             : 
      14             : registerMooseObject("MooseApp", MaterialRankTwoTensorAux);
      15             : registerMooseObject("MooseApp", ADMaterialRankTwoTensorAux);
      16             : registerMooseObject("MooseApp", MaterialSymmetricRankFourTensorAux);
      17             : registerMooseObject("MooseApp", ADMaterialSymmetricRankFourTensorAux);
      18             : 
      19             : template <typename T, bool is_ad>
      20             : InputParameters
      21       72135 : MaterialRankTwoTensorAuxTempl<T, is_ad>::validParams()
      22             : {
      23       72135 :   InputParameters params = MaterialAuxBaseTempl<T, is_ad>::validParams();
      24       72135 :   params.addClassDescription(
      25             :       "Access a component of a RankTwoTensor for automatic material property output");
      26       72135 :   params.addRequiredParam<unsigned int>("i", "The index i of ij for the tensor to output");
      27       72135 :   params.addRequiredParam<unsigned int>("j", "The index j of ij for the tensor to output");
      28       72135 :   return params;
      29           0 : }
      30             : 
      31             : template <typename T, bool is_ad>
      32        7893 : MaterialRankTwoTensorAuxTempl<T, is_ad>::MaterialRankTwoTensorAuxTempl(
      33             :     const InputParameters & parameters)
      34             :   : MaterialAuxBaseTempl<T, is_ad>(parameters),
      35        7893 :     _i(this->template getParam<unsigned int>("i")),
      36       15786 :     _j(this->template getParam<unsigned int>("j"))
      37             : {
      38             :   mooseAssert(_i < T::N, "i component out of range.");
      39             :   mooseAssert(_j < T::N, "j component out of range.");
      40        7893 : }
      41             : 
      42             : template <typename T, bool is_ad>
      43             : Real
      44     5022720 : MaterialRankTwoTensorAuxTempl<T, is_ad>::getRealValue()
      45             : {
      46     5022720 :   return MetaPhysicL::raw_value(this->_full_value(_i, _j));
      47             : }
      48             : 
      49             : template class MaterialRankTwoTensorAuxTempl<RankTwoTensor, false>;
      50             : template class MaterialRankTwoTensorAuxTempl<RankTwoTensor, true>;
      51             : template class MaterialRankTwoTensorAuxTempl<SymmetricRankFourTensor, false>;
      52             : template class MaterialRankTwoTensorAuxTempl<SymmetricRankFourTensor, true>;

Generated by: LCOV version 1.14