Commit 307a7b40 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

More robust debugging checks in the PM gravity tasks.

parent 4c992de2
......@@ -145,7 +145,7 @@ ylabel("${\\rm{Peculiar Velocity}}~v_x$", labelpad=0)
# Density profile --------------------------------
subplot(232, yscale="log")
subplot(232)#, yscale="log")
if np.size(x_g) > 1:
plot(x_g, rho_g/rho_0, 's', color='g', alpha=0.8, lw=1.2, ms=4)
plot(x, rho/rho_0, '.', color='r', ms=4.0)
......@@ -161,8 +161,8 @@ plot(x, phi, '.', color='r', ms=4.0)
xlabel("${\\rm{Comoving Position}}~x$", labelpad=0)
ylabel("${\\rm{Potential}}~\\phi$", labelpad=0)
# Internal energy profile -------------------------
subplot(234, yscale="log")
# Temperature profile -------------------------
subplot(234)#, yscale="log")
u *= (unit_length_in_si**2 / unit_time_in_si**2)
u_g *= (unit_length_in_si**2 / unit_time_in_si**2)
u /= a**(3 * (gas_gamma - 1.))
......
......@@ -504,8 +504,12 @@ static INLINE void runner_dopair_grav_pm_full(
const float r_max2 = r_max_j * r_max_j;
const float theta_crit2 = e->gravity_properties->theta_crit2;
if (!gravity_M2P_accept(r_max2, theta_crit2, r2))
error("use_mpole[i] set when M2P accept fails");
/* 1.01 to avoid FP rounding false-positives */
if (!gravity_M2P_accept(r_max2, theta_crit2 * 1.01, r2))
error(
"use_mpole[i] set when M2P accept fails CoM=[%e %e %e] pos=[%e %e "
"%e], rmax=%e",
CoM_j[0], CoM_j[1], CoM_j[2], x_i, y_i, z_i, r_max_j);
#endif
/* Interact! */
......@@ -594,8 +598,12 @@ static INLINE void runner_dopair_grav_pm_truncated(
const float r_max2 = r_max_j * r_max_j;
const float theta_crit2 = e->gravity_properties->theta_crit2;
if (!gravity_M2P_accept(r_max2, theta_crit2, r2))
error("use_mpole[i] set when M2P accept fails");
/* 1.01 to avoid FP rounding false-positives */
if (!gravity_M2P_accept(r_max2, theta_crit2 * 1.01, r2))
error(
"use_mpole[i] set when M2P accept fails CoM=[%e %e %e] pos=[%e %e "
"%e], rmax=%e",
CoM_j[0], CoM_j[1], CoM_j[2], x_i, y_i, z_i, r_max_j);
#endif
/* Interact! */
......
......@@ -32,7 +32,7 @@ typedef long long integertime_t;
typedef char timebin_t;
/*! The number of time bins */
#define num_time_bins 27
#define num_time_bins 56
/*! The maximal number of timesteps in a simulation */
#define max_nr_timesteps (1LL << (num_time_bins + 1))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment