22 params.
addParam<
bool>(
"contains_complete_history",
24 "Set this flag to indicate that the values in all vectors declared by this " 25 "VPP represent a time history (e.g. with each invocation, new values are " 26 "added and old values are never removed). This changes the output so that " 27 "only a single file is output and updated with each invocation");
35 MooseEnum parallel_type(
"DISTRIBUTED REPLICATED",
"REPLICATED");
39 "Set how the data is represented within the VectorPostprocessor (VPP); 'distributed' " 40 "indicates that data within the VPP is distributed and no auto communication is performed, " 41 "this setting will result in parallel output within the CSV output; 'replicated' indicates " 42 "that the data within the VPP is correct on processor 0, the data will automatically be " 43 "broadcast to all processors unless the '_auto_broadcast' param is set to false within the " 44 "validParams function.");
54 _vpp_name(moose_object->
name()),
56 *moose_object->parameters().getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")),
57 _parallel_type(moose_object->parameters().
get<
MooseEnum>(
"parallel_type")),
58 _vpp_moose_object(*moose_object),
59 _vpp_tid(moose_object->parameters().isParamValid(
"_tid")
62 _contains_complete_history(moose_object->parameters().
get<bool>(
"contains_complete_history")),
63 _is_distributed(_parallel_type ==
"DISTRIBUTED"),
64 _is_broadcast(_is_distributed || !moose_object->parameters().
get<bool>(
"_auto_broadcast"))
68 #ifdef MOOSE_KOKKOS_ENABLED 73 _vpp_name(object._vpp_name),
74 _vpp_fe_problem(object._vpp_fe_problem),
75 _parallel_type(object._parallel_type),
76 _vpp_moose_object(object._vpp_moose_object),
77 _vpp_tid(object._vpp_tid),
78 _contains_complete_history(object._contains_complete_history),
79 _is_distributed(object._is_distributed),
80 _is_broadcast(object._is_broadcast)
106 const std::set<std::string> &
114 template <
typename T>
122 template <
typename T>
128 const auto & consumer_modes = this->state().getConsumers();
129 auto func = [](
const std::pair<ReporterMode, const MooseObject *> & mode_pair)
131 if (std::find_if(consumer_modes.begin(), consumer_modes.end(), func) != consumer_modes.end())
133 const T &
value = this->state().value();
134 if (this->processor_id() == 0 &&
value.size() != this->n_processors())
135 mooseError(
"The VectorPostprocessor value to be scatter has a length of ",
137 "; it must be the same length as the number of processors (",
138 this->n_processors(),
141 this->comm().scatter(
value, _scatter_value);
145 template <
typename T>
150 _scatter_value_old = _scatter_value;
153 template <
typename T>
157 return _scatter_value;
160 template <
typename T>
164 return _scatter_value_old;
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...
std::string name(const ElemQuality q)
virtual void finalize() override
Perform automatic parallel communication based on the producer/consumer modes.
A special version of RestartableData to aid in storing Reporter values.
static InputParameters validParams()
T & declareReporterValue(const ReporterName &reporter_name, const ReporterMode &mode, const MooseObject &producer, Args &&... args)
Method for returning a writable reference to the current Reporter value.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
const ReporterMode REPORTER_MODE_ROOT
A class to provide an common interface to objects requiring "outputs" option.
const ScatterVectorPostprocessorValue & getScatterValueOld() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
A ReporterName that represents a VectorPostprocessor.
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Every object that can be built by the factory should be derived from this class.
const MooseObject & _vpp_moose_object
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
const ReporterMode REPORTER_MODE_DISTRIBUTED
VectorPostprocessorValue & declareVector(const std::string &vector_name)
Register a new vector to fill up.
std::map< std::string, VectorPostprocessorValue > _thread_local_vectors
VectorPostprocessorContext(const libMesh::ParallelObject &other, const MooseObject &producer, ReporterState< T > &state)
virtual void copyValuesBack() override
Called by FEProblemBase::advanceState via ReporterData.
FEProblemBase & _vpp_fe_problem
The FEProblemBase.
std::vector< Real > VectorPostprocessorValue
Real ScatterVectorPostprocessorValue
virtual void copyValuesBack() override
Called by FEProblemBase::advanceState via ReporterData.
static InputParameters validParams()
const ReporterMode REPORTER_MODE_VPP_SCATTER("VPP_SCATTER")
const bool _is_distributed
std::set< std::string > _vector_names
static InputParameters validParams()
const ReporterMode REPORTER_MODE_REPLICATED
Base class for Postprocessors that produce a vector of values.
MooseEnumItem that automatically creates the ID and doesn't allow the ID to be assigned.
const std::set< std::string > & getVectorNames() const
Return the names of the vectors associated with this object.
const Elem & get(const ElemType type_in)
const ScatterVectorPostprocessorValue & getScatterValue() const
VectorPostprocessor(const MooseObject *moose_object)
const std::string _vpp_name
The name of the VectorPostprocessor.
virtual void finalize() override
Perform automatic parallel communication based on the producer/consumer modes.