27 template <
unsigned Dim>
43 template <
unsigned Dim>
45 const NDIndex<Dim>& subDomain, std::array<bool, Dim> isParallel,
bool isAllPeriodic)
57 template <
unsigned Dim>
59 std::array<bool, Dim> isParallel,
bool isAllPeriodic)
75 template <
unsigned Dim>
85 unsigned int nRanks = this->comm.size();
87 originDomain_m = domain;
89 this->gDomain_m = subDomain;
92 if (this->hLocalDomains_m(this->comm.rank()).intersect(subDomain).empty()) {
93 throw std::runtime_error(
"SubFieldLayout:initialize: given subdomain is not valid, rank"
94 + std::to_string(this->comm.rank()) +
" has an empty local domain, choose a sub-domain that has content on all ranks");
99 for (
unsigned int rank = 0; rank < nRanks; ++rank) {
100 if (!this->gDomain_m.contains(this->hLocalDomains_m(rank))) {
101 this->hLocalDomains_m(rank) = this->hLocalDomains_m(rank).intersect(this->gDomain_m);
105 this->findNeighbors();
107 Kokkos::deep_copy(this->dLocalDomains_m, this->hLocalDomains_m);
119 template <
unsigned Dim>
121 bool isAllPeriodic) {
125 originDomain_m = domain;
Implementations for FFT constructor/destructor and transforms.
std::array< bool, Dim > isParallel() const
void initialize(const NDIndex< Dim > &domain, std::array< bool, Dim > decomp, bool isAllPeriodic=false)
SubFieldLayout(const mpi::Communicator &=MPI_COMM_WORLD)
Default constructor, which should only be used if you are going to call 'initialize' soon after (befo...
void initialize(const NDIndex< Dim > &domain, const NDIndex< Dim > &subDomain, std::array< bool, Dim > decomp, bool isAllPeriodic=false)
Initializes a SubFieldLayout with the sub-domain partitioned in the same way as the original FieldLay...
KOKKOS_INLINE_FUNCTION bool contains(const NDIndex< Dim > &a) const