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 : #pragma once 11 : 12 : #include "TwoMaterialPropertyInterface.h" 13 : 14 : // Forward Declarations 15 : class MaterialData; 16 : 17 : /** 18 : * This interface is designed currently for DomainUserObject where material properties 19 : * on element, face and neighboring face may all required. It can be used in the future 20 : * by objects having similar requirements as DomainUserObject. The base interface 21 : * TwoMaterialPropertyInterface only provides functions to retrieve material properties 22 : * on sides of its primary side (face) and its secondary side (neighbor). 23 : */ 24 : class ThreeMaterialPropertyInterface : public TwoMaterialPropertyInterface 25 : { 26 : public: 27 : ThreeMaterialPropertyInterface(const MooseObject * moose_object, 28 : const std::set<SubdomainID> & blocks_ids, 29 : const std::set<BoundaryID> & boundary_ids); 30 : 31 : static InputParameters validParams(); 32 : 33 : /** 34 : * Retrieve the property deduced from the name \p name 35 : */ 36 : template <typename T> 37 : const MaterialProperty<T> & getFaceMaterialProperty(const std::string & name); 38 : 39 : /** 40 : * Retrieve the property named "name" without any deduction 41 : */ 42 : template <typename T> 43 : const MaterialProperty<T> & getFaceMaterialPropertyByName(const std::string & name); 44 : 45 : /** 46 : * Retrieve the ADMaterialProperty named "name" 47 : */ 48 : template <typename T> 49 : const ADMaterialProperty<T> & getFaceADMaterialProperty(const std::string & name); 50 : 51 : template <typename T> 52 : const MaterialProperty<T> & getFaceMaterialPropertyOld(const std::string & name); 53 : 54 : template <typename T> 55 : const MaterialProperty<T> & getFaceMaterialPropertyOlder(const std::string & name); 56 : 57 : /** 58 : * Retrieve the face material property whether AD or not 59 : */ 60 : template <typename T, bool is_ad> 61 26 : const auto & getGenericFaceMaterialProperty(const std::string & name) 62 : { 63 : if constexpr (is_ad) 64 13 : return getFaceADMaterialProperty<T>(name); 65 : else 66 13 : return getFaceMaterialProperty<T>(name); 67 : } 68 : 69 : protected: 70 : MaterialData & _face_material_data; 71 : }; 72 : 73 : template <typename T> 74 : const MaterialProperty<T> & 75 13 : ThreeMaterialPropertyInterface::getFaceMaterialProperty(const std::string & name) 76 : { 77 13 : return getMaterialProperty<T>(name, _face_material_data); 78 : } 79 : 80 : template <typename T> 81 : const MaterialProperty<T> & 82 13 : ThreeMaterialPropertyInterface::getFaceMaterialPropertyByName(const std::string & name) 83 : { 84 13 : return getMaterialPropertyByName<T>(name, _face_material_data); 85 : } 86 : 87 : template <typename T> 88 : const ADMaterialProperty<T> & 89 1316 : ThreeMaterialPropertyInterface::getFaceADMaterialProperty(const std::string & name) 90 : { 91 1316 : return getADMaterialProperty<T>(name, _face_material_data); 92 : } 93 : 94 : template <typename T> 95 : const MaterialProperty<T> & 96 13 : ThreeMaterialPropertyInterface::getFaceMaterialPropertyOld(const std::string & name) 97 : { 98 13 : return getMaterialPropertyOld<T>(name, _face_material_data); 99 : } 100 : 101 : template <typename T> 102 : const MaterialProperty<T> & 103 13 : ThreeMaterialPropertyInterface::getFaceMaterialPropertyOlder(const std::string & name) 104 : { 105 13 : return getMaterialPropertyOlder<T>(name, _face_material_data); 106 : }