mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Slight re-organization of C/C++ tools. Significant modifications to support observational data. Python and pipeline scripts added
This commit is contained in:
parent
15496df4ff
commit
14abbc2018
42 changed files with 16252 additions and 557 deletions
47
c_tools/mock/generateTestMock.cpp
Normal file
47
c_tools/mock/generateTestMock.cpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue