63#include "Vector/vector_dist.hpp"
65#include "Draw/DrawParticles.hpp"
67typedef float real_number;
76const real_number dp = 0.0085;
79real_number h_swl = 0.0;
82const real_number coeff_sound = 20.0;
85const real_number gamma_ = 7.0;
88const real_number H = 0.0147224318643;
91const real_number Eta2 = 0.01 * H*H;
94const real_number visco = 0.1;
97real_number cbar = 0.0;
100const real_number MassFluid = 0.000614125;
103const real_number MassBound = 0.000614125;
107const real_number t_end = 0.001;
109const real_number t_end = 1.5;
113const real_number gravity = 9.81;
116const real_number rho_zero = 1000.0;
122const real_number CFLnumber = 0.2;
125const real_number DtMin = 0.00001;
128const real_number RhoMin = 700.0;
131const real_number RhoMax = 1300.0;
134real_number max_fluid_height = 0.0;
139const size_t type = 0;
145const int rho_prev = 2;
148const int Pressure = 3;
157const int velocity = 6;
160const int velocity_prev = 7;
167typedef vector_dist_gpu<3,real_number,aggregate<size_t,real_number, real_number, real_number, real_number, real_number[3], real_number[3], real_number[3], real_number, real_number>>
particles;
176 template<
typename Decomposition,
typename vector>
inline void addComputation(
Decomposition & dec,
181 if (vd.template getProp<type>(p) == FLUID)
182 dec.addComputationCost(v,4);
184 dec.addComputationCost(v,3);
187 template<
typename Decomposition>
inline void applyModel(
Decomposition & dec,
size_t v)
189 dec.setSubSubDomainComputationCost(v, dec.getSubSubDomainComputationCost(v) * dec.getSubSubDomainComputationCost(v));
192 real_number distributionTol()
198template<
typename vd_type>
199__global__
void EqState_gpu(vd_type vd, real_number B)
201 auto a = GET_PARTICLE(vd);
203 real_number rho_a = vd.template getProp<rho>(a);
204 real_number rho_frac = rho_a / rho_zero;
206 vd.template getProp<Pressure>(a) = B*( rho_frac*rho_frac*rho_frac*rho_frac*rho_frac*rho_frac*rho_frac - 1.0);
211 auto it = vd.getDomainIteratorGPU();
216 CUDA_LAUNCH(EqState_gpu,it,vd.toKernel(),B)
220const real_number a2 = 1.0/M_PI/H/H/H;
222inline __device__ __host__ real_number Wab(real_number r)
227 return (1.0 - 3.0/2.0*r*r + 3.0/4.0*r*r*r)*a2;
229 return (1.0/4.0*(2.0 - r*r)*(2.0 - r*r)*(2.0 - r*r))*a2;
235const real_number c1 = -3.0/M_PI/H/H/H/H;
236const real_number d1 = 9.0/4.0/M_PI/H/H/H/H;
237const real_number c2 = -3.0/4.0/M_PI/H/H/H/H;
238const real_number a2_4 = 0.25*a2;
240real_number W_dap = 0.0;
244 const real_number qq=r/H;
246 real_number qq2 = qq * qq;
247 real_number fac1 = (c1*qq + d1*qq2)/r;
248 real_number b1 = (qq < 1.0)?1.0f:0.0f;
250 real_number wqq = (2.0 - qq);
251 real_number fac2 = c2 * wqq * wqq / r;
252 real_number b2 = (qq >= 1.0 && qq < 2.0)?1.0f:0.0f;
254 real_number factor = (b1*fac1 + b2*fac2);
256 DW.
get(0) = factor * dx.
get(0);
257 DW.
get(1) = factor * dx.
get(1);
258 DW.
get(2) = factor * dx.
get(2);
262inline __device__ __host__ real_number Tensile(real_number r, real_number rhoa, real_number rhob, real_number prs1, real_number prs2, real_number W_dap)
264 const real_number qq=r/H;
269 real_number wqq1=2.0f-qq;
270 real_number wqq2=wqq1*wqq1;
272 wab=a2_4*(wqq2*wqq1);
276 real_number wqq2=qq*qq;
277 real_number wqq3=wqq2*qq;
279 wab=a2*(1.0f-1.5f*wqq2+0.75f*wqq3);
283 real_number fab=wab*W_dap;
285 const real_number tensilp1=(prs1/(rhoa*rhoa))*(prs1>0? 0.01: -0.2);
286 const real_number tensilp2=(prs2/(rhob*rhob))*(prs2>0? 0.01: -0.2);
288 return (fab*(tensilp1+tensilp2));
292inline __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)
294 const real_number dot = dr.
get(0)*dv.
get(0) + dr.
get(1)*dv.
get(1) + dr.
get(2)*dv.
get(2);
295 const real_number dot_rr2 = dot/(rr2+Eta2);
296 visc=(dot_rr2 < visc)?visc:dot_rr2;
300 const float amubar=H*dot_rr2;
301 const float robar=(rhoa+rhob)*0.5f;
302 const float pi_visc=(-visco*cbar*amubar/robar);
310template<
typename particles_type,
typename NN_type>
311__global__
void calc_forces_gpu(
particles_type vd, NN_type NN, real_number W_dap, real_number cbar)
314 auto a = GET_PARTICLE(vd);
316 real_number max_visc = 0.0;
322 real_number massa = (vd.template getProp<type>(a) == FLUID)?MassFluid:MassBound;
325 real_number rhoa = vd.template getProp<rho>(a);
328 real_number Pa = vd.template getProp<Pressure>(a);
334 vd.template getProp<force>(a)[0] = 0.0;
335 vd.template getProp<force>(a)[1] = 0.0;
336 vd.template getProp<force>(a)[2] = -gravity;
337 vd.template getProp<drho>(a) = 0.0;
340 if (vd.template getProp<type>(a) != FLUID)
345 auto Np = NN.getNNIterator(NN.getCell(vd.
getPos(a)));
348 while (Np.isNext() ==
true)
357 if (a == b) {++Np;
continue;};
360 real_number massb = (vd.template getProp<type>(b) == FLUID)?MassFluid:MassBound;
366 real_number Pb = vd.template getProp<Pressure>(b);
367 real_number rhob = vd.template getProp<rho>(b);
372 real_number r2 = norm2(dr);
378 real_number r = sqrt(r2);
385 const real_number dot = dr.
get(0)*dv.
get(0) + dr.
get(1)*dv.
get(1) + dr.
get(2)*dv.
get(2);
386 const real_number dot_rr2 = dot/(r2+Eta2);
387 max_visc = (dot_rr2 < max_visc)?max_visc:dot_rr2;
389 vd.template getProp<drho>(a) += massb*(dv.
get(0)*DW.
get(0)+dv.
get(1)*DW.
get(1)+dv.
get(2)*DW.
get(2));
395 vd.template getProp<red>(a) = max_visc;
402 auto Np = NN.getNNIterator(NN.getCell(vd.
getPos(a)));
405 while (Np.isNext() ==
true)
414 if (a == b) {++Np;
continue;};
416 real_number massb = (vd.template getProp<type>(b) == FLUID)?MassFluid:MassBound;
418 real_number Pb = vd.template getProp<Pressure>(b);
419 real_number rhob = vd.template getProp<rho>(b);
424 real_number r2 = norm2(dr);
429 real_number r = sqrt(r2);
436 real_number factor = - massb*((vd.template getProp<Pressure>(a) + vd.template getProp<Pressure>(b)) / (rhoa * rhob) + Tensile(r,rhoa,rhob,Pa,Pb,W_dap) + Pi(dr,r2,v_rel,rhoa,rhob,massb,cbar,max_visc));
438 vd.template getProp<force>(a)[0] += factor * DW.
get(0);
439 vd.template getProp<force>(a)[1] += factor * DW.
get(1);
440 vd.template getProp<force>(a)[2] += factor * DW.
get(2);
442 vd.template getProp<drho>(a) += massb*(v_rel.
get(0)*DW.
get(0)+v_rel.
get(1)*DW.
get(1)+v_rel.
get(2)*DW.
get(2));
448 vd.template getProp<red>(a) = max_visc;
452template<
typename CellList>
inline void calc_forces(
particles & vd,
CellList & NN, real_number & max_visc,
size_t cnt)
454 auto part = vd.getDomainIteratorGPU(32);
460 CUDA_LAUNCH(calc_forces_gpu,part,vd.toKernel(),NN.toKernel(),W_dap,cbar)
462 max_visc = reduce_local<red,_max_>(vd);
465template<
typename vector_type>
466__global__
void max_acceleration_and_velocity_gpu(
vector_type vd)
468 auto a = GET_PARTICLE(vd);
471 vd.template getProp<red>(a) = norm(acc);
474 vd.template getProp<red2>(a) = norm(vel);
477void max_acceleration_and_velocity(
particles & vd, real_number & max_acc, real_number & max_vel)
480 auto part = vd.getDomainIteratorGPU();
483 CUDA_LAUNCH(max_acceleration_and_velocity_gpu,part,vd.toKernel());
485 max_acc = reduce_local<red,_max_>(vd);
486 max_vel = reduce_local<red2,_max_>(vd);
495real_number calc_deltaT(
particles & vd, real_number ViscDtMax)
497 real_number Maxacc = 0.0;
498 real_number Maxvel = 0.0;
499 max_acceleration_and_velocity(vd,Maxacc,Maxvel);
502 const real_number dt_f = (Maxacc)?sqrt(H/Maxacc):std::numeric_limits<int>::max();
505 const real_number dt_cv = H/(std::max(cbar,Maxvel*10.f) + H*ViscDtMax);
508 real_number dt=real_number(CFLnumber)*std::min(dt_f,dt_cv);
509 if(dt<real_number(DtMin))
510 {dt=real_number(DtMin);}
515template<
typename vector_dist_type>
516__global__
void verlet_int_gpu(vector_dist_type vd, real_number dt, real_number dt2, real_number dt205)
519 auto a = GET_PARTICLE(vd);
522 if (vd.template getProp<type>(a) == BOUNDARY)
525 real_number rhop = vd.template getProp<rho>(a);
528 vd.template getProp<velocity>(a)[0] = 0.0;
529 vd.template getProp<velocity>(a)[1] = 0.0;
530 vd.template getProp<velocity>(a)[2] = 0.0;
531 real_number rhonew = vd.template getProp<rho_prev>(a) + dt2*vd.template getProp<drho>(a);
532 vd.template getProp<rho>(a) = (rhonew < rho_zero)?rho_zero:rhonew;
534 vd.template getProp<rho_prev>(a) = rhop;
536 vd.template getProp<red>(a) = 0;
542 real_number dx = vd.template getProp<velocity>(a)[0]*dt + vd.template getProp<force>(a)[0]*dt205;
543 real_number dy = vd.template getProp<velocity>(a)[1]*dt + vd.template getProp<force>(a)[1]*dt205;
544 real_number dz = vd.template getProp<velocity>(a)[2]*dt + vd.template getProp<force>(a)[2]*dt205;
546 vd.getPos(a)[0] += dx;
547 vd.getPos(a)[1] += dy;
548 vd.getPos(a)[2] += dz;
550 real_number velX = vd.template getProp<velocity>(a)[0];
551 real_number velY = vd.template getProp<velocity>(a)[1];
552 real_number velZ = vd.template getProp<velocity>(a)[2];
554 real_number rhop = vd.template getProp<rho>(a);
556 vd.template getProp<velocity>(a)[0] = vd.template getProp<velocity_prev>(a)[0] + vd.template getProp<force>(a)[0]*dt2;
557 vd.template getProp<velocity>(a)[1] = vd.template getProp<velocity_prev>(a)[1] + vd.template getProp<force>(a)[1]*dt2;
558 vd.template getProp<velocity>(a)[2] = vd.template getProp<velocity_prev>(a)[2] + vd.template getProp<force>(a)[2]*dt2;
559 vd.template getProp<rho>(a) = vd.template getProp<rho_prev>(a) + dt2*vd.template getProp<drho>(a);
564 if (vd.getPos(a)[0] < 0.000263878 || vd.getPos(a)[1] < 0.000263878 || vd.getPos(a)[2] < 0.000263878 ||
565 vd.getPos(a)[0] > 0.000263878+1.59947 || vd.getPos(a)[1] > 0.000263878+0.672972 || vd.getPos(a)[2] > 0.50 ||
566 vd.template getProp<rho>(a) < RhoMin || vd.template getProp<rho>(a) > RhoMax)
567 {vd.template getProp<red>(a) = 1;}
569 {vd.template getProp<red>(a) = 0;}
573 vd.template getProp<velocity_prev>(a)[0] = velX;
574 vd.template getProp<velocity_prev>(a)[1] = velY;
575 vd.template getProp<velocity_prev>(a)[2] = velZ;
576 vd.template getProp<rho_prev>(a) = rhop;
581void verlet_int(
particles & vd, real_number dt)
584 auto part = vd.getDomainIteratorGPU();
586 real_number dt205 = dt*dt*0.5;
587 real_number dt2 = dt*2.0;
590 CUDA_LAUNCH(verlet_int_gpu,part,vd.toKernel(),dt,dt2,dt205);
595 remove_marked<red>(vd);
603template<
typename vector_type>
604__global__
void euler_int_gpu(
vector_type vd,real_number dt, real_number dt205)
607 auto a = GET_PARTICLE(vd);
610 if (vd.template getProp<type>(a) == BOUNDARY)
613 real_number rhop = vd.template getProp<rho>(a);
616 vd.template getProp<velocity>(a)[0] = 0.0;
617 vd.template getProp<velocity>(a)[1] = 0.0;
618 vd.template getProp<velocity>(a)[2] = 0.0;
619 real_number rhonew = vd.template getProp<rho>(a) + dt*vd.template getProp<drho>(a);
620 vd.template getProp<rho>(a) = (rhonew < rho_zero)?rho_zero:rhonew;
622 vd.template getProp<rho_prev>(a) = rhop;
624 vd.template getProp<red>(a) = 0;
630 real_number dx = vd.template getProp<velocity>(a)[0]*dt + vd.template getProp<force>(a)[0]*dt205;
631 real_number dy = vd.template getProp<velocity>(a)[1]*dt + vd.template getProp<force>(a)[1]*dt205;
632 real_number dz = vd.template getProp<velocity>(a)[2]*dt + vd.template getProp<force>(a)[2]*dt205;
638 real_number velX = vd.template getProp<velocity>(a)[0];
639 real_number velY = vd.template getProp<velocity>(a)[1];
640 real_number velZ = vd.template getProp<velocity>(a)[2];
641 real_number rhop = vd.template getProp<rho>(a);
643 vd.template getProp<velocity>(a)[0] = vd.template getProp<velocity>(a)[0] + vd.template getProp<force>(a)[0]*dt;
644 vd.template getProp<velocity>(a)[1] = vd.template getProp<velocity>(a)[1] + vd.template getProp<force>(a)[1]*dt;
645 vd.template getProp<velocity>(a)[2] = vd.template getProp<velocity>(a)[2] + vd.template getProp<force>(a)[2]*dt;
646 vd.template getProp<rho>(a) = vd.template getProp<rho>(a) + dt*vd.template getProp<drho>(a);
649 if (vd.
getPos(a)[0] < 0.000263878 || vd.
getPos(a)[1] < 0.000263878 || vd.
getPos(a)[2] < 0.000263878 ||
650 vd.
getPos(a)[0] > 0.000263878+1.59947 || vd.
getPos(a)[1] > 0.000263878+0.672972 || vd.
getPos(a)[2] > 0.50 ||
651 vd.template getProp<rho>(a) < RhoMin || vd.template getProp<rho>(a) > RhoMax)
652 {vd.template getProp<red>(a) = 1;}
654 {vd.template getProp<red>(a) = 0;}
656 vd.template getProp<velocity_prev>(a)[0] = velX;
657 vd.template getProp<velocity_prev>(a)[1] = velY;
658 vd.template getProp<velocity_prev>(a)[2] = velZ;
659 vd.template getProp<rho_prev>(a) = rhop;
662void euler_int(
particles & vd, real_number dt)
666 auto part = vd.getDomainIteratorGPU();
668 real_number dt205 = dt*dt*0.5;
671 CUDA_LAUNCH(euler_int_gpu,part,vd.toKernel(),dt,dt205);
674 remove_marked<red>(vd);
679template<
typename vector_type,
typename NN_type>
682 real_number tot_ker = 0.0;
688 auto itg = NN.getNNIterator(NN.getCell(xp));
694 if (vd.template getProp<type>(q) != FLUID)
705 real_number r = sqrt(norm2(xp - xq));
707 real_number ker = Wab(r) * (MassFluid / rho_zero);
714 *press_tmp += vd.template getProp<Pressure>(q) * ker;
725 {*press_tmp = 1.0 / tot_ker * *press_tmp;}
728template<
typename Vector,
typename CellList>
729inline void sensor_pressure(
Vector & vd,
738 for (
size_t i = 0 ; i < probes.size() ; i++)
742 real_number press_tmp;
745 if (vd.getDecomposition().isLocal(probes.get(i)) ==
true)
748 CUDA_LAUNCH_DIM3(sensor_pressure_gpu,1,1,vd.toKernel(),NN.toKernel(),probes.
get(i),(real_number *)press_tmp_.toKernel());
751 press_tmp_.deviceToHost();
752 press_tmp = *(real_number *)press_tmp_.getPointer();
762 press_t.last().add(press_tmp);
766int main(
int argc,
char* argv[])
769 openfpm_init(&argc,&argv);
775 probes.add({0.8779,0.3,0.02});
776 probes.add({0.754,0.31,0.02});
780 size_t sz[3] = {207,90,66};
783 W_dap = 1.0/Wab(H/1.5);
786 size_t bc[3]={NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
791 particles vd(0,domain,bc,g,DEC_GRAN(512));
797 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});
803 max_fluid_height = fluid_it.getBoxMargins().
getHigh(2);
804 h_swl = fluid_it.getBoxMargins().
getHigh(2) - fluid_it.getBoxMargins().
getLow(2);
805 B = (coeff_sound)*(coeff_sound)*gravity*h_swl*rho_zero / gamma_;
806 cbar = coeff_sound * sqrt(gravity * h_swl);
809 while (fluid_it.isNext())
815 vd.getLastPos()[0] = fluid_it.get().get(0);
816 vd.getLastPos()[1] = fluid_it.get().get(1);
817 vd.getLastPos()[2] = fluid_it.get().get(2);
820 vd.template getLastProp<type>() = FLUID;
829 vd.template getLastProp<Pressure>() = rho_zero * gravity * (max_fluid_height - fluid_it.get().get(2));
831 vd.template getLastProp<rho>() = pow(vd.template getLastProp<Pressure>() / B + 1, 1.0/gamma_) * rho_zero;
832 vd.template getLastProp<rho_prev>() = vd.template getLastProp<rho>();
833 vd.template getLastProp<velocity>()[0] = 0.0;
834 vd.template getLastProp<velocity>()[1] = 0.0;
835 vd.template getLastProp<velocity>()[2] = 0.0;
837 vd.template getLastProp<velocity_prev>()[0] = 0.0;
838 vd.template getLastProp<velocity_prev>()[1] = 0.0;
839 vd.template getLastProp<velocity_prev>()[2] = 0.0;
846 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});
849 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});
850 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});
854 holes.add(recipient2);
855 holes.add(obstacle1);
858 while (bound_box.isNext())
862 vd.getLastPos()[0] = bound_box.get().get(0);
863 vd.getLastPos()[1] = bound_box.get().get(1);
864 vd.getLastPos()[2] = bound_box.get().get(2);
866 vd.template getLastProp<type>() = BOUNDARY;
867 vd.template getLastProp<rho>() = rho_zero;
868 vd.template getLastProp<rho_prev>() = rho_zero;
869 vd.template getLastProp<velocity>()[0] = 0.0;
870 vd.template getLastProp<velocity>()[1] = 0.0;
871 vd.template getLastProp<velocity>()[2] = 0.0;
873 vd.template getLastProp<velocity_prev>()[0] = 0.0;
874 vd.template getLastProp<velocity_prev>()[1] = 0.0;
875 vd.template getLastProp<velocity_prev>()[2] = 0.0;
882 while (obstacle_box.isNext())
886 vd.getLastPos()[0] = obstacle_box.get().get(0);
887 vd.getLastPos()[1] = obstacle_box.get().get(1);
888 vd.getLastPos()[2] = obstacle_box.get().get(2);
890 vd.template getLastProp<type>() = BOUNDARY;
891 vd.template getLastProp<rho>() = rho_zero;
892 vd.template getLastProp<rho_prev>() = rho_zero;
893 vd.template getLastProp<velocity>()[0] = 0.0;
894 vd.template getLastProp<velocity>()[1] = 0.0;
895 vd.template getLastProp<velocity>()[2] = 0.0;
897 vd.template getLastProp<velocity_prev>()[0] = 0.0;
898 vd.template getLastProp<velocity_prev>()[1] = 0.0;
899 vd.template getLastProp<velocity_prev>()[2] = 0.0;
909 vd.addComputationCosts(md);
910 vd.getDecomposition().decompose();
917 vd.hostToDevicePos();
918 vd.template hostToDeviceProp<type,rho,rho_prev,Pressure,velocity,velocity_prev>();
920 vd.ghost_get<type,rho,Pressure,velocity>(RUN_ON_DEVICE);
922 auto NN = vd.getCellListGPU(2*H);
940 vd.map(RUN_ON_DEVICE);
944 vd.addComputationCosts(md);
945 vd.getDecomposition().decompose();
948 {std::cout <<
"REBALANCED " << it_reb << std::endl;}
951 vd.map(RUN_ON_DEVICE);
956 real_number max_visc = 0.0;
958 vd.ghost_get<type,rho,Pressure,velocity>(RUN_ON_DEVICE);
961 calc_forces(vd,NN,max_visc,cnt);
968 real_number dt = calc_deltaT(vd,max_visc);
986 vd.map(RUN_ON_DEVICE);
987 vd.ghost_get<type,rho,Pressure,velocity>(RUN_ON_DEVICE);
988 vd.updateCellList(NN);
993 std::cout <<
"OUTPUT " << dt << std::endl;
997 vd.deviceToHostPos();
998 vd.deviceToHostProp<type,rho,rho_prev,Pressure,drho,force,velocity,velocity_prev,
red,red2>();
1000 vd.write_frame(
"Geometry",write);
1004 {std::cout <<
"TIME: " << t <<
" write " << it_time.
getwct() <<
" " << it_reb <<
" " << cnt <<
" Max visc: " << max_visc <<
" " << vd.size_local() << std::endl;}
1009 {std::cout <<
"TIME: " << t <<
" " << it_time.
getwct() <<
" " << it_reb <<
" " << cnt <<
" Max visc: " << max_visc <<
" " << vd.size_local() << std::endl;}
1014 std::cout <<
"Time to complete: " << tot_sim.
getwct() <<
" seconds" << std::endl;
1021int 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