36#include <boost/mpi/communicator.hpp>
56 boost::mpi::communicator m_comm;
58 double m_cutoff_regular;
59 std::vector<Cell *> m_local_cells;
60 std::vector<Cell *> m_ghost_cells;
75 std::set<int>
const m_n_square_types;
77 std::function<bool()> m_get_global_ghost_flags;
79 bool is_n_square_type(
int type_id)
const {
80 return m_n_square_types.contains(type_id);
85 double skin, std::function<
bool()> get_ghost_flags,
87 std::set<int> n_square_types);
89 auto get_cell_grid()
const {
return m_regular_decomposition.cell_grid; }
91 auto get_cell_size()
const {
return m_regular_decomposition.cell_size; }
95 void resort(
bool global, std::vector<ParticleChange> &diff)
override;
101 std::span<Cell *const>
local_cells()
const override {
return m_local_cells; }
102 std::span<Cell *const>
ghost_cells()
const override {
return m_ghost_cells; }
105 if (is_n_square_type(p.
type())) {
106 return m_n_square.particle_to_cell(p);
108 return m_regular_decomposition.particle_to_cell(p);
112 if (is_n_square_type(p.
type())) {
113 return m_n_square.particle_to_cell(p);
115 return m_regular_decomposition.particle_to_cell(p);
119 return m_n_square.max_cutoff();
132 return count_particles(m_regular_decomposition.get_local_cells());
137 return count_particles(m_n_square.get_local_cells());
147 std::size_t count_particles(std::vector<Cell *>
const &
local_cells)
const;
Vector implementation and trait types for boost qvm interoperability.
Atom decomposition cell system.
std::span< Cell *const > local_cells() const override
std::size_t count_particles_in_regular() const
Count particles in child regular decompositions.
GhostComm::HaloPlan const * halo_plan() const override
Utils::Vector3d max_range() const override
auto get_cutoff_regular() const
std::size_t count_particles_in_n_square() const
Count particles in child N-square decompositions.
Cell * particle_to_cell(Particle const &p) override
auto get_cell_grid() const
Cell const * particle_to_cell(Particle const &p) const override
void resort(bool global, std::vector< ParticleChange > &diff) override
BoxGeometry const & box() const override
auto get_n_square_types() const
HybridDecomposition(boost::mpi::communicator comm, double cutoff_regular, double skin, std::function< bool()> get_ghost_flags, BoxGeometry const &box_geo, LocalBox const &local_box, std::set< int > n_square_types)
auto get_cell_size() const
Utils::Vector3d max_cutoff() const override
std::optional< BoxGeometry > minimum_image_distance() const override
std::span< Cell *const > ghost_cells() const override
A distributed particle decomposition.
Struct holding all information for one particle.
constexpr auto const & type() const
Regular decomposition cell system.