1 |
mmeineke |
377 |
#ifndef IS_MPI |
2 |
|
|
#include <iostream> |
3 |
|
|
#include <fstream> |
4 |
|
|
#include <cstdlib> |
5 |
|
|
#include <cmath> |
6 |
|
|
#include <cstring> |
7 |
|
|
|
8 |
mmeineke |
888 |
#ifdef PROFILE |
9 |
|
|
#include "mdProfile.hpp" |
10 |
gezelter |
1169 |
#endif // PROFILE |
11 |
mmeineke |
888 |
|
12 |
mmeineke |
377 |
#include "simError.h" |
13 |
|
|
#include "SimSetup.hpp" |
14 |
|
|
#include "SimInfo.hpp" |
15 |
|
|
#include "Atom.hpp" |
16 |
|
|
#include "Integrator.hpp" |
17 |
|
|
#include "Thermo.hpp" |
18 |
|
|
#include "ReadWrite.hpp" |
19 |
tim |
1066 |
#include "OOPSEMinimizer.hpp" |
20 |
gezelter |
1169 |
|
21 |
mmeineke |
377 |
char* program_name; |
22 |
|
|
using namespace std; |
23 |
|
|
|
24 |
|
|
int main(int argc,char* argv[]){ |
25 |
|
|
|
26 |
|
|
char* in_name; |
27 |
|
|
SimSetup* startMe; |
28 |
|
|
SimInfo* entry_plug; |
29 |
gezelter |
1169 |
|
30 |
mmeineke |
377 |
// first things first, all of the initializations |
31 |
|
|
|
32 |
gezelter |
1169 |
initSimError(); // the error handler |
33 |
mmeineke |
377 |
srand48( 1337 ); // the random number generator. |
34 |
gezelter |
1169 |
|
35 |
mmeineke |
888 |
#ifdef PROFILE |
36 |
|
|
initProfile(); |
37 |
|
|
#endif //profile |
38 |
|
|
|
39 |
gezelter |
1173 |
std::cerr << |
40 |
|
|
"+--------------------------------------------------------------------+\n" << |
41 |
|
|
"| ____ ____ ____ _____ ______ The OpenSource, Object-oriented |\n" << |
42 |
|
|
"| / __ \\/ __ \\/ __ \\/ ___// ____/ Parallel Simulation Engine. |\n" << |
43 |
|
|
"| / / / / / / / /_/ /\\__ \\/ __/ |\n" << |
44 |
|
|
"| / /_/ / /_/ / ____/___/ / /___ Copyright 2004 by the |\n" << |
45 |
|
|
"| \\____/\\____/_/ /____/_____/ University of Notre Dame. |\n" << |
46 |
|
|
"| http://maul.chem.nd.edu/OOPSE |\n" << |
47 |
|
|
"+--------------------------------------------------------------------+\n" << |
48 |
|
|
"\n"; |
49 |
|
|
|
50 |
gezelter |
1169 |
// check command line arguments, and set the input file |
51 |
|
|
|
52 |
|
|
program_name = argv[0]; // save the program name in case we need it |
53 |
|
|
|
54 |
mmeineke |
377 |
if( argc < 2 ){ |
55 |
|
|
sprintf( painCave.errMsg, |
56 |
|
|
"Error, bass file is needed to run.\n" ); |
57 |
|
|
painCave.isFatal = 1; |
58 |
|
|
simError(); |
59 |
|
|
} |
60 |
gezelter |
1169 |
|
61 |
mmeineke |
377 |
in_name = argv[1]; |
62 |
gezelter |
1169 |
|
63 |
|
|
// create the simulation objects, and get the show on the road |
64 |
|
|
|
65 |
mmeineke |
377 |
entry_plug = new SimInfo(); |
66 |
|
|
startMe = new SimSetup(); |
67 |
gezelter |
1169 |
|
68 |
mmeineke |
377 |
startMe->setSimInfo( entry_plug ); |
69 |
mmeineke |
888 |
|
70 |
|
|
#ifdef PROFILE |
71 |
|
|
startProfile( pro1 ); |
72 |
|
|
#endif //profile |
73 |
|
|
|
74 |
mmeineke |
377 |
startMe->parseFile( in_name ); |
75 |
mmeineke |
888 |
|
76 |
|
|
#ifdef PROFILE |
77 |
|
|
endProfile( pro1 ); |
78 |
|
|
|
79 |
|
|
startProfile( pro2 ); |
80 |
|
|
#endif //profile |
81 |
|
|
|
82 |
mmeineke |
377 |
startMe->createSim(); |
83 |
|
|
delete startMe; |
84 |
|
|
|
85 |
mmeineke |
888 |
#ifdef PROFILE |
86 |
|
|
endProfile( pro2 ); |
87 |
|
|
|
88 |
|
|
startProfile( pro3 ); |
89 |
|
|
#endif //profile |
90 |
|
|
|
91 |
tim |
1031 |
if (!entry_plug->has_minimizer) |
92 |
|
|
entry_plug->the_integrator->integrate(); |
93 |
|
|
else |
94 |
|
|
entry_plug->the_minimizer->minimize(); |
95 |
mmeineke |
888 |
#ifdef PROFILE |
96 |
|
|
endProfile( pro3 ); |
97 |
|
|
|
98 |
|
|
writeProfiles(); |
99 |
|
|
#endif //profile |
100 |
|
|
|
101 |
mmeineke |
377 |
return 0 ; |
102 |
|
|
} |
103 |
|
|
|
104 |
|
|
#endif |