Commit 1c597bd3 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

added sample folders

parent e97bbffb
......@@ -4,11 +4,14 @@
#include "m++.h"
#include "stochastics/StochasticField.h"
#include "MonteCarloLogger.h"
#include <sys/stat.h>
#include <utility>
class MonteCarlo {
public:
int verbose = 0, plotting = 0;
int plotting = 0;
MonteCarloLogger *logger;
int l = 0, pLevel = 0;
......@@ -78,14 +81,26 @@ protected:
3.0 * avgY * avgY * avgY * avgY) / varY / varY;
}
const char *buildString(int m, string name, const string &suffix="") {
string mkSampleDirName(int m) {
return buildName(m, "sample");
}
void mkSampleDir(int m) {
string pathToData = "data/vtk/";
string sampleDirName = mkSampleDirName(m);
int status = mkdir(const_cast<char *> ((pathToData + sampleDirName).c_str()),
0777);
}
string buildName(int m, string name, const string &suffix = "") {
string returnName = std::move(name);
if (!suffix.empty())
name += "_" + suffix;
returnName = returnName.append("_").append(suffix);
if (l != -1)
name += "_" + to_string(l);
returnName = returnName.append("_").append(to_string(l));
if (m != -1)
name += "_" + to_string(m);
return const_cast<char *>(name.c_str());
returnName = returnName.append("_").append(to_string(m));
return returnName;
}
};
......
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