21#ifndef OPM_PARALLELISTLINFORMATION_HEADER_INCLUDED
22#define OPM_PARALLELISTLINFORMATION_HEADER_INCLUDED
26#if HAVE_MPI && HAVE_DUNE_ISTL
34#include <dune/istl/owneroverlapcopy.hh>
36#include <opm/simulators/utils/ParallelCommunication.hpp>
47 using ParallelIndexSet = Dune::OwnerOverlapCopyCommunication<int, int>::ParallelIndexSet;
49 using RemoteIndices = Dune::OwnerOverlapCopyCommunication<int, int>::RemoteIndices;
72 std::shared_ptr<ParallelIndexSet>
indexSet()
const
99 void copyOwnerToAll (
const T& source, T&
dest)
const;
133 template<
typename Container,
typename BinaryOperator,
typename T>
140 std::tuple<BinaryOperators...>&
operators,
141 std::tuple<ReturnValues...>& values)
const;
143 std::shared_ptr<ParallelIndexSet>
indexSet_;
156 template<
typename BinaryOperator>
161 typedef typename std::remove_cv<
162 typename std::remove_reference<typename BinaryOperator::result_type>::type
170 template<
class T,
class T1>
171 T operator()(
const T& t1,
const T& t2,
const T1& mask)
173 return b_(t1, maskValue(t2, mask));
175 template<
class T,
class T1>
176 T maskValue(
const T& t,
const T1& mask)
180 BinaryOperator& localOperator()
184 Result getInitialValue()
203 T operator()(
const T& t1,
const T& t2,
const T1& mask)
205 T masked = maskValue(t2, mask);
206 return t1 + masked * masked;
209 T maskValue(
const T& t,
const T1& mask)
213 std::plus<T> localOperator()
215 return std::plus<T>();
228 template<
typename BinaryOperator>
233 typedef typename std::remove_reference<
234 typename std::remove_const<typename BinaryOperator::result_type>::type
237 explicit MaskToMinOperator(BinaryOperator b)
246 template<
class T,
class T1>
247 T operator()(
const T& t1,
const T& t2,
const T1& mask)
249 return b_(t1, maskValue(t2, mask));
251 template<
class T,
class T1>
252 T maskValue(
const T& t,
const T1& mask)
260 return getInitialValue();
263 Result getInitialValue()
268 if( std::is_integral<Result>::value )
270 return std::numeric_limits<Result>::min();
274 return -std::numeric_limits<Result>::max();
281 BinaryOperator& localOperator()
292 template<
typename BinaryOperator>
297 typedef typename std::remove_cv<
298 typename std::remove_reference<typename BinaryOperator::result_type>::type
301 explicit MaskToMaxOperator(BinaryOperator b)
310 template<
class T,
class T1>
311 T operator()(
const T& t1,
const T& t2,
const T1& mask)
313 return b_(t1, maskValue(t2, mask));
315 template<
class T,
class T1>
316 T maskValue(
const T& t,
const T1& mask)
324 return std::numeric_limits<T>::max();
327 BinaryOperator& localOperator()
331 Result getInitialValue()
333 return std::numeric_limits<Result>::max();
355 using result_type = T;
356 const result_type& operator()(
const T& t1,
const T& t2)
358 return std::max(t1, t2);
367 template<
typename T,
typename Enable =
void>
370 using result_type = T;
371 result_type operator()(
const T& t1,
374 return std::max(std::abs(t1), std::abs(t2));
382 struct MaxAbsFunctor<T, typename std::enable_if<std::is_unsigned<T>::value>::type>
384 using result_type = T;
385 result_type operator()(
const T& t1,
388 return std::max(t1, t2);
411 using result_type = T;
412 const result_type& operator()(
const T& t1,
const T& t2)
414 return std::min(t1, t2);
441 ->
decltype(
container[0]*(*maskContainer)[0]);
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
auto accumulateMaskedValues(const T1 &container, const std::vector< double > *maskContainer) -> decltype(container[0] *(*maskContainer)[0])
Accumulates entries masked with 1.