diff --git a/src/loadRamses.cpp b/src/loadRamses.cpp index d243c1a..7999cf6 100644 --- a/src/loadRamses.cpp +++ b/src/loadRamses.cpp @@ -433,7 +433,7 @@ CosmoTool::SimuData *CosmoTool::loadRamsesSimu(const char *basename, int outputI -CosmoTool::PurePositionData *CosmoTool::loadRamsesPosition(const char *basename, int outputId, bool quiet) +CosmoTool::PurePositionData *CosmoTool::loadRamsesPosition(const char *basename, int outputId, bool quiet, bool dp) { PurePositionData *gd = (PurePositionData *)malloc(sizeof(PurePositionData)); int id = 1; @@ -542,6 +542,25 @@ CosmoTool::PurePositionData *CosmoTool::loadRamsesPosition(const char *basename, nPar = infile.readInt32(); infile.endCheckpoint(); + infile.beginCheckpoint(); + for (int i = 0; i < 4; i++) infile.readInt32(); + infile.endCheckpoint(); + + infile.beginCheckpoint(); + infile.readInt32(); + infile.endCheckpoint(); + + infile.beginCheckpoint(); + infile.readReal64(); + infile.endCheckpoint(); + + infile.beginCheckpoint(); + infile.readReal64(); + infile.endCheckpoint(); + + infile.beginCheckpoint(); + infile.readInt32(); + infile.endCheckpoint(); FCoordinates *s = new FCoordinates[nPar]; @@ -550,7 +569,7 @@ CosmoTool::PurePositionData *CosmoTool::loadRamsesPosition(const char *basename, infile.beginCheckpoint(); for (uint32_t i = 0; i < nPar; i++) { - s[i][k] = infile.readReal32(); + s[i][k] = dp ? infile.readReal64() : infile.readReal32(); s[i][k] *= gd->BoxSize; } infile.endCheckpoint(); @@ -561,7 +580,7 @@ CosmoTool::PurePositionData *CosmoTool::loadRamsesPosition(const char *basename, infile.beginCheckpoint(); for (uint32_t i = nPar; i > 0; i--) { - infile.readReal32(); + (dp ? infile.readReal64() : infile.readReal32()); } infile.endCheckpoint(); } @@ -570,7 +589,7 @@ CosmoTool::PurePositionData *CosmoTool::loadRamsesPosition(const char *basename, infile.beginCheckpoint(); for (uint32_t i = nPar; i > 0; i--) { - float dummyF = infile.readReal32(); + float dummyF = dp ? infile.readReal64() : infile.readReal32(); if (dummyF < minMass) minMass = dummyF; } infile.endCheckpoint(); diff --git a/src/loadRamses.hpp b/src/loadRamses.hpp index c3efc84..f09d569 100644 --- a/src/loadRamses.hpp +++ b/src/loadRamses.hpp @@ -7,7 +7,7 @@ namespace CosmoTool { GadgetData *loadRamses(const char *name, bool quiet = false); - PurePositionData *loadRamsesPosition(const char *fname, int id, bool quiet = false); + PurePositionData *loadRamsesPosition(const char *fname, int id, bool quiet = false, bool dp = true); PhaseSpaceData *loadRamsesPhase(const char *fname, int id, bool quiet = false); PhaseSpaceDataID *loadRamsesPhase1(const char *fname, int id, int cpuid, bool quiet = false);