11 #include "libmesh/parallel_algebra.h" 18 "unique_times",
true,
"Whether duplicate values should be removed from the Times vector");
22 "Absolute tolerance for removing duplicated times when getting a set of unique times");
23 params.
addParam<
bool>(
"auto_sort",
true,
"Whether Times should be sorted");
27 "Wether Times should be broadcasted across all ranks");
28 params.
addParamNamesToGroup(
"auto_broadcast auto_sort unique_times unique_tolerance",
"Advanced");
44 _need_broadcast(getParam<bool>(
"auto_broadcast")),
45 _need_sort(getParam<bool>(
"auto_sort")),
46 _need_unique(getParam<bool>(
"unique_times")),
47 _unique_tol(getParam<
Real>(
"unique_tolerance"))
55 mooseError(
"Times retrieved with an out-of-bound index");
60 mooseError(
"Times vector has not been initialized.");
67 mooseError(
"Times vector has not been initialized.");
72 const auto & time =
_times[i];
86 const auto & time =
_times[i];
90 if (
_times.size() && error_if_no_next)
91 mooseError(
"No next time in Times vector for time ",
93 ". Maximum time in vector is ",
95 else if (!error_if_no_next)
98 mooseError(
"Times vector has not been initialized.");
101 const std::vector<Real> &
107 mooseError(
"Times vector has not been initialized.");
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
const bool _need_unique
Whether duplicate times should be removed.
This context is specific for vector types of reporters, mainly for declaring a vector of the type fro...
Real getNextTime(const Real current_time, const bool error_if_no_next) const
Find the next time in the times vector for a given time If current_time is also in the times vector w...
Reporter object that has a single execution of the "execute" method for for each execute flag...
const std::vector< Real > & getTimes() const
Getter for the full times vector.
Times(const InputParameters ¶meters)
const bool _need_broadcast
Whether generation of times is distributed or not (and therefore needs a broadcast) ...
static InputParameters validParams()
void clearTimes()
Clear the times vector.
const Parallel::Communicator & _communicator
auto max(const L &left, const R &right)
static InputParameters validParams()
Real getPreviousTime(const Real current_time) const
Find the previous time in the times vector for a given time If current_time is also in the times vect...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real getTimeAtIndex(unsigned int index) const
Getter for a single time at a known index.
const Real _unique_tol
Absolute tolerance for performing duplication checks to make the times vector unique.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const ReporterMode REPORTER_MODE_REPLICATED
virtual void finalize() override
In charge of reduction across all ranks.
auto index_range(const T &sizable)
std::vector< Real > & _times
The vector holding the times.
bool absoluteFuzzyGreaterThan(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Function to check whether a variable is greater than another variable within an absolute tolerance...
const bool _need_sort
Whether times should be sorted, because they come from different sources for example.