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

Periodic boundary conditions. More...

#include <celllistimpl.h>

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

Public Types

using GridType = typename AbstractNeighborGrid< TGridType >::GridType
 
- Public Types inherited from Faunus::CellList::Grid::GridBase< TGridType >
using GridType = typename AbstractGrid< TGridType >::GridType
 
- Public Types inherited from Faunus::CellList::Grid::AbstractGrid< TGridType >
using GridType = TGridType
 
- Public Types inherited from Faunus::CellList::Grid::AbstractNeighborGrid< 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 &) const override
 Verifies if coordinates are valid in the grid. More...
 
bool isCellAt (const Point &) const override
 Verifies if spatial coordinates are in the box. More...
 
bool isNeighborCell ([[maybe_unused]] const CellCoord &coordinates, const CellCoord &offset) const override
 Verifies if offseted coordinates are valid taking into account periodic boundary conditions. More...
 
 PeriodicBoundaryGrid (const Point &box, SpaceAxis cell_dimension)
 
- Public Member Functions inherited from Faunus::CellList::Grid::GridBase< TGridType >
CellIndex size () const override
 
 GridBase (const Point &box, SpaceAxis minimal_cell_dimension)
 
- Public Member Functions inherited from Faunus::CellList::Grid::AbstractNeighborGrid< TGridType >
virtual bool isNeighborCell (const CellCoord &coordinates, const CellCoord &offset) const =0
 

Additional Inherited Members

- Protected Member Functions inherited from Faunus::CellList::Grid::GridBase< TGridType >
const CellCoord & getCellListEnd () const
 
const PointgetBox () const
 
const PointgetCell () const
 

Detailed Description

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

Periodic boundary conditions.

Both spatial coordinates and cell coordinates are first converted to the original image and then evaluated. To avoid repeated cell inclusion by completing a full circle in periodic boundary conditions, offsets are limited in both directions assuming symetry.

Todo:
Currently only full or none PBC is supperted. To support geometries like a slit, more fine distingtion is needed.
Template Parameters
TGridTypea cell grid type declaration

Member Function Documentation

◆ coordinates()

template<typename TGridType >
CellCoord Faunus::CellList::Grid::PeriodicBoundaryGrid< 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

Reimplemented from Faunus::CellList::Grid::GridBase< TGridType >.

◆ coordinatesAt()

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

Compute cell coordinates from a spatial position.

⌊ position / cell_dimension ⌋

Parameters
position
Returns
cell coordinates

Reimplemented from Faunus::CellList::Grid::GridBase< TGridType >.

◆ index()

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

Compute the cell index from the cell coordinates.

coordinates mod cell_list_end

Parameters
coordinatescell coordinates
Returns
cell index

Reimplemented from Faunus::CellList::Grid::GridBase< TGridType >.

◆ indexAt()

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

Compute the cell index from the spatial position.

Parameters
positionspatial position
Returns
cell index

Reimplemented from Faunus::CellList::Grid::GridBase< TGridType >.

◆ isCell()

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

Verifies if coordinates are valid in the grid.

Any coordinates are valid under full PBC.

Parameters
coordinates
Returns
always true

Reimplemented from Faunus::CellList::Grid::GridBase< TGridType >.

◆ isCellAt()

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

Verifies if spatial coordinates are in the box.

Any coordinates are valid under full PBC.

Parameters
point
Returns
always true

Reimplemented from Faunus::CellList::Grid::GridBase< TGridType >.

◆ isNeighborCell()

template<typename TGridType >
bool Faunus::CellList::Grid::PeriodicBoundaryGrid< TGridType >::isNeighborCell ( [[maybe_unused] ] const CellCoord &  coordinates,
const CellCoord &  offset 
) const
inlineoverride

Verifies if offseted coordinates are valid taking into account periodic boundary conditions.

Symmetric offsets around the reference cell are assumed. To avoid repeated inclusion of a cell, the offset is limited to be at most the half of the cell grid, with an attention paid to the odd and even number of cells.

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

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