faunus
Public Types | Public Member Functions | List of all members
Faunus::CellList::CellListBase< TContainer, TGrid > Class Template Reference

A basic class for a cell list allowing to keep members organized into a grid. More...

#include <celllistimpl.h>

Inheritance diagram for Faunus::CellList::CellListBase< TContainer, TGrid >:
Inheritance graph
[legend]
Collaboration diagram for Faunus::CellList::CellListBase< TContainer, TGrid >:
Collaboration graph
[legend]

Public Types

using AbstractCellList = AbstractImmutableCellList< ContainerTypeOf< TContainer >, GridTypeOf< TGrid > >
 
using Grid = TGrid
 
using Container = TContainer
 
using CellCoord = typename Grid::CoordOf< GridType >
 grid (cell) coordinates type
 
using CellIndex = typename Grid::IndexOf< GridType >
 grid (cell) index type
 
using GridType = TGridType
 abstract grid type
 
using Member = typename Container::MemberOf< ContainerType >
 member type
 
using Members = typename Container::MembersOf< ContainerType >
 members type
 
- Public Types inherited from Faunus::CellList::AbstractImmutableCellList< ContainerTypeOf< TContainer >, GridTypeOf< TGrid > >
using AbstractCellList = AbstractImmutableCellList< ContainerTypeOf< TContainer >, GridTypeOf< TGrid > >
 
using ContainerType = ContainerTypeOf< TContainer >
 abstract container types
 
using GridType = GridTypeOf< TGrid >
 abstract grid type
 
using Members = typename Container::MembersOf< ContainerType >
 members type
 
using Member = typename Container::MemberOf< ContainerType >
 member type
 
using CellIndex = typename Grid::IndexOf< GridType >
 grid (cell) index type
 
using CellCoord = typename Grid::CoordOf< GridType >
 grid (cell) coordinates type
 

Public Member Functions

const MembersgetMembers (const CellCoord &cell_coordinates) override
 < members type More...
 
const MembersgetNeighborMembers (const CellCoord &cell_coordinates, const CellCoord &cell_offset) override
 Get cell members at given offseted cell coordinates, or empty if offseted dcoordinates do not exist. More...
 
std::vector< CellCoordgetCells () const override
 
CellIndex gridSize () const override
 
const TGrid & getGrid ()
 Static cast itself to a grid. More...
 
 CellListBase (const TGrid &cell_grid)
 Construct an empty cell list from a grid. More...
 
 CellListBase (const typename TGrid::Point &box, const typename TGrid::SpaceAxis cell_dimension)
 Construct an empty cell list knowing a box dimension and minimal cell dimension. More...
 

Detailed Description

template<class TContainer, class TGrid>
class Faunus::CellList::CellListBase< TContainer, TGrid >

A basic class for a cell list allowing to keep members organized into a grid.

It provides the minimal functionality that should be extended by mixin and decorators as needed.

Template Parameters
TMember
TGrid

Constructor & Destructor Documentation

◆ CellListBase() [1/2]

template<class TContainer , class TGrid >
Faunus::CellList::CellListBase< TContainer, TGrid >::CellListBase ( const TGrid &  cell_grid)
inlineexplicit

Construct an empty cell list from a grid.

Parameters
cell_grid

◆ CellListBase() [2/2]

template<class TContainer , class TGrid >
Faunus::CellList::CellListBase< TContainer, TGrid >::CellListBase ( const typename TGrid::Point &  box,
const typename TGrid::SpaceAxis  cell_dimension 
)
inline

Construct an empty cell list knowing a box dimension and minimal cell dimension.

Parameters
boxspatial dimension of the box
cell_dimensionminimal length of the cell's edge

Member Function Documentation

◆ getCells()

template<class TContainer , class TGrid >
std::vector<CellCoord> Faunus::CellList::CellListBase< TContainer, TGrid >::getCells ( ) const
inlineoverridevirtual
Returns
range of containg coordinates of all possibly non-empty cells

Implements Faunus::CellList::AbstractImmutableCellList< ContainerTypeOf< TContainer >, GridTypeOf< TGrid > >.

◆ getGrid()

template<class TContainer , class TGrid >
const TGrid& Faunus::CellList::CellListBase< TContainer, TGrid >::getGrid ( )
inline

Static cast itself to a grid.

Useful to avoid using a copy constructor.

Returns
self statically cast as a grid`

◆ getMembers()

template<class TContainer , class TGrid >
const Members& Faunus::CellList::CellListBase< TContainer, TGrid >::getMembers ( const CellCoord cell_coordinates)
inlineoverridevirtual

< members type

Get cell members at given cell coordinates.

Parameters
cell_coordinates
Returns
vector of cell members

Implements Faunus::CellList::AbstractImmutableCellList< ContainerTypeOf< TContainer >, GridTypeOf< TGrid > >.

◆ getNeighborMembers()

template<class TContainer , class TGrid >
const Members& Faunus::CellList::CellListBase< TContainer, TGrid >::getNeighborMembers ( const CellCoord cell_coordinates,
const CellCoord cell_offset 
)
inlineoverridevirtual

Get cell members at given offseted cell coordinates, or empty if offseted dcoordinates do not exist.

Parameters
cell_coordinates
Returns
vector of cell members or empty vector if cell does not exist

Implements Faunus::CellList::AbstractImmutableCellList< ContainerTypeOf< TContainer >, GridTypeOf< TGrid > >.

◆ gridSize()

template<class TContainer , class TGrid >
CellIndex Faunus::CellList::CellListBase< TContainer, TGrid >::gridSize ( ) const
inlineoverridevirtual

The documentation for this class was generated from the following file: