10 #ifndef SRC_INCLUDE_GRID_H_ 11 #define SRC_INCLUDE_GRID_H_ 62 static std::pair<std::array<double, 3>, std::array<double, 3>>
63 find_min_and_length(
const Particles &particles);
78 template <Gr
idOptions Options = Gr
idOptions::Normal>
94 double timestep_duration,
96 :
Grid{find_min_and_length(particles), std::move(particles),
97 min_cell_length, timestep_duration, strategy} {}
111 Grid(
const std::pair<std::array<double, 3>, std::array<double, 3>>
113 const Particles &particles,
double min_cell_length,
114 double timestep_duration,
134 const std::function<
void(
const ParticleList &)> &search_cell_callback,
135 const std::function<
void(
const ParticleList &,
const ParticleList &)>
136 &neighbor_cell_callback)
const;
150 return make_index(idx[0], idx[1], idx[2]);
165 #endif // SRC_INCLUDE_GRID_H_ With ghost cells for periodic boundaries.
Look for optimal cell size.
std::vector< ParticleList > cells_
The cell storage.
Grid(const Particles &particles, double min_cell_length, double timestep_duration, CellSizeStrategy strategy=CellSizeStrategy::Optimal)
Constructs a grid from the given particle list particles.
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.
SizeType make_index(std::array< SizeType, 3 > idx) const
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.
Abstracts a list of cells that partition the particles in the experiment into regions of space that c...
Make cells as large as possible.
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.