Program received signal SIGSEGV, Segmentation fault.0x000000000045e983 in reposition (f=..., P=0) at /u/omriargov/software/basilisk/src/vof-tracer-particles.h:6666 if (f[] > 1e-6 && f[] < 1 - 1e-6) {event init(t=0){ //ssi = true; if (!restore (file = "restart")) { refine (sq(x-X0/2) + sq(y-DROP_HEIGHT) < sq(RADIUS + RADIUS*0.1) && level < maxlevel); fraction(f, sq(RADIUS) - sq(x-X0/2) - sq (y - DROP_HEIGHT));//The drop
int Pnr = 1000; Pin = new_vof_tracer_particles (Pnr, 1); //Assign phase f[] = 1 place_in_circle (Pin, (struct Init_P){Pnr, X0/2, 0, RADIUS}); particle_boundary (Pin); } else { int Pnr = 1000; Pin = new_vof_tracer_particles (Pnr, 1); //Assign phase f[] = 1 prestore ("dumplist");
}}
event snapshot (t += 0.0001){ char name[80]; vorticity (u, omega); boundary ((scalar *){omega}); sprintf (name, "dump-%.6f", t); dump (file = name); Particles Plist[1] = {Pin}; sprintf (name, "dumplist-%.6f", t); pdump (name, Plist);}
int Pnr = 1000; Pin = new_vof_tracer_particles (Pnr, 1); //Assign phase f[] = 1 prestore ("dumplist");
Hi all,
First of all, thank you to Antoon for the very useful tracer-particles module!
I encountered a floating-point exception on restart. After investigation, it happens in the RK scheme: Basilisk restarts from the last step which can be the first or second step, but dtf[0] is only initialised in setp1. So a fix that worked was to add 'dtf[0] = dt' in tracer_particles_step2 :
event tracer_particles_step2 (i = 1; i += 2) {
dtf[0] = dt;
dtf[1] = dt;
foreach_P_in_list (tracer_particles) {
particle_boundary (P);
RK_step2 (P, dtf);
}
}
I'm using the particles with an embed configuration, and I used remove_particles() to prevent particles from entering the solid (otherwise it ends up with an exception), and the restart seems fine.
I’ve added a function to ouput particles in a paraview format in MPI (.vtu) to be used with Acastillo’s sandbox, that I should soon put in a repository.
Cheers,
Cyprien