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
ce5b5ac3
Commit
ce5b5ac3
authored
Mar 24, 2018
by
Matthieu Schaller
Browse files
When generating gas particles from DM ICs, check that the IDs do not overflow.
parent
3f7769ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/space.c
View file @
ce5b5ac3
...
...
@@ -3245,6 +3245,12 @@ void space_generate_gas(struct space *s, const struct cosmology *cosmo,
p
->
id
=
gp_gas
->
id_or_neg_offset
*
2
+
1
;
gp_dm
->
id_or_neg_offset
*=
2
;
if
(
gp_dm
->
id_or_neg_offset
<=
0
)
error
(
"DM particle ID overflowd"
);
if
(
p
->
id
<=
0
)
error
(
"gas particle ID overflowd"
);
/* Set the links correctly */
p
->
gpart
=
gp_gas
;
gp_gas
->
id_or_neg_offset
=
-
i
;
...
...
@@ -3277,7 +3283,7 @@ void space_generate_gas(struct space *s, const struct cosmology *cosmo,
p
->
v
[
2
]
=
gp_gas
->
v_full
[
2
];
/* Set the smoothing length to the mean inter-particle separation */
p
->
h
=
d
;
p
->
h
=
30
.
*
d
;
}
/* Replace the content of the space */
...
...
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