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)
GhostComm::HaloPlan const * halo_plan () 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
GhostComm::HaloPlan m_halo_plan
 Topology-agnostic direct-neighbor halo plan (see make_halo_plan).

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 69 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 )

Member Function Documentation

◆ box()

BoxGeometry const & RegularDecomposition::box ( ) const
inlineoverridevirtual

Implements ParticleDecomposition.

Definition at line 128 of file RegularDecomposition.hpp.

References m_box.

◆ fully_connected_boundary()

auto RegularDecomposition::fully_connected_boundary ( ) const
inline

Definition at line 122 of file RegularDecomposition.hpp.

References m_fully_connected_boundary.

◆ get_ghost_cells()

auto const & RegularDecomposition::get_ghost_cells ( ) const
inline

Definition at line 108 of file RegularDecomposition.hpp.

References m_ghost_cells.

◆ get_local_cells()

auto const & RegularDecomposition::get_local_cells ( ) const
inline

Definition at line 107 of file RegularDecomposition.hpp.

References m_local_cells.

◆ ghost_cells()

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

Implements ParticleDecomposition.

Definition at line 104 of file RegularDecomposition.hpp.

References m_ghost_cells.

Referenced by RegularDecomposition().

◆ halo_plan()

GhostComm::HaloPlan const * RegularDecomposition::halo_plan ( ) const
inlineoverridevirtual

Implements ParticleDecomposition.

Definition at line 101 of file RegularDecomposition.hpp.

References m_halo_plan.

◆ local_cells()

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

Implements ParticleDecomposition.

Definition at line 103 of file RegularDecomposition.hpp.

References m_local_cells.

Referenced by RegularDecomposition(), and resort().

◆ max_cutoff()

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

Implements ParticleDecomposition.

Definition at line 362 of file RegularDecomposition.cpp.

References m_box, and m_local_box.

◆ max_range()

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

Implements ParticleDecomposition.

Definition at line 370 of file RegularDecomposition.cpp.

References cell_size.

◆ minimum_image_distance()

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

Implements ParticleDecomposition.

Definition at line 124 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 114 of file RegularDecomposition.hpp.

References Particle::pos().

◆ particle_to_cell() [2/2]

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

Implements ParticleDecomposition.

Definition at line 110 of file RegularDecomposition.hpp.

References Particle::pos().

Referenced by resort().

◆ resort()

Member Data Documentation

◆ cell_grid

Utils::Vector3i RegularDecomposition::cell_grid = {}

Grid dimensions per node.

Definition at line 71 of file RegularDecomposition.hpp.

Referenced by RegularDecomposition().

◆ cell_offset

Utils::Vector3i RegularDecomposition::cell_offset = {}

Offset in global grid.

Definition at line 75 of file RegularDecomposition.hpp.

◆ cell_size

Utils::Vector3d RegularDecomposition::cell_size = {}

Cell size.

Definition at line 73 of file RegularDecomposition.hpp.

Referenced by max_range().

◆ cells

std::vector<Cell> RegularDecomposition::cells

Definition at line 85 of file RegularDecomposition.hpp.

Referenced by RegularDecomposition().

◆ ghost_cell_grid

Utils::Vector3i RegularDecomposition::ghost_cell_grid = {}

linked cell grid with ghost frame.

Definition at line 77 of file RegularDecomposition.hpp.

Referenced by RegularDecomposition().

◆ inv_cell_size

Utils::Vector3d RegularDecomposition::inv_cell_size = {}

inverse cell_size.

Definition at line 79 of file RegularDecomposition.hpp.

◆ m_box

BoxGeometry const& RegularDecomposition::m_box

◆ m_comm

boost::mpi::communicator RegularDecomposition::m_comm

Definition at line 81 of file RegularDecomposition.hpp.

Referenced by RegularDecomposition(), and resort().

◆ m_fully_connected_boundary

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

Definition at line 84 of file RegularDecomposition.hpp.

Referenced by fully_connected_boundary(), and RegularDecomposition().

◆ m_ghost_cells

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

Definition at line 87 of file RegularDecomposition.hpp.

Referenced by get_ghost_cells(), and ghost_cells().

◆ m_halo_plan

GhostComm::HaloPlan RegularDecomposition::m_halo_plan

Topology-agnostic direct-neighbor halo plan (see make_halo_plan).

Holds ParticleList pointers into this decomposition's cells. Value-copying this object leaves these pointers dangling.

Todo
make non-copyable or rebuild-on-copy.

Definition at line 94 of file RegularDecomposition.hpp.

Referenced by halo_plan(), and RegularDecomposition().

◆ m_local_box

LocalBox RegularDecomposition::m_local_box

Definition at line 83 of file RegularDecomposition.hpp.

Referenced by max_cutoff(), and RegularDecomposition().

◆ m_local_cells

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

Definition at line 86 of file RegularDecomposition.hpp.

Referenced by get_local_cells(), and local_cells().


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