Renamed directory mytools to pipeline_tools

This commit is contained in:
Guilhem Lavaux 2012-10-30 11:54:42 -04:00
parent b5ee1cc7a6
commit f6fae36329
14 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,47 @@
#include <iostream>
#include <cstdlib>
#include <CosmoTool/fortran.hpp>
using namespace CosmoTool;
using namespace std;
#define LX 1.0
#define LY 1.0
#define LZ 1.0
#define NUMPART (16*16*16)
int main(int argc, char **argv)
{
UnformattedWrite f("particles.bin");
f.beginCheckpoint();
f.writeInt32(NUMPART);
f.endCheckpoint();
cout << "Writing X components..." << endl;
f.beginCheckpoint();
for (uint32_t i = 0; i < NUMPART; i++)
{
f.writeReal32(drand48()*LX);
}
f.endCheckpoint();
cout << "Writing Y components..." << endl;
f.beginCheckpoint();
for (uint32_t i = 0; i < NUMPART; i++)
{
f.writeReal32(drand48()*LY);
}
f.endCheckpoint();
cout << "Writing Z components..." << endl;
f.beginCheckpoint();
for (uint32_t i = 0; i < NUMPART; i++)
{
f.writeReal32(drand48()*LZ);
}
f.endCheckpoint();
return 0;
}