diff --git a/src/loadRamses.cpp b/src/loadRamses.cpp index 84d2b82..0eed042 100644 --- a/src/loadRamses.cpp +++ b/src/loadRamses.cpp @@ -194,6 +194,7 @@ typedef struct double unitLength; double aexp; double boxSize; + double hubble; } InfoData; int readInfoFile(const char *basename, int outputId, InfoData& info) @@ -249,6 +250,10 @@ int readInfoFile(const char *basename, int outputId, InfoData& info) info.aexp = infoMap["aexp"]; info.boxSize = infoMap["boxlen"]; + static const double CM_IN_MPC = 3.08e24; + double unit_t = infoMap["unit_t"]; + info.hubble = info.aexp*info.aexp/unit_t / (1e5/CM_IN_MPC); + return 1; } @@ -267,7 +272,10 @@ CosmoTool::PurePositionData *CosmoTool::loadRamsesPosition(const char *basename, double L0 = info.boxSize*info.unitLength/CM_IN_MPC/info.aexp; if (!quiet) - cout << "L0=" << L0 << " Mpc" << endl; + { + cout << "L0=" << L0 << " Mpc" << endl; + cout << "H=" << info.hubble << " km/s/Mpc" << endl; + } if (!quiet) cout << "Detecting number of files and particles..." << endl; @@ -320,6 +328,7 @@ CosmoTool::PurePositionData *CosmoTool::loadRamsesPosition(const char *basename, assert(gd->pos != 0); gd->NumPart = totPart; gd->BoxSize = L0*1000; + gd->hubble = info.hubble; if (!quiet) cout << " Total number part=" << totPart << endl diff --git a/src/load_data.hpp b/src/load_data.hpp index be2f088..a153815 100644 --- a/src/load_data.hpp +++ b/src/load_data.hpp @@ -60,11 +60,13 @@ namespace CosmoTool { struct PurePositionData { unsigned int NumPart; double BoxSize; + double hubble; FCoordinates *pos; }; struct PhaseSpaceData { unsigned int NumPart; + double hubble; double BoxSize; FCoordinates *pos; FCoordinates *vel;