|
OpenFPM
5.2.0
Project that contain the implementation of distributed structures
|
|
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"
22 template<
unsigned int dim,
24 unsigned int sh_byte ,
36 typedef boost::low_bits_mask_t<
sizeof(size_t)*8-sh_byte>
mask_low;
51 const vector_pos_type & pos,
59 if (opt == VL_CRS_SYMMETRIC)
65 else if (opt == VL_SYMMETRIC)
90 const vector_pos_type & pos,
100 size_t end = pos.size();
102 this->init_to_zero(this->slot,end);
105 T r_cut2 = r_cut * r_cut;
115 auto NN = it.getNNIteratorCSRM(pos,pos2);
119 size_t nnp = NN.getP();
120 size_t v = NN.getV();
121 size_t nnp_a = NN.get();
126 this->addPart(i,nnp_a);
149 const vector_pos_type & pos,
157 size_t end = ghostMarker;
158 this->init_to_zero(this->slot,end);
161 T r_cut2 = r_cut * r_cut;
164 auto it = pos.getIteratorTo(end);
171 auto NN = cli.getNNIteratorBoxSym(cli.getCell(xp),pp,i,pos,pos2);
175 size_t nnp = NN.getP();
176 size_t v = NN.getV();
177 size_t nnp_a = NN.get();
182 this->addPart(i,nnp_a);
205 const vector_pos_type & pos,
213 size_t end = ghostMarker;
215 this->init_to_zero(this->slot,end);
218 T r_cut2 = r_cut * r_cut;
221 auto it = pos.getIteratorTo(end);
228 auto NN = cli.getNNIteratorBox(cli.getCell(xp));
232 size_t nnp = NN.getP();
233 size_t v = NN.getV();
234 size_t nnp_a = NN.get();
239 this->addPart(i,nnp_a);
265 T r_cut,
const vector_pos_type & pos,
267 size_t opt = VL_NON_SYMMETRIC)
277 for (
size_t i = 0 ; i < dim ; i++)
278 {wr &= r_cut <= spacing.get(i);}
280 if (wr ==
true || opt == VL_SYMMETRIC)
282 create(pos,pos2,pp,r_cut,ghostMarker,cli,opt);
286 std::cerr << __FILE__ <<
":" << __LINE__ <<
" error iterator with radius is not implemented yet " << std::endl;
300 inline size_t getP(
size_t part,
size_t ele)
const
302 return VerletBase::get(part,
ele) & mask_low::sig_bits_fast;
315 inline size_t getV(
size_t part,
size_t ele)
const
317 return (VerletBase::get(part,
ele)) >> (
sizeof(size_t)*8-sh_byte);
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 ghostMarker, size_t opt=VL_NON_SYMMETRIC)
void createSymmetric(const vector_pos_type &pos, const openfpm::vector< pos_v< vector_pos_type >> &pos2, size_t pp, T r_cut, size_t ghostMarker, CellListImpl &cli, size_t opt)
Create the Symmetric Verlet list from a given cell-list.
T distance2(const Point< dim, T > &q) const
It calculate the square distance between 2 points.
Structure that contain a reference to a vector of particles.
Class for Verlet list implementation with Multiphase.
boost::high_bit_mask_t< sh_byte > mask_high
Mask to get the high bits of a number.
void createCRSSymmetric(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 ghostMarker, CellListImpl &cli, size_t opt)
Create the CRS Symmetric Verlet list from a given cell-list.
This iterator iterate across the particles of a Cell-list following the Cell structure.
__device__ const __host__ T & get(unsigned int i) const
Get coordinate.
Implementation of 1-D std::vector like structure.
boost::low_bits_mask_t< sizeof(size_t) *8-sh_byte > mask_low
Mask to get the low bits of a number.
void createNonSymmetric(const vector_pos_type &pos, const openfpm::vector< pos_v< vector_pos_type >> &pos2, size_t pp, T r_cut, size_t ghostMarker, CellListImpl &cli, size_t opt)
Create the Non-symmetric 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.
size_t getV(size_t part, size_t ele) const
Get the element vector in the cell.
Class for Multi-Phase cell-list.
void create(const vector_pos_type &pos, const openfpm::vector< pos_v< vector_pos_type >> &pos2, size_t pp, T r_cut, size_t ghostMarker, CellListImpl &cl, size_t opt)
Create the Verlet list from a given cell-list.
Linearized version of subsub.
size_t getP(size_t part, size_t ele) const
Get the element-id in the cell.
Iterator for the neighborhood of the cell structures.
Class for Verlet list implementation.
This class implement the point shape in an N-dimensional space.