#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <cassert>
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
Go to the source code of this file.
int ChangeDirectory |
( |
const std::string & |
path | ) |
|
Definition at line 20 of file sepin.C.
Referenced by main().
22 return(chdir(path.c_str()));
int CreateDirectory |
( |
const std::string & |
fname | ) |
|
Definition at line 13 of file sepin.C.
16 return(std::string(getcwd(buf,1024)));
bool FILEEXISTS |
( |
const std::string & |
fname | ) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 40 of file sepin.C.
References ChangeDirectory(), CreateDirectory(), FILEEXISTS(), and i.
44 std::string numproc_s(argv[1]);
45 std::istringstream Istr(numproc_s);
46 std::ofstream RocinSurfFile;
47 std::ofstream RocinVolFile;
48 std::ifstream OrigSurfFile;
49 std::ifstream OrigVolFile;
50 OrigSurfFile.open(
"ifluid_in_00.000000.txt");
51 OrigVolFile.open(
"fluid_in_00.000000.txt");
52 std::string surfpanes;
53 std::string surffiles;
57 OrigSurfFile >> junk >> junk >> junk
59 std::getline(OrigSurfFile,surfpanes);
60 OrigVolFile >> junk >> junk >> junk
62 std::getline(OrigVolFile,volpanes);
65 rename(
"ifluid_in_00.000000.txt",
"ifluid_in_00.000000.txt.orig");
66 rename(
"fluid_in_00.000000.txt",
"fluid_in_00.000000.txt.orig");
67 RocinSurfFile.open(
"ifluid_in_00.000000.txt");
68 RocinVolFile.open(
"fluid_in_00.000000.txt");
71 for(
int i = 0;
i < np;
i++){
72 RocinSurfFile <<
"@Proc: " <<
i << std::endl;
73 RocinVolFile <<
"@Proc: " <<
i << std::endl;
75 std::ostringstream Ostr;
76 std::ostringstream Ostr2;
78 int nchar = Ostr2.str().length();
83 RocinSurfFile <<
"@Files: " << Ostr.str() <<
"/" << surffiles << std::endl
84 <<
"@Panes: " << surfpanes << std::endl << std::endl;
85 RocinVolFile <<
"@Files: " << Ostr.str() <<
"/" << volfiles << std::endl
86 <<
"@Panes: " << volpanes << std::endl << std::endl;
92 nchar = 5 - Ostr2.str().length();
98 std::ostringstream FNout;
99 std::ostringstream FNout2;
100 FNout <<
"fluid_" << Ostr.str() <<
".hdf";
101 FNout2 <<
"../fluid_" << Ostr.str() <<
".hdf";
102 symlink(FNout2.str().c_str(),FNout.str().c_str());
107 FNout <<
"ifluid_" << Ostr.str() <<
".hdf";
108 FNout2 <<
"../ifluid_" << Ostr.str() <<
".hdf";
110 symlink(FNout2.str().c_str(),FNout.str().c_str());
113 RocinSurfFile.close();
114 RocinVolFile.close();
bool FILEEXISTS(const std::string &fname)
int ChangeDirectory(const std::string &path)
int CreateDirectory(const std::string &fname)