centerofmass.cpp File Reference
#include <cstring>
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
#include <sys/stat.h>
#include <cstdio>
#include <cstdlib>
#include <Logger.h>

Classes

class  CFile
 takes data and fstat files and splits them into *.data.???? and *.fstat.???? files More...
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
177 {
178  if (argc<2) {
179  logger(ERROR, "Please enter problem name as first argument");
180  }
181  std::string name(argv[1]);
182  logger(INFO, "Name: %\n", name, Flusher::NO_FLUSH);
183 
184  CFile files(name);
185 
186  //defines the splitting radius
187 // if (argc>2) files.splittingradius = atof(argv[2]);
188  if (argc>2) {
189  if (!strcmp(argv[2],"-info")) {
190  //std::cout << "hello" << std::endl;
191  if (argc>4) {
192  files.splittinginfo = true;
193  files.info0 = std::atoi(argv[3]);
194  files.info1 = std::atoi(argv[4]);
195  }
196  else
197  {
198  logger(ERROR, "Please provide two info values");
199  }
200  }
201  else
202  {
203  files.splittingradius = std::atof(argv[2]);
204  }
205  }
206 
207 
208  files.copy();
209  logger(INFO, "finished writing files: %", name);
210  return 0;
211 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
takes data and fstat files and splits them into *.data.???? and *.fstat.???? files
Definition: centerofmass.cpp:40
std::string name
Definition: MercuryProb.h:48

References CFile::copy(), ERROR, INFO, CFile::info0, CFile::info1, logger, units::name, NO_FLUSH, CFile::splittinginfo, and CFile::splittingradius.