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
0a0cff1d
Commit
0a0cff1d
authored
Apr 03, 2017
by
Matthieu Schaller
Browse files
Corrected a mistake in the drifting of the multipoles that did not recurse correctly.
parent
707ef041
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
0a0cff1d
...
...
@@ -1077,8 +1077,8 @@ void cell_check_multipole_drift_point(struct cell *c, void *data) {
if
(
c
->
ti_old_multipole
!=
ti_drift
)
error
(
"Cell multipole in an incorrect time-zone! c->ti_old_multipole=%lld "
"ti_drift=%lld"
,
c
->
ti_old_multipole
,
ti_drift
);
"ti_drift=%lld
(depth=%d)
"
,
c
->
ti_old_multipole
,
ti_drift
,
c
->
depth
);
#else
error
(
"Calling debugging code without debugging flag activated."
);
...
...
@@ -1504,18 +1504,17 @@ void cell_drift_all_multipoles(struct cell *c, const struct engine *e) {
/* Check that we are actually going to move forward. */
if
(
ti_current
<
ti_old_multipole
)
error
(
"Attempt to drift to the past"
);
/* Drift the multipole */
if
(
ti_current
>
ti_old_multipole
)
gravity_drift
(
c
->
multipole
,
dt
);
/* Are we not in a leaf ? */
if
(
c
->
split
)
{
/* Loop over the progeny and
drift the multipoles
. */
/* Loop over the progeny and
recurse
. */
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
cell_drift_particles
(
c
->
progeny
[
k
],
e
);
}
else
if
(
ti_current
>
ti_old_multipole
)
{
/* Drift the multipole */
gravity_drift
(
c
->
multipole
,
dt
);
if
(
c
->
progeny
[
k
]
!=
NULL
)
cell_drift_all_multipoles
(
c
->
progeny
[
k
],
e
);
}
/* Update the time of the last drift */
...
...
src/engine.c
View file @
0a0cff1d
...
...
@@ -3312,7 +3312,7 @@ void engine_do_drift_all_mapper(void *map_data, int num_elements,
/* Drift all the particles */
cell_drift_particles
(
c
,
e
);
/* Drift the multipole */
/* Drift the multipole
s
*/
if
(
e
->
policy
&
engine_policy_self_gravity
)
cell_drift_all_multipoles
(
c
,
e
);
}
...
...
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