diff --git a/examples/ZeldovichPancake_3D/zeldovichPancake.yml b/examples/ZeldovichPancake_3D/zeldovichPancake.yml index 62041621aeff2eded4ab92d8f78e3623fa5dcea6..7028be99632fcce038f995c10fc0f16bb36381b3 100644 --- a/examples/ZeldovichPancake_3D/zeldovichPancake.yml +++ b/examples/ZeldovichPancake_3D/zeldovichPancake.yml @@ -15,7 +15,7 @@ TimeIntegration: Snapshots: basename: zeldovichPancake # Common part of the name of output files time_first: 0. # Time of the first output (in internal units) - delta_time: 1.04 # Time difference between consecutive outputs (in internal units) + delta_time: 1.01 # Time difference between consecutive outputs (in internal units) scale_factor_first: 0.00991 # Parameters governing the conserved quantities statistics @@ -47,6 +47,6 @@ Gravity: mesh_side_length: 16 eta: 0.025 theta: 0.85 - r_cut_max: 5. + r_cut_max: 6. comoving_softening: 0.0001 max_physical_softening: 0.0001 diff --git a/examples/plot_gravity_checks.py b/examples/plot_gravity_checks.py index 1a3d1b014ea38240899e7b0060c267aecadeb67e..23866ac2a6952ff918dbc80533269c0d2e9bcbc5 100644 --- a/examples/plot_gravity_checks.py +++ b/examples/plot_gravity_checks.py @@ -46,21 +46,21 @@ step = int(sys.argv[1]) periodic = int(sys.argv[2]) # Find the files for the different expansion orders -order_list = glob.glob("gravity_checks_swift_step%d_order*.dat"%step) +order_list = glob.glob("gravity_checks_swift_step%.4d_order*.dat"%step) num_order = len(order_list) # Get the multipole orders order = np.zeros(num_order) for i in range(num_order): - order[i] = int(order_list[i][32]) + order[i] = int(order_list[i][35]) order = sorted(order) order_list = sorted(order_list) # Read the exact accelerations first if periodic: - data = np.loadtxt('gravity_checks_exact_periodic_step%d.dat'%step) + data = np.loadtxt('gravity_checks_exact_periodic_step%.4d.dat'%step) else: - data = np.loadtxt('gravity_checks_exact_step%d.dat'%step) + data = np.loadtxt('gravity_checks_exact_step%.4d.dat'%step) exact_ids = data[:,0] exact_pos = data[:,1:4] exact_a = data[:,4:7] @@ -303,5 +303,5 @@ plt.ylim(0,1.75) -plt.savefig("gravity_checks_step%d.png"%step, dpi=200) -plt.savefig("gravity_checks_step%d.pdf"%step, dpi=200) +plt.savefig("gravity_checks_step%.4d.png"%step, dpi=200) +plt.savefig("gravity_checks_step%.4d.pdf"%step, dpi=200) diff --git a/src/engine.c b/src/engine.c index 5eadd6b364ae00668565f1b38a93e1297308b97f..3299c52a4ada1bb25a72f5aec0d8d557cf5d3208 100644 --- a/src/engine.c +++ b/src/engine.c @@ -5436,6 +5436,7 @@ void engine_unpin(void) { * @param cosmo The #cosmology used for this run. * @param hydro The #hydro_props used for this run. * @param gravity The #gravity_props used for this run. + * @param mesh The #pm_mesh used for the long-range periodic forces. * @param potential The properties of the external potential. * @param cooling_func The properties of the cooling function. * @param chemistry The chemistry information. diff --git a/src/gravity.c b/src/gravity.c index 5d572f98dfed0cc8698d16568168f666244b05a4..d0eb589d15ba89aecc5a581de0c143dc7504d3ee 100644 --- a/src/gravity.c +++ b/src/gravity.c @@ -416,9 +416,9 @@ int gravity_exact_force_file_exits(const struct engine *e) { /* File name */ char file_name[100]; if (e->s->periodic) - sprintf(file_name, "gravity_checks_exact_periodic_step%d.dat", e->step); + sprintf(file_name, "gravity_checks_exact_periodic_step%.4d.dat", e->step); else - sprintf(file_name, "gravity_checks_exact_step%d.dat", e->step); + sprintf(file_name, "gravity_checks_exact_step%.4d.dat", e->step); /* Does the file exist ? */ if (access(file_name, R_OK | W_OK) == 0) { @@ -647,7 +647,7 @@ void gravity_exact_force_check(struct space *s, const struct engine *e, /* File name */ char file_name_swift[100]; - sprintf(file_name_swift, "gravity_checks_swift_step%d_order%d.dat", e->step, + sprintf(file_name_swift, "gravity_checks_swift_step%.4d_order%d.dat", e->step, SELF_GRAVITY_MULTIPOLE_ORDER); /* Creare files and write header */ @@ -703,10 +703,10 @@ void gravity_exact_force_check(struct space *s, const struct engine *e, char file_name_exact[100]; if (s->periodic) - sprintf(file_name_exact, "gravity_checks_exact_periodic_step%d.dat", + sprintf(file_name_exact, "gravity_checks_exact_periodic_step%.4d.dat", e->step); else - sprintf(file_name_exact, "gravity_checks_exact_step%d.dat", e->step); + sprintf(file_name_exact, "gravity_checks_exact_step%.4d.dat", e->step); FILE *file_exact = fopen(file_name_exact, "w"); fprintf(file_exact, "# Gravity accuracy test - EXACT FORCES\n"); diff --git a/src/mesh_gravity.c b/src/mesh_gravity.c index 5e39e27d2af190ac984759bd827b9d06ca8394e0..886ded57406c11cba505a73373d1f2482ed45bf6 100644 --- a/src/mesh_gravity.c +++ b/src/mesh_gravity.c @@ -479,7 +479,7 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct engine* e) { * @param mesh The #pm_mesh (containing the potential) to interpolate from. * @param e The #engine (to check active status). * @param gparts The #gpart to interpolate to. - * @param gcount The number of #gparts. + * @param gcount The number of #gpart. */ void pm_mesh_interpolate_forces(const struct pm_mesh* mesh, const struct engine* e, struct gpart* gparts,