23 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
25 : dLocalRegions_m(
"local regions (device)", 0)
26 , hLocalRegions_m(
Kokkos::create_mirror_view(dLocalRegions_m)) {
31 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
38 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
42 for (
unsigned int d = 0; d <
Dim; ++d) {
43 indexOffset_m[d] = fl.
getDomain()[d].first();
44 centerOffset_m[d] = 1;
47 region_m = convertNDIndex(fl.
getDomain(), mesh);
49 fillRegions(fl, mesh);
57 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
60 const Mesh& mesh)
const {
63 for (
unsigned int d = 0; d <
Dim; d++) {
65 int last = ni[d].
last() - indexOffset_m[d] + centerOffset_m[d];
67 lastPoint[d] =
Index(last, last);
74 for (
unsigned int d = 0; d <
Dim; d++) {
75 ndregion[d] =
PRegion<T>(firstCoord(d), lastCoord(d));
80 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
86 Kokkos::resize(hLocalRegions_m, ldomains.size());
87 Kokkos::resize(dLocalRegions_m, ldomains.size());
90 for (
size_type i = 0; i < ldomains.size(); ++i) {
91 hLocalRegions_m(i) = convertNDIndex(ldomains(i), mesh);
94 Kokkos::deep_copy(dLocalRegions_m, hLocalRegions_m);
97 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
99 if (
Comm->rank() > 0) {
103 out <<
"Total region = " << region_m <<
"\n"
104 <<
"Total number of subregions = " << hLocalRegions_m.size() <<
"\n";
107 for (
size_type i = 0; i < hLocalRegions_m.size(); ++i) {
108 out <<
" subregion " << i <<
" " << hLocalRegions_m(i) <<
"\n";
112 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
115 return dLocalRegions_m;
118 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
121 return hLocalRegions_m;
124 template <
typename T,
unsigned Dim,
class Mesh,
class... Properties>
typename ippl::detail::ViewType< ippl::Vector< double, Dim >, 1 >::view_type view_type
ippl::detail::size_type size_type
constexpr KOKKOS_INLINE_FUNCTION auto first()
Implementations for FFT constructor/destructor and transforms.
std::unique_ptr< mpi::Communicator > Comm
std::ostream & operator<<(std::ostream &, const BCondBase< Field > &)
typename view_type::host_mirror_type host_mirror_type
const host_mirror_type getHostLocalDomains() const
const NDIndex< Dim > & getDomain() const
KOKKOS_INLINE_FUNCTION Vector< int, Dim > last() const
KOKKOS_INLINE_FUNCTION Vector< int, Dim > first() const
virtual KOKKOS_INLINE_FUNCTION vector_type getVertexPosition(const NDIndex< Dim > &ndi) const =0
NDRegion_t convertNDIndex(const NDIndex< Dim > &, const Mesh &mesh) const
const view_type getdLocalRegions() const
void fillRegions(const FieldLayout< Dim > &, const Mesh &mesh)
void write(std::ostream &=std::cout) const
std::array< int, Dim > indexOffset_m
Offset from 'normal' Index space to 'Mesh' Index space.
std::array< bool, Dim > centerOffset_m
Offset needed between centering of Index space and Mesh points.
const host_mirror_type gethLocalRegions() const
void changeDomain(const FieldLayout< Dim > &, const Mesh &mesh)