8#ifndef OPENFPM_DATA_SRC_NN_VERLETLIST_VERLETLISTM_HPP_
9#define OPENFPM_DATA_SRC_NN_VERLETLIST_VERLETLISTM_HPP_
11#include "NN/VerletList/VerletNNIteratorM.hpp"
12#include "VerletList.hpp"
24template<
unsigned int dim,
typename T,
typename CellListImpl,
typename PartIt,
int type>
38 static inline auto get(
const PartIt & it,
39 const typename CellListImpl::internal_vector_pos_type & pos,
45 T r_cut) ->
decltype(cl.template getNNIterator<NO_CHECK>(0))
47 return cl.template getNNIterator<NO_CHECK>(cl.getCell(xp));
61template<
unsigned int dim,
typename T,
typename CellListImpl,
typename PartIt>
62struct NNTypeM<dim,T,CellListImpl,PartIt,VL_CRS_SYMMETRIC>
76 static inline auto get(
const PartIt & it,
77 const typename CellListImpl::internal_vector_pos_type & pos,
83 T r_cut) ->
decltype(it.getNNIteratorCSRM(pos,v))
85 return it.getNNIteratorCSRM(pos,v);
99template<
unsigned int dim,
typename T,
typename CellListImpl,
typename PartIt>
100struct NNTypeM<dim,T,CellListImpl,PartIt,VL_SYMMETRIC>
113 static inline auto get(
const PartIt & it,
114 const typename CellListImpl::internal_vector_pos_type & pos,
122 return cl.template getNNIteratorSym<NO_CHECK>(cl.getCell(xp),pp,p,pos,v);
135template<
unsigned int dim,
137 unsigned int sh_byte ,
163 inline void create(
const vector_pos_type & pos,
173 if (opt == VL_CRS_SYMMETRIC)
175 create_<CellNNIteratorSymM<dim,CellListImpl,sh_byte,RUNTIME,NO_CHECK>,VL_CRS_SYMMETRIC>(pos,
pos2,dom,anom,pp,
r_cut,g_m,cl,opt);
177 else if (opt == VL_SYMMETRIC)
179 create_<
decltype(cl.template
getNNIteratorSym<NO_CHECK>(0,0,0,pos,
pos2)),VL_SYMMETRIC>(pos,
pos2,dom,anom,pp,
r_cut,g_m,cl,opt);
201 template<
typename NN_type,
int type>
inline void create_(
const vector_pos_type & pos,
219 this->init_to_zero(this->slot,end);
231 NN_type NN =
NNTypeM<dim,T,
CellListImpl,
decltype(it),type>::get(it,pos,
pos2,xp,pp,i,cli,
r_cut);
235 size_t nnp = NN.getP();
236 size_t v = NN.getV();
237 size_t nnp_a = NN.get();
242 this->addPart(i,
nnp_a);
268 T
r_cut,
const vector_pos_type & pos,
270 size_t opt = VL_NON_SYMMETRIC)
280 for (
size_t i = 0 ; i < dim ; i++)
283 if (
wr ==
true || opt == VL_SYMMETRIC)
292 std::cerr <<
__FILE__ <<
":" <<
__LINE__ <<
" error iterator with radius is not implemented yet " << std::endl;
306 inline size_t getP(
size_t part,
size_t ele)
const
308 return VerletBase::get(part,
ele) & mask_low::sig_bits_fast;
321 inline size_t getV(
size_t part,
size_t ele)
const
Class for Multi-Phase cell-list.
static auto get(const vector &pos, const openfpm::vector< size_t > &dom, const openfpm::vector< subsub_lin< dim > > &anom, CellList &cli, size_t g_m, size_t &end) -> decltype(pos.getIteratorTo(0))
It return the particle iterator.
This class implement the point shape in an N-dimensional space.
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
T distance2(const Point< dim, T > &q) const
It calculate the square distance between 2 points.
Class for Verlet list implementation with Multiphase.
size_t getP(size_t part, size_t ele) const
Get the element-id in the cell.
size_t getV(size_t part, size_t ele) const
Get the element vector in the cell.
boost::high_bit_mask_t< sh_byte > mask_high
Mask to get the high bits of a number.
void Initialize(CellListImpl &cli, size_t pp, T r_cut, const vector_pos_type &pos, const openfpm::vector< struct pos_v< vector_pos_type > > &pos2, size_t g_m, size_t opt=VL_NON_SYMMETRIC)
boost::low_bits_mask_t< sizeof(size_t) *8-sh_byte > mask_low
Mask to get the low bits of a number.
void create_(const vector_pos_type &pos, const openfpm::vector< pos_v< vector_pos_type > > &pos2, const openfpm::vector< size_t > &dom, const openfpm::vector< subsub_lin< dim > > &anom, size_t pp, T r_cut, size_t g_m, CellListImpl &cli, size_t opt)
Create the Verlet list from a given cell-list.
void create(const vector_pos_type &pos, const openfpm::vector< pos_v< vector_pos_type > > &pos2, const openfpm::vector< size_t > &dom, const openfpm::vector< subsub_lin< dim > > &anom, size_t pp, T r_cut, size_t g_m, CellListImpl &cl, size_t opt)
Create the Verlet list from a given cell-list.
VerletNNIteratorM< dim, VerletListM< dim, T, sh_byte, CellListImpl, transform, vector_pos_type, VerletBase >, sh_byte > getNNIterator(size_t part_id)
Get the Neighborhood iterator.
Class for Verlet list implementation.
Iterator for the neighborhood of the cell structures.
Implementation of 1-D std::vector like structure.
static auto get(const PartIt &it, const typename CellListImpl::internal_vector_pos_type &pos, const openfpm::vector< pos_v< typename CellListImpl::internal_vector_pos_type > > &v, Point< dim, T > &xp, size_t pp, size_t p, CellListImpl &cl, T r_cut) -> decltype(it.getNNIteratorCSRM(pos, v))
Get the neighborhood.
static auto get(const PartIt &it, const typename CellListImpl::internal_vector_pos_type &pos, const openfpm::vector< pos_v< typename CellListImpl::internal_vector_pos_type > > &v, Point< dim, T > &xp, size_t pp, size_t p, CellListImpl &cl, T r_cut) -> decltype(cl.template getNNIteratorSym< NO_CHECK >(0, 0, 0, typename CellListImpl::internal_vector_pos_type(), openfpm::vector< pos_v< typename CellListImpl::internal_vector_pos_type > >()))
Get the neighborhood.
Get the neighborhood iterator based on type.
static auto get(const PartIt &it, const typename CellListImpl::internal_vector_pos_type &pos, const openfpm::vector< pos_v< typename CellListImpl::internal_vector_pos_type > > &v, Point< dim, T > &xp, size_t pp, size_t p, CellListImpl &cl, T r_cut) -> decltype(cl.template getNNIterator< NO_CHECK >(0))
Get the neighborhood.
Structure that contain a reference to a vector of particles.
Linearized version of subsub.