10 #ifndef SRC_INCLUDE_GRID_H_ 11 #define SRC_INCLUDE_GRID_H_ 62 static std::pair<std::array<double, 3>, std::array<double, 3>>
78 template <Gr
idOptions Options = Gr
idOptions::Normal>
93 min_cell_length, strategy} {}
106 Grid(
const std::pair<std::array<double, 3>, std::array<double, 3>>
108 const Particles &particles,
double min_cell_length,
128 const std::function<
void(
const ParticleList &)> &search_cell_callback,
129 const std::function<
void(
const ParticleList &,
const ParticleList &)>
130 &neighbor_cell_callback)
const;
159 #endif // SRC_INCLUDE_GRID_H_ With ghost cells for periodic boundaries.
Look for optimal cell size.
std::vector< ParticleList > cells_
The cell storage.
SizeType make_index(std::array< SizeType, 3 > idx) const
void iterate_cells(const std::function< void(const ParticleList &)> &search_cell_callback, const std::function< void(const ParticleList &, const ParticleList &)> &neighbor_cell_callback) const
Iterates over all cells in the grid and calls the callback arguments with a search cell and 0 to 13 n...
std::array< int, 3 > number_of_cells_
The number of cells in x, y, and z direction.
int SizeType
A type to store the sizes.
static std::pair< std::array< double, 3 >, std::array< double, 3 > > find_min_and_length(const Particles &particles)
CellSizeStrategy
Indentifies the strategy of determining the cell size.
Base class for Grid to host common functions that do not depend on the GridOptions parameter...
The Particles class abstracts the storage and manipulation of particles.
Grid(const Particles &particles, double min_cell_length, CellSizeStrategy strategy=CellSizeStrategy::Optimal)
Constructs a grid from the given particle list particles.
Abstracts a list of cells that partition the particles in the experiment into regions of space that c...
Make cells as large as possible.
SizeType make_index(SizeType x, SizeType y, SizeType z) const
const std::array< double, 3 > length_
The 3 lengths of the complete grid. Used for periodic boundary wrapping.
GridOptions
Identifies the mode of the Grid.