diff --git a/.gitignore b/.gitignore index a2fd8d3d6e932eff75dcd0d80e22a4073f7c2bd3..e47ab3086cfbb52be6c42d3c1b9a3d0a28fa4525 100644 --- a/.gitignore +++ b/.gitignore @@ -131,6 +131,8 @@ tests/testEOS tests/testEOS*.txt tests/testEOS*.png tests/testUtilities +tests/testCosmology +tests/testOutputList tests/testCbrt tests/testFormat.sh diff --git a/src/mesh_gravity.c b/src/mesh_gravity.c index 8cad7b621a58cd211a7e84d083894c73eb8c641a..182e4fdd9c249d0d43415ad3e4b5e1e47dfd545a 100644 --- a/src/mesh_gravity.c +++ b/src/mesh_gravity.c @@ -437,14 +437,20 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s, /* message("\n\n\n DENSITY"); */ /* print_array(rho, N); */ - const ticks tic2 = getticks(); + tic = getticks(); /* Fourier transform to go to magic-land */ fftw_execute(forward_plan); + if (verbose) + message("Forward Fourier transform took %.3f %s.", + clocks_from_ticks(getticks() - tic), clocks_getunit()); + /* frho now contains the Fourier transform of the density field */ /* frho contains NxNx(N/2+1) complex numbers */ + tic = getticks(); + /* Some common factors */ const double green_fac = -1. / (M_PI * box_size); const double a_smooth2 = 4. * M_PI * M_PI * r_s * r_s / (box_size * box_size); @@ -506,18 +512,25 @@ void pm_mesh_compute_potential(struct pm_mesh* mesh, const struct space* s, frho[0][0] = 0.; frho[0][1] = 0.; + if (verbose) + message("Applying Green function took %.3f %s.", + clocks_from_ticks(getticks() - tic), clocks_getunit()); + + tic = getticks(); + /* Fourier transform to come back from magic-land */ fftw_execute(inverse_plan); + if (verbose) + message("Backwards Fourier transform took %.3f %s.", + clocks_from_ticks(getticks() - tic), clocks_getunit()); + /* rho now contains the potential */ /* This array is now again NxNxN real numbers */ + /* Let's store it in the structure */ mesh->potential = rho; - if (verbose) - message("Fourier-space PM took %.3f %s.", - clocks_from_ticks(getticks() - tic2), clocks_getunit()); - /* message("\n\n\n POTENTIAL"); */ /* print_array(potential, N); */