ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Regular decomposition cell system. More...
#include <RegularDecomposition.hpp>
Public Member Functions | |
RegularDecomposition (boost::mpi::communicator comm, double range, BoxGeometry const &box_geo, LocalBox const &local_geo, std::optional< std::pair< int, int > > fully_connected) | |
GhostCommunicator const & | exchange_ghosts_comm () const override |
GhostCommunicator const & | collect_ghost_force_comm () const override |
std::span< Cell *const > | local_cells () const override |
std::span< Cell *const > | ghost_cells () const override |
auto const & | get_local_cells () const |
auto const & | get_ghost_cells () const |
Cell * | particle_to_cell (Particle const &p) override |
Cell const * | particle_to_cell (Particle const &p) const override |
void | resort (bool global, std::vector< ParticleChange > &diff) override |
Utils::Vector3d | max_cutoff () const override |
Utils::Vector3d | max_range () const override |
auto | fully_connected_boundary () const |
std::optional< BoxGeometry > | minimum_image_distance () const override |
BoxGeometry const & | box () const override |
Public Member Functions inherited from ParticleDecomposition | |
virtual | ~ParticleDecomposition ()=default |
Public Attributes | |
Utils::Vector3i | cell_grid = {} |
Grid dimensions per node. | |
Utils::Vector3d | cell_size = {} |
Cell size. | |
Utils::Vector3i | cell_offset = {} |
Offset in global grid. | |
Utils::Vector3i | ghost_cell_grid = {} |
linked cell grid with ghost frame. | |
Utils::Vector3d | inv_cell_size = {} |
inverse cell_size. | |
boost::mpi::communicator | m_comm |
BoxGeometry const & | m_box |
LocalBox | m_local_box |
std::optional< std::pair< int, int > > | m_fully_connected_boundary = {} |
std::vector< Cell > | cells |
std::vector< Cell * > | m_local_cells |
std::vector< Cell * > | m_ghost_cells |
GhostCommunicator | m_exchange_ghosts_comm |
GhostCommunicator | m_collect_ghost_force_comm |
Regular decomposition cell system.
The domain of a node is split into a 3D cell grid with dimension cell_grid. Together with one ghost cell layer on each side the overall dimension of the ghost cell grid is ghost_cell_grid. The regular decomposition enables the use of the linked cell algorithm which is in turn used for setting up the Verlet list for the system. You can see a 2D graphical representation of the linked cell grid below.
2D representation of a linked cell grid: cell_grid = {4,4}, ghost_cell_grid = {6,6}
Each cell has \( 3^D \) neighbor cells. Since we deal with pair forces, it is sufficient to calculate only half of the interactions (Newton's law: action = reaction). We have chosen the upper half e.g. all neighbor cells with a higher linear index (for cell 14 they are marked in light blue). Caution: This implementation needs double sided ghost communication! For single sided ghost communication one would need some ghost-ghost cell interaction as well, which we do not need!
Definition at line 67 of file RegularDecomposition.hpp.
RegularDecomposition::RegularDecomposition | ( | boost::mpi::communicator | comm, |
double | range, | ||
BoxGeometry const & | box_geo, | ||
LocalBox const & | local_geo, | ||
std::optional< std::pair< int, int > > | fully_connected | ||
) |
Definition at line 670 of file RegularDecomposition.cpp.
References m_collect_ghost_force_comm, and m_exchange_ghosts_comm.
|
inlineoverridevirtual |
Implements ParticleDecomposition.
Definition at line 126 of file RegularDecomposition.hpp.
References m_box.
|
inlineoverridevirtual |
Implements ParticleDecomposition.
Definition at line 97 of file RegularDecomposition.hpp.
References m_collect_ghost_force_comm.
Referenced by HybridDecomposition::HybridDecomposition().
|
inlineoverridevirtual |
Implements ParticleDecomposition.
Definition at line 94 of file RegularDecomposition.hpp.
References m_exchange_ghosts_comm.
Referenced by HybridDecomposition::HybridDecomposition().
|
inline |
Definition at line 120 of file RegularDecomposition.hpp.
References m_fully_connected_boundary.
|
inline |
Definition at line 106 of file RegularDecomposition.hpp.
References m_ghost_cells.
Referenced by HybridDecomposition::HybridDecomposition().
|
inline |
Definition at line 105 of file RegularDecomposition.hpp.
References m_local_cells.
Referenced by HybridDecomposition::count_particles_in_regular(), HybridDecomposition::HybridDecomposition(), and HybridDecomposition::resort().
|
inlineoverridevirtual |
Implements ParticleDecomposition.
Definition at line 102 of file RegularDecomposition.hpp.
References m_ghost_cells.
|
inlineoverridevirtual |
Implements ParticleDecomposition.
Definition at line 101 of file RegularDecomposition.hpp.
References m_local_cells.
Referenced by HybridDecomposition::HybridDecomposition(), HybridDecomposition::resort(), and resort().
|
overridevirtual |
Implements ParticleDecomposition.
Definition at line 268 of file RegularDecomposition.cpp.
References BoxGeometry::length(), LocalBox::length(), m_box, and m_local_box.
|
overridevirtual |
Implements ParticleDecomposition.
Definition at line 276 of file RegularDecomposition.cpp.
References cell_size.
|
inlineoverridevirtual |
Implements ParticleDecomposition.
Definition at line 122 of file RegularDecomposition.hpp.
References m_box.
|
inlineoverridevirtual |
Implements ParticleDecomposition.
Definition at line 112 of file RegularDecomposition.hpp.
References Particle::pos().
Implements ParticleDecomposition.
Definition at line 108 of file RegularDecomposition.hpp.
References Particle::pos().
Referenced by HybridDecomposition::particle_to_cell(), HybridDecomposition::particle_to_cell(), and resort().
|
overridevirtual |
Implements ParticleDecomposition.
Definition at line 174 of file RegularDecomposition.cpp.
References Utils::Bag< T >::empty(), fold_and_reset(), RemovedParticle::id, Utils::Bag< T >::insert(), local_cells(), m_box, m_comm, particle_to_cell(), runtimeErrorMsg, and Utils::Bag< T >::size().
Referenced by HybridDecomposition::resort().
Utils::Vector3i RegularDecomposition::cell_grid = {} |
Grid dimensions per node.
Definition at line 69 of file RegularDecomposition.hpp.
Referenced by HybridDecomposition::get_cell_grid().
Utils::Vector3i RegularDecomposition::cell_offset = {} |
Offset in global grid.
Definition at line 73 of file RegularDecomposition.hpp.
Utils::Vector3d RegularDecomposition::cell_size = {} |
Cell size.
Definition at line 71 of file RegularDecomposition.hpp.
Referenced by HybridDecomposition::get_cell_size(), and max_range().
std::vector<Cell> RegularDecomposition::cells |
Definition at line 83 of file RegularDecomposition.hpp.
Utils::Vector3i RegularDecomposition::ghost_cell_grid = {} |
linked cell grid with ghost frame.
Definition at line 75 of file RegularDecomposition.hpp.
Utils::Vector3d RegularDecomposition::inv_cell_size = {} |
inverse cell_size.
Definition at line 77 of file RegularDecomposition.hpp.
BoxGeometry const& RegularDecomposition::m_box |
Definition at line 80 of file RegularDecomposition.hpp.
Referenced by box(), max_cutoff(), minimum_image_distance(), and resort().
GhostCommunicator RegularDecomposition::m_collect_ghost_force_comm |
Definition at line 87 of file RegularDecomposition.hpp.
Referenced by collect_ghost_force_comm(), and RegularDecomposition().
boost::mpi::communicator RegularDecomposition::m_comm |
Definition at line 79 of file RegularDecomposition.hpp.
Referenced by resort().
GhostCommunicator RegularDecomposition::m_exchange_ghosts_comm |
Definition at line 86 of file RegularDecomposition.hpp.
Referenced by exchange_ghosts_comm(), and RegularDecomposition().
std::optional<std::pair<int, int> > RegularDecomposition::m_fully_connected_boundary = {} |
Definition at line 82 of file RegularDecomposition.hpp.
Referenced by fully_connected_boundary().
std::vector<Cell *> RegularDecomposition::m_ghost_cells |
Definition at line 85 of file RegularDecomposition.hpp.
Referenced by get_ghost_cells(), and ghost_cells().
LocalBox RegularDecomposition::m_local_box |
Definition at line 81 of file RegularDecomposition.hpp.
Referenced by max_cutoff().
std::vector<Cell *> RegularDecomposition::m_local_cells |
Definition at line 84 of file RegularDecomposition.hpp.
Referenced by get_local_cells(), and local_cells().