22 MultiMooseEnum entries(
"value type declared loaded stored has_context",
"value type");
24 "entries", entries,
"The entries to output for each restartable value");
26 params.
addParam<
bool>(
"allow_unimplemented",
28 "Set to true to allow the empty output of data that does not have a JSON " 29 "output implementation");
32 "map",
"",
"The data map to use; if unset, use system restartable data");
34 params.
addParam<std::vector<std::string>>(
37 "The data name patterns to include (* for matching all, ? for matching a single character)");
38 params.
addParam<std::vector<std::string>>(
41 "The data name patterns to exclude (* for matching all, ? for matching a single character)");
48 _data_params(getDataParams()),
49 _allow_unimplemented(getParam<bool>(
"allow_unimplemented")),
50 _include(getParam<
std::vector<
std::string>>(
"include")),
51 _exclude(getParam<
std::vector<
std::string>>(
"exclude")),
55 _data_map(getParam<
std::string>(
"map").size()
56 ? _app.getRestartableDataMap(getParam<
std::string>(
"map"))
57 : _app.getRestartableData()[0])
64 const auto & entries = getParam<MultiMooseEnum>(
"entries");
67 params.
value = entries.isValueSet(
"value");
68 params.type = entries.isValueSet(
"type");
70 params.declared = entries.isValueSet(
"declared");
71 params.loaded = entries.isValueSet(
"loaded");
72 params.stored = entries.isValueSet(
"stored");
73 params.has_context = entries.isValueSet(
"has_context");
85 mooseAssert(!
_values.count(
value.name()),
"Non-unique name");
88 if (
typeid(nlohmann::json) ==
value.typeId())
97 [&
value](
const auto & pattern) {
104 [&
value](
const auto & pattern)
112 if (!
value.hasStoreJSON())
115 mooseError(
"The method for outputting restartable data of type '",
117 "' is not implemented.\n\nTo omit data values that are not able to be " 118 "output, set Reporters/",
121 "allow_unimplemented=true,\nor skip the data with Reporters/",
123 "/[include/exclude].");
134 mooseAssert(
value.value,
"Not set");
bool globCompare(const std::string &candidate, const std::string &pattern, std::size_t c=0, std::size_t p=0)
RestartableDataReporter(const InputParameters ¶meters)
Reporter object that has a single execution of the "execute" method for for each execute flag...
RestartableDataValue::StoreJSONParams getDataParams() const
Internal method for setting _data_params.
const ReporterMode REPORTER_MODE_ROOT
const RestartableDataMap & _data_map
The map of data that we're going to output.
static const std::string REPORTER_RESTARTABLE_DATA_PREFIX
The prefix for reporter data in the restartable system.
const bool _allow_unimplemented
Whether or not to error on the output of types with unimplemented output methods. ...
static InputParameters validParams()
Reports restartable data and restartable meta data.
const std::vector< std::string > _include
The include patterns to match.
const RestartableDataValue::StoreJSONParams _data_params
The parameters to pass to the output of a single value.
const RestartableDataValue * value
const std::string & name() const
Get the name of the class.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
virtual void execute() override
Execute method.
Helper struct for storing a single piece of restartable data.
const ReporterMode REPORTER_MODE_DISTRIBUTED
Struct that represents parameters for how to store the JSON value via store.
static InputParameters validParams()
RestartableDataValue::StoreJSONParams params
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
void to_json(nlohmann::json &json, const RestartableDataReporter::Value &value)
registerMooseObject("MooseApp", RestartableDataReporter)
std::map< std::string, RestartableDataReporter::Value > & _values
The values we are to output.
const std::vector< std::string > _exclude
The exclude patterns to match.