7 |
|
|
8 |
|
#ifdef PROFILE |
9 |
|
#include "mdProfile.hpp" |
10 |
< |
#endif //profile |
10 |
> |
#endif // PROFILE |
11 |
|
|
12 |
|
#include "simError.h" |
13 |
|
#include "SimSetup.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 |
< |
|
29 |
< |
|
29 |
> |
|
30 |
|
// first things first, all of the initializations |
31 |
|
|
32 |
– |
printf("Initializing stuff ....\n"); |
33 |
– |
srand48( 1337 ); // the random number generator. |
32 |
|
initSimError(); // the error handler |
33 |
< |
|
33 |
> |
srand48( 1337 ); // the random number generator. |
34 |
> |
|
35 |
|
#ifdef PROFILE |
36 |
|
initProfile(); |
37 |
|
#endif //profile |
38 |
|
|
39 |
< |
program_name = argv[0]; /*save the program name in case we need it*/ |
39 |
> |
// check command line arguments, and set the input file |
40 |
> |
|
41 |
> |
program_name = argv[0]; // save the program name in case we need it |
42 |
> |
|
43 |
|
if( argc < 2 ){ |
44 |
|
sprintf( painCave.errMsg, |
45 |
|
"Error, bass file is needed to run.\n" ); |
46 |
|
painCave.isFatal = 1; |
47 |
|
simError(); |
48 |
|
} |
49 |
< |
|
48 |
< |
|
49 |
> |
|
50 |
|
in_name = argv[1]; |
51 |
+ |
|
52 |
+ |
// create the simulation objects, and get the show on the road |
53 |
+ |
|
54 |
|
entry_plug = new SimInfo(); |
51 |
– |
|
55 |
|
startMe = new SimSetup(); |
56 |
+ |
|
57 |
|
startMe->setSimInfo( entry_plug ); |
58 |
|
|
59 |
|
#ifdef PROFILE |
77 |
|
startProfile( pro3 ); |
78 |
|
#endif //profile |
79 |
|
|
80 |
< |
entry_plug->the_integrator->integrate(); |
81 |
< |
|
80 |
> |
if (!entry_plug->has_minimizer) |
81 |
> |
entry_plug->the_integrator->integrate(); |
82 |
> |
else |
83 |
> |
entry_plug->the_minimizer->minimize(); |
84 |
|
#ifdef PROFILE |
85 |
|
endProfile( pro3 ); |
86 |
|
|