| 1 | mmeineke | 276 | #include <iostream> | 
| 2 |  |  | #include <fstream> | 
| 3 |  |  | #include <cstdlib> | 
| 4 |  |  | #include <cmath> | 
| 5 |  |  | #include <cstring> | 
| 6 |  |  |  | 
| 7 |  |  | #include "simError.h" | 
| 8 |  |  | #include "SimSetup.hpp" | 
| 9 |  |  | #include "SimInfo.hpp" | 
| 10 |  |  | #include "Atom.hpp" | 
| 11 |  |  | #include "Integrator.hpp" | 
| 12 |  |  | #include "Thermo.hpp" | 
| 13 |  |  | #include "ReadWrite.hpp" | 
| 14 |  |  |  | 
| 15 |  |  | char* program_name; | 
| 16 |  |  | using namespace std; | 
| 17 |  |  |  | 
| 18 |  |  | int main(int argc,char* argv[]){ | 
| 19 |  |  |  | 
| 20 |  |  | char* in_name; | 
| 21 |  |  | SimSetup* startMe; | 
| 22 |  |  | SimInfo* entry_plug; | 
| 23 |  |  |  | 
| 24 |  |  |  | 
| 25 |  |  | // first things first, all of the initializations | 
| 26 |  |  |  | 
| 27 |  |  | printf("Initializing stuff ....\n"); | 
| 28 |  |  | srand48( 1337 );          // the random number generator. | 
| 29 |  |  | initSimError();           // the error handler | 
| 30 |  |  |  | 
| 31 |  |  | program_name = argv[0]; /*save the program name in case we need it*/ | 
| 32 |  |  | if( argc < 2 ){ | 
| 33 |  |  | sprintf( painCave.errMsg, | 
| 34 |  |  | "Error, bass file is needed to run.\n" ); | 
| 35 |  |  | painCave.isFatal = 1; | 
| 36 |  |  | simError(); | 
| 37 |  |  | } | 
| 38 |  |  |  | 
| 39 |  |  |  | 
| 40 |  |  | in_name = argv[1]; | 
| 41 |  |  | entry_plug = new SimInfo(); | 
| 42 |  |  |  | 
| 43 |  |  | startMe = new SimSetup(); | 
| 44 |  |  | startMe->setSimInfo( entry_plug ); | 
| 45 |  |  | startMe->parseFile( in_name ); | 
| 46 |  |  | startMe->createSim(); | 
| 47 |  |  |  | 
| 48 |  |  | delete startMe; | 
| 49 |  |  |  | 
| 50 |  |  | entry_plug->the_integrator->integrate(); | 
| 51 |  |  |  | 
| 52 |  |  | return 0 ; | 
| 53 |  |  | } | 
| 54 |  |  |  | 
| 55 |  |  |  |