77#include " openpfc/core/world.hpp"
88#include < array>
99#include < heffte.h>
10- #include < mpi.h>
1110#include < ostream>
1211#include < stdexcept>
1312#include < vector>
1413
1514namespace pfc {
1615
1716/* *
18- * @brief Class representing the domain decomposition for parallel Fast Fourier
19- * Transform .
17+ * @brief Represents a partitioning of the global simulation domain into local
18+ * subdomains .
2019 *
21- * The Decomposition class defines the domain decomposition for parallel FFT. It
22- * splits the domain into multiple parts based on the number of processors and
23- * the grid setup. It provides information about the local domain and
24- * communication patterns.
20+ * The Decomposition class describes how the World is split among multiple
21+ * processes. Each instance provides access to the local subdomain owned by the
22+ * current process, including size, offset, and basic mappings between global
23+ * and local indices.
24+ *
25+ *
26+ * ## Responsibilities
27+ *
28+ * - Split the World into non-overlapping local boxes.
29+ * - Provide access to local box information.
30+ * - Support global-local coordinate mapping.
31+ *
32+ *
33+ * ## Design Justification
34+ *
35+ * - Keeps World (global domain) and local process view separate.
36+ * - Decouples decomposition logic from communication (MPI, FFT backends).
37+ * - Enables different decomposition strategies if needed (block, slab, pencil).
38+ *
39+ *
40+ * ## Relations to Other Components
41+ *
42+ * - Used by Fields and Arrays to allocate local data.
43+ * - Used by Communication components to know where data lives.
44+ * - Passed to FFT backends as a description of local domains.
2545 */
2646class Decomposition {
2747private:
@@ -33,20 +53,6 @@ class Decomposition {
3353 const std::array<int , 3 > proc_grid; // /< Processor grid dimensions.
3454 const std::vector<heffte::box3d<int >> real_boxes, complex_boxes; // /< Local domain boxes.
3555
36- /* *
37- * @brief Get the rank of the current MPI communicator.
38- * @param comm The MPI communicator.
39- * @return The rank of the current process.
40- */
41- int get_comm_rank (MPI_Comm comm);
42-
43- /* *
44- * @brief Get the size of the current MPI communicator.
45- * @param comm The MPI communicator.
46- * @return The size of the communicator (total number of processes).
47- */
48- int get_comm_size (MPI_Comm comm);
49-
5056public:
5157 const heffte::box3d<int > inbox, outbox; // /< Local communication boxes.
5258 const int r2c_direction = 0 ; // /< Real-to-complex symmetry direction.
@@ -64,15 +70,6 @@ class Decomposition {
6470 */
6571 Decomposition (const World &world, int rank, int num_domains);
6672
67- /* *
68- * @brief Construct a new Decomposition object using MPI communicator. In this
69- * case, the total number of domains equals the communicator size.
70- *
71- * @param world Reference to the World object.
72- * @param comm The MPI communicator (default: MPI_COMM_WORLD).
73- */
74- Decomposition (const World &world, MPI_Comm comm = MPI_COMM_WORLD);
75-
7673 /* *
7774 * @brief Get the size of the inbox.
7875 *
0 commit comments