 |
Version: SMASH-1.8
|
|
Go to the documentation of this file.
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>
94 double timestep_duration,
97 min_cell_length, timestep_duration, strategy} {}
112 Grid(
const std::pair<std::array<double, 3>, std::array<double, 3>>
114 const Particles &particles,
double min_cell_length,
115 double timestep_duration,
135 const std::function<
void(
const ParticleList &)> &search_cell_callback,
136 const std::function<
void(
const ParticleList &,
const ParticleList &)>
137 &neighbor_cell_callback)
const;
174 #endif // SRC_INCLUDE_GRID_H_
Look for optimal cell size.
GridOptions
Identifies the mode of the Grid.
CellSizeStrategy
Indentifies the strategy of determining the cell size.
std::array< int, 3 > number_of_cells_
The number of cells in x, y, and z direction.
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...
Abstracts a list of cells that partition the particles in the experiment into regions of space that c...
SizeType make_index(std::array< SizeType, 3 > idx) const
std::vector< ParticleList > cells_
The cell storage.
Make cells as large as possible.
const std::array< double, 3 > length_
The 3 lengths of the complete grid. Used for periodic boundary wrapping.
int SizeType
A type to store the sizes.
double cell_volume_
The volume of a single cell.
Base class for Grid to host common functions that do not depend on the GridOptions parameter.
Grid(const Particles &particles, double min_cell_length, double timestep_duration, CellSizeStrategy strategy=CellSizeStrategy::Optimal)
Constructs a grid from the given particle list particles.
With ghost cells for periodic boundaries.
double cell_volume() const
static std::pair< std::array< double, 3 >, std::array< double, 3 > > find_min_and_length(const Particles &particles)
SizeType make_index(SizeType x, SizeType y, SizeType z) const