MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
centerofmass.cpp File Reference
#include <string.h>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

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

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

Definition at line 168 of file centerofmass.cpp.

References CFile::copy(), CFile::info0, CFile::info1, CFile::splittinginfo, and CFile::splittingradius.

169 {
170  if (argc<2) {
171  std::cerr << "Please enter problem name as first argument" << std::endl;
172  return -1;
173  }
174  std::string name(argv[1]);
175  std::cout << "Name: " << name << std::endl;
176 
177  CFile files(name);
178 
179  //defines the splitting radius
180 // if (argc>2) files.splittingradius = atof(argv[2]);
181  if (argc>2) {
182  if (!strcmp(argv[2],"-info")) {
183  //std::cout << "hello" << std::endl;
184  if (argc>4) {
185  files.splittinginfo = true;
186  files.info0 = atoi(argv[3]);
187  files.info1 = atoi(argv[4]);
188  } else {
189  std::cerr << "Please provide two info values" << std::endl;
190  }
191  } else {
192  files.splittingradius = atof(argv[2]);
193  }
194  }
195 
196 
197  files.copy();
198  std::cout << "finished writing files: " << name << std::endl;
199  return 0;
200 }
takes data and fstat files and splits them into *.data.???? and *.fstat.???? files ...