LCOV - code coverage report
Current view: top level - src/materials - PorousFlowPermeabilityConstFromVar.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #32971 (54bef8) with base c6cf66 Lines: 40 41 97.6 %
Date: 2026-05-29 20:38:56 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 "PorousFlowPermeabilityConstFromVar.h"
      11             : 
      12             : registerMooseObject("PorousFlowApp", PorousFlowPermeabilityConstFromVar);
      13             : registerMooseObject("PorousFlowApp", ADPorousFlowPermeabilityConstFromVar);
      14             : 
      15             : template <bool is_ad>
      16             : InputParameters
      17         241 : PorousFlowPermeabilityConstFromVarTempl<is_ad>::validParams()
      18             : {
      19         241 :   InputParameters params = PorousFlowPermeabilityBase::validParams();
      20         482 :   params.addRequiredCoupledVar("perm_xx", "The xx component of the permeability tensor");
      21         482 :   params.addRequiredCoupledVar("perm_yy", "The yy component of the permeability tensor");
      22         482 :   params.addRequiredCoupledVar("perm_zz", "The zz component of the permeability tensor");
      23         482 :   params.addCoupledVar("perm_xy", 0.0, "The xy component of the permeability tensor");
      24         482 :   params.addCoupledVar("perm_xz", 0.0, "The xz component of the permeability tensor");
      25         482 :   params.addCoupledVar("perm_yx", 0.0, "The yx component of the permeability tensor");
      26         482 :   params.addCoupledVar("perm_yz", 0.0, "The yz component of the permeability tensor");
      27         482 :   params.addCoupledVar("perm_zx", 0.0, "The zx component of the permeability tensor");
      28         482 :   params.addCoupledVar("perm_zy", 0.0, "The zy component of the permeability tensor");
      29         241 :   params.addClassDescription(
      30             :       "This Material calculates the permeability tensor given by the input variables");
      31         241 :   return params;
      32           0 : }
      33             : 
      34             : template <bool is_ad>
      35         186 : PorousFlowPermeabilityConstFromVarTempl<is_ad>::PorousFlowPermeabilityConstFromVarTempl(
      36             :     const InputParameters & parameters)
      37             :   : PorousFlowPermeabilityBaseTempl<is_ad>(parameters),
      38         186 :     _perm_xx(coupledValue("perm_xx")),
      39         186 :     _perm_xy(coupledValue("perm_xy")),
      40         186 :     _perm_xz(coupledValue("perm_xz")),
      41         186 :     _perm_yx(coupledValue("perm_yx")),
      42         186 :     _perm_yy(coupledValue("perm_yy")),
      43         186 :     _perm_yz(coupledValue("perm_yz")),
      44         186 :     _perm_zx(coupledValue("perm_zx")),
      45         186 :     _perm_zy(coupledValue("perm_zy")),
      46         372 :     _perm_zz(coupledValue("perm_zz"))
      47             : {
      48         186 : }
      49             : 
      50             : template <bool is_ad>
      51             : void
      52      478805 : PorousFlowPermeabilityConstFromVarTempl<is_ad>::computeQpProperties()
      53             : {
      54      478805 :   const RealTensorValue permeability(_perm_xx[_qp],
      55      478805 :                                      _perm_xy[_qp],
      56      478805 :                                      _perm_xz[_qp],
      57      478805 :                                      _perm_yx[_qp],
      58      478805 :                                      _perm_yy[_qp],
      59      478805 :                                      _perm_yz[_qp],
      60      478805 :                                      _perm_zx[_qp],
      61      478805 :                                      _perm_zy[_qp],
      62      478805 :                                      _perm_zz[_qp]);
      63             : 
      64      478805 :   _permeability_qp[_qp] = permeability;
      65             : 
      66             :   if (!is_ad)
      67             :   {
      68      300920 :     (*_dpermeability_qp_dvar)[_qp].resize(_num_var, RealTensorValue());
      69      300920 :     (*_dpermeability_qp_dgradvar)[_qp].resize(LIBMESH_DIM);
      70             : 
      71     1203680 :     for (const auto i : make_range(Moose::dim))
      72      902760 :       (*_dpermeability_qp_dgradvar)[_qp][i].resize(_num_var, RealTensorValue());
      73             :   }
      74      478805 : }
      75             : 
      76             : template class PorousFlowPermeabilityConstFromVarTempl<false>;
      77             : template class PorousFlowPermeabilityConstFromVarTempl<true>;

Generated by: LCOV version 1.14