numerics
Loading...
Searching...
No Matches
IsingLattice Struct Reference

Public Member Functions

 IsingLattice ()
 
void set_temperature (real T)
 
void set_field (real Fnew)
 
real temperature () const
 
void rebuild_boltz ()
 
void random_init ()
 
void all_up ()
 
void generate_nucleus (real r=100.0)
 
void sweep ()
 
int sweep_umbrella (int lo, int hi, num::ClusterResult &det)
 
real magnetization () const
 
real energy_per_spin ()
 

Static Public Member Functions

static real mean_field_m (real beta_val, real F_val)
 

Public Attributes

Vector spins
 
Vector ones
 
Vector nbr_buf
 
SparseMatrix adj
 
num::PBCLattice2D nbr_
 
real boltz [2][5] {}
 
std::vector< realsave_buf
 
std::mt19937 rng
 
std::uniform_real_distribution< realdist {0.0, 1.0}
 
real beta = 1.0 / (1.0 / 0.58)
 
real F = 0.0
 

Detailed Description

Definition at line 70 of file main.cpp.

Constructor & Destructor Documentation

◆ IsingLattice()

IsingLattice::IsingLattice ( )
inline

Definition at line 94 of file main.cpp.

References random_init(), and rebuild_boltz().

Member Function Documentation

◆ all_up()

void IsingLattice::all_up ( )
inline

Definition at line 127 of file main.cpp.

References spins.

Referenced by generate_nucleus(), and main().

◆ energy_per_spin()

real IsingLattice::energy_per_spin ( )
inline

Definition at line 195 of file main.cpp.

References adj, num::dot(), F, nbr_buf, ones, num::sparse_matvec(), and spins.

Referenced by main().

◆ generate_nucleus()

void IsingLattice::generate_nucleus ( real  r = 100.0)
inline

Definition at line 130 of file main.cpp.

References all_up(), and spins.

Referenced by main().

◆ magnetization()

real IsingLattice::magnetization ( ) const
inline

Definition at line 190 of file main.cpp.

References num::dot(), ones, and spins.

Referenced by main().

◆ mean_field_m()

static real IsingLattice::mean_field_m ( real  beta_val,
real  F_val 
)
inlinestatic

Definition at line 203 of file main.cpp.

References num::newton().

Referenced by main().

◆ random_init()

void IsingLattice::random_init ( )
inline

Definition at line 122 of file main.cpp.

References dist, rng, and spins.

Referenced by IsingLattice(), and main().

◆ rebuild_boltz()

void IsingLattice::rebuild_boltz ( )
inline

Definition at line 111 of file main.cpp.

References beta, boltz, num::markov::boltzmann_accept(), and F.

Referenced by IsingLattice(), set_field(), and set_temperature().

◆ set_field()

void IsingLattice::set_field ( real  Fnew)
inline

Definition at line 108 of file main.cpp.

References F, and rebuild_boltz().

Referenced by main().

◆ set_temperature()

void IsingLattice::set_temperature ( real  T)
inline

Definition at line 107 of file main.cpp.

References beta, num::e, and rebuild_boltz().

Referenced by main().

◆ sweep()

void IsingLattice::sweep ( )
inline

◆ sweep_umbrella()

◆ temperature()

real IsingLattice::temperature ( ) const
inline

Definition at line 109 of file main.cpp.

References beta, and num::e.

Member Data Documentation

◆ adj

SparseMatrix IsingLattice::adj

Definition at line 74 of file main.cpp.

Referenced by energy_per_spin().

◆ beta

real IsingLattice::beta = 1.0 / (1.0 / 0.58)

Definition at line 91 of file main.cpp.

Referenced by main(), rebuild_boltz(), set_temperature(), and temperature().

◆ boltz

real IsingLattice::boltz[2][5] {}

Definition at line 84 of file main.cpp.

Referenced by rebuild_boltz(), sweep(), and sweep_umbrella().

◆ dist

std::uniform_real_distribution<real> IsingLattice::dist {0.0, 1.0}

Definition at line 89 of file main.cpp.

Referenced by random_init().

◆ F

real IsingLattice::F = 0.0

Definition at line 92 of file main.cpp.

Referenced by energy_per_spin(), main(), rebuild_boltz(), and set_field().

◆ nbr_

num::PBCLattice2D IsingLattice::nbr_

Definition at line 77 of file main.cpp.

Referenced by sweep(), and sweep_umbrella().

◆ nbr_buf

Vector IsingLattice::nbr_buf

Definition at line 73 of file main.cpp.

Referenced by energy_per_spin().

◆ ones

Vector IsingLattice::ones

Definition at line 72 of file main.cpp.

Referenced by energy_per_spin(), and magnetization().

◆ rng

std::mt19937 IsingLattice::rng

Definition at line 88 of file main.cpp.

Referenced by random_init(), sweep(), and sweep_umbrella().

◆ save_buf

std::vector<real> IsingLattice::save_buf

Definition at line 86 of file main.cpp.

Referenced by sweep_umbrella().

◆ spins

Vector IsingLattice::spins

The documentation for this struct was generated from the following file: