Merged SDF and KDtree bits from private repo

This commit is contained in:
Guilhem Lavaux 2014-06-04 17:39:18 +02:00
parent 60f283c958
commit 162d7bd09b
135 changed files with 110 additions and 28632 deletions

View file

@ -27,12 +27,14 @@
#include <CosmoTool/loadRamses.hpp>
#include <CosmoTool/fortran.hpp>
#include "simulation_loader.hpp"
#include <libsdf/cosmo.h>
using boost::format;
using namespace std;
using namespace CosmoTool;
static const double one_kpc = 3.08567802e16; /* km */
static const double one_Gyr = 3.1558149984e16; /* sec */
class MultiDarkLoader: public SimulationLoader
{
protected:

View file

@ -26,16 +26,44 @@
#include <string>
#include "sdfloader_internal.hpp"
#include "simulation_loader.hpp"
#include <libsdf/mpmy.h>
#include <libsdf/SDF.h>
#include <libsdf/error.h>
#include <libsdf/cosmo.h>
#include <libSDF/SDF.h>
#undef SDFgetfloatOrDie
#undef SDFgetdoubleOrDie
#undef SDFgetintOrDie
using boost::format;
using namespace std;
using namespace CosmoTool;
static const double one_kpc = 3.08567802e16; /* km */
static const double one_Gyr = 3.1558149984e16; /* sec */
static void SDFgetfloatOrDie(SDF *sdfp, const char *name, float *v)
{
if( SDFgetfloat(sdfp, name, v) ) {
cerr << format("SDFgetfloat(%s) failed") % name << endl;
abort();
}
}
static void SDFgetdoubleOrDie(SDF *sdfp, const char *name, double *v)
{
if( SDFgetdouble(sdfp, name, v) ) {
cerr << format("SDFgetdouble(%s) failed") % name << endl;
abort();
}
}
static void SDFgetintOrDie(SDF *sdfp, const char *name, int *v)
{
if( SDFgetint(sdfp, name, v) ) {
cerr << format("SDFgetint(%s) failed") % name << endl;
abort();
}
}
class SDFLoader: public SimulationLoader
{
private:
@ -277,5 +305,4 @@ SimulationLoader *sdfLoader(const std::string& snapshot, int flags,
void sdfLoaderInit(int& argc, char **& argv)
{
MPMY_Init(&argc, &argv);
}