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