2 Dimensional Ising Model
Simulate the change in energy and magnetization in a ferro magnet
Loading...
Searching...
No Matches
monte_carlo.hpp
Go to the documentation of this file.
1
12#ifndef __MONTE_CARLO__
13#define __MONTE_CARLO__
14
15#include "IsingModel.hpp"
16#include "data_type.hpp"
17#include "utils.hpp"
18
19#include <functional>
20#include <string>
21#include <omp.h>
22
23//#define BURN_IN_TIME 12500
24#define BURN_IN_TIME 5000
25
26#pragma omp declare reduction(+: data_t: omp_out += omp_in)
27
35int test_2x2_lattice(double tol, int max_cycles);
36
44void monte_carlo_progression(double T, int L, int cycles,
45 const std::string filename);
46
55void monte_carlo_progression(double T, int L, int cycles, int value,
56 const std::string filename);
57
65void pd_estimate(double T, int L, int cycles, const std::string filename);
66
76data_t monte_carlo_serial(int L, double T, int cycles);
77
87data_t monte_carlo_parallel(int L, double T, int cycles);
88
99 int L, double start_T, double end_T, int points_T,
100 std::function<data_t(int, double, int)> monte_carlo,
101 std::string outfile);
102
103#endif
The definition of the Ising model.
Header for the data_t type.
void phase_transition(int L, double start_T, double end_T, int points_T, std::function< data_t(int, double, int)> monte_carlo, std::string outfile)
Perform the MCMC algorithm using a range of temperatures.
data_t monte_carlo_serial(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
void pd_estimate(double T, int L, int cycles, const std::string filename)
Estimate the probability distribution for the energy.
Definition: monte_carlo.cpp:85
int test_2x2_lattice(double tol, int max_cycles)
Test numerical data with analytical data.
void monte_carlo_progression(double T, int L, int cycles, const std::string filename)
Write the expected values for each Monte Carlo cycles to file.
Definition: monte_carlo.cpp:17
data_t monte_carlo_parallel(int L, double T, int cycles)
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
Function prototypes and macros that are useful.