Commit 2ee3c042 authored by Christof Metzger-Kraus's avatar Christof Metzger-Kraus
Browse files

moving files that are generated during run into directory data

parent fe3cc35e
......@@ -128,7 +128,7 @@ enum elements {
void IndexMap::saveSDDS(double startS) const {
std::string fileName(OpalData::getInstance()->getInputBasename() + "_ElementPositions.sdds");
std::string fileName("data/" + OpalData::getInstance()->getInputBasename() + "_ElementPositions.sdds");
std::ofstream sdds;
if (OpalData::getInstance()->hasPriorTrack() && boost::filesystem::exists(fileName)) {
Util::rewindLinesSDDS(fileName, startS, false);
......
......@@ -45,7 +45,7 @@ OrbitThreader::OrbitThreader(const PartData &ref,
reference_m(ref)
{
if (Ippl::myNode() == 0) {
std::string fileName = OpalData::getInstance()->getInputBasename() + "_DesignPath.dat";
std::string fileName = "data/" + OpalData::getInstance()->getInputBasename() + "_DesignPath.dat";
if (Options::openMode == Options::WRITE || !boost::filesystem::exists(fileName)) {
logger_m.open(fileName);
logger_m << "#"
......
......@@ -673,7 +673,7 @@ void LossDataSink::saveStatistics(unsigned int numSets) {
}
void LossDataSink::writeStatistics() {
if (Ippl::myNode() != 0) return;
if (Ippl::myNode() != 0 || statFileEntries_s.size() == 0) return;
namespace fs = boost::filesystem;
......
......@@ -95,7 +95,7 @@ void MeshGenerator::add(const ElementBase &element) {
#include <boost/iostreams/filter/zlib.hpp>
void MeshGenerator::write(const std::string &fname) {
std::ofstream out(fname + "_ElementPositions.py");
std::ofstream out("data/" + fname + "_ElementPositions.py");
const char *buffer;
const std::string indent(" ");
......
......@@ -465,7 +465,7 @@ void OpalBeamline::plot3DLattice() {
if (origin(1) < minX(1)) minX(1) = origin(1);
std::ofstream gpl;
std::string fileName = OpalData::getInstance()->getInputBasename() + "_ElementPositions.gpl";
std::string fileName = "data/" + OpalData::getInstance()->getInputBasename() + "_ElementPositions.gpl";
if (Options::openMode == Options::APPEND && boost::filesystem::exists(fileName)) {
gpl.open(fileName, std::ios_base::app);
} else {
......@@ -504,7 +504,7 @@ void OpalBeamline::save3DLattice() {
FieldList::iterator end = elements_m.end();
std::ofstream pos;
std::string fileName = OpalData::getInstance()->getInputBasename() + "_ElementPositions.txt";
std::string fileName = "data/" + OpalData::getInstance()->getInputBasename() + "_ElementPositions.txt";
if (Options::openMode == Options::APPEND && boost::filesystem::exists(fileName)) {
pos.open(fileName, std::ios_base::app);
} else {
......@@ -653,7 +653,7 @@ void OpalBeamline::save3DInput() {
FieldList::iterator end = elements_m.end();
std::string input = parseInput();
std::ofstream pos(OpalData::getInstance()->getInputBasename() + "_3D.opal");
std::ofstream pos("data/" + OpalData::getInstance()->getInputBasename() + "_3D.opal");
for (; it != end; ++ it) {
std::string element = (*it).getElement()->getName();
......
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