-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (27 loc) · 1.03 KB
/
Copy pathmain.cpp
File metadata and controls
36 lines (27 loc) · 1.03 KB
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
#include <iostream>
#include <memory>
#include <armadillo>
#include "Model/Heisenberg.hpp"
#include "Algorithm/MonteCarlo.hpp"
#include "WebSocket.hpp"
using namespace arma;
int main() {
auto ws = std::make_unique<WebSocket>();
std::cout << "Phys-sym v. 0.0" << std::endl;
std::cout << "Simulation software" << std::endl << std::endl;
Model *model_ptr;
Heisenberg heisenberg(10);
model_ptr = &heisenberg;
heisenberg.create_ferromagnetic_exchange_matrix();
model_ptr -> create_initial_spin_configuration();
std::cout << "The spin configuration is: " << std::endl << model_ptr -> spin_config << std::endl;
std::cout << "The energy of the system is: " << model_ptr->energy() << std::endl;
int n_itr = 10000;
Algorithm *alg;
MonteCarlo mc;
alg = &mc;
alg->simulate(n_itr, model_ptr);
std::cout << "The spin configuration is: " << std::endl << model_ptr -> spin_config << std::endl;
std::cout << "The energy of the system is: " << model_ptr->energy() << std::endl;
return 0;
}