|
| const grid_sm< dim, void > & | getGrid () |
| | Return the underlying grid information of the cell list. More...
|
| |
| void | Initialize (CellDecomposer_sm< dim, T, transform > &cd_sm, const Box< dim, T > &dom_box, const size_t pad=1, size_t slot=STARTING_NSLOT) |
| |
| void | Initialize (const Box< dim, T > &box, const size_t(&div)[dim], const size_t pad=1, size_t slot=STARTING_NSLOT) |
| |
|
| CellList () |
| | Default Constructor.
|
| |
|
| CellList (const CellList< dim, T, Mem_type, transform, vector_pos_type > &cell) |
| | Copy constructor.
|
| |
|
| CellList (CellList< dim, T, Mem_type, transform, vector_pos_type > &&cell) |
| | Copy constructor.
|
| |
| | CellList (Box< dim, T > &box, const size_t(&div)[dim], Matrix< dim, T > mat, const size_t pad=1, size_t slot=STARTING_NSLOT) |
| | Cell list constructor. More...
|
| |
| | CellList (Box< dim, T > &box, const size_t(&div)[dim], const size_t pad=1, size_t slot=STARTING_NSLOT) |
| | Cell list constructor. More...
|
| |
| | CellList (CellDecomposer_sm< dim, T, transform > &cd_sm, const Box< dim, T > &box, const size_t pad=1, size_t slot=STARTING_NSLOT) |
| | Cell list constructor from a cell decomposer. More...
|
| |
|
| ~CellList () |
| | Destructor.
|
| |
| CellList< dim, T, Mem_type, transform > & | operator= (CellList< dim, T, Mem_type, transform > &&cell) |
| | Constructor from a temporal object. More...
|
| |
| CellList< dim, T, Mem_type, transform, vector_pos_type > & | operator= (const CellList< dim, T, Mem_type, transform, vector_pos_type > &cell) |
| | Constructor from a temporal object. More...
|
| |
| template<typename Mem_type2 > |
| CellList< dim, T, Mem_type, transform, vector_pos_type > & | operator= (const CellList< dim, T, Mem_type2, transform, vector_pos_type > &cell) |
| | Constructor from a temporal object. More...
|
| |
| void | setRadius (T radius) |
| | Set the radius for the getNNIteratorRadius. More...
|
| |
| ParticleIt_Cells< dim, CellList< dim, T, Mem_fast<>, transform > > | getDomainIterator (openfpm::vector< size_t > &dom_cells) |
| | Get an iterator over particles following the cell structure. More...
|
| |
| void | add (const T(&pos)[dim], typename Mem_type::local_index_type ele) |
| | Add an element in the cell list. More...
|
| |
| void | add (const Point< dim, T > &pos, typename Mem_type::local_index_type ele) |
| | Add an element in the cell list. More...
|
| |
| void | addDom (const T(&pos)[dim], typename Mem_type::local_index_type ele) |
| | Add an element in the cell list forcing to be in the domain cells. More...
|
| |
| void | addDom (const Point< dim, T > &pos, typename Mem_type::local_index_type ele) |
| | Add an element in the cell list forcing to be in the domain cells. More...
|
| |
| void | addPad (const T(&pos)[dim], typename Mem_type::local_index_type ele) |
| | Add an element in the cell list forcing to be in the padding cells. More...
|
| |
| void | addPad (const Point< dim, T > &pos, typename Mem_type::local_index_type ele) |
| | Add an element in the cell list forcing to be in the padding cells. More...
|
| |
|
void | addCellGhostMarkers () |
| | add ghost marker in each cell
|
| |
| void | remove (size_t cell, size_t ele) |
| | remove an element from the cell More...
|
| |
| size_t | getNCells () const |
| | Get the number of cells this cell-list contain. More...
|
| |
| size_t | getNelements (const size_t cell_id) const |
| | Return the number of elements in the cell. More...
|
| |
| auto | get (size_t cell, size_t ele) -> decltype(this->Mem_type::get(cell, ele)) |
| | Get an element in the cell. More...
|
| |
| auto | get (size_t cell, size_t ele) const -> decltype(this->Mem_type::get(cell, ele)) |
| | Get an element in the cell. More...
|
| |
| void | swap (CellList< dim, T, Mem_type, transform, vector_pos_type > &cl) |
| | Swap the memory. More...
|
| |
| CellIterator< CellList< dim, T, Mem_type, transform > > | getParticleInCellIterator (size_t cell) |
| | Get the Cell iterator. More...
|
| |
| CellNNIteratorRadius< dim, CellList< dim, T, Mem_type, transform > > | getNNIteratorRadius (size_t cell) |
| | Get the Neighborhood iterator. More...
|
| |
| | __attribute__ ((always_inline)) inline CellNNIterator< dim |
| | Get the Neighborhood iterator. More...
|
| |
|
int FULL | getNNIteratorBox (size_t cell) |
| |
| | __attribute__ ((always_inline)) inline CellNNIteratorRadius< dim |
| | Get the symmetric Neighborhood iterator. More...
|
| |
|
CellList< dim, T, Mem_type, transform, vector_pos_type > | getNNIteratorRadius (size_t cell, T r_cut) |
| |
| | __attribute__ ((always_inline)) inline CellNNIteratorSym< dim |
| | Get the symmetric Neighborhood iterator. More...
|
| |
|
unsigned int SYM | getNNIteratorBoxSym (size_t cell, size_t p, const vector_pos_type &v) |
| |
| | __attribute__ ((always_inline)) inline CellNNIteratorSymLocal< dim |
| | Get the symmetric local Neighborhood iterator. More...
|
| |
|
int FULL | getNNIteratorBoxSymLocal (size_t cell, size_t p, const vector_pos_type &v) |
| |
| template<typename vector_pos_type2 > |
| | __attribute__ ((always_inline)) inline CellNNIteratorSymMP< dim |
| | Get the symmetric Neighborhood iterator. More...
|
| |
|
unsigned int SYM | getNNIteratorBoxSymMP (size_t cell, size_t p, const vector_pos_type2 &v_p1, const vector_pos_type2 &v_p2) |
| |
| const NNc_array< dim,(unsigned int) openfpm::math::pow(3, dim)/2+1 > & | getNNc_sym () const |
| | Get the symmetric neighborhood. More...
|
| |
| size_t | getOpt () const |
| | Returns the option flags that control the cell list. More...
|
| |
| void | setOpt (size_t opt) |
| | Sets the option flags that control the cell list. More...
|
| |
| size_t | getPadding (size_t i) const |
| | Return the number of padding cells of the Cell decomposer. More...
|
| |
| size_t(& | getPadding ())[dim] |
| | Return the number of padding cells of the Cell decomposer as an array. More...
|
| |
|
void | clear () |
| | Clear the cell list.
|
| |
|
void | clear (typename Mem_type::local_index_type cell_id) |
| | Clear one cell of the cell list.
|
| |
|
void | destroy () |
| | Litterary destroy the memory of the cell list, including the retained one.
|
| |
| __attribute__((always_inline)) inline const typename Mem_type size_t | getGhostMarker () const |
| | Return the starting point of the cell p. More...
|
| |
| void | setGhostMarker (size_t ghostMarker) |
| | Set the ghost marker. More...
|
| |
| CellParticleIterator | getCellParticleIterator () |
| | return the celllist iterator (across cells) More...
|
| |
| const openfpm::vector< size_t > & | getCellSFCKeys () |
| | Get the space filling curve object. More...
|
| |
| bool | isSFCInit () const |
| | Returns a bool flag of SFC keys vector being filled. More...
|
| |
|
const NNc_array< dim,(unsigned int) openfpm::math::pow(3, dim)> & | private_get_NNc_full () const |
| |
|
const NNc_array< dim,(unsigned int) openfpm::math::pow(3, dim)/2+1 > & | private_get_NNc_sym () const |
| |
|
const NNc_array< dim,(unsigned int) openfpm::math::pow(3, dim)> & | private_get_NNc_sym_local () const |
| |
|
bool | private_get_from_cd () const |
| |
|
void | resetBoxNN () |
| |
| void | set_ndec (size_t n_dec) |
| | Set the n_dec number. More...
|
| |
| size_t | get_ndec () const |
| | Set the n_dec number. More...
|
| |
| template<typename vector_pos_type2 , typename vector_prp_type > |
| void | fill (vector_pos_type2 &vPos, vector_prp_type &vPrp, size_t ghostMarker) |
| | Fill cell list with particles at positions vPos. More...
|
| |
| size_t | size () const |
| | return the number of elements More...
|
| |
|
void | destroy () |
| | Destroy the internal memory including the retained one.
|
| |
| void | init_to_zero (local_index slot, local_index tot_n_cell) |
| | Initialize the data to zero. More...
|
| |
| void | operator= (const Mem_fast< Memory, local_index > &mem) |
| | copy an object Mem_fast More...
|
| |
| void | operator= (Mem_fast< Memory, local_index > &&mem) |
| | copy an object Mem_fast More...
|
| |
| template<typename Memory2 > |
| void | copy_general (const Mem_fast< Memory2, local_index > &mem) |
| | copy an object Mem_fast More...
|
| |
| void | addCellGhostMarkers () |
| | Add ghost marker to the cell. More...
|
| |
|
size_t | getGhostMarker (local_index cell_id) const |
| | Get ghost marker of the cell.
|
| |
| void | addCell (local_index cell_id, local_index ele) |
| | Add an element to the cell. More...
|
| |
| auto | get (local_index cell, local_index ele) -> decltype(cl_base.template get< 0 >(cell *slot+ele)) & |
| | Get an element in the cell. More...
|
| |
| auto | get (local_index cell, local_index ele) const -> decltype(cl_base.template get< 0 >(cell *slot+ele)) & |
| | Get an element in the cell. More...
|
| |
| void | remove (local_index cell_id, local_index ele) |
| | Remove an element in the cell. More...
|
| |
| size_t | getNelements (const local_index cell_id) const |
| | Get the number of elements in the cell. More...
|
| |
| void | swap (Mem_fast< Memory, local_index > &mem) |
| | swap to Mem_fast object More...
|
| |
| void | swap (Mem_fast< Memory, local_index > &&mem) |
| | swap to Mem_fast object More...
|
| |
|
void | clear () |
| | Delete all the elements in every cell.
|
| |
|
void | clear (local_index cell_id) |
| | Delete cell elements in Cell p.
|
| |
| const local_index & | getStartId (local_index cell_id) const |
| | Get the first element of a cell (as reference) More...
|
| |
| const local_index & | getGhostId (local_index cell_id) const |
| | Get the index of the first ghost element. More...
|
| |
| const local_index & | getStopId (local_index cell_id) const |
| | Get the last element of a cell (as reference) More...
|
| |
| const local_index & | get_lin (const local_index *part_id) const |
| | Just return the value pointed by part_id. More...
|
| |
| | Mem_fast (local_index slot) |
| | Constructor. More...
|
| |
| void | set_slot (local_index slot) |
| | Set the number of slot for each cell. More...
|
| |
| const openfpm::vector< aggregate< local_index >, Memory > & | private_get_cl_n () const |
| | Return the private data-structure cl_n. More...
|
| |
| const openfpm::vector< size_t > & | getGhostMarkers () const |
| | Return the private data-structure ghostMarkers. More...
|
| |
| const int & | private_get_slot () const |
| | Return the private slot. More...
|
| |
| const base & | private_get_cl_base () const |
| | Return the private data-structure cl_base. More...
|
| |
| template<int ... prp> |
| void | packRequest (size_t &req) const |
| | It calculate the number of byte required to serialize the object. More...
|
| |
| template<int ... prp> |
| void | pack (ExtPreAlloc< HeapMemory > &mem, Pack_stat &sts) const |
| | pack a vector selecting the properties to pack More...
|
| |
| template<int ... prp, typename MemType > |
| void | unpack (ExtPreAlloc< MemType > &mem, Unpack_stat &ps) |
| | unpack a vector More...
|
| |
template<unsigned int dim, typename T, typename Mem_type = Mem_fast<>, typename transform = no_transform<dim,T>, typename vector_pos_type = openfpm::vector<Point<dim,T>>>
class CellList< dim, T, Mem_type, transform, vector_pos_type >
Class for FAST cell list implementation.
This class implement the FAST cell list, fast but memory expensive. The memory allocation is (M * N_cell_max)*sizeof(ele) + M*8
- M = number of cells
- N_cell_max = maximum number of elements in a cell
- ele = element the structure is storing
- Note
- Because N_cell_max >= N/M then M * N_cell_max >= O(N)
- Warning
- Not not use for high asymmetric distribution
Example of a 2D Cell list 6x6 structure with padding 1 without shift, cell indicated with p are padding cell the origin of the cell or point (0,0) is marked with cell number 9
* +-----------------------+
* |p |p |p |p |p |p |p |p |
* +-----------------------+
* |p | | | | | | |p |
* +-----------------------+
* |p | | | | | | |p |
* +-----------------------+
* |p | | | | | | |p |
* +-----------------------+
* |p |9 | | | | | |p |
* +-----------------------+
* |p |p |p |p |p |p |p |p |
* +-----------------------+
*
- Template Parameters
-
| dim | Dimensionality of the space |
| T | type of the space float, double ... |
| base | Base structure that store the information |
Declaration of a cell list
size_t div[dim] = {16,16,16};
CellS cl2(box,div);
This class implement the point shape in an N-dimensional space.
Usage of cell list [CellS == CellList<3,double,FAST>]
CellS cl1(box,div);
for (size_t i = 0 ; i < dim ; i++)
{
offset[i].
get(i) += (1.0 / div[i]) / 8.0;
}
size_t id = 0;
while (g_it.isNext())
{
key = pmul(key,spacing) + offset[0] + box.getP1();
pos.add(key);
cl1.add(key,id);
++id;
key = pmul(key,spacing) + offset[1] + box.getP1();
pos.add(key);
cl1.add(key,id);
++id;
++g_it;
}
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
Implementation of 1-D std::vector like structure.
Remove one particle from each cell
while (g_it.isNext())
{
key = pmul(key,spacing) + offset[0] + box.getP1();
auto cell = cl1.getCell(key);
cl1.remove(cell,0);
++g_it;
}
Usage of the neighborhood iterator
key = pmul(key,spacing) + offset[0] + box.getP1();
auto NN = cl1.getNNIteratorBox(cl1.getCell(key));
size_t total = 0;
while(NN.isNext())
{
total++;
++NN;
}
Definition at line 557 of file CellList.hpp.