21 VectorPostprocessorValue * vpp)
30 params.addClassDescription(
31 "Storage container for stochastic simulation results coming from a Postprocessor.");
34 params.addParam<std::vector<SamplerName>>(
"samplers",
35 "A list of sampler names of associated data.");
37 MooseEnum parallel_type(
"REPLICATED DISTRIBUTED",
"REPLICATED");
38 params.addParam<MooseEnum>(
41 "Specify if the stored data vector is replicated or distributed across processors.");
43 params.addParam<processor_id_type>(
44 "output_distributed_rank",
45 Moose::INVALID_PROCESSOR_ID,
46 "When 'parallel_type = DISTRIBUTED' set this to copy the data from the specified processor "
47 "for output. This is mainly for testing since the data from that rank will override the data "
48 "on the root process.");
50 params.set<
bool>(
"_is_broadcast") =
false;
55 : GeneralVectorPostprocessor(parameters),
56 SamplerInterface(this),
57 _parallel_type(getParam<MooseEnum>(
"parallel_type")),
58 _output_distributed_rank(getParam<processor_id_type>(
"output_distributed_rank"))
64 paramError(
"output_distributed_rank",
65 "The output rank cannot be used with 'parallel_type' set to replicated.");
67 paramError(
"output_distributed_rank",
68 "The supplied value is greater than the number of available processors: ",
73 if ((
_parallel_type ==
"DISTRIBUTED") && (getOutputs().count(
"none") == 0) &&
75 paramWarning(
"parallel_type",
76 "The parallel_type was set to DISTRIBUTED and output is enabled for the object, "
77 "when running in parallel the results output will only contain the data on the "
78 "root processor. Output can be disabled by setting 'outputs = none' in the "
79 "input block. If output is desired the 'output_distributed_rank' can be set.");
82 if (isParamValid(
"samplers"))
83 for (
const SamplerName &
name : getParam<std::vector<SamplerName>>(
"samplers"))
85 Sampler & sampler = getSamplerByName(
name);
86 _sample_vectors.emplace_back(sampler.name(), &declareVector(sampler.name()));
94 if (!containsCompleteHistory())
105 _communicator.gather(0, data.current);
112 _communicator.send(0, data.current);
114 else if (processor_id() == 0)
121 data.vector->insert(data.vector->end(), data.current.begin(), data.current.end());
122 data.current.clear();
128 const std::string &
name,
const VectorPostprocessorValue && current)
130 mooseAssert(!hasVectorPostprocessorByName(
name),
131 "The supplied name must be a valid vector postprocessor name.");
136 data_ptr->current = current;
143 if (!isParamValid(
"samplers"))
145 paramWarning(
"samplers",
146 "Support for the 'StochasticResults' objects without the 'samplers' input "
147 "parameter is being removed, please update your input file(s).");
148 _sample_vectors.emplace_back(sampler.name(), &declareVector(sampler.name()));