42#define PRINT_STACKTRACE
52#include "Vector/vector_dist.hpp"
54#include "Draw/DrawParticles.hpp"
58typedef float real_number;
67const real_number dp = 0.00425;
70real_number h_swl = 0.0;
73const real_number coeff_sound = 20.0;
76const real_number gamma_ = 7.0;
79const real_number H = 0.00736121593217;
82const real_number Eta2 = 0.01 * H*H;
84const real_number FourH2 = 4.0 * H*H;
87const real_number visco = 0.1;
90real_number cbar = 0.0;
93const real_number MassFluid = 0.0000767656;
96const real_number MassBound = 0.0000767656;
102const real_number t_end = 0.001;
104const real_number t_end = 1.5;
108const real_number gravity = 9.81;
111const real_number rho_zero = 1000.0;
117const real_number CFLnumber = 0.2;
120const real_number DtMin = 0.00001;
123const real_number RhoMin = 700.0;
126const real_number RhoMax = 1300.0;
129real_number max_fluid_height = 0.0;
134const size_t type = 0;
140const int rho_prev = 2;
143const int Pressure = 3;
152const int velocity = 6;
155const int velocity_prev = 7;
162typedef vector_dist_gpu<3,real_number,aggregate<unsigned int,real_number, real_number, real_number, real_number, real_number[3], real_number[3], real_number[3], real_number, real_number>>
particles;
171 template<
typename Decomposition,
typename vector>
inline void addComputation(
Decomposition & dec,
176 if (vd.template getProp<type>(p) == FLUID)
177 dec.addComputationCost(v,4);
179 dec.addComputationCost(v,3);
182 template<
typename Decomposition>
inline void applyModel(
Decomposition & dec,
size_t v)
184 dec.setSubSubDomainComputationCost(v, dec.getSubSubDomainComputationCost(v) * dec.getSubSubDomainComputationCost(v));
187 real_number distributionTol()
193template<
typename vd_type>
194__global__
void EqState_gpu(vd_type vd, real_number B)
196 auto a = GET_PARTICLE(vd);
198 real_number rho_a = vd.template getProp<rho>(a);
199 real_number rho_frac = rho_a / rho_zero;
201 vd.template getProp<Pressure>(a) = B*( rho_frac*rho_frac*rho_frac*rho_frac*rho_frac*rho_frac*rho_frac - 1.0);
206 auto it = vd.getDomainIteratorGPU();
208 CUDA_LAUNCH(EqState_gpu,it,vd.toKernel(),B);
212const real_number a2 = 1.0/M_PI/H/H/H;
214inline __device__ __host__ real_number Wab(real_number r)
219 return (1.0 - 3.0/2.0*r*r + 3.0/4.0*r*r*r)*a2;
221 return (1.0/4.0*(2.0 - r*r)*(2.0 - r*r)*(2.0 - r*r))*a2;
227const real_number c1 = -3.0/M_PI/H/H/H/H;
228const real_number d1 = 9.0/4.0/M_PI/H/H/H/H;
229const real_number c2 = -3.0/4.0/M_PI/H/H/H/H;
230const real_number a2_4 = 0.25*a2;
232real_number W_dap = 0.0;
236 const real_number qq=r/H;
238 real_number qq2 = qq * qq;
239 real_number fac1 = (c1*qq + d1*qq2)/r;
240 real_number b1 = (qq < 1.0f)?1.0f:0.0f;
242 real_number wqq = (2.0f - qq);
243 real_number fac2 = c2 * wqq * wqq / r;
244 real_number b2 = (qq >= 1.0f && qq < 2.0f)?1.0f:0.0f;
246 real_number factor = (b1*fac1 + b2*fac2);
248 DW.
get(0) = factor * dx.
get(0);
249 DW.
get(1) = factor * dx.
get(1);
250 DW.
get(2) = factor * dx.
get(2);
255inline __device__ __host__ real_number Tensile(real_number r, real_number rhoa, real_number rhob, real_number prs1, real_number prs2, real_number W_dap)
257 const real_number qq=r/H;
262 real_number wqq1=2.0f-qq;
263 real_number wqq2=wqq1*wqq1;
265 wab=a2_4*(wqq2*wqq1);
269 real_number wqq2=qq*qq;
270 real_number wqq3=wqq2*qq;
272 wab=a2*(1.0f-1.5f*wqq2+0.75f*wqq3);
276 real_number fab=wab*W_dap;
278 const real_number tensilp1=(prs1/(rhoa*rhoa))*(prs1>0.0f? 0.01f: -0.2f);
279 const real_number tensilp2=(prs2/(rhob*rhob))*(prs2>0.0f? 0.01f: -0.2f);
281 return (fab*(tensilp1+tensilp2));
285inline __device__ __host__ real_number Pi(
const Point<3,real_number> & dr, real_number rr2,
Point<3,real_number> & dv, real_number rhoa, real_number rhob, real_number massb, real_number cbar, real_number & visc)
287 const real_number dot = dr.
get(0)*dv.
get(0) + dr.
get(1)*dv.
get(1) + dr.
get(2)*dv.
get(2);
288 const real_number dot_rr2 = dot/(rr2+Eta2);
289 visc=(dot_rr2 < visc)?visc:dot_rr2;
293 const float amubar=H*dot_rr2;
294 const float robar=(rhoa+rhob)*0.5f;
295 const float pi_visc=(-visco*cbar*amubar/robar);
303template<
typename particles_type,
typename NN_type>
304__global__
void calc_forces_gpu(
particles_type vd, NN_type NN, real_number W_dap, real_number cbar)
309 GET_PARTICLE_SORT(a,NN);
311 real_number max_visc = 0.0f;
317 unsigned int typea = vd.template getProp<type>(a);
323 real_number rhoa = vd.template getProp<rho>(a);
326 real_number Pa = vd.template getProp<Pressure>(a);
332 force_.
get(0) = 0.0f;
333 force_.
get(1) = 0.0f;
334 force_.
get(2) = -gravity;
335 real_number drho_ = 0.0f;
338 auto Np = NN.getNNIteratorBox(NN.getCell(xa));
341 while (Np.isNext() ==
true)
344 auto b = Np.get_sort();
350 if (a == b) {++Np;
continue;};
352 unsigned int typeb = vd.template getProp<type>(b);
354 real_number massb = (typeb == FLUID)?MassFluid:MassBound;
356 real_number Pb = vd.template getProp<Pressure>(b);
357 real_number rhob = vd.template getProp<rho>(b);
363 real_number r2 = norm2(dr);
366 if (r2 < FourH2 && r2 >= 1e-16)
368 real_number r = sqrtf(r2);
373 real_number factor = - massb*((Pa + Pb) / (rhoa * rhob) + Tensile(r,rhoa,rhob,Pa,Pb,W_dap) + Pi(dr,r2,v_rel,rhoa,rhob,massb,cbar,max_visc));
376 factor = (typea == BOUNDARY && typeb == BOUNDARY)?0.0f:factor;
378 force_.
get(0) += factor * DW.
get(0);
379 force_.
get(1) += factor * DW.
get(1);
380 force_.
get(2) += factor * DW.
get(2);
382 real_number scal = massb*(v_rel.
get(0)*DW.
get(0)+v_rel.
get(1)*DW.
get(1)+v_rel.
get(2)*DW.
get(2));
383 scal = (typea == BOUNDARY && typeb == BOUNDARY)?0.0f:scal;
391 vd.template getProp<red>(a) = max_visc;
393 vd.template getProp<force>(a)[0] = force_.
get(0);
394 vd.template getProp<force>(a)[1] = force_.
get(1);
395 vd.template getProp<force>(a)[2] = force_.
get(2);
396 vd.template getProp<drho>(a) = drho_;
399template<
typename CellList>
inline void calc_forces(
particles & vd,
CellList & NN, real_number & max_visc,
size_t cnt)
401 auto part = vd.getDomainIteratorGPU(96);
406 CUDA_LAUNCH(calc_forces_gpu,part,vd.toKernel_sorted(),NN.toKernel(),W_dap,cbar);
408 vd.merge_sort<force,drho,
red>(NN);
410 max_visc = reduce_local<red,_max_>(vd);
413template<
typename vector_type>
414__global__
void max_acceleration_and_velocity_gpu(
vector_type vd)
416 auto a = GET_PARTICLE(vd);
419 vd.template getProp<red>(a) = norm(acc);
422 vd.template getProp<red2>(a) = norm(vel);
425void max_acceleration_and_velocity(
particles & vd, real_number & max_acc, real_number & max_vel)
428 auto part = vd.getDomainIteratorGPU();
430 CUDA_LAUNCH(max_acceleration_and_velocity_gpu,part,vd.toKernel());
432 max_acc = reduce_local<red,_max_>(vd);
433 max_vel = reduce_local<red2,_max_>(vd);
442real_number calc_deltaT(
particles & vd, real_number ViscDtMax)
444 real_number Maxacc = 0.0;
445 real_number Maxvel = 0.0;
446 max_acceleration_and_velocity(vd,Maxacc,Maxvel);
449 const real_number dt_f = (Maxacc)?sqrt(H/Maxacc):std::numeric_limits<float>::max();
452 const real_number dt_cv = H/(std::max(cbar,Maxvel*10.f) + H*ViscDtMax);
455 real_number dt=real_number(CFLnumber)*std::min(dt_f,dt_cv);
456 if(dt<real_number(DtMin))
457 {dt=real_number(DtMin);}
462template<
typename vector_dist_type>
463__global__
void verlet_int_gpu(vector_dist_type vd, real_number dt, real_number dt2, real_number dt205)
466 auto a = GET_PARTICLE(vd);
469 if (vd.template getProp<type>(a) == BOUNDARY)
472 real_number rhop = vd.template getProp<rho>(a);
475 vd.template getProp<velocity>(a)[0] = 0.0;
476 vd.template getProp<velocity>(a)[1] = 0.0;
477 vd.template getProp<velocity>(a)[2] = 0.0;
478 real_number rhonew = vd.template getProp<rho_prev>(a) + dt2*vd.template getProp<drho>(a);
479 vd.template getProp<rho>(a) = (rhonew < rho_zero)?rho_zero:rhonew;
481 vd.template getProp<rho_prev>(a) = rhop;
483 vd.template getProp<red>(a) = 0;
489 real_number dx = vd.template getProp<velocity>(a)[0]*dt + vd.template getProp<force>(a)[0]*dt205;
490 real_number dy = vd.template getProp<velocity>(a)[1]*dt + vd.template getProp<force>(a)[1]*dt205;
491 real_number dz = vd.template getProp<velocity>(a)[2]*dt + vd.template getProp<force>(a)[2]*dt205;
493 vd.getPos(a)[0] += dx;
494 vd.getPos(a)[1] += dy;
495 vd.getPos(a)[2] += dz;
497 real_number velX = vd.template getProp<velocity>(a)[0];
498 real_number velY = vd.template getProp<velocity>(a)[1];
499 real_number velZ = vd.template getProp<velocity>(a)[2];
501 real_number rhop = vd.template getProp<rho>(a);
503 vd.template getProp<velocity>(a)[0] = vd.template getProp<velocity_prev>(a)[0] + vd.template getProp<force>(a)[0]*dt2;
504 vd.template getProp<velocity>(a)[1] = vd.template getProp<velocity_prev>(a)[1] + vd.template getProp<force>(a)[1]*dt2;
505 vd.template getProp<velocity>(a)[2] = vd.template getProp<velocity_prev>(a)[2] + vd.template getProp<force>(a)[2]*dt2;
506 vd.template getProp<rho>(a) = vd.template getProp<rho_prev>(a) + dt2*vd.template getProp<drho>(a);
509 if (vd.getPos(a)[0] < 0.0 || vd.getPos(a)[1] < 0.0 || vd.getPos(a)[2] < 0.0 ||
510 vd.getPos(a)[0] > 1.61 || vd.getPos(a)[1] > 0.68 || vd.getPos(a)[2] > 0.50 ||
511 vd.template getProp<rho>(a) < RhoMin || vd.template getProp<rho>(a) > RhoMax)
512 {vd.template getProp<red>(a) = 1;}
514 {vd.template getProp<red>(a) = 0;}
517 vd.template getProp<velocity_prev>(a)[0] = velX;
518 vd.template getProp<velocity_prev>(a)[1] = velY;
519 vd.template getProp<velocity_prev>(a)[2] = velZ;
520 vd.template getProp<rho_prev>(a) = rhop;
525void verlet_int(
particles & vd, real_number dt)
528 auto part = vd.getDomainIteratorGPU();
530 real_number dt205 = dt*dt*0.5;
531 real_number dt2 = dt*2.0;
533 CUDA_LAUNCH(verlet_int_gpu,part,vd.toKernel(),dt,dt2,dt205);
536 remove_marked<red>(vd);
542template<
typename vector_type>
543__global__
void euler_int_gpu(
vector_type vd,real_number dt, real_number dt205)
546 auto a = GET_PARTICLE(vd);
549 if (vd.template getProp<type>(a) == BOUNDARY)
552 real_number rhop = vd.template getProp<rho>(a);
555 vd.template getProp<velocity>(a)[0] = 0.0;
556 vd.template getProp<velocity>(a)[1] = 0.0;
557 vd.template getProp<velocity>(a)[2] = 0.0;
558 real_number rhonew = vd.template getProp<rho>(a) + dt*vd.template getProp<drho>(a);
559 vd.template getProp<rho>(a) = (rhonew < rho_zero)?rho_zero:rhonew;
561 vd.template getProp<rho_prev>(a) = rhop;
563 vd.template getProp<red>(a) = 0;
569 real_number dx = vd.template getProp<velocity>(a)[0]*dt + vd.template getProp<force>(a)[0]*dt205;
570 real_number dy = vd.template getProp<velocity>(a)[1]*dt + vd.template getProp<force>(a)[1]*dt205;
571 real_number dz = vd.template getProp<velocity>(a)[2]*dt + vd.template getProp<force>(a)[2]*dt205;
577 real_number velX = vd.template getProp<velocity>(a)[0];
578 real_number velY = vd.template getProp<velocity>(a)[1];
579 real_number velZ = vd.template getProp<velocity>(a)[2];
580 real_number rhop = vd.template getProp<rho>(a);
582 vd.template getProp<velocity>(a)[0] = vd.template getProp<velocity>(a)[0] + vd.template getProp<force>(a)[0]*dt;
583 vd.template getProp<velocity>(a)[1] = vd.template getProp<velocity>(a)[1] + vd.template getProp<force>(a)[1]*dt;
584 vd.template getProp<velocity>(a)[2] = vd.template getProp<velocity>(a)[2] + vd.template getProp<force>(a)[2]*dt;
585 vd.template getProp<rho>(a) = vd.template getProp<rho>(a) + dt*vd.template getProp<drho>(a);
590 vd.template getProp<rho>(a) < RhoMin || vd.template getProp<rho>(a) > RhoMax)
591 {vd.template getProp<red>(a) = 1;}
593 {vd.template getProp<red>(a) = 0;}
595 vd.template getProp<velocity_prev>(a)[0] = velX;
596 vd.template getProp<velocity_prev>(a)[1] = velY;
597 vd.template getProp<velocity_prev>(a)[2] = velZ;
598 vd.template getProp<rho_prev>(a) = rhop;
601void euler_int(
particles & vd, real_number dt)
605 auto part = vd.getDomainIteratorGPU();
607 real_number dt205 = dt*dt*0.5;
609 CUDA_LAUNCH(euler_int_gpu,part,vd.toKernel(),dt,dt205);
612 remove_marked<red>(vd);
617template<
typename vector_type,
typename NN_type>
620 real_number tot_ker = 0.0;
626 auto itg = NN.getNNIteratorBox(NN.getCell(xp));
629 auto q = itg.get_sort();
632 if (vd.template getProp<type>(q) != FLUID)
643 real_number r = sqrt(norm2(xp - xq));
645 real_number ker = Wab(r) * (MassFluid / rho_zero);
652 *press_tmp += vd.template getProp<Pressure>(q) * ker;
663 {*press_tmp = 1.0 / tot_ker * *press_tmp;}
666template<
typename Vector,
typename CellList>
667inline void sensor_pressure(
Vector & vd,
676 for (
size_t i = 0 ; i < probes.size() ; i++)
680 real_number press_tmp;
683 if (vd.getDecomposition().isLocal(probes.get(i)) ==
true)
685 CUDA_LAUNCH_DIM3(sensor_pressure_gpu,1,1,vd.toKernel_sorted(),NN.toKernel(),probes.
get(i),(real_number *)press_tmp_.toKernel());
687 vd.merge<Pressure>(NN);
690 press_tmp_.deviceToHost();
691 press_tmp = *(real_number *)press_tmp_.getPointer();
701 press_t.last().add(press_tmp);
705int main(
int argc,
char* argv[])
722 openfpm_init(&argc,&argv);
724#if !defined(CUDA_ON_CPU) && !defined(__HIP__)
725 cudaDeviceSetCacheConfig(cudaFuncCachePreferL1);
732 probes.add({0.8779f,0.3f,0.02f});
733 probes.add({0.754f,0.31f,0.02f});
737 size_t sz[3] = {413,179,133};
740 W_dap = 1.0/Wab(H/1.5);
743 size_t bc[3]={NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
748 particles vd(0,domain,bc,g,DEC_GRAN(128));
754 Box<3,real_number> fluid_box({dp/2.0f,dp/2.0f,dp/2.0f},{0.4f+dp/2.0f,0.67f-dp/2.0f,0.3f+dp/2.0f});
760 max_fluid_height = fluid_it.getBoxMargins().
getHigh(2);
761 h_swl = fluid_it.getBoxMargins().
getHigh(2) - fluid_it.getBoxMargins().
getLow(2);
762 B = (coeff_sound)*(coeff_sound)*gravity*h_swl*rho_zero / gamma_;
763 cbar = coeff_sound * sqrt(gravity * h_swl);
766 while (fluid_it.isNext())
772 vd.getLastPos()[0] = fluid_it.get().get(0);
773 vd.getLastPos()[1] = fluid_it.get().get(1);
774 vd.getLastPos()[2] = fluid_it.get().get(2);
777 vd.template getLastProp<type>() = FLUID;
786 vd.template getLastProp<Pressure>() = rho_zero * gravity * (max_fluid_height - fluid_it.get().get(2));
788 vd.template getLastProp<rho>() = pow(vd.template getLastProp<Pressure>() / B + 1, 1.0/gamma_) * rho_zero;
789 vd.template getLastProp<rho_prev>() = vd.template getLastProp<rho>();
790 vd.template getLastProp<velocity>()[0] = 0.0;
791 vd.template getLastProp<velocity>()[1] = 0.0;
792 vd.template getLastProp<velocity>()[2] = 0.0;
794 vd.template getLastProp<velocity_prev>()[0] = 0.0;
795 vd.template getLastProp<velocity_prev>()[1] = 0.0;
796 vd.template getLastProp<velocity_prev>()[2] = 0.0;
803 Box<3,real_number> recipient1({0.0f,0.0f,0.0f},{1.6f+dp/2.0f,0.67f+dp/2.0f,0.4f+dp/2.0f});
806 Box<3,real_number> obstacle1({0.9f,0.24f-dp/2.0f,0.0f},{1.02f+dp/2.0f,0.36f,0.45f+dp/2.0f});
807 Box<3,real_number> obstacle2({0.9f+dp,0.24f+dp/2.0f,0.0f},{1.02f-dp/2.0f,0.36f-dp,0.45f-dp/2.0f});
811 holes.add(recipient2);
812 holes.add(obstacle1);
815 while (bound_box.isNext())
819 vd.getLastPos()[0] = bound_box.get().get(0);
820 vd.getLastPos()[1] = bound_box.get().get(1);
821 vd.getLastPos()[2] = bound_box.get().get(2);
823 vd.template getLastProp<type>() = BOUNDARY;
824 vd.template getLastProp<rho>() = rho_zero;
825 vd.template getLastProp<rho_prev>() = rho_zero;
826 vd.template getLastProp<velocity>()[0] = 0.0;
827 vd.template getLastProp<velocity>()[1] = 0.0;
828 vd.template getLastProp<velocity>()[2] = 0.0;
830 vd.template getLastProp<velocity_prev>()[0] = 0.0;
831 vd.template getLastProp<velocity_prev>()[1] = 0.0;
832 vd.template getLastProp<velocity_prev>()[2] = 0.0;
839 while (obstacle_box.isNext())
843 vd.getLastPos()[0] = obstacle_box.get().get(0);
844 vd.getLastPos()[1] = obstacle_box.get().get(1);
845 vd.getLastPos()[2] = obstacle_box.get().get(2);
847 vd.template getLastProp<type>() = BOUNDARY;
848 vd.template getLastProp<rho>() = rho_zero;
849 vd.template getLastProp<rho_prev>() = rho_zero;
850 vd.template getLastProp<velocity>()[0] = 0.0;
851 vd.template getLastProp<velocity>()[1] = 0.0;
852 vd.template getLastProp<velocity>()[2] = 0.0;
854 vd.template getLastProp<velocity_prev>()[0] = 0.0;
855 vd.template getLastProp<velocity_prev>()[1] = 0.0;
856 vd.template getLastProp<velocity_prev>()[2] = 0.0;
866 vd.addComputationCosts(md);
867 vd.getDecomposition().decompose();
874 vd.hostToDevicePos();
875 vd.template hostToDeviceProp<type,rho,rho_prev,Pressure,velocity,velocity_prev>();
877 vd.ghost_get<type,rho,Pressure,velocity>(RUN_ON_DEVICE);
879 auto NN = vd.getCellListGPU(2*H / 2.0);
899 vd.map(RUN_ON_DEVICE);
902 vd.deviceToHostPos();
903 vd.template deviceToHostProp<type>();
907 vd.addComputationCosts(md);
908 vd.getDecomposition().decompose();
911 {std::cout <<
"REBALANCED " << it_reb << std::endl;}
914 vd.map(RUN_ON_DEVICE);
923 real_number max_visc = 0.0;
925 vd.ghost_get<type,rho,Pressure,velocity>(RUN_ON_DEVICE);
928 calc_forces(vd,NN,max_visc,cnt);
936 real_number dt = calc_deltaT(vd,max_visc);
954 vd.map(RUN_ON_DEVICE);
955 vd.ghost_get<type,rho,Pressure,velocity>(RUN_ON_DEVICE);
956 vd.updateCellList(NN);
961 std::cout <<
"OUTPUT " << dt << std::endl;
965 vd.deviceToHostPos();
966 vd.deviceToHostProp<type,rho,rho_prev,Pressure,drho,force,velocity,velocity_prev,
red,red2>();
971 auto ito = vd.getDomainIterator();
979 vd_out.getLastPos()[0] = vd.getPos(p)[0];
980 vd_out.getLastPos()[1] = vd.getPos(p)[1];
981 vd_out.getLastPos()[2] = vd.getPos(p)[2];
983 vd_out.template getLastProp<0>() = vd.template getProp<type>(p);
985 vd_out.template getLastProp<1>()[0] = vd.template getProp<velocity>(p)[0];
986 vd_out.template getLastProp<1>()[1] = vd.template getProp<velocity>(p)[1];
987 vd_out.template getLastProp<1>()[2] = vd.template getProp<velocity>(p)[2];
992 vd_out.write_frame(
"Particles",write,VTK_WRITER | FORMAT_BINARY);
996 {std::cout <<
"TIME: " << t <<
" write " << it_time.
getwct() <<
" " << it_reb <<
" " << cnt <<
" Max visc: " << max_visc <<
" " << vd.size_local() << std::endl;}
1001 {std::cout <<
"TIME: " << t <<
" " << it_time.
getwct() <<
" " << it_reb <<
" " << cnt <<
" Max visc: " << max_visc <<
" " << vd.size_local() << std::endl;}
1006 std::cout <<
"Time to complete: " << tot_sim.
getwct() <<
" seconds" << std::endl;
1014int main(
int argc,
char* argv[])
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
Class for FAST cell list implementation.
auto get(size_t cell, size_t ele) -> decltype(this->Mem_type::get(cell, ele))
Get an element in the cell.
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.
void sum(T &num)
Sum the numbers across all processors and get the result.
size_t getProcessUnitID()
Get the process unit id.
void max(T &num)
Get the maximum number across all processors (or reduction with infinity norm)
Implementation of VCluster class.
Sparse Matrix implementation stub object when OpenFPM is compiled with no linear algebra support.
Implementation of 1-D std::vector like structure.
Class for cpu time benchmarking.
void stop()
Stop the timer.
void start()
Start the timer.
double getwct()
Return the elapsed real time.
void updateCellList(CellL &cell_list, bool no_se3=false, cl_construct_opt opt=cl_construct_opt::Full)
Update a cell list using the stored particles.
auto getPos(vect_dist_key_dx vec_key) -> decltype(v_pos.template get< 0 >(vec_key.getKey()))
Get the position of an element.
Model for Dynamic load balancing.
temporal buffer for reductions