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
913232cb
Commit
913232cb
authored
Dec 19, 2017
by
Matthieu Schaller
Browse files
Avoid empty cells in the long-range gravity tasks.
parent
6021d143
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
913232cb
...
...
@@ -2321,6 +2321,10 @@ void engine_make_self_gravity_tasks(struct engine *e) {
if
(
periodic
)
for
(
int
i
=
0
;
i
<
s
->
nr_cells
;
++
i
)
{
const
struct
cell
*
c
=
&
s
->
cells_top
[
i
];
/* Skip empty cells */
if
(
c
->
gcount
==
0
)
continue
;
/* Did we correctly attach the FFT task ghosts? */
if
(
c
->
nodeID
==
engine_rank
&&
(
c
->
grav_ghost_in
==
NULL
||
c
->
grav_ghost_out
==
NULL
))
error
(
"Invalid gravity_ghost for local cell"
);
...
...
src/runner_doiact_grav.h
View file @
913232cb
...
...
@@ -1179,6 +1179,9 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci, int timer) {
/* Avoid self contributions */
if
(
ci
==
cj
)
continue
;
/* Skip empty cells */
if
(
cj
->
gcount
==
0
)
continue
;
/* Get the distance between the CoMs at the last rebuild*/
double
dx_r
=
CoM_rebuild_i
[
0
]
-
multi_j
->
CoM_rebuild
[
0
];
double
dy_r
=
CoM_rebuild_i
[
1
]
-
multi_j
->
CoM_rebuild
[
1
];
...
...
Matthieu Schaller
@matthieu
mentioned in issue
#383 (closed)
·
Dec 19, 2017
mentioned in issue
#383 (closed)
mentioned in issue #383
Toggle commit list
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