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
002c5574
Commit
002c5574
authored
Jul 25, 2017
by
Peter W. Draper
Browse files
Check that cells has parts before accessing them
parent
ffbf1f31
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
002c5574
...
...
@@ -3411,7 +3411,7 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs,
if
(
s
->
cells_top
!=
NULL
&&
s
->
nr_parts
>
0
)
{
for
(
int
i
=
0
;
i
<
s
->
nr_cells
;
i
++
)
{
struct
cell
*
c
=
&
s
->
cells_top
[
i
];
if
(
c
->
nodeID
==
engine_rank
)
{
if
(
c
->
nodeID
==
engine_rank
&&
c
->
count
>
0
)
{
float
part_h_max
=
c
->
parts
[
0
].
h
;
for
(
int
k
=
1
;
k
<
c
->
count
;
k
++
)
{
if
(
c
->
parts
[
k
].
h
>
part_h_max
)
part_h_max
=
c
->
parts
[
k
].
h
;
...
...
Peter W. Draper
@pdraper
mentioned in issue
#328 (closed)
·
Jul 25, 2017
mentioned in issue
#328 (closed)
mentioned in issue #328
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