Merge branch 'master' of file:///home/guilhem/Dropbox/gitRoot/CosmoToolbox

This commit is contained in:
Guilhem Lavaux 2010-06-29 17:54:20 -04:00
commit d9eb97525d
6 changed files with 41 additions and 7 deletions

View file

@ -247,7 +247,7 @@ void UnformattedWrite::endCheckpoint()
if (checkPointAccum == 0)
throw InvalidUnformattedAccess();
ostream::streampos curPos = f->tellp();
streampos curPos = f->tellp();
int64_t deltaPos = curPos-checkPointRef;

View file

@ -28,7 +28,7 @@ PurePositionData *CosmoTool::loadGadgetPosition(const char *fname)
h.npartTotal[i] = f.readInt32();
h.flag_cooling = f.readInt32();
h.num_files = f.readInt32();
h.BoxSize = f.readReal64();
data->BoxSize = h.BoxSize = f.readReal64();
h.Omega0 = f.readReal64();
h.OmegaLambda = f.readReal64();
h.HubbleParam = f.readReal64();

View file

@ -1,3 +1,4 @@
#include <sys/types.h>
#include <regex.h>
#include <cmath>
#include <cstring>
@ -436,12 +437,13 @@ CosmoTool::PhaseSpaceData *CosmoTool::loadRamsesPhase(const char *basename, int
if (!readInfoFile(basename, outputId, info))
return 0;
double unit_vel = info.unitLength/info.unit_t/1e5;
double hubble = info.aexp*info.aexp/info.unit_t / (1e5/CM_IN_MPC);
double L0 = info.boxSize*info.unitLength/CM_IN_MPC/info.aexp;
double L0 = info.boxSize*info.unitLength*hubble/(100*CM_IN_MPC)/info.aexp;
double unit_vel = 100*L0/info.aexp;
if (!quiet) {
cout << "L0=" << L0 << " Mpc" << endl;
cout << "H=" << hubble << " km/s/Mpc" << endl;
cout << "unit_vel=" << unit_vel << " km/s" << endl;
}
if (!quiet)

View file

@ -212,6 +212,7 @@ namespace CosmoTool {
template<typename T>
void loadArray(const char *fname,
T*&array, uint32_t *&dimList, uint32_t& rank)
throw (NoSuchFileException)
{
NcFile f(fname, NcFile::ReadOnly);

View file

@ -183,9 +183,11 @@ namespace CosmoTool
template<typename T>
void saveArray(const char *fname,
T *array, uint32_t *dimList, uint32_t rank);
template<typename T>
void loadArray(const char *fname,
T*& array, uint32_t *& dimList, uint32_t& rank);
T*& array, uint32_t *& dimList, uint32_t& rank)
throw (NoSuchFileException);
ProgressiveDoubleOutput saveDoubleArrayProgressive(const char *fname, uint32_t *dimList, uint32_t rank);
};