37 template <
class TObjectType>
40 static TObjectType
Get()
46 template <
class TValueType, std::
size_t ArraySize>
66 template<
class TDataType,
class TReturnType = TDataType>
96 template<
class TDataType,
class TReturnType = TDataType>
126 template<
class TDataType,
class TReturnType = TDataType>
133 TReturnType
mValue = std::numeric_limits<TReturnType>::lowest();
157 template<
class TDataType,
class TReturnType = TDataType>
164 TReturnType
mValue = std::numeric_limits<TReturnType>::lowest();
188 template<
class TDataType,
class TReturnType = TDataType>
221 template<
class TDataType,
class TReturnType = TDataType>
253 template<
class TDataType,
class TReturnType = std::vector<TDataType>>
281 template<
class MapType>
309 template <
class... Reducer>
311 typedef std::tuple<
typename Reducer::value_type...>
value_type;
321 fill_value<0>(return_value);
325 template <
int I,
class T>
326 typename std::enable_if<(I <
sizeof...(Reducer)),
void>
::type
328 std::get<I>(
v) = std::get<I>(
mChild).GetValue();
332 template <
int I,
class T>
333 typename std::enable_if<(I ==
sizeof...(Reducer)),
void>
::type
337 template <
class... T>
345 reduce_global<0>(other);
350 template <
int I,
class T>
351 typename std::enable_if<(I <
sizeof...(Reducer)),
void>
::type
352 reduce_local(T &&
v) {
353 std::get<I>(
mChild).LocalReduce(std::get<I>(
v));
354 reduce_local<I+1>(std::forward<T>(
v));
357 template <
int I,
class T>
358 typename std::enable_if<(I ==
sizeof...(Reducer)),
void>
::type
359 reduce_local(T &&
v) {
364 typename std::enable_if<(I <
sizeof...(Reducer)),
void>
::type
366 std::get<I>(
mChild).ThreadSafeReduce(std::get<I>(other.mChild));
367 reduce_global<I+1>(other);
371 typename std::enable_if<(I ==
sizeof...(Reducer)),
void>
::type
Definition: reduction_utilities.h:159
void ThreadSafeReduce(const AbsMaxReduction< TDataType, TReturnType > &rOther)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:178
TDataType value_type
Definition: reduction_utilities.h:161
void LocalReduce(const TDataType value)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:173
TReturnType return_type
Definition: reduction_utilities.h:162
TReturnType GetValue() const
access to reduced value
Definition: reduction_utilities.h:167
TReturnType mValue
Definition: reduction_utilities.h:164
Definition: reduction_utilities.h:223
void LocalReduce(const TDataType value)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:237
void ThreadSafeReduce(const AbsMinReduction< TDataType, TReturnType > &rOther)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:242
TDataType value_type
Definition: reduction_utilities.h:225
TReturnType GetValue() const
access to reduced value
Definition: reduction_utilities.h:231
TReturnType mValue
Definition: reduction_utilities.h:228
TReturnType return_type
Definition: reduction_utilities.h:226
Definition: reduction_utilities.h:255
void LocalReduce(const TDataType value)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:269
TDataType value_type
Definition: reduction_utilities.h:257
TReturnType return_type
Definition: reduction_utilities.h:258
TReturnType mValue
Definition: reduction_utilities.h:260
void ThreadSafeReduce(const AccumReduction< TDataType, TReturnType > &rOther)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:274
TReturnType GetValue() const
access to reduced value
Definition: reduction_utilities.h:263
Definition: reduction_utilities.h:283
typename MapType::value_type value_type
Definition: reduction_utilities.h:285
MapType return_type
Definition: reduction_utilities.h:286
return_type GetValue() const
access to reduced value
Definition: reduction_utilities.h:291
void LocalReduce(const value_type rValue)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:297
void ThreadSafeReduce(MapReduction< MapType > &rOther)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:302
return_type mValue
Definition: reduction_utilities.h:288
Definition: reduction_utilities.h:128
void LocalReduce(const TDataType value)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:142
TReturnType return_type
Definition: reduction_utilities.h:131
TReturnType GetValue() const
access to reduced value
Definition: reduction_utilities.h:136
void ThreadSafeReduce(const MaxReduction< TDataType, TReturnType > &rOther)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:147
TReturnType mValue
Definition: reduction_utilities.h:133
TDataType value_type
Definition: reduction_utilities.h:130
Definition: reduction_utilities.h:190
void ThreadSafeReduce(const MinReduction< TDataType, TReturnType > &rOther)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:209
TReturnType mValue
Definition: reduction_utilities.h:195
TReturnType GetValue() const
access to reduced value
Definition: reduction_utilities.h:198
void LocalReduce(const TDataType value)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:204
TReturnType return_type
Definition: reduction_utilities.h:193
TDataType value_type
Definition: reduction_utilities.h:192
Definition: reduction_utilities.h:98
TReturnType return_type
Definition: reduction_utilities.h:101
TReturnType GetValue() const
access to reduced value
Definition: reduction_utilities.h:106
void LocalReduce(const TDataType value)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:112
TReturnType mValue
Definition: reduction_utilities.h:103
void ThreadSafeReduce(const SubReduction< TDataType, TReturnType > &rOther)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:117
TDataType value_type
Definition: reduction_utilities.h:100
utility function to do a sum reduction
Definition: reduction_utilities.h:68
void LocalReduce(const TDataType value)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:82
TReturnType mValue
Definition: reduction_utilities.h:73
void ThreadSafeReduce(const SumReduction< TDataType, TReturnType > &rOther)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:87
TReturnType GetValue() const
access to reduced value
Definition: reduction_utilities.h:76
TDataType value_type
Definition: reduction_utilities.h:70
TReturnType return_type
Definition: reduction_utilities.h:71
Short class definition.
Definition: array_1d.h:61
BOOST_UBLAS_INLINE const_iterator begin() const
Definition: array_1d.h:606
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void AtomicAdd(TDataType &target, const TDataType &value)
Definition: atomic_utilities.h:55
v
Definition: generate_convection_diffusion_explicit_element.py:114
type
Definition: generate_gid_list_file.py:35
#define KRATOS_CRITICAL_SECTION
Definition: parallel_utilities.h:39
Definition: reduction_utilities.h:310
void ThreadSafeReduce(const CombinedReduction &other)
THREADSAFE (needs some sort of lock guard) reduction, to be used to sync threads.
Definition: reduction_utilities.h:344
void LocalReduce(const std::tuple< T... > &&v)
NON-THREADSAFE (fast) value of reduction, to be used within a single thread.
Definition: reduction_utilities.h:338
CombinedReduction()
Definition: reduction_utilities.h:316
std::tuple< Reducer... > mChild
Definition: reduction_utilities.h:314
std::enable_if<(I==sizeof...(Reducer)), void >::type fill_value(T &v)
Definition: reduction_utilities.h:334
std::tuple< typename Reducer::return_type... > return_type
Definition: reduction_utilities.h:312
std::tuple< typename Reducer::value_type... > value_type
Definition: reduction_utilities.h:311
std::enable_if<(I< sizeof...(Reducer)), void >::type fill_value(T &v)
Definition: reduction_utilities.h:327
return_type GetValue()
access to reduced value
Definition: reduction_utilities.h:319
static array_1d< TValueType, ArraySize > Get()
Definition: reduction_utilities.h:49
Helper class for null-initializiation.
Definition: reduction_utilities.h:39
static TObjectType Get()
Definition: reduction_utilities.h:40