-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.cc
44 lines (30 loc) · 926 Bytes
/
global.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <iostream>
#include <cstdlib>
#include "structure.h"
#include "basinhopping.h"
#include "acceptanceTest.h"
#include "timer.h"
using namespace std;
int main (int argc, char *argv[])
{
timer T;
if (argc < 3)
{
cerr << "Please provide system size and number of steps. Terminating program." << endl;
return 1;
}
int n = atoi(argv[1]);
int steps = atoi(argv[2]);
structure cluster(n);
vector<coord3d> coordinates = cluster.getCoordinates();
//for (auto& i : coordinates) cout << i << endl;
shared_ptr<AcceptanceTest> accept_shared;
Metropolis* metro = new Metropolis();
accept_shared.reset(metro);
BasinHopping<StorageByEnergy> hop(cluster,accept_shared,steps);
hop.run();
cout << "N minima: " << hop.nStructures() << endl;
hop.printEnergies(cout);
cout << "Time: " << T.total_timing() << " s" << endl;
return 0;
}