Export also velocities

This commit is contained in:
Guilhem Lavaux 2014-05-20 16:53:51 +02:00
parent 468f5222b8
commit c88599aa59

View File

@ -30,17 +30,20 @@ int main(int argc, char **argv)
SimuData *p = loadGadgetMulti(fname, 0, 0); SimuData *p = loadGadgetMulti(fname, 0, 0);
double L0 = p->BoxSize/1000; double L0 = p->BoxSize/1000;
array_type parts(boost::extents[p->TotalNumPart][3]); array_type parts(boost::extents[p->TotalNumPart][6]);
uint64_t q = 0; uint64_t q = 0;
try { try {
for (int cpuid=0;;cpuid++) { for (int cpuid=0;;cpuid++) {
p = loadGadgetMulti(fname, cpuid, NEED_POSITION); p = loadGadgetMulti(fname, cpuid, NEED_POSITION|NEED_VELOCITY);
for (uint32_t i = 0; i < p->NumPart; i++) for (uint32_t i = 0; i < p->NumPart; i++)
{ {
parts[q][0] = p->Pos[0][i]/1000; parts[q][0] = p->Pos[0][i]/1000;
parts[q][1] = p->Pos[1][i]/1000; parts[q][1] = p->Pos[1][i]/1000;
parts[q][2] = p->Pos[2][i]/1000; parts[q][2] = p->Pos[2][i]/1000;
parts[q][3] = p->Vel[0][i];
parts[q][4] = p->Vel[1][i];
parts[q][5] = p->Vel[2][i];
q++; q++;
} }