Skip to content
Snippets Groups Projects
Commit 1bde8a65 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make sure no 0 or negative ID is read in for DM particles

parent 655198e6
No related branches found
No related tags found
2 merge requests!136Master,!116Basic implementation of gparts
......@@ -487,7 +487,11 @@ void prepare_dm_gparts(struct gpart* gparts, int Ndm) {
/* Let's give all these gparts a negative id */
for (int i = 0; i < Ndm; ++i) {
gparts[i].id = -abs(gparts[i].id);
/* 0 ir negative ids are not allowed */
if(gparts[i].id <= 0) error("0 or negative if for DM particle");
gparts[i].id = -gparts[i].id;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment