21 template <
typename T>
using GridTypeOf =
typename T::GridType;
22 template <
typename T>
using IndexOf =
typename T::CellIndex;
23 template <
typename T>
using CoordOf =
typename T::CellCoord;
24 template <
typename T>
using SpaceAxisOf =
typename T::SpaceAxis;
25 template <
typename T>
using PointOf =
typename T::Point;
34 template <
unsigned int VDimension, std::integral TCellIndex = int,
35 std::floating_point TSpaceAxis =
double>
43 using Point = Eigen::Array<SpaceAxis, Dimension, 1>;
44 using CellCoord = Eigen::Array<CellIndex, Dimension, 1>;
56 using CellCoord = CoordOf<Grid3DType>;
57 using CellIndex = IndexOf<Grid3DType>;
59 const std::vector<CellCoord>
self{{0, 0, 0}};
71 void initForwardNeighbors();
79 template <
typename T>
using ContainerTypeOf =
typename T::ContainerType;
80 template <
typename T>
using IndexOf =
typename ContainerTypeOf<T>::Index;
81 template <
typename T>
using MemberOf =
typename ContainerTypeOf<T>::Member;
82 template <
typename T>
using MembersOf =
typename ContainerTypeOf<T>::Members;
101 virtual const Members&
get(TIndex)
const = 0;
103 virtual Members&
get(TIndex) = 0;
105 virtual const Members& getEmpty()
const = 0;
108 virtual std::vector<TIndex> indices()
const = 0;
116 template <
typename T>
using ContainerOf =
typename T::Container;
117 template <
typename T>
using GridOf =
typename T::Grid;
118 using Container::ContainerTypeOf;
119 using Grid::GridTypeOf;
120 template <
typename T>
121 using IndexOf =
typename Grid::IndexOf<GridTypeOf<typename T::AbstractCellList>>;
122 template <
typename T>
123 using CoordOf =
typename Grid::CoordOf<GridTypeOf<typename T::AbstractCellList>>;
124 template <
typename T>
125 using PointOf =
typename Grid::PointOf<GridTypeOf<typename T::AbstractCellList>>;
126 template <
typename T>
127 using SpaceAxisOf =
typename Grid::SpaceAxisOf<GridTypeOf<typename T::AbstractCellList>>;
128 template <
typename T>
using MemberOf =
typename Container::MemberOf<typename T::AbstractCellList>;
129 template <
typename T>
using MembersOf =
typename Container::MembersOf<typename T::AbstractCellList>;
142 using Members =
typename Container::MembersOf<ContainerType>;
143 using Member =
typename Container::MemberOf<ContainerType>;
155 virtual std::vector<CellCoord> getCells()
const = 0;
167 template <
class TContainerType,
class TGr
idType>
static constexpr unsigned int Dimension
number of dimmensions, e.g., 3 for the real 3D world
Definition: celllist.h:38
ContainerTypeOf< TContainer > ContainerType
abstract container types
Definition: celllist.h:140
Cell list class templates implementation.
TIndex Index
the cell index (key) type
Definition: celllist.h:96
An interface of a container.
Definition: celllist.h:93
Containers store members in individual cells with a common minimalistic interface.
A simple data holder for common offsets in 3D grids, e.g., nearest neighbors or forward neighbors...
Definition: celllist.h:54
Eigen::Array< SpaceAxis, Dimension, 1 > Point
a point in the VDimensional space
Definition: celllist.h:43
TCellIndex CellIndex
a single coordinate in cell space, e.g., int; also an absolute cell index
Definition: celllist.h:42
TSpaceAxis SpaceAxis
a single coordinate in physical space, e.g., double
Definition: celllist.h:40
std::vector< CellCoord > neighbors
all neighbors (excluding self); (1 + 2×distance)³ - 1
Definition: celllist.h:60
typename Container::MemberOf< ContainerType > Member
member type
Definition: celllist.h:143
std::vector< CellCoord > forward_neighbors
only the preceding half of all neighbors
Definition: celllist.h:61
Cell list class templates.
Definition: actions.cpp:11
GridTypeOf< TGrid > GridType
abstract grid type
Definition: celllist.h:141
typename Container::MembersOf< ContainerType > Members
members type
Definition: celllist.h:142
typename Grid::CoordOf< GridType > CellCoord
grid (cell) coordinates type
Definition: celllist.h:145
TMember Member
the cell member (primitive value) type
Definition: celllist.h:97
std::vector< Member > Members
the cell members type
Definition: celllist.h:98
Eigen::Array< CellIndex, Dimension, 1 > CellCoord
VDimensional cell coordinates.
Definition: celllist.h:44
typename Grid::IndexOf< GridType > CellIndex
grid (cell) index type
Definition: celllist.h:144
CellIndex distance
maximal distance of neighbours (1 for the nearest neighbors)
Definition: celllist.h:62
An interface of a immutable cell list.
Definition: celllist.h:137
A cell grid type declarations.
Definition: celllist.h:36
An interface to a cell list that can return cell's members in sorted order.
Definition: celllist.h:168