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;
98 return id_to_cell(p.
id());
101 return id_to_cell(p.
id());
121 Cell *id_to_cell(
int id) {
122 return has_id(
id) ? std::addressof(local()) : nullptr;
125 Cell const *id_to_cell(
int id)
const {
126 return has_id(
id) ? std::addressof(local()) : nullptr;
132 Cell &local() {
return cells.at(
static_cast<unsigned int>(m_comm.rank())); }
133 Cell const &local()
const {
134 return cells.at(
static_cast<unsigned int>(m_comm.rank()));
137 void configure_neighbors();
143 void configure_comms();
153 int id_to_rank(
int id)
const {
return id % m_comm.size(); }
158 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.