LCOV - code coverage report
Current view: top level - src/materials - LevelSetBiMaterialRankTwo.C (source / functions) Hit Total Coverage
Test: idaholab/moose xfem: #31405 (292dce) with base fef103 Lines: 16 17 94.1 %
Date: 2025-09-04 07:58:55 Functions: 8 8 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 "LevelSetBiMaterialRankTwo.h"
      11             : 
      12             : registerMooseObjectReplaced("XFEMApp",
      13             :                             LevelSetBiMaterialRankTwo,
      14             :                             "01/01/2022 00:00",
      15             :                             XFEMCutSwitchingMaterialRankTwoTensor);
      16             : registerMooseObjectReplaced("XFEMApp",
      17             :                             ADLevelSetBiMaterialRankTwo,
      18             :                             "01/01/2022 00:00",
      19             :                             ADXFEMCutSwitchingMaterialRankTwoTensor);
      20             : 
      21             : template <bool is_ad>
      22             : InputParameters
      23         124 : LevelSetBiMaterialRankTwoTempl<is_ad>::validParams()
      24             : {
      25         124 :   InputParameters params = LevelSetBiMaterialBase::validParams();
      26         124 :   params.addClassDescription(
      27             :       "Compute a RankTwoTensor material property for bi-materials problem (consisting of two "
      28             :       "different materials) defined by a level set function.");
      29         124 :   return params;
      30           0 : }
      31             : 
      32             : template <bool is_ad>
      33          93 : LevelSetBiMaterialRankTwoTempl<is_ad>::LevelSetBiMaterialRankTwoTempl(
      34             :     const InputParameters & parameters)
      35             :   : LevelSetBiMaterialBase(parameters),
      36         186 :     _bimaterial_material_prop(2),
      37         186 :     _material_prop(declareGenericProperty<RankTwoTensor, is_ad>(_base_name + _prop_name))
      38             : {
      39         186 :   _bimaterial_material_prop[0] = &getGenericMaterialProperty<RankTwoTensor, is_ad>(
      40             :       getParam<std::string>("levelset_positive_base") + "_" + _prop_name);
      41         186 :   _bimaterial_material_prop[1] = &getGenericMaterialProperty<RankTwoTensor, is_ad>(
      42             :       getParam<std::string>("levelset_negative_base") + "_" + _prop_name);
      43          93 : }
      44             : 
      45             : template <bool is_ad>
      46             : void
      47      757932 : LevelSetBiMaterialRankTwoTempl<is_ad>::assignQpPropertiesForLevelSetPositive()
      48             : {
      49      757932 :   _material_prop[_qp] = (*_bimaterial_material_prop[0])[_qp];
      50      757932 : }
      51             : 
      52             : template <bool is_ad>
      53             : void
      54      569724 : LevelSetBiMaterialRankTwoTempl<is_ad>::assignQpPropertiesForLevelSetNegative()
      55             : {
      56      569724 :   _material_prop[_qp] = (*_bimaterial_material_prop[1])[_qp];
      57      569724 : }
      58             : 
      59             : template class LevelSetBiMaterialRankTwoTempl<false>;
      60             : template class LevelSetBiMaterialRankTwoTempl<true>;

Generated by: LCOV version 1.14