mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-05 07:41:11 +00:00
renamed 'generateMock' routines to 'prep' routines to accurately reflect what they do
This commit is contained in:
parent
b1962100a8
commit
50ad2d6d73
21 changed files with 69 additions and 89 deletions
68
c_tools/prep/generateMock.cpp
Normal file
68
c_tools/prep/generateMock.cpp
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*+
|
||||
VIDE -- Void IDentification and Examination -- ./c_tools/mock/generateTestMock.cpp
|
||||
Copyright (C) 2010-2014 Guilhem Lavaux
|
||||
Copyright (C) 2011-2014 P. M. Sutter
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
+*/
|
||||
|
||||
|
||||
|
||||
#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