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