15 if(
P[i].ID ==
id)
return i;
23 if(
P[i].Type == type)
return i;
31 if(
P[i].Generation == gen)
return i;
38 static char buf[1024];
39 char tmp[20] = {
'\0'};
42 if(
P[i].TimeBin == bin) {
43 snprintf(tmp, 15,
" %d", i);
44 strncat(buf, tmp, 1024-strlen(tmp)-1);
53 if(
P[i].IsGarbage)
return i;
59 static char buf[1024];
63 #define add(fmt, ...) \
64 snprintf(p, n - 1, fmt, __VA_ARGS__ ); \
65 p = buf + strlen(buf); \
66 n = 4096 - strlen(buf)
69 add(
"ID : %ld ",
P[i].ID);
70 add(
"Generation: %d ", (
int)
P[i].Generation);
71 add(
"Mass : %g ",
P[i].Mass);
72 add(
"Pos: %g %g %g ",
P[i].Pos[0],
P[i].Pos[1],
P[i].Pos[2]);
73 add(
"Vel: %g %g %g ",
P[i].Vel[0],
P[i].Vel[1],
P[i].Vel[2]);
74 add(
"GravAccel: %g %g %g ",
P[i].GravAccel[0],
P[i].GravAccel[1],
P[i].GravAccel[2]);
static struct gravpm_params GravPM
struct part_manager_type PartManager[1]