5#include "Vector/vector_dist.hpp"
7#include "Draw/DrawParticles.hpp"
19const double dp = 0.0085;
25const double coeff_sound = 20.0;
28const double gamma_ = 7.0;
31const double H = 0.0147224318643;
34const double Eta2 = 0.01 * H*H;
37const double visco = 0.1;
43const double MassFluid = 0.000614125;
46const double MassBound = 0.000614125;
49const double t_end = 1.5;
52const double gravity = 9.81;
55const double rho_zero = 1000.0;
61const double CFLnumber = 0.2;
64const double DtMin = 0.00001;
67const double RhoMin = 700.0;
70const double RhoMax = 1300.0;
73double max_fluid_height = 0.0;
84const int rho_prev = 2;
87const int Pressure = 3;
96const int velocity = 6;
99const int velocity_prev = 7;
107 bool operator<(
const struct nb_f & pag)
const
109 return (
id < pag.id);
114typedef vector_dist<3,double,aggregate<size_t,double, double, double, double, double[3], double[3], double[3],openfpm::vector<nb_f>,
openfpm::vector<nb_f>,
double[3], double ,
size_t>>
particles;
122 template<
typename Decomposition,
typename vector>
inline void addComputation(
Decomposition & dec,
const vector & vd,
size_t v,
size_t p)
124 if (vd.template getProp<type>(p) == FLUID)
125 dec.addComputationCost(v,4);
127 dec.addComputationCost(v,3);
130 template<
typename Decomposition>
inline void applyModel(
Decomposition & dec,
size_t v)
132 dec.setSubSubDomainComputationCost(v, dec.getSubSubDomainComputationCost(v) * dec.getSubSubDomainComputationCost(v));
144 double rho_a = vd.template getProp<rho>(a);
145 double rho_frac = rho_a / rho_zero;
147 vd.template getProp<Pressure>(a) = B*( rho_frac*rho_frac*rho_frac*rho_frac*rho_frac*rho_frac*rho_frac - 1.0);
155const double a2 = 1.0/M_PI/H/H/H;
157inline double Wab(
double r)
162 return (1.0 - 3.0/2.0*r*r + 3.0/4.0*r*r*r)*a2;
164 return (1.0/4.0*(2.0 - r*r)*(2.0 - r*r)*(2.0 - r*r))*a2;
171const double c1 = -3.0/M_PI/H/H/H/H;
172const double d1 = 9.0/4.0/M_PI/H/H/H/H;
173const double c2 = -3.0/4.0/M_PI/H/H/H/H;
174const double a2_4 = 0.25*a2;
184 double qq2 = qq * qq;
185 double fac = (c1*qq + d1*qq2)/r;
187 DW.
get(0) = fac*dx.
get(0);
188 DW.
get(1) = fac*dx.
get(1);
189 DW.
get(2) = fac*dx.
get(2);
193 double wqq = (2.0 - qq);
194 double fac = c2 * wqq * wqq / r;
196 DW.
get(0) = fac * dx.
get(0);
197 DW.
get(1) = fac * dx.
get(1);
198 DW.
get(2) = fac * dx.
get(2);
210inline double Tensile(
double r,
double rhoa,
double rhob,
double prs1,
double prs2)
218 double wqq2=wqq1*wqq1;
220 wab=a2_4*(wqq2*wqq1);
227 wab=a2*(1.0f-1.5f*wqq2+0.75f*wqq3);
231 double fab=wab*W_dap;
233 const double tensilp1=(prs1/(rhoa*rhoa))*(prs1>0? 0.01: -0.2);
234 const double tensilp2=(prs2/(rhob*rhob))*(prs2>0? 0.01: -0.2);
236 return (fab*(tensilp1+tensilp2));
243 const double dot_rr2 = dot/(rr2+Eta2);
244 visc=std::max(dot_rr2,visc);
248 const float amubar=H*dot_rr2;
249 const float robar=(rhoa+rhob)*0.5f;
250 const float pi_visc=(-visco*cbar*amubar/robar);
259template<
typename VerletList>
inline double calc_forces(
particles & vd,
VerletList & NN,
double & max_visc,
double r_gskin)
273 vd.template getProp<force>(p)[0] = 0.0;
274 vd.template getProp<force>(p)[1] = 0.0;
275 vd.template getProp<force>(p)[2] = -gravity;
276 vd.template getProp<drho>(p) = 0.0;
280 vd.template getProp<10>(p)[0] = 0.0;
281 vd.template getProp<10>(p)[1] = 0.0;
282 vd.template getProp<10>(p)[2] = -gravity;
283 vd.template getProp<11>(p) = 0.0;
307 while (part.isNext())
316 double massa = (vd.
getProp<type>(a) == FLUID)?MassFluid:MassBound;
319 double rhoa = vd.
getProp<rho>(a);
322 double Pa = vd.
getProp<Pressure>(a);
328 if (vd.
getProp<type>(a) != FLUID)
332 auto Np = NN.template getNNIterator<NO_CHECK>(a);
335 while (Np.isNext() ==
true)
344 if (a == b) {++Np;
continue;};
347 double massb = (vd.
getProp<type>(b) == FLUID)?MassFluid:MassBound;
353 double Pb = vd.
getProp<Pressure>(b);
354 double rhob = vd.
getProp<rho>(b);
359 double r2 = norm2(dr);
372 const double dot = dr.get(0)*dv.
get(0) + dr.get(1)*dv.
get(1) + dr.get(2)*dv.
get(2);
373 const double dot_rr2 = dot/(r2+Eta2);
374 max_visc=std::max(dot_rr2,max_visc);
378 vd.
getProp<drho>(a) += massb*scal;
379 vd.
getProp<drho>(b) += massa*scal;
388 if (vd.
getProp<type>(b) == FLUID)
391 double factor = - ((vd.
getProp<Pressure>(a) + vd.
getProp<Pressure>(b)) / (rhoa * rhob) + Tensile(r,rhoa,rhob,Pa,Pb) + Pi(dr,r2,v_rel,rhoa,rhob,massb,visc));
393 vd.
getProp<force>(b)[0] -= massa * factor * DW.
get(0);
394 vd.
getProp<force>(b)[1] -= massa * factor * DW.
get(1);
395 vd.
getProp<force>(b)[2] -= massa * factor * DW.
get(2);
398 nnb.fact = -massa * factor * DW.
get(2);
418 auto Np2 = NN2.template getNNIterator<NO_CHECK>(NN2.getCell(vd.
getPos(a)));
421 while (Np2.isNext() ==
true)
430 if (a == b) {++Np2;
continue;};
433 double massb = (vd.
getProp<type>(b) == FLUID)?MassFluid:MassBound;
439 double Pb = vd.
getProp<Pressure>(b);
440 double rhob = vd.
getProp<rho>(b);
445 double r2 = norm2(dr);
458 const double dot = dr.get(0)*dv.
get(0) + dr.get(1)*dv.
get(1) + dr.get(2)*dv.
get(2);
459 const double dot_rr2 = dot/(r2+Eta2);
480 auto Np = NN.template getNNIterator<NO_CHECK>(a);
483 while (Np.isNext() ==
true)
492 if (a == b) {++Np;
continue;};
494 double massb = (vd.
getProp<type>(b) == FLUID)?MassFluid:MassBound;
496 double Pb = vd.
getProp<Pressure>(b);
497 double rhob = vd.
getProp<rho>(b);
502 double r2 = norm2(dr);
514 double factor = - ((vd.
getProp<Pressure>(a) + vd.
getProp<Pressure>(b)) / (rhoa * rhob) + Tensile(r,rhoa,rhob,Pa,Pb) + Pi(dr,r2,v_rel,rhoa,rhob,massb,visc));
516 vd.
getProp<force>(a)[0] += massb * factor * DW.
get(0);
517 vd.
getProp<force>(a)[1] += massb * factor * DW.
get(1);
518 vd.
getProp<force>(a)[2] += massb * factor * DW.
get(2);
520 vd.
getProp<force>(b)[0] -= massa * factor * DW.
get(0);
521 vd.
getProp<force>(b)[1] -= massa * factor * DW.
get(1);
522 vd.
getProp<force>(b)[2] -= massa * factor * DW.
get(2);
526 vd.
getProp<drho>(a) += massb*scal;
527 vd.
getProp<drho>(b) += massa*scal;
532 std::cout <<
"DETECTED ERROR " << std::endl;
537 std::cout <<
"DETECTED ERROR " << create_vcluster().getProcessUnitID() <<
" a " << a <<
" b " << b <<
" " << vd.
size_local_with_ghost() << std::endl;
543 nna.fact = massb * factor * DW.
get(2);
547 nnb.fact = -massa * factor * DW.
get(2);
563 auto Np2 = NN2.template getNNIterator<NO_CHECK>(NN2.getCell(vd.
getPos(a)));
565 if (a == 0 && create_vcluster().getProcessUnitID() == 0)
571 while (Np2.isNext() ==
true)
580 if (a == b) {++Np2;
continue;};
582 double massb = (vd.
getProp<type>(b) == FLUID)?MassFluid:MassBound;
584 double Pb = vd.
getProp<Pressure>(b);
585 double rhob = vd.
getProp<rho>(b);
590 double r2 = norm2(dr);
602 double factor = - massb*((vd.
getProp<Pressure>(a) + vd.
getProp<Pressure>(b)) / (rhoa * rhob) + Tensile(r,rhoa,rhob,Pa,Pb) + Pi(dr,r2,v_rel,rhoa,rhob,massb,visc));
612 nna.fact = factor * DW.
get(2);
624 vd.template ghost_put<add_,drho>();
625 vd.template ghost_put<add_,force>();
626 vd.template ghost_put<merge_,9>();
627 vd.template ghost_put<add_,10>();
628 vd.template ghost_put<add_,11>();
632 while (part3.isNext())
634 auto a = part3.get();
640 if (create_vcluster().getProcessUnitID() == 0)
642 std::cout <<
"LISTS " << vd.
getProp<12>(a) <<
" " << vd.
getProp<8>(a).size() <<
" " << vd.
getProp<9>(a).size() << std::endl;
643 std::cout <<
"ERROR: " << vd.
getProp<force>(a)[2] <<
" " << vd.
getProp<10>(a)[2] <<
" part: " << a.getKey() << std::endl;
654 for (
size_t i = 0 ; i < vd.
getProp<8>(a).size() ; i++)
657 std::cout <<
"FACT: " << vd.
getProp<8>(a).get(i).fact <<
" " << vd.
getProp<9>(a).get(i).fact <<
" " << vd.
getProp<8>(a).get(i).id <<
" " << vd.
getProp<9>(a).get(i).id << std::endl;
659 sum1 += vd.
getProp<8>(a).get(i).fact;
660 sum2 += vd.
getProp<9>(a).get(i).fact;
663 std::cout <<
"sum: " << sum1 <<
" " << sum2 << std::endl;
672 if (create_vcluster().getProcessUnitID() == 0)
676 std::cout <<
"ERROR: " << vd.
getProp<12>(a) <<
" " << vd.
getProp<8>(a).size() <<
" " << vd.
getProp<9>(a).size() << std::endl;
678 for (
size_t i = 0 ; i < vd.
getProp<8>(a).size() ; i++)
680 std::cout <<
"NNNN: " << vd.
getProp<9>(a).get(i).id <<
" " << vd.
getProp<8>(a).get(i).id << std::endl;
692void max_acceleration_and_velocity(
particles & vd,
double & max_acc,
double & max_vel)
697 while (part.isNext())
702 double acc2 = norm2(acc);
705 double vel2 = norm2(vel);
715 max_acc = sqrt(max_acc);
716 max_vel = sqrt(max_vel);
718 Vcluster & v_cl = create_vcluster();
725double calc_deltaT(
particles & vd,
double ViscDtMax)
729 max_acceleration_and_velocity(vd,Maxacc,Maxvel);
732 const double dt_f = (Maxacc)?sqrt(H/Maxacc):std::numeric_limits<int>::max();
735 const double dt_cv = H/(std::max(cbar,Maxvel*10.) + H*ViscDtMax);
738 double dt=double(CFLnumber)*std::min(dt_f,dt_cv);
749void verlet_int(
particles & vd,
double dt,
double & max_disp)
757 double dt205 = dt*dt*0.5;
763 while (part.isNext())
769 if (vd.template getProp<type>(a) == BOUNDARY)
772 double rhop = vd.template getProp<rho>(a);
775 vd.template getProp<velocity>(a)[0] = 0.0;
776 vd.template getProp<velocity>(a)[1] = 0.0;
777 vd.template getProp<velocity>(a)[2] = 0.0;
778 vd.template getProp<rho>(a) = vd.template getProp<rho_prev>(a) + dt2*vd.template getProp<drho>(a);
780 vd.template getProp<rho_prev>(a) = rhop;
787 double dx = vd.template getProp<velocity>(a)[0]*dt + vd.template getProp<force>(a)[0]*dt205;
788 double dy = vd.template getProp<velocity>(a)[1]*dt + vd.template getProp<force>(a)[1]*dt205;
789 double dz = vd.template getProp<velocity>(a)[2]*dt + vd.template getProp<force>(a)[2]*dt205;
795 double d2 = dx*dx + dy*dy + dz*dz;
797 max_disp = (max_disp > d2)?max_disp:d2;
799 double velX = vd.template getProp<velocity>(a)[0];
800 double velY = vd.template getProp<velocity>(a)[1];
801 double velZ = vd.template getProp<velocity>(a)[2];
802 double rhop = vd.template getProp<rho>(a);
804 vd.template getProp<velocity>(a)[0] = vd.template getProp<velocity_prev>(a)[0] + vd.template getProp<force>(a)[0]*dt2;
805 vd.template getProp<velocity>(a)[1] = vd.template getProp<velocity_prev>(a)[1] + vd.template getProp<force>(a)[1]*dt2;
806 vd.template getProp<velocity>(a)[2] = vd.template getProp<velocity_prev>(a)[2] + vd.template getProp<force>(a)[2]*dt2;
807 vd.template getProp<rho>(a) = vd.template getProp<rho_prev>(a) + dt2*vd.template getProp<drho>(a);
810 if (vd.
getPos(a)[0] < 0.000263878 || vd.
getPos(a)[1] < 0.000263878 || vd.
getPos(a)[2] < 0.000263878 ||
811 vd.
getPos(a)[0] > 0.000263878+1.59947 || vd.
getPos(a)[1] > 0.000263878+0.672972 || vd.
getPos(a)[2] > 0.000263878+0.903944 ||
812 vd.template getProp<rho>(a) < RhoMin || vd.template getProp<rho>(a) > RhoMax)
814 to_remove.add(a.getKey());
821 vd.template getProp<velocity_prev>(a)[0] = velX;
822 vd.template getProp<velocity_prev>(a)[1] = velY;
823 vd.template getProp<velocity_prev>(a)[2] = velZ;
824 vd.template getProp<rho_prev>(a) = rhop;
829 Vcluster & v_cl = create_vcluster();
833 max_disp = sqrt(max_disp);
842void euler_int(
particles & vd,
double dt,
double & max_disp)
850 double dt205 = dt*dt*0.5;
856 while (part.isNext())
862 if (vd.template getProp<type>(a) == BOUNDARY)
865 double rhop = vd.template getProp<rho>(a);
868 vd.template getProp<velocity>(a)[0] = 0.0;
869 vd.template getProp<velocity>(a)[1] = 0.0;
870 vd.template getProp<velocity>(a)[2] = 0.0;
871 vd.template getProp<rho>(a) = vd.template getProp<rho>(a) + dt*vd.template getProp<drho>(a);
873 vd.template getProp<rho_prev>(a) = rhop;
880 double dx = vd.template getProp<velocity>(a)[0]*dt + vd.template getProp<force>(a)[0]*dt205;
881 double dy = vd.template getProp<velocity>(a)[1]*dt + vd.template getProp<force>(a)[1]*dt205;
882 double dz = vd.template getProp<velocity>(a)[2]*dt + vd.template getProp<force>(a)[2]*dt205;
888 double d2 = dx*dx + dy*dy + dz*dz;
890 max_disp = (max_disp > d2)?max_disp:d2;
892 double velX = vd.template getProp<velocity>(a)[0];
893 double velY = vd.template getProp<velocity>(a)[1];
894 double velZ = vd.template getProp<velocity>(a)[2];
895 double rhop = vd.template getProp<rho>(a);
897 vd.template getProp<velocity>(a)[0] = vd.template getProp<velocity>(a)[0] + vd.template getProp<force>(a)[0]*dt;
898 vd.template getProp<velocity>(a)[1] = vd.template getProp<velocity>(a)[1] + vd.template getProp<force>(a)[1]*dt;
899 vd.template getProp<velocity>(a)[2] = vd.template getProp<velocity>(a)[2] + vd.template getProp<force>(a)[2]*dt;
900 vd.template getProp<rho>(a) = vd.template getProp<rho>(a) + dt*vd.template getProp<drho>(a);
903 if (vd.
getPos(a)[0] < 0.000263878 || vd.
getPos(a)[1] < 0.000263878 || vd.
getPos(a)[2] < 0.000263878 ||
904 vd.
getPos(a)[0] > 0.000263878+1.59947 || vd.
getPos(a)[1] > 0.000263878+0.672972 || vd.
getPos(a)[2] > 0.000263878+0.903944 ||
905 vd.template getProp<rho>(a) < RhoMin || vd.template getProp<rho>(a) > RhoMax)
907 to_remove.add(a.getKey());
913 vd.template getProp<velocity_prev>(a)[0] = velX;
914 vd.template getProp<velocity_prev>(a)[1] = velY;
915 vd.template getProp<velocity_prev>(a)[2] = velZ;
916 vd.template getProp<rho_prev>(a) = rhop;
924 Vcluster & v_cl = create_vcluster();
928 max_disp = sqrt(max_disp);
935int main(
int argc,
char* argv[])
938 openfpm_init(&argc,&argv);
941 Box<3,double> domain({-0.05,-0.05,-0.05},{1.7010,0.7065,0.5025});
942 size_t sz[3] = {207,90,66};
945 W_dap = 1.0/Wab(H/1.5);
948 size_t bc[3]={NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
950 double skin = 0.25 * 2*H;
951 double r_gskin = 2*H + skin;
957 particles vd(0,domain,bc,g,BIND_DEC_TO_GHOST);
961 Box<3,double> fluid_box({dp/2.0,dp/2.0,dp/2.0},{0.4+dp/2.0,0.67-dp/2.0,0.3+dp/2.0});
967 max_fluid_height = fluid_it.getBoxMargins().
getHigh(2);
968 h_swl = fluid_it.getBoxMargins().
getHigh(2) - fluid_it.getBoxMargins().
getLow(2);
969 B = (coeff_sound)*(coeff_sound)*gravity*h_swl*rho_zero / gamma_;
970 cbar = coeff_sound * sqrt(gravity * h_swl);
973 while (fluid_it.isNext())
984 vd.template getLastProp<type>() = FLUID;
993 vd.template getLastProp<Pressure>() = rho_zero * gravity * (max_fluid_height - fluid_it.get().get(2));
995 vd.template getLastProp<rho>() = pow(vd.template getLastProp<Pressure>() / B + 1, 1.0/gamma_) * rho_zero;
996 vd.template getLastProp<rho_prev>() = vd.template getLastProp<rho>();
997 vd.template getLastProp<velocity>()[0] = 0.0;
998 vd.template getLastProp<velocity>()[1] = 0.0;
999 vd.template getLastProp<velocity>()[2] = 0.0;
1001 vd.template getLastProp<velocity_prev>()[0] = 0.0;
1002 vd.template getLastProp<velocity_prev>()[1] = 0.0;
1003 vd.template getLastProp<velocity_prev>()[2] = 0.0;
1011 Box<3,double> recipient1({0.0,0.0,0.0},{1.6+dp/2.0,0.67+dp/2.0,0.4+dp/2.0});
1012 Box<3,double> recipient2({dp,dp,dp},{1.6-dp/2.0,0.67-dp/2.0,0.4+dp/2.0});
1014 Box<3,double> obstacle1({0.9,0.24-dp/2.0,0.0},{1.02+dp/2.0,0.36,0.45+dp/2.0});
1015 Box<3,double> obstacle2({0.9+dp,0.24+dp/2.0,0.0},{1.02-dp/2.0,0.36-dp,0.45-dp/2.0});
1016 Box<3,double> obstacle3({0.9+dp,0.24,0.0},{1.02,0.36,0.45});
1019 holes.add(recipient2);
1020 holes.add(obstacle1);
1023 while (bound_box.isNext())
1031 vd.template getLastProp<type>() = BOUNDARY;
1032 vd.template getLastProp<rho>() = rho_zero;
1033 vd.template getLastProp<rho_prev>() = rho_zero;
1034 vd.template getLastProp<velocity>()[0] = 0.0;
1035 vd.template getLastProp<velocity>()[1] = 0.0;
1036 vd.template getLastProp<velocity>()[2] = 0.0;
1038 vd.template getLastProp<velocity_prev>()[0] = 0.0;
1039 vd.template getLastProp<velocity_prev>()[1] = 0.0;
1040 vd.template getLastProp<velocity_prev>()[2] = 0.0;
1047 while (obstacle_box.isNext())
1051 vd.
getLastPos()[0] = obstacle_box.get().get(0);
1052 vd.
getLastPos()[1] = obstacle_box.get().get(1);
1053 vd.
getLastPos()[2] = obstacle_box.get().get(2);
1055 vd.template getLastProp<type>() = BOUNDARY;
1056 vd.template getLastProp<rho>() = rho_zero;
1057 vd.template getLastProp<rho_prev>() = rho_zero;
1058 vd.template getLastProp<velocity>()[0] = 0.0;
1059 vd.template getLastProp<velocity>()[1] = 0.0;
1060 vd.template getLastProp<velocity>()[2] = 0.0;
1062 vd.template getLastProp<velocity_prev>()[0] = 0.0;
1063 vd.template getLastProp<velocity_prev>()[1] = 0.0;
1064 vd.template getLastProp<velocity_prev>()[2] = 0.0;
1081 Vcluster & v_cl = create_vcluster();
1092 for (
size_t i ; i < create_vcluster().getProcessUnitID() ; i++)
1095 while(debug_it.isNext())
1097 auto a = debug_it.get();
1105 vd.
ghost_get<type,rho,Pressure,velocity,12>();
1115 double tot_disp = 0.0;
1119 Vcluster & v_cl = create_vcluster();
1140 std::cout <<
"REBALANCED " << std::endl;
1149 vd.
ghost_get<type,rho,Pressure,velocity,12>();
1159 std::cout <<
"RECONSTRUCT Verlet " << std::endl;
1169 double max_visc = 0.0;
1172 calc_forces(vd,NN,max_visc,r_gskin);
1179 double dt = calc_deltaT(vd,max_visc);
1184 verlet_int(vd,dt,max_disp);
1187 euler_int(vd,dt,max_disp);
1191 tot_disp += max_disp;
1197 vd.
write(
"Geometry",write);
1202 std::cout <<
"TIME: " << t <<
" write " << it_time.
getwct() <<
" " << v_cl.
getProcessUnitID() <<
" TOT disp: " << tot_disp <<
" " << cnt << std::endl;
1207 std::cout <<
"TIME: " << t <<
" " << it_time.
getwct() <<
" " << v_cl.
getProcessUnitID() <<
" TOT disp: " << tot_disp <<
" " << cnt << std::endl;
This class represent an N-dimensional box.
__device__ __host__ T getLow(int i) const
get the i-coordinate of the low bound interval of the box
__device__ __host__ T getHigh(int i) const
get the high interval of the box
This class define the domain decomposition interface.
static PointIteratorSkin< dim, T, typename vd_type::Decomposition_type > DrawSkin(vd_type &vd, size_t(&sz)[dim], Box< dim, T > &domain, Box< dim, T > &sub_A, Box< dim, T > &sub_B)
Draw particles in a box B excluding the area of a second box A (B - A)
static PointIterator< dim, T, typename vd_type::Decomposition_type > DrawBox(vd_type &vd, size_t(&sz)[dim], Box< dim, T > &domain, Box< dim, T > &sub)
Draw particles in a box.
This class implement the point shape in an N-dimensional space.
__device__ __host__ const T & get(unsigned int i) const
Get coordinate.
void execute()
Execute all the requests.
size_t getProcessUnitID()
Get the process unit id.
bool allGather(T &send, openfpm::vector< T, Mem, gr > &v)
Gather the data from all processors.
void max(T &num)
Get the maximum number across all processors (or reduction with infinity norm)
Implementation of VCluster class.
Class for Verlet list implementation.
CellListImpl & getInternalCellList()
Get the internal cell-list used to construct the Verlet-list.
Implementation of 1-D std::vector like structure.
Class for cpu time benchmarking.
double getwct()
Return the elapsed real time.
vect_dist_key_dx get()
Get the actual key.
size_t size_local() const
return the local size of the vector
void remove(openfpm::vector< size_t > &keys, size_t start=0)
Remove a set of elements from the distributed vector.
auto getProp(vect_dist_key_dx vec_key) -> decltype(v_prp.template get< id >(vec_key.getKey()))
Get the property of an element.
size_t size_local_with_ghost() const
return the local size of the vector
openfpm::vector_key_iterator_seq< typename vrl::Mem_type_type::local_index_type > getParticleIteratorCRS(vrl &NN)
Get a special particle iterator able to iterate across particles using symmetric crossing scheme.
auto getPos(vect_dist_key_dx vec_key) -> decltype(v_pos.template get< 0 >(vec_key.getKey()))
Get the position of an element.
CellL getCellList(St r_cut, bool no_se3=false)
Construct a cell list starting from the stored particles.
vector_dist_iterator getDomainIterator() const
Get an iterator that traverse the particles in the domain.
void ghost_get(size_t opt=WITH_POSITION)
It synchronize the properties and position of the ghost particles.
void map(size_t opt=NONE)
It move all the particles that does not belong to the local processor to the respective processor.
bool write(std::string out, int opt=VTK_WRITER)
Output particle position and properties.
auto getLastPos() -> decltype(v_pos.template get< 0 >(0))
Get the position of the last element.
VerletL getVerletCrs(St r_cut)
for each particle get the symmetric verlet list
vector_dist_iterator getDomainAndGhostIterator() const
Get an iterator that traverse the particles in the domain.
void add()
Add local particle.
void addComputationCosts(const self &vd, Model md=Model())
Add the computation cost on the decomposition coming from the particles.
Decomposition & getDecomposition()
Get the decomposition.
Model for Dynamic load balancing.