NetDEM v1.0
Loading...
Searching...
No Matches
cell_manager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "cell.hpp"
4
5namespace netdem {
6
17private:
19 Vec3d bound_min{-0.5, -0.5, -0.5};
20
22 Vec3d bound_max{0.5, 0.5, 0.5};
23
25 Vec3d spacing{1.0, 1.0, 1.0};
26
29 Vec3i cell_size{3, 3, 3};
30
33 VecXT<VecXT<VecXT<Cell>>> cell_list;
34
35public:
40
44 std::tuple<Vec3d, Vec3d> GetBound() const;
45
49 Vec3d const &GetSpacing() const;
50
54 Vec3i const &GetCellSizes() const;
55
60
61 Cell *const GetCell(int i, int j, int k);
62
66 void Init();
67
77 void SetBound(double bmin_x, double bmin_y, double bmin_z, double bmax_x,
78 double bmax_y, double bmax_z);
79
86 void SetSpacing(double s_x, double s_y, double s_z);
87
95 std::tuple<Vec3i, Vec3i> GetOverlappedCells(Vec3d const &bmin,
96 Vec3d const &bmax);
97
104
110};
111
112} // namespace netdem
A class representing a cell in a simulation grid.
Definition cell.hpp:19
A class responsible for managing cells in a simulation grid.
Definition cell_manager.hpp:16
STLModel GetSTLModel()
Generate an STL model for visualization purposes.
Definition cell_manager.cpp:143
Vec3i GetOverlappedCell(Vec3d const &pos)
Determine which cell a given point is in.
Definition cell_manager.cpp:125
Cell *const GetCell(int i, int j, int k)
Definition cell_manager.cpp:23
CellManager()
Default constructor for the CellManager class.
Definition cell_manager.cpp:9
VecXT< VecXT< VecXT< Cell > > > const & GetCellList()
Get the bounds of the simulation.
Definition cell_manager.cpp:19
void Init()
Initialize the simulation grid by populating it with cells.
Definition cell_manager.cpp:27
Vec3i const & GetCellSizes() const
Get the sizes of the cells in each dimension.
Definition cell_manager.cpp:17
std::tuple< Vec3d, Vec3d > GetBound() const
Get the bounds of the simulation.
Definition cell_manager.cpp:11
void SetSpacing(double s_x, double s_y, double s_z)
Set the spacing between adjacent cells in the simulation grid.
Definition cell_manager.cpp:94
std::tuple< Vec3i, Vec3i > GetOverlappedCells(Vec3d const &bmin, Vec3d const &bmax)
Determine which cells overlap with a given bounding box.
Definition cell_manager.cpp:102
void SetBound(double bmin_x, double bmin_y, double bmin_z, double bmax_x, double bmax_y, double bmax_z)
Set the bounds of the simulation.
Definition cell_manager.cpp:81
Vec3d const & GetSpacing() const
Get the spacing of the cells.
Definition cell_manager.cpp:15
Class for working with STL models.
Definition stl_model.hpp:17
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
pos
Definition json_serilization.hpp:19
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18
std::array< int, 3 > Vec3i
Definition utils_macros.hpp:14