ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
cells.hpp File Reference

This file contains everything related to the global cell structure / cell system. More...

#include "cell_system/Cell.hpp"
#include "cell_system/CellStructure.hpp"
#include "cell_system/CellStructureType.hpp"
#include "BoxGeometry.hpp"
#include "Particle.hpp"
#include "system/System.hpp"
#include <utils/Vector.hpp>
#include <boost/optional.hpp>
#include <utility>
#include <vector>
+ Include dependency graph for cells.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NeighborPIDs
 
class  PairInfo
 

Namespaces

namespace  boost
 
namespace  boost::serialization
 

Functions

std::vector< std::pair< int, int > > get_pairs (System::System const &system, double distance)
 Get pairs closer than distance from the cells.
 
std::vector< std::pair< int, int > > get_pairs_of_types (System::System const &system, double distance, std::vector< int > const &types)
 Get pairs closer than distance if both their types are in types.
 
boost::optional< std::vector< int > > get_short_range_neighbors (System::System const &system, int pid, double distance)
 Get ids of particles that are within a certain distance of another particle.
 
template<class Archive >
void boost::serialization::serialize (Archive &ar, NeighborPIDs &n, unsigned int const)
 
std::vector< NeighborPIDsget_neighbor_pids (System::System const &system)
 Returns pairs of particle ids and neighbor particle id lists.
 
template<class Archive >
void boost::serialization::serialize (Archive &ar, PairInfo &p, unsigned int const)
 
std::vector< PairInfonon_bonded_loop_trace (System::System const &system, int rank)
 Returns pairs of particle ids, positions and distance as seen by the non-bonded loop.
 

Detailed Description

This file contains everything related to the global cell structure / cell system.

The cell system (CellStructure) describes how particles are distributed on the cells and how particles of different cells (regardless if they reside on the same or different nodes) interact with each other. The following cell systems are implemented:

  • regular decomposition: The simulation box is divided spatially into cells (see RegularDecomposition.hpp). This is suitable for short-range interactions.
  • N-square: The particles are distributed equally on all nodes regardless their spatial position (see AtomDecomposition.hpp). This is suitable for long-range interactions that cannot be treated by a special method like P3M.
  • hybrid decomposition: Initializes both regular decomposition and N-square at the same time and is given a set of particle types n_square_types (see HybridDecomposition.hpp). By default, particles will be distributed using the regular decomposition. For particles of the types defined as n_square_types the N-square method is used. This is suitable for systems containing lots of small particles with short-range interactions mixed with a few large particles with long-range interactions. There, the large particles should be treated using N-square.

Definition in file cells.hpp.

Function Documentation

◆ get_neighbor_pids()

std::vector< NeighborPIDs > get_neighbor_pids ( System::System const &  system)

Returns pairs of particle ids and neighbor particle id lists.

Definition at line 189 of file cells.cpp.

References System::System::cell_structure, get_interacting_neighbors(), and Particle::id().

Referenced by ScriptInterface::Analysis::Analysis::do_call_method().

◆ get_pairs()

std::vector< std::pair< int, int > > get_pairs ( System::System const &  system,
double  distance 
)

Get pairs closer than distance from the cells.

Pairs are sorted so that first.id < second.id

Definition at line 159 of file cells.cpp.

References get_pairs_filtered().

Referenced by ScriptInterface::CellSystem::CellSystem::do_call_method().

◆ get_pairs_of_types()

std::vector< std::pair< int, int > > get_pairs_of_types ( System::System const &  system,
double  distance,
std::vector< int > const &  types 
)

Get pairs closer than distance if both their types are in types.

Pairs are sorted so that first.id < second.id

Definition at line 167 of file cells.cpp.

References get_pairs_filtered().

Referenced by ScriptInterface::CellSystem::CellSystem::do_call_method().

◆ get_short_range_neighbors()

boost::optional< std::vector< int > > get_short_range_neighbors ( System::System const &  system,
int  pid,
double  distance 
)

Get ids of particles that are within a certain distance of another particle.

Definition at line 119 of file cells.cpp.

References System::System::cell_structure, and Utils::sqr().

◆ non_bonded_loop_trace()

std::vector< PairInfo > non_bonded_loop_trace ( System::System const &  system,
int  rank 
)

Returns pairs of particle ids, positions and distance as seen by the non-bonded loop.

Definition at line 177 of file cells.cpp.

References System::System::cell_structure.