Skip to content
GitLab
Menu
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
f15c30bb
Commit
f15c30bb
authored
Oct 10, 2016
by
Peter W. Draper
Browse files
Use index over particles not indices
parent
43b710d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
f15c30bb
...
...
@@ -447,7 +447,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
if
((
ind
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
ind_size
))
==
NULL
)
error
(
"Failed to allocate temporary particle indices."
);
if
(
ind_size
>
0
)
space_parts_get_cell_index
(
s
,
ind
,
cells_top
,
verbose
);
for
(
size_t
i
=
0
;
i
<
ind_size
;
++
i
)
cells_top
[
ind
[
i
]].
count
++
;
for
(
size_t
i
=
0
;
i
<
s
->
nr_parts
;
++
i
)
cells_top
[
ind
[
i
]].
count
++
;
/* Run through the gravity particles and get their cell index. */
const
size_t
gind_size
=
s
->
size_gparts
;
...
...
@@ -455,7 +455,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
if
((
gind
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
gind_size
))
==
NULL
)
error
(
"Failed to allocate temporary g-particle indices."
);
if
(
gind_size
>
0
)
space_gparts_get_cell_index
(
s
,
gind
,
cells_top
,
verbose
);
for
(
size_t
i
=
0
;
i
<
gind_size
;
++
i
)
cells_top
[
gind
[
i
]].
gcount
++
;
for
(
size_t
i
=
0
;
i
<
s
->
nr_gparts
;
++
i
)
cells_top
[
gind
[
i
]].
gcount
++
;
#ifdef WITH_MPI
...
...
Peter W. Draper
@pdraper
mentioned in merge request
!260 (merged)
·
Oct 10, 2016
mentioned in merge request
!260 (merged)
mentioned in merge request !260
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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