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
......@@ -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;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment