2#include "Vector/vector_dist.hpp"
3#include "Decomposition/CartDecomposition.hpp"
4#include "data_type/aggregate.hpp"
5#include "NN/CellList/CellListM.hpp"
6#include "Vector/vector_dist_multiphase_functions.hpp"
22int main(
int argc,
char* argv[])
43 openfpm_init(&argc,&argv);
52 size_t bc[3]={PERIODIC,PERIODIC,PERIODIC};
95 auto it = phases.get(0).getDomainIterator();
104 for (
size_t i = 0 ; i < phases.
size(); i++)
107 phases.get(i).getPos(p)[0] = (float)rand() / RAND_MAX;
108 phases.get(i).getPos(p)[1] = (float)rand() / RAND_MAX;
109 phases.get(i).getPos(p)[2] = (float)rand() / RAND_MAX;
118 for (
size_t i = 0 ; i < 4 ; i++)
121 phases.get(i).ghost_get<>();
155 auto CL_phase1 = phases.get(1).getCellList(r_cut);
158 auto NN_ver01 = createVerlet(phases.get(0),phases.get(1),CL_phase1,r_cut);
177 it = phases.get(0).getDomainIterator();
186 phases.get(0).getProp<0>(p) = 0;
189 auto Np = NN_ver01.template getNNIterator<NO_CHECK>(p.getKey());
199 phases.get(0).getProp<0>(p)++;
243 float r_cut2 = r_cut*1.00001;
244 auto CL_all = createCellListM<2>(phases,r_cut2);
247 auto NNver0_all = createVerletM<2>(0,phases.get(0),phases,CL_all,r_cut);
266 it = phases.get(0).getDomainIterator();
274 auto Np = NNver0_all.template getNNIterator<NO_CHECK>(p.getKey());
277 phases.get(0).getProp<0>(p) = 0;
286 auto ph_q = Np.getV();
289 phases.get(0).getProp<0>(p)++;
326 auto CL_phase1 = phases.get(1).getCellListSym(r_cut);
329 auto NN_ver01 = createVerletSym(phases.get(0),phases.get(1),CL_phase1,r_cut);
332 it = phases.get(0).getDomainAndGhostIterator();
341 phases.get(0).getProp<0>(p) = 0;
350 it = phases.get(0).getDomainIterator();
359 auto Np = NN_ver01.template getNNIterator<NO_CHECK>(p.getKey());
368 phases.get(0).getProp<0>(p)++;
369 phases.get(1).getProp<0>(q)++;
380 phases.get(0).ghost_put<
add_,0>();
381 phases.get(1).ghost_put<
add_,0>();
411 it = phases.get(0).getDomainAndGhostIterator();
420 phases.get(0).getProp<0>(p) = 0;
421 phases.get(1).getProp<0>(p) = 0;
422 phases.get(2).getProp<0>(p) = 0;
423 phases.get(3).getProp<0>(p) = 0;
430 CL_all = createCellListSymM<2>(phases,r_cut);
433 typedef decltype(createVerletSymM<2>(0,phases.get(0),phases,CL_all,r_cut)) verlet_type;
437 verlet_type NNver_all[4];
442 NNver_all[0] = createVerletSymM<2>(0,phases.get(0),phases,CL_all,r_cut);
445 NNver_all[1] = createVerletSymM<2>(1,phases.get(1),phases,CL_all,r_cut);
448 NNver_all[2] = createVerletSymM<2>(2,phases.get(2),phases,CL_all,r_cut);
451 NNver_all[3] = createVerletSymM<2>(3,phases.get(3),phases,CL_all,r_cut);
454 for (
size_t i = 0 ; i < phases.
size() ; i++)
457 it = phases.get(i).getDomainIterator();
466 auto Np = NNver_all[i].template getNNIterator<NO_CHECK>(p.getKey());
475 auto ph_q = Np.getV();
478 phases.get(i).getProp<0>(p)++;
479 phases.get(ph_q).getProp<0>(q)++;
491 phases.get(0).ghost_put<
add_,0>();
492 phases.get(1).ghost_put<
add_,0>();
493 phases.get(2).ghost_put<
add_,0>();
494 phases.get(3).ghost_put<
add_,0>();
517 auto it2 = current_phase.getIterator();
529 current_phase.getProp<0>(p) = 0.0;
532 auto Np = CL_all.getNNIterator(CL_all.getCell(current_phase.getPos(p)));
541 auto ph_q = Np.getV();
546 current_phase.getProp<0>(p) = norm(xp - xq);
This class represent an N-dimensional box.
This class implement the point shape in an N-dimensional space.
Implementation of VCluster class.
Implementation of 1-D std::vector like structure.
This structure define the operation add to use with copy general.
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...