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 "LevelSetBiMaterialRankFour.h" 11 : 12 : registerMooseObjectReplaced("XFEMApp", 13 : LevelSetBiMaterialRankFour, 14 : "01/01/2022 00:00", 15 : XFEMCutSwitchingMaterialRankFourTensor); 16 : registerMooseObjectReplaced("XFEMApp", 17 : ADLevelSetBiMaterialRankFour, 18 : "01/01/2022 00:00", 19 : ADXFEMCutSwitchingMaterialRankFourTensor); 20 : 21 : template <bool is_ad> 22 : InputParameters 23 108 : LevelSetBiMaterialRankFourTempl<is_ad>::validParams() 24 : { 25 108 : InputParameters params = LevelSetBiMaterialBase::validParams(); 26 108 : params.addClassDescription( 27 : "Compute a RankFourTensor material property for bi-materials problem (consisting of two " 28 : "different materials) defined by a level set function."); 29 108 : return params; 30 0 : } 31 : 32 : template <bool is_ad> 33 81 : LevelSetBiMaterialRankFourTempl<is_ad>::LevelSetBiMaterialRankFourTempl( 34 : const InputParameters & parameters) 35 : : LevelSetBiMaterialBase(parameters), 36 162 : _bimaterial_material_prop(2), 37 162 : _material_prop(declareGenericProperty<RankFourTensor, is_ad>(_base_name + _prop_name)) 38 : { 39 162 : _bimaterial_material_prop[0] = &getGenericMaterialProperty<RankFourTensor, is_ad>( 40 : getParam<std::string>("levelset_positive_base") + "_" + _prop_name); 41 162 : _bimaterial_material_prop[1] = &getGenericMaterialProperty<RankFourTensor, is_ad>( 42 : getParam<std::string>("levelset_negative_base") + "_" + _prop_name); 43 81 : } 44 : 45 : template <bool is_ad> 46 : void 47 724320 : LevelSetBiMaterialRankFourTempl<is_ad>::assignQpPropertiesForLevelSetPositive() 48 : { 49 724320 : _material_prop[_qp] = (*_bimaterial_material_prop[0])[_qp]; 50 724320 : } 51 : 52 : template <bool is_ad> 53 : void 54 550824 : LevelSetBiMaterialRankFourTempl<is_ad>::assignQpPropertiesForLevelSetNegative() 55 : { 56 550824 : _material_prop[_qp] = (*_bimaterial_material_prop[1])[_qp]; 57 550824 : } 58 : 59 : template class LevelSetBiMaterialRankFourTempl<false>; 60 : template class LevelSetBiMaterialRankFourTempl<true>;