35 #include <boost/filesystem.hpp> 55 boost::filesystem::create_directory(
m_outputDir+
"/flow");
64 if(Parallel::rank() == 0){
67 fprintf(m_file,
"Step\t");
68 for(
auto& obs : obsList)
69 fprintf(m_file,
"%s\t", obs->getName());
70 fprintf(m_file,
"\n");
81 if(Parallel::rank() == 0){
83 fprintf(
m_file,
"%i\t", MCSteps);
84 for(
auto& obs : obsList)
85 fprintf(
m_file,
"%lf\t", obs->value());
97 void OutputObs::writeFlowObs(
int confNum, std::vector<Observable*>& obsList, std::vector<std::vector<double>>& obsMatrix){
98 if(Parallel::rank() == 0){
99 char flowFileName [1024];
100 sprintf(flowFileName,
"%s/flow/conf%04d.dat",
m_outputDir.c_str(), confNum);
101 FILE* flowOut = fopen(flowFileName,
"w+");
102 fprintf(flowOut,
"Flow Time\t");
105 fprintf(flowOut,
"%s\t",
"Plaq.");
106 fprintf(flowOut,
"%s\t",
"Topc.");
107 fprintf(flowOut,
"%s\t",
"Energ.");
108 fprintf(flowOut,
"\n");
110 for(
auto& flowStep : obsMatrix){
111 for(
auto& obs : flowStep)
112 fprintf(flowOut,
"%lf\t", obs);
113 fprintf(flowOut,
"\n");
Contains classes for output to file of observables values.
Contains the definition of the Lattice class.
static char fileName[1024]
The name of the output file.
Contains the definition of the Observable prototype.
static void writeFlowObs(int confNum, std::vector< Observable * > &obsList, std::vector< std::vector< double >> &obsMatrix)
Writes the observables for given flow step.
static void setOutputDir(std::string outputDir)
Sets the output directory for the file output.
Utilities for parallelization.
static std::string m_outputDir
The output directory.
static void writeObs(std::vector< Observable * > &obsList, int MCSteps)
Writes the list of observables to file at given generation point.
static FILE * m_file
The file object for target output.
static void initialize(std::vector< Observable * > &obsList)
Opens the files and writes needed headers.