faunus
Public Types | Public Member Functions | Protected Member Functions | List of all members
Faunus::CellList::Grid::GridBase< TGridType > Class Template Reference

A cell grid core class assuming fixed boundary conditions. More...

#include <celllistimpl.h>

Inheritance diagram for Faunus::CellList::Grid::GridBase< TGridType >:
Inheritance graph
[legend]
Collaboration diagram for Faunus::CellList::Grid::GridBase< TGridType >:
Collaboration graph
[legend]

Public Types

using GridType = typename AbstractGrid< TGridType >::GridType
 
- Public Types inherited from Faunus::CellList::Grid::AbstractGrid< TGridType >
using GridType = TGridType
 

Public Member Functions

CellCoord coordinates (const CellIndex index) const override
 Compute the cell coordinates from the cell index. More...
 
CellIndex index (const CellCoord &coordinates) const override
 Compute the cell index from the cell coordinates. More...
 
CellCoord coordinatesAt (const Point &position) const override
 Compute cell coordinates from a spatial position. More...
 
CellIndex indexAt (const Point &position) const override
 Compute the cell index from the spatial position. More...
 
bool isCell (const CellCoord &coordinates) const override
 Verifies if coordinates are valid in the grid. More...
 
bool isCellAt (const Point &point) const override
 Verifies if spatial coordinates are in the box. More...
 
CellIndex size () const override
 
 GridBase (const Point &box, SpaceAxis minimal_cell_dimension)
 

Protected Member Functions

const CellCoord & getCellListEnd () const
 
const PointgetBox () const
 
const PointgetCell () const
 

Detailed Description

template<typename TGridType>
class Faunus::CellList::Grid::GridBase< TGridType >

A cell grid core class assuming fixed boundary conditions.

The grid converts spatial coordinates to cell coordinates and cell coordinates to the scalar cell index. The grid is designed for arbitrary number of dimensions.

Template Parameters
TGridTypea cell grid type declaration

Constructor & Destructor Documentation

◆ GridBase()

template<typename TGridType >
Faunus::CellList::Grid::GridBase< TGridType >::GridBase ( const Point box,
SpaceAxis  minimal_cell_dimension 
)
inline
Parameters
boxa box to be divided into cells, e.g., a simulation box
minimal_cell_dimensionminimal cell dimension, e.g., a cut off distance

Member Function Documentation

◆ coordinates()

template<typename TGridType >
CellCoord Faunus::CellList::Grid::GridBase< TGridType >::coordinates ( const CellIndex  index) const
inlineoverridevirtual

Compute the cell coordinates from the cell index.

⌊ (index mod cell_index_to_coordinates) / cell_coordinates_to_index ⌋

Parameters
index
Returns
cell coordinates

Implements Faunus::CellList::Grid::AbstractGrid< TGridType >.

Reimplemented in Faunus::CellList::Grid::PeriodicBoundaryGrid< TGridType >.

◆ coordinatesAt()

template<typename TGridType >
CellCoord Faunus::CellList::Grid::GridBase< TGridType >::coordinatesAt ( const Point position) const
inlineoverridevirtual

Compute cell coordinates from a spatial position.

⌊ position / cell_dimension ⌋

Parameters
position
Returns
cell coordinates

Implements Faunus::CellList::Grid::AbstractGrid< TGridType >.

Reimplemented in Faunus::CellList::Grid::PeriodicBoundaryGrid< TGridType >.

◆ index()

template<typename TGridType >
CellIndex Faunus::CellList::Grid::GridBase< TGridType >::index ( const CellCoord &  coordinates) const
inlineoverridevirtual

Compute the cell index from the cell coordinates.

Parameters
coordinatescell coordinates
Returns
cell index

Implements Faunus::CellList::Grid::AbstractGrid< TGridType >.

Reimplemented in Faunus::CellList::Grid::PeriodicBoundaryGrid< TGridType >.

◆ indexAt()

template<typename TGridType >
CellIndex Faunus::CellList::Grid::GridBase< TGridType >::indexAt ( const Point position) const
inlineoverridevirtual

Compute the cell index from the spatial position.

Parameters
positionspatial position
Returns
cell index

Implements Faunus::CellList::Grid::AbstractGrid< TGridType >.

Reimplemented in Faunus::CellList::Grid::PeriodicBoundaryGrid< TGridType >.

◆ isCell()

template<typename TGridType >
bool Faunus::CellList::Grid::GridBase< TGridType >::isCell ( const CellCoord &  coordinates) const
inlineoverridevirtual

Verifies if coordinates are valid in the grid.

Coordinates must be within [0, cell_list_end).

Parameters
coordinates
Returns
true if cell coordinates are valid, false otherwise

Implements Faunus::CellList::Grid::AbstractGrid< TGridType >.

Reimplemented in Faunus::CellList::Grid::PeriodicBoundaryGrid< TGridType >.

◆ isCellAt()

template<typename TGridType >
bool Faunus::CellList::Grid::GridBase< TGridType >::isCellAt ( const Point point) const
inlineoverridevirtual

Verifies if spatial coordinates are in the box.

Coordinates must be within [0, box).

Parameters
point
Returns
true if spatial coordinates are valid, false otherwise

Implements Faunus::CellList::Grid::AbstractGrid< TGridType >.

Reimplemented in Faunus::CellList::Grid::PeriodicBoundaryGrid< TGridType >.

◆ size()

template<typename TGridType >
CellIndex Faunus::CellList::Grid::GridBase< TGridType >::size ( ) const
inlineoverridevirtual
Returns
CellIndex total number of cells

Implements Faunus::CellList::Grid::AbstractGrid< TGridType >.


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