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
b5b6c6dc
Commit
b5b6c6dc
authored
Jan 11, 2019
by
Matthieu Schaller
Browse files
Use the correct offset for the particle arrays when re-linking.
parent
9a8b7e4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
b5b6c6dc
...
...
@@ -103,6 +103,11 @@ int cell_getsize(struct cell *c) {
*/
int
cell_link_parts
(
struct
cell
*
c
,
struct
part
*
parts
)
{
#ifdef SWIFT_DEBUG_CHECKS
if
(
c
->
hydro
.
parts
!=
NULL
)
error
(
"Linking parts into a cell that was already linked"
);
#endif
c
->
hydro
.
parts
=
parts
;
/* Fill the progeny recursively, depth-first. */
...
...
@@ -151,7 +156,7 @@ int cell_link_foreign_parts(struct cell *c, struct part *parts) {
int
count
=
0
;
for
(
int
k
=
0
;
k
<
8
;
k
++
)
{
if
(
c
->
progeny
[
k
]
!=
NULL
)
{
count
+=
cell_link_foreign_parts
(
c
->
progeny
[
k
],
parts
);
count
+=
cell_link_foreign_parts
(
c
->
progeny
[
k
],
&
parts
[
count
]
);
}
}
return
count
;
...
...
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