|
2 Dimensional Ising Model
Simulate the change in energy and magnetization in a ferro magnet
|
Functions for Monte Carlo simulations. More...
#include "IsingModel.hpp"#include "data_type.hpp"#include "utils.hpp"#include <functional>#include <omp.h>#include <string>Go to the source code of this file.
Macros | |
| #define | BURN_IN_TIME 5000 |
Functions | |
| void | montecarlo::progression (double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME) |
| Write the expected values for each Monte Carlo cycles to file. | |
| void | montecarlo::progression (double T, int L, int cycles, int value, const std::string filename, int burn_in_time=BURN_IN_TIME) |
| Write the expected values for each Monte Carlo cycles to file. | |
| void | montecarlo::pd_estimate (double T, int L, int cycles, const std::string filename, int burn_in_time=BURN_IN_TIME) |
| Estimate the probability distribution for the energy. | |
| data_t | montecarlo::mcmc_serial (int L, double T, int cycles, int burn_in_time=BURN_IN_TIME) |
| Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles. | |
| data_t | montecarlo::mcmc_parallel (int L, double T, int cycles, int burn_in_time=BURN_IN_TIME) |
| Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel. | |
| void | montecarlo::phase_transition (int L, double start_T, double end_T, int points_T, int cycles, std::function< data_t(int, double, int, int)> monte_carlo, std::string outfile, int burn_in_time=BURN_IN_TIME) |
| Perform the MCMC algorithm using a range of temperatures. | |
Functions for Monte Carlo simulations.
Definition in file monte_carlo.hpp.
| #define BURN_IN_TIME 5000 |
Definition at line 24 of file monte_carlo.hpp.
| data_t montecarlo::mcmc_parallel | ( | int | L, |
| double | T, | ||
| int | cycles, | ||
| int | burn_in_time = BURN_IN_TIME |
||
| ) |
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles in parallel.
| L | The size of the lattice |
| T | The Temperature for the Ising model |
| cycles | The amount of Monte Carlo cycles to do |
| burn_in_time | The burn-in time to use |
Definition at line 141 of file monte_carlo.cpp.
| data_t montecarlo::mcmc_serial | ( | int | L, |
| double | T, | ||
| int | cycles, | ||
| int | burn_in_time = BURN_IN_TIME |
||
| ) |
Execute the Metropolis algorithm for a certain amount of Monte Carlo cycles.
| L | The size of the lattice |
| T | The Temperature for the Ising model |
| cycles | The amount of Monte Carlo cycles to do |
| burn_in_time | The burn-in time to use |
Definition at line 122 of file monte_carlo.cpp.
| void montecarlo::pd_estimate | ( | double | T, |
| int | L, | ||
| int | cycles, | ||
| const std::string | filename, | ||
| int | burn_in_time = BURN_IN_TIME |
||
| ) |
Estimate the probability distribution for the energy.
| T | The temperature of the Ising model |
| L | The size of the lattice |
| cycles | The amount of Monte Carlo cycles to do |
| filename | The file to write to |
| burn_in_time | The burn-in time to use |
Definition at line 91 of file monte_carlo.cpp.
| void montecarlo::phase_transition | ( | int | L, |
| double | start_T, | ||
| double | end_T, | ||
| int | points_T, | ||
| int | cycles, | ||
| std::function< data_t(int, double, int, int)> | monte_carlo, | ||
| std::string | outfile, | ||
| int | burn_in_time = BURN_IN_TIME |
||
| ) |
Perform the MCMC algorithm using a range of temperatures.
| L | The size of the lattice |
| start_T | The start temperature |
| end_T | The end temperature |
| point_T | The amount of point to measure |
| monte_carlo | Which Monte Carlo implementation to use |
| outfile | The file to write the data to |
| burn_in_time | The burn-in time to use |
Definition at line 169 of file monte_carlo.cpp.
| void montecarlo::progression | ( | double | T, |
| int | L, | ||
| int | cycles, | ||
| const std::string | filename, | ||
| int | burn_in_time = BURN_IN_TIME |
||
| ) |
Write the expected values for each Monte Carlo cycles to file.
| T | Temperature |
| L | The size of the lattice |
| cycles | The amount of Monte Carlo cycles to do |
| filename | The file to write to |
| burn_in_time | The burn-in time to use |
Definition at line 15 of file monte_carlo.cpp.
| void montecarlo::progression | ( | double | T, |
| int | L, | ||
| int | cycles, | ||
| int | value, | ||
| const std::string | filename, | ||
| int | burn_in_time = BURN_IN_TIME |
||
| ) |
Write the expected values for each Monte Carlo cycles to file.
| T | Temperature |
| L | The size of the lattice |
| cycles | The amount of Monte Carlo cycles to do |
| value | The value to set the elements in the lattice |
| filename | The file to write to |
| burn_in_time | The burn-in time to use |
Definition at line 53 of file monte_carlo.cpp.