54 boost::mpi::communicator m_comm;
55 std::vector<Cell> cells;
57 std::vector<Cell *> m_local_cells;
58 std::vector<Cell *> m_ghost_cells;
69 void resort(
bool global_flag, std::vector<ParticleChange> &diff)
override;
72 return m_exchange_ghosts_comm;
75 return m_collect_ghost_force_comm;
78 std::span<Cell *const>
local_cells()
const override {
return m_local_cells; }
79 std::span<Cell *const>
ghost_cells()
const override {
return m_ghost_cells; }
94 return id_to_cell(p.
id());
97 return id_to_cell(p.
id());
117 Cell *id_to_cell(
int id) {
118 return has_id(
id) ? std::addressof(local()) : nullptr;
121 Cell const *id_to_cell(
int id)
const {
122 return has_id(
id) ? std::addressof(local()) : nullptr;
128 Cell &local() {
return cells.at(
static_cast<unsigned int>(m_comm.rank())); }
129 Cell const &local()
const {
130 return cells.at(
static_cast<unsigned int>(m_comm.rank()));
133 void configure_neighbors();
139 void configure_comms();
149 int id_to_rank(
int id)
const {
return id % m_comm.size(); }
154 bool has_id(
int id)
const {
return id_to_rank(
id) == m_comm.rank(); }
A distributed particle decomposition.
Struct holding all information for one particle.