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 : // MOOSE includes 11 : #include "MeshMetaDataInterface.h" 12 : #include "MooseApp.h" 13 : 14 125206 : MeshMetaDataInterface::MeshMetaDataInterface(const MooseObject * moose_object) 15 125206 : : _meta_data_app(moose_object->getMooseApp()), _meta_data_object(moose_object) 16 : { 17 125206 : } 18 : 19 3008917 : MeshMetaDataInterface::MeshMetaDataInterface(MooseApp & moose_app) 20 3008917 : : _meta_data_app(moose_app), _meta_data_object(nullptr) 21 : { 22 3008917 : } 23 : 24 : bool 25 182471 : MeshMetaDataInterface::hasMeshProperty(const std::string & data_name, 26 : const std::string & prefix) const 27 : { 28 364942 : return _meta_data_app.hasRestartableMetaData(meshPropertyName(data_name, prefix), 29 364942 : MooseApp::MESH_META_DATA); 30 : } 31 : 32 : std::string 33 362861 : MeshMetaDataInterface::meshPropertyName(const std::string & data_name, const std::string & prefix) 34 : { 35 725722 : return std::string(SYSTEM) + "/" + prefix + "/" + data_name; 36 : } 37 : 38 : std::string 39 0 : MeshMetaDataInterface::meshPropertyPrefix(const std::string &) const 40 : { 41 0 : mooseError("This object does not support obtaining a mesh property without a prefix.\n\nThis " 42 : "capability is upcoming."); 43 : } 44 : 45 : const RestartableDataValue & 46 1074 : MeshMetaDataInterface::getMeshPropertyInternal(const std::string & data_name, 47 : const std::string & prefix) const 48 : { 49 1074 : return _meta_data_app.getRestartableMetaData( 50 2148 : meshPropertyName(data_name, prefix), MooseApp::MESH_META_DATA, 0); 51 : }