Can't restart system with more than 1 planet
@elena did anyone actually restarted a system with more than one planet ?
std::vector<real>
GetDescFromPlanetFile (std::string fname, int timeStep, int n) {
std::ifstream ifs(OFilePathIndexed(fname, n)); // this is an planet indexed file => each planet has it own file. So.......
std::string line;
while (std::getline(ifs, line)) {
std::vector<std::string> tks;
{
std::istringstream tokenizer(line);
std::copy(std::istream_iterator<std::string>(tokenizer), std::istream_iterator<std::string>(),
std::back_inserter(tks));
}
int timeTag = boost::lexical_cast<int>(tks[0]);
if (timeTag != timeStep) {
continue;
} else { // we have reach the right timStep
if (n > 0) { // .... So this does not make sense.
--n; // not the right planet yet
continue;
} else {
std::vector<real> res;
std::transform(tks.begin()+1, tks.end(), std::back_inserter(res), [](std::string s){ return boost::lexical\
_cast<real>(s);});
return res;
}
}
}
std::abort();
return std::vector<real>();
}