#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include "Math/ExtendedMath.h"
#include "Math/Helpers.h"
#include "Math/Vector.h"
Go to the source code of this file.
|
class | CFile |
| takes data and fstat files and splits them into *.data.???? and *.fstat.???? files More...
|
|
int main |
( |
int argc |
, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 445 of file ConvertP4Files.cpp.
References CFile::copy(), and helpers::writeToFile().
451 std::cout <<
"no arguments given, so a test file is converted; to convert your own p4 files, use:" << std::endl;
452 std::cout <<
"convertP4Files.cpp name xmin xmax ymin ymax zmin zmax [timeMin [timeMax [periodic]]]" << std::endl;
455 "TIMESTEP PARTICLES\n"
457 "ID GROUP VOLUME MASS PX PY PZ VX VY VZ Angular_Velocity_X Angular_Velocity_Y Angular_Velocity_Z\n"
458 "1 1 0.52359877559 1 0.5 0.5 0.5 1 0 0 0 0 1\n"
459 "3 1 0.52359877559 1 3.5 0.5 0.5 0 0 0 0 0 0\n"
460 "TIMESTEP PARTICLES\n"
462 "ID GROUP VOLUME MASS PX PY PZ VX VY VZ Angular_Velocity_X Angular_Velocity_Y Angular_Velocity_Z\n"
463 "1 1 0.52359877559 1 0.5 0.5 0.5 1 0 0 0 0 1\n"
464 "3 1 0.52359877559 1 3.5 0.5 0.5 0 0 0 0 0 0\n"
468 "TIMESTEP CONTACTS\n"
470 "P1 P2 CX CY CZ FX FY FZ\n"
471 "1 3 0 0.5 0.5 1 1 0\n"
472 "TIMESTEP CONTACTS\n"
474 "P1 P2 CX CY CZ FX FY FZ\n"
475 "1 3 4 0.5 0.5 1 1 0\n"
479 "TIMESTEP CONTACTS\n"
481 "P1 CX CY CZ FX FY FZ\n"
482 "1 0.5 0.5 0 0 0 1\n"
483 "3 3.5 0.5 0 0 0 1\n"
484 "TIMESTEP CONTACTS\n"
486 "P1 CX CY CZ FX FY FZ\n"
487 "1 0.5 0.5 0 0 0 1\n"
488 "3 3.5 0.5 0 0 0 1\n"
492 files.copy(0,4,0,1,0,1,-1,1e20,1);
496 std::cerr <<
"convertP4Files.cpp problem_name xmin xmax ymin ymax zmin zmax [timeMin [timeMax [periodic]]]" << std::endl;
502 std::string name(argv[1]);
503 std::cout <<
"converting " << name << std::endl;
507 timeMin = atof(argv[8]);
508 std::cout <<
"timeMin " << timeMin << std::endl;
511 double timeMax = 1e20;
513 timeMax = atof(argv[9]);
514 std::cout <<
"timeMax " << timeMax << std::endl;
517 unsigned int periodic = 0;
519 periodic = atoi(argv[10]);
520 std::cout <<
"periodic " << periodic << std::endl;
524 files.copy(atof(argv[2]),atof(argv[3]),atof(argv[4]),atof(argv[5]),atof(argv[6]),atof(argv[7]),timeMin,timeMax,periodic);
526 std::cout <<
"finished converting " << name << std::endl;
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
takes data and fstat files and splits them into *.data.???? and *.fstat.???? files ...