8#ifndef OPENFPM_DATA_SRC_NN_CELLLIST_CELLLIST_UTIL_HPP_
9#define OPENFPM_DATA_SRC_NN_CELLLIST_CELLLIST_UTIL_HPP_
12#define CL_NON_SYMMETRIC 2
20#include "util/ofp_context.hpp"
37 cli.PopulateOnGPU(pos);
40#include "Vector/map_vector.hpp"
45 template<
unsigned int dim,
typename T,
typename prop,
typename Memory,
template <
typename>
class layout_base ,
typename CellList,
unsigned int ... prp>
53 cl_construct_opt optc)
57 for (
size_t i = 0; i < pos.size() ; i++)
59 cli.
add(pos.get(i), i);
67 template<
unsigned int dim,
typename T,
typename prop,
typename Memory,
template <
typename>
class layout_base ,
typename CellList,
unsigned int ... prp>
75 cl_construct_opt optc)
77 v_prp_out.resize(pos.size());
78 v_pos_out.resize(pos.size());
80 cli.template construct<
decltype(pos),
decltype(v_prp),prp ...>(pos,v_pos_out,v_prp,v_prp_out,context,g_m,0,pos.size(),optc);
87 template<
unsigned int dim,
typename T,
typename Memory,
template <
typename>
class layout_base ,
typename CellList>
94 for (
size_t i = 0; i < g_m ; i++)
99 for (
size_t i = g_m; i < pos.size() ; i++)
101 cli.
addPad(pos.get(i), i);
109 template<
unsigned int dim,
typename T,
typename Memory,
template <
typename>
class layout_base ,
typename CellList>
114 std::cout << __FILE__ <<
":" << __LINE__ <<
" symmetric cell list on GPU is not implemented. (And will never be, race conditions make them non suitable for GPU)" << std::endl;
129template<
unsigned int dim,
133 template <
typename>
class layout_base ,
135 unsigned int ... prp>
143 cl_construct_opt optc)
146 ::template populate<dim,T,
prop,Memory,layout_base,
CellList, prp ...>(pos,v_pos_out,v_prp,v_prp_out,cli,gpu,g_m,optc);
160template<
unsigned int dim,
typename T,
typename Memory,
template <
typename>
class layout_base ,
typename CellList>
180template<
unsigned int dim,
184 template <
typename>
class layout_base,
186 unsigned int ... prp>
195 cl_construct_opt optc)
197 if (opt == CL_NON_SYMMETRIC)
198 {populate_cell_list_no_sym<dim,T,
prop,Memory,layout_base,
CellList,prp ...>(pos,v_pos_out,v_prp,v_prp_out,cli,context,g_m,optc);}
200 {populate_cell_list_sym(pos,cli,g_m);}
217template<
unsigned int dim,
220 template <
typename>
class layout_base,
222 unsigned int ... prp>
228 cl_construct_opt optc)
232 stub_prop_type stub1;
233 stub_prop_type stub2;
237 populate_cell_list<dim,T,aggregate<int>,Memory,layout_base,
CellList,prp...>(pos,stub3,stub1,stub2,cli,context,g_m,opt,optc);
244template<
typename vector_pos_type>
247 vector_pos_type & pos;
249 pos_v(vector_pos_type & pos)
Class for FAST cell list implementation.
void add(const T(&pos)[dim], typename Mem_type::local_index_type ele)
Add an element in the cell list.
void clear()
Clear the cell list.
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.
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.
This class implement the point shape in an N-dimensional space.
Implementation of 1-D std::vector like structure.
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
Structure that contain a reference to a vector of particles.