16#include "libmesh/parallel.h"
61template <
typename InType,
typename OutType>
111 virtual void update(
const typename InType::value_type &) = 0;
122 virtual OutType
get()
const = 0;
136template <
typename InType,
typename OutType>
140 using Calculator<InType, OutType>::Calculator;
144 virtual void update(
const typename InType::value_type & val)
override;
145 virtual void finalize(
bool is_distributed)
override;
146 virtual OutType
get()
const override {
return _sum; }
152template <
typename InType,
typename OutType>
156 using Mean<InType, OutType>::Mean;
159 virtual void update(
const typename InType::value_type & val)
override;
162template <
typename InType,
typename OutType>
166 using Calculator<InType, OutType>::Calculator;
170 virtual void update(
const typename InType::value_type & val)
override;
171 virtual void finalize(
bool is_distributed)
override;
178template <
typename InType,
typename OutType>
182 using Ratio<InType, OutType>::Ratio;
185 virtual OutType
get()
const override {
return this->
_min; }
188template <
typename InType,
typename OutType>
192 using Ratio<InType, OutType>::Ratio;
195 virtual OutType
get()
const override {
return this->
_max; }
198template <
typename InType,
typename OutType>
202 using Mean<InType, OutType>::Mean;
205 virtual void finalize(
bool is_distributed)
override;
208template <
typename InType,
typename OutType>
212 using Calculator<InType, OutType>::Calculator;
216 virtual void update(
const typename InType::value_type & val)
override;
217 virtual void finalize(
bool is_distributed)
override;
225template <
typename InType,
typename OutType>
229 using StdDev<InType, OutType>::StdDev;
232 virtual void finalize(
bool is_distributed)
override;
235template <
typename InType,
typename OutType>
239 using Calculator<InType, OutType>::Calculator;
243 virtual void update(
const typename InType::value_type & val)
override;
244 virtual void finalize(
bool is_distributed)
override;
250template <
typename InType,
typename OutType>
254 using Calculator<InType, OutType>::Calculator;
258 virtual void update(
const typename InType::value_type & val)
override;
259 virtual void finalize(
bool is_distributed)
override;
271template <
typename InType = std::vector<Real>,
typename OutType = Real>
279template <
typename InType,
typename OutType>
286template <
typename InType,
typename OutType>
290 initializeCalculator();
291 for (
const auto & val : data)
292 updateCalculator(val);
293 finalizeCalculator(is_distributed);
297template <
typename InType,
typename OutType>
302 _state = CalculatorState::INITIALIZED;
305template <
typename InType,
typename OutType>
309 mooseAssert(_state == CalculatorState::INITIALIZED,
"Calculator is in wrong state.");
313template <
typename InType,
typename OutType>
317 if (_state != CalculatorState::INITIALIZED)
318 ::mooseError(
"Calculator is in wrong state.");
319 finalize(is_distributed);
320 _state = CalculatorState::FINALIZED;
323template <
typename InType,
typename OutType>
327 if (_state != CalculatorState::FINALIZED)
328 ::mooseError(
"Calculator is in wrong state.");
333template <
typename InType,
typename OutType>
334std::unique_ptr<Calculator<InType, OutType>>
ParallelObject(const Parallel::Communicator &comm_in)
void initialize(EquationSystems &es, const std::string &system_name)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...