ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
RegularDecomposition Struct Reference

Regular decomposition cell system. More...

#include <RegularDecomposition.hpp>

+ Inheritance diagram for RegularDecomposition:
+ Collaboration diagram for RegularDecomposition:

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
 
Cellparticle_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< BoxGeometryminimum_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< Cellcells
 
std::vector< Cell * > m_local_cells
 
std::vector< Cell * > m_ghost_cells
 
GhostCommunicator m_exchange_ghosts_comm
 
GhostCommunicator m_collect_ghost_force_comm
 

Detailed Description

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.

Linked cells structure

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.

Constructor & Destructor Documentation

◆ RegularDecomposition()

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.

Member Function Documentation

◆ box()

BoxGeometry const & RegularDecomposition::box ( ) const
inlineoverridevirtual

Implements ParticleDecomposition.

Definition at line 126 of file RegularDecomposition.hpp.

References m_box.

◆ collect_ghost_force_comm()

GhostCommunicator const & RegularDecomposition::collect_ghost_force_comm ( ) const
inlineoverridevirtual

◆ exchange_ghosts_comm()

GhostCommunicator const & RegularDecomposition::exchange_ghosts_comm ( ) const
inlineoverridevirtual

◆ fully_connected_boundary()

auto RegularDecomposition::fully_connected_boundary ( ) const
inline

Definition at line 120 of file RegularDecomposition.hpp.

References m_fully_connected_boundary.

◆ get_ghost_cells()

auto const & RegularDecomposition::get_ghost_cells ( ) const
inline

Definition at line 106 of file RegularDecomposition.hpp.

References m_ghost_cells.

Referenced by HybridDecomposition::HybridDecomposition().

◆ get_local_cells()

auto const & RegularDecomposition::get_local_cells ( ) const
inline

◆ ghost_cells()

std::span< Cell *const > RegularDecomposition::ghost_cells ( ) const
inlineoverridevirtual

Implements ParticleDecomposition.

Definition at line 102 of file RegularDecomposition.hpp.

References m_ghost_cells.

◆ local_cells()

std::span< Cell *const > RegularDecomposition::local_cells ( ) const
inlineoverridevirtual

◆ max_cutoff()

Utils::Vector3d RegularDecomposition::max_cutoff ( ) const
overridevirtual

◆ max_range()

Utils::Vector3d RegularDecomposition::max_range ( ) const
overridevirtual

Implements ParticleDecomposition.

Definition at line 276 of file RegularDecomposition.cpp.

References cell_size.

◆ minimum_image_distance()

std::optional< BoxGeometry > RegularDecomposition::minimum_image_distance ( ) const
inlineoverridevirtual

Implements ParticleDecomposition.

Definition at line 122 of file RegularDecomposition.hpp.

References m_box.

◆ particle_to_cell() [1/2]

Cell const * RegularDecomposition::particle_to_cell ( Particle const &  p) const
inlineoverridevirtual

Implements ParticleDecomposition.

Definition at line 112 of file RegularDecomposition.hpp.

References Particle::pos().

◆ particle_to_cell() [2/2]

Cell * RegularDecomposition::particle_to_cell ( Particle const &  p)
inlineoverridevirtual

◆ resort()

void RegularDecomposition::resort ( bool  global,
std::vector< ParticleChange > &  diff 
)
overridevirtual

Member Data Documentation

◆ cell_grid

Utils::Vector3i RegularDecomposition::cell_grid = {}

Grid dimensions per node.

Definition at line 69 of file RegularDecomposition.hpp.

Referenced by HybridDecomposition::get_cell_grid().

◆ cell_offset

Utils::Vector3i RegularDecomposition::cell_offset = {}

Offset in global grid.

Definition at line 73 of file RegularDecomposition.hpp.

◆ cell_size

Utils::Vector3d RegularDecomposition::cell_size = {}

Cell size.

Definition at line 71 of file RegularDecomposition.hpp.

Referenced by HybridDecomposition::get_cell_size(), and max_range().

◆ cells

std::vector<Cell> RegularDecomposition::cells

Definition at line 83 of file RegularDecomposition.hpp.

◆ ghost_cell_grid

Utils::Vector3i RegularDecomposition::ghost_cell_grid = {}

linked cell grid with ghost frame.

Definition at line 75 of file RegularDecomposition.hpp.

◆ inv_cell_size

Utils::Vector3d RegularDecomposition::inv_cell_size = {}

inverse cell_size.

Definition at line 77 of file RegularDecomposition.hpp.

◆ m_box

BoxGeometry const& RegularDecomposition::m_box

Definition at line 80 of file RegularDecomposition.hpp.

Referenced by box(), max_cutoff(), minimum_image_distance(), and resort().

◆ m_collect_ghost_force_comm

GhostCommunicator RegularDecomposition::m_collect_ghost_force_comm

Definition at line 87 of file RegularDecomposition.hpp.

Referenced by collect_ghost_force_comm(), and RegularDecomposition().

◆ m_comm

boost::mpi::communicator RegularDecomposition::m_comm

Definition at line 79 of file RegularDecomposition.hpp.

Referenced by resort().

◆ m_exchange_ghosts_comm

GhostCommunicator RegularDecomposition::m_exchange_ghosts_comm

Definition at line 86 of file RegularDecomposition.hpp.

Referenced by exchange_ghosts_comm(), and RegularDecomposition().

◆ m_fully_connected_boundary

std::optional<std::pair<int, int> > RegularDecomposition::m_fully_connected_boundary = {}

Definition at line 82 of file RegularDecomposition.hpp.

Referenced by fully_connected_boundary().

◆ m_ghost_cells

std::vector<Cell *> RegularDecomposition::m_ghost_cells

Definition at line 85 of file RegularDecomposition.hpp.

Referenced by get_ghost_cells(), and ghost_cells().

◆ m_local_box

LocalBox RegularDecomposition::m_local_box

Definition at line 81 of file RegularDecomposition.hpp.

Referenced by max_cutoff().

◆ m_local_cells

std::vector<Cell *> RegularDecomposition::m_local_cells

Definition at line 84 of file RegularDecomposition.hpp.

Referenced by get_local_cells(), and local_cells().


The documentation for this struct was generated from the following files: