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

This file contains functions for the cell system. More...

#include "cells.hpp"
#include "cell_system/Cell.hpp"
#include "cell_system/CellStructure.hpp"
#include "cell_system/CellStructureType.hpp"
#include "cell_system/HybridDecomposition.hpp"
#include "Particle.hpp"
#include "communication.hpp"
#include "errorhandling.hpp"
#include "particle_node.hpp"
#include "system/System.hpp"
#include <utils/Vector.hpp>
#include <utils/math/sqr.hpp>
#include <boost/serialization/set.hpp>
#include <algorithm>
#include <functional>
#include <optional>
#include <stdexcept>
#include <utility>
#include <vector>
+ Include dependency graph for cells.cpp:

Go to the source code of this file.

Functions

template<class Filter >
static auto get_pairs_filtered (System::System const &system, double const distance, Filter filter)
 Get pairs of particles that are closer than a distance and fulfill a filter criterion.
 
std::optional< std::vector< int > > get_short_range_neighbors (System::System const &system, int const pid, double const distance)
 Get ids of particles that are within a certain distance of another particle.
 
static auto get_interacting_neighbors (System::System const &system, Particle const &p)
 Get pointers to all interacting neighbors of a central particle.
 
std::vector< std::pair< int, int > > get_pairs (System::System const &system, double const distance)
 Get pairs closer than distance from the cells.
 
std::vector< std::pair< int, int > > get_pairs_of_types (System::System const &system, double const distance, std::vector< int > const &types)
 Get pairs closer than distance if both their types are in types.
 
std::vector< PairInfonon_bonded_loop_trace (System::System const &system, int const rank)
 Returns pairs of particle ids, positions and distance as seen by the non-bonded loop.
 
std::vector< NeighborPIDsget_neighbor_pids (System::System const &system)
 Returns pairs of particle ids and neighbor particle id lists.
 

Detailed Description

This file contains functions for the cell system.

Implementation of cells.hpp.

Definition in file cells.cpp.

Function Documentation

◆ get_interacting_neighbors()

static auto get_interacting_neighbors ( System::System const &  system,
Particle const &  p 
)
static

Get pointers to all interacting neighbors of a central particle.

Definition at line 142 of file cells.cpp.

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

Referenced by get_neighbor_pids().

◆ 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_filtered()

template<class Filter >
static auto get_pairs_filtered ( System::System const &  system,
double const  distance,
Filter  filter 
)
static

Get pairs of particles that are closer than a distance and fulfill a filter criterion.

It uses link_cell to get pairs out of the cellsystem by a simple distance criterion and applies the filter on both particles.

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

Definition at line 63 of file cells.cpp.

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

Referenced by get_pairs(), and get_pairs_of_types().

◆ 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()

std::optional< std::vector< int > > get_short_range_neighbors ( System::System const &  system,
int const  pid,
double const  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 const  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.