IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
NDRegion.h
Go to the documentation of this file.
1//
2// Class NDRegion
3// NDRegion is a simple container of N PRegion objects. It is templated
4// on the type of data (T) and the number of PRegions (Dim).
5//
6#ifndef IPPL_NDREGION_H
7#define IPPL_NDREGION_H
8
9#include <type_traits>
10
11#include "Region/PRegion.h"
12
13namespace ippl {
14 template <typename T, unsigned Dim>
20 class NDRegion {
21 public:
25 KOKKOS_FUNCTION
27
28 KOKKOS_FUNCTION
29 ~NDRegion() {}
30
38 template <class... Args,
39 typename std::enable_if<sizeof...(Args) == Dim
40 && (std::is_convertible_v<Args, PRegion<T>> && ...),
41 bool>::type = true>
42 KOKKOS_FUNCTION NDRegion(const Args&... args);
43
44 KOKKOS_INLINE_FUNCTION NDRegion(const NDRegion<T, Dim>& nr);
45
46 KOKKOS_INLINE_FUNCTION NDRegion<T, Dim>& operator=(const NDRegion<T, Dim>& nr);
47
48 KOKKOS_INLINE_FUNCTION const PRegion<T>& operator[](unsigned d) const;
49
50 KOKKOS_INLINE_FUNCTION PRegion<T>& operator[](unsigned d);
51
52 KOKKOS_INLINE_FUNCTION NDRegion<T, Dim>& operator+=(const T t);
53
54 KOKKOS_INLINE_FUNCTION NDRegion<T, Dim>& operator-=(const T t);
55
56 KOKKOS_INLINE_FUNCTION NDRegion<T, Dim>& operator*=(const T t);
57
58 KOKKOS_INLINE_FUNCTION NDRegion<T, Dim>& operator/=(const T t);
59
60 KOKKOS_INLINE_FUNCTION bool empty() const;
61
62 private:
64 PRegion<T> regions_m[Dim];
65 };
66} // namespace ippl
67
68#include "Region/NDRegion.hpp"
69
70#endif
Definition NDRegion.h:20
KOKKOS_FUNCTION NDRegion()
Definition NDRegion.h:26
Definition Archive.h:20