OpenFPM Data
This module collect the implementation of non-distributed structures like vectors, Multi Array (Grid), Graph, CellLists and others
Folders:
- Vector: Implementation of vector structures
- Grid: Implementation of multi arrays
- Graph: Implementation of graph structures
- NN : Implementation of Nearest Neighbourhood search structure like CellList ...
- data_type : Definition of default data type
- Space : Definition of N-dimensional geometrical basic structures like Box, Hypercube, Sphere, Point, ...
Overview
All the structures must
- Work on generic basic objects (We will referee at it with basic object )
- Abstract how they are represented on memory
- Use Memory objects to produce memory over they work
Specializations are allowed to be mapped or use internally STL, Boost, OpenFPM_data, or other structures (consider anyway always to implement over already implemented structures inside OpenFPM_data, because they already implement the capabilities that we are going to describe)
Basic objects
Memory objects
Memory mapping
Iterators
Template
Template parameter oder
Template parameters must follow an order, first come the specific template parameters, than the basic object the structure is storing in the following order, memory pool, ordering, implementation
Example
/*!
*
* \brief This is an N-dimensional grid or an N-dimensional array working on CPU
*
* This is an N-Dimensional grid or an N-dimensional array working on CPU
*
* \param dim Dimensionality of the grid
* \param T type of object the grid store
* \param Mem interface used to allocate memory
*
*/
template<unsigned int dim, typename T, typename Mem = typename memory_traits_lin< typename T::type >::type >
class grid_cpu
{
The following is the class signature for multi array, first come the class specific parameters, in this case the dimensionality of the grid, than come the Generic object that store than the Memory pool and implementation detail (Ordering is not present, but is going to change)