Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
99c339a8
Commit
99c339a8
authored
Sep 12, 2018
by
Matthieu Schaller
Browse files
More detailed timers for the PM calculation.
parent
ed1fb797
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
99c339a8
...
...
@@ -131,6 +131,8 @@ tests/testEOS
tests/testEOS*.txt
tests/testEOS*.png
tests/testUtilities
tests/testCosmology
tests/testOutputList
tests/testCbrt
tests/testFormat.sh
...
...
src/mesh_gravity.c
View file @
99c339a8
...
...
@@ -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); */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment