https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MeshMetaDataInterface.C
Go to the documentation of this file.
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
12#include "MooseApp.h"
13
15 : _meta_data_app(moose_object->getMooseApp()), _meta_data_object(moose_object)
16{
17}
18
20 : _meta_data_app(moose_app), _meta_data_object(nullptr)
21{
22}
23
24#ifdef MOOSE_KOKKOS_ENABLED
27 : _meta_data_app(object._meta_data_app), _meta_data_object(object._meta_data_object)
28{
29}
30#endif
31
32bool
33MeshMetaDataInterface::hasMeshProperty(const std::string & data_name,
34 const std::string & prefix) const
35{
38}
39
40std::string
41MeshMetaDataInterface::meshPropertyName(const std::string & data_name, const std::string & prefix)
42{
43 return std::string(SYSTEM) + "/" + prefix + "/" + data_name;
44}
45
46std::string
48{
49 mooseError("This object does not support obtaining a mesh property without a prefix.\n\nThis "
50 "capability is upcoming.");
51}
52
55 const std::string & prefix) const
56{
58 meshPropertyName(data_name, prefix), MooseApp::MESH_META_DATA, 0);
59}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
The Interface used to retrieve mesh meta data (attributes) set by the MeshGenerator system.
bool hasMeshProperty(const std::string &data_name, const std::string &prefix) const
MooseApp & _meta_data_app
Reference to the application.
static constexpr auto SYSTEM
The system name used when initializing the Restartable interface.
const RestartableDataValue & getMeshPropertyInternal(const std::string &data_name, const std::string &prefix) const
Helper for getting a mesh property.
static std::string meshPropertyName(const std::string &data_name, const std::string &prefix)
virtual std::string meshPropertyPrefix(const std::string &data_name) const
The default prefix to use for getting/seeing if mesh properties exist.
MeshMetaDataInterface(const MooseObject *moose_object)
Interface for all objects reading MeshMetaData.
Base class for MOOSE-based applications.
Definition MooseApp.h:110
bool hasRestartableMetaData(const std::string &name, const RestartableDataMapName &metaname) const
Definition MooseApp.C:2501
RestartableDataValue & getRestartableMetaData(const std::string &name, const RestartableDataMapName &metaname, THREAD_ID tid)
Definition MooseApp.C:2511
static const RestartableDataMapName MESH_META_DATA
Definition MooseApp.h:136
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
Abstract definition of a RestartableData value.