5 |
|
#include <cmath> |
6 |
|
#include <cstring> |
7 |
|
|
8 |
+ |
#ifdef PROFILE |
9 |
+ |
#include "mdProfile.hpp" |
10 |
+ |
#endif // PROFILE |
11 |
+ |
|
12 |
|
#include "simError.h" |
13 |
|
#include "SimSetup.hpp" |
14 |
|
#include "SimInfo.hpp" |
16 |
|
#include "Integrator.hpp" |
17 |
|
#include "Thermo.hpp" |
18 |
|
#include "ReadWrite.hpp" |
19 |
+ |
#include "OOPSEMinimizer.hpp" |
20 |
|
|
21 |
|
char* program_name; |
22 |
|
using namespace std; |
26 |
|
char* in_name; |
27 |
|
SimSetup* startMe; |
28 |
|
SimInfo* entry_plug; |
29 |
< |
|
25 |
< |
|
29 |
> |
|
30 |
|
// first things first, all of the initializations |
31 |
|
|
28 |
– |
printf("Initializing stuff ....\n"); |
29 |
– |
srand48( 1337 ); // the random number generator. |
32 |
|
initSimError(); // the error handler |
33 |
+ |
srand48( 1337 ); // the random number generator. |
34 |
+ |
|
35 |
+ |
#ifdef PROFILE |
36 |
+ |
initProfile(); |
37 |
+ |
#endif //profile |
38 |
+ |
|
39 |
+ |
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://oopse.org |\n" << |
47 |
+ |
" | |\n" << |
48 |
+ |
" | OOPSE is an OpenScience project. All source code is available for |\n" << |
49 |
+ |
" | any use subject to only one condition: |\n" << |
50 |
+ |
" | |\n" << |
51 |
+ |
" | Any published work resulting from the use of this code must cite the |\n" << |
52 |
+ |
" | following paper: M. A. Meineke, C. F. Vardeman II, T. Lin, |\n" << |
53 |
+ |
" | C. J. Fennell, and J. D. Gezelter, |\n" << |
54 |
+ |
" | J. Comp. Chem. XX, XXXX (2004). |\n" << |
55 |
+ |
" +----------------------------------------------------------------------+\n" << |
56 |
+ |
"\n"; |
57 |
+ |
|
58 |
+ |
// check command line arguments, and set the input file |
59 |
|
|
60 |
< |
program_name = argv[0]; /*save the program name in case we need it*/ |
60 |
> |
program_name = argv[0]; // save the program name in case we need it |
61 |
> |
|
62 |
|
if( argc < 2 ){ |
63 |
|
sprintf( painCave.errMsg, |
64 |
|
"Error, bass file is needed to run.\n" ); |
65 |
|
painCave.isFatal = 1; |
66 |
|
simError(); |
67 |
|
} |
68 |
< |
|
40 |
< |
|
68 |
> |
|
69 |
|
in_name = argv[1]; |
70 |
+ |
|
71 |
+ |
// create the simulation objects, and get the show on the road |
72 |
+ |
|
73 |
|
entry_plug = new SimInfo(); |
43 |
– |
|
74 |
|
startMe = new SimSetup(); |
75 |
+ |
|
76 |
|
startMe->setSimInfo( entry_plug ); |
77 |
+ |
|
78 |
+ |
#ifdef PROFILE |
79 |
+ |
startProfile( pro1 ); |
80 |
+ |
#endif //profile |
81 |
+ |
|
82 |
|
startMe->parseFile( in_name ); |
47 |
– |
startMe->createSim(); |
83 |
|
|
84 |
+ |
#ifdef PROFILE |
85 |
+ |
endProfile( pro1 ); |
86 |
+ |
|
87 |
+ |
startProfile( pro2 ); |
88 |
+ |
#endif //profile |
89 |
+ |
|
90 |
+ |
startMe->createSim(); |
91 |
|
delete startMe; |
92 |
|
|
93 |
< |
entry_plug->the_integrator->integrate(); |
93 |
> |
#ifdef PROFILE |
94 |
> |
endProfile( pro2 ); |
95 |
> |
|
96 |
> |
startProfile( pro3 ); |
97 |
> |
#endif //profile |
98 |
|
|
99 |
+ |
if (!entry_plug->has_minimizer) |
100 |
+ |
entry_plug->the_integrator->integrate(); |
101 |
+ |
else |
102 |
+ |
entry_plug->the_minimizer->minimize(); |
103 |
+ |
#ifdef PROFILE |
104 |
+ |
endProfile( pro3 ); |
105 |
+ |
|
106 |
+ |
writeProfiles(); |
107 |
+ |
#endif //profile |
108 |
+ |
|
109 |
|
return 0 ; |
110 |
|
} |
111 |
|
|