Commit bf561bcc authored by jclamber's avatar jclamber
Browse files

daily...

git-svn-id: http://svn.oamp.fr/repos/uns_projects/trunk@94 f264a43e-d52d-4b82-913b-c2bd5215a18a
parent 5f2a943e
...@@ -23,12 +23,12 @@ using namespace jclut; ...@@ -23,12 +23,12 @@ using namespace jclut;
// //
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// getCodFromFile // getCodFromFile
bool CSnaptools::getCodFromFile(std::string cod_file,const float time,double cod[6], double offset,bool verbose) bool getTimeDataFile(std::string input_file,const float time,std::vector<double> data,double offset, bool verbose)
{ {
bool ok=false; bool ok=false;
std::ifstream fd; // file descriptor std::ifstream fd; // file descriptor
fd.open(cod_file.c_str(), std::ios::in); // open file fd.open(input_file.c_str(), std::ios::in); // open file
if (fd.is_open()) { if (fd.is_open()) {
bool stop=false; bool stop=false;
...@@ -45,7 +45,8 @@ bool CSnaptools::getCodFromFile(std::string cod_file,const float time,double cod ...@@ -45,7 +45,8 @@ bool CSnaptools::getCodFromFile(std::string cod_file,const float time,double cod
stop = true; stop = true;
ok = true; ok = true;
for (int i=0; i<6; i++) { // read cod for (int i=0; i<6; i++) { // read cod
ss >> cod[i]; double value;
ss >> value;
} }
} }
} }
......
...@@ -28,7 +28,7 @@ namespace jclut { ...@@ -28,7 +28,7 @@ namespace jclut {
template <class T> static void moveToCod(const int nbody,T * pos, T * Vel, T * mass, T * rho, double cod[6], bool move, bool verbose=false); template <class T> static void moveToCod(const int nbody,T * pos, T * Vel, T * mass, T * rho, double cod[6], bool move, bool verbose=false);
template <class T> static void moveToCom(const int nbody,T * pos, T * mass, bool verbose=false); template <class T> static void moveToCom(const int nbody,T * pos, T * mass, bool verbose=false);
static bool getCodFromFile(std::string cod_file,const float time,double cod[6],double offset=0.0000001, bool verbose=false); static bool getTimeDataFile(std::string _file,const float time,std::vector<double> data,double offset=0.0000001, bool verbose=false);
static std::string basename(const std::string); static std::string basename(const std::string);
static std::string dirname(const std::string); static std::string dirname(const std::string);
static std::string parseString(std::string & next_string, const std::string sep=","); static std::string parseString(std::string & next_string, const std::string sep=",");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment