An abstract class representing the model describing the spins. A model class has to derive from it an override the pure virtual functions.
More...
#include <model.h>
|
| Model ()=default |
|
| Model (float J, float3 B) |
| constructs a model describing spins on a grid More...
|
|
virtual | ~Model ()=default |
|
virtual float | calcEnergy (const Grid< short int > &grid)=0 |
| calculates the overall energy of the underlying grid according to the model More...
|
|
virtual float | calcMagnetization (const Grid< short int > &grid)=0 |
| calculates the overall magnetization of the underlying grid according to the model More...
|
|
float3 | getBField () const |
| returns the magnetic flux density of the model More...
|
|
float | getCouplingConstant () const |
| returns the coupling constant of the model More...
|
|
void | setBField (const float3 B) |
| sets the magnetic flux density of the model More...
|
|
void | setCouplingConstant (const float J) |
| sets the coupling constant of the model More...
|
|
virtual float | calcEnergy (const Grid< short int > &grid, const dim3 index)=0 |
| returns the energy after one spin is flipped More...
|
|
virtual void | flip (const dim3 index, Grid< short int > &grid)=0 |
| flips randomly a spin More...
|
|
virtual void | simulate () const =0 |
|
An abstract class representing the model describing the spins. A model class has to derive from it an override the pure virtual functions.
Definition at line 40 of file model.h.
◆ Model() [1/2]
◆ Model() [2/2]
HB::Model::Model |
( |
float |
J, |
|
|
float3 |
B |
|
) |
| |
|
inline |
constructs a model describing spins on a grid
- Parameters
-
J | Coupling constant |
B | three dimensional magnetic flux density with x component parallel to y direction of the grid and y component vice versa |
Definition at line 51 of file model.h.
◆ ~Model()
virtual HB::Model::~Model |
( |
| ) |
|
|
virtualdefault |
◆ calcEnergy() [1/2]
virtual float HB::Model::calcEnergy |
( |
const Grid< short int > & |
grid | ) |
|
|
pure virtual |
calculates the overall energy of the underlying grid according to the model
Implemented in HB::Ising::Ising.
◆ calcEnergy() [2/2]
virtual float HB::Model::calcEnergy |
( |
const Grid< short int > & |
grid, |
|
|
const dim3 |
index |
|
) |
| |
|
pure virtual |
returns the energy after one spin is flipped
- Parameters
-
index | Index of the flipped spin |
Implemented in HB::Ising::Ising.
◆ calcMagnetization()
virtual float HB::Model::calcMagnetization |
( |
const Grid< short int > & |
grid | ) |
|
|
pure virtual |
calculates the overall magnetization of the underlying grid according to the model
Implemented in HB::Ising::Ising.
◆ flip()
virtual void HB::Model::flip |
( |
const dim3 |
index, |
|
|
Grid< short int > & |
grid |
|
) |
| |
|
pure virtual |
flips randomly a spin
The function should define how a spin has to change for a Monte-Carlo accept-reject step.
- Parameters
-
index | Index of the spin to be flipped |
rng | Pointer to the state of GSL RNG |
Implemented in HB::Ising::Ising.
◆ getBField()
float3 HB::Model::getBField |
( |
| ) |
const |
|
inline |
returns the magnetic flux density of the model
Definition at line 70 of file model.h.
◆ getCouplingConstant()
float HB::Model::getCouplingConstant |
( |
| ) |
const |
|
inline |
returns the coupling constant of the model
Definition at line 75 of file model.h.
◆ setBField()
void HB::Model::setBField |
( |
const float3 |
B | ) |
|
|
inline |
sets the magnetic flux density of the model
- Parameters
-
B | Three dimensional magnetic flux density with x component parallel to y direction of the grid and y component vice versa |
Definition at line 83 of file model.h.
◆ setCouplingConstant()
void HB::Model::setCouplingConstant |
( |
const float |
J | ) |
|
|
inline |
sets the coupling constant of the model
- Parameters
-
Definition at line 90 of file model.h.
◆ simulate()
virtual void HB::Model::simulate |
( |
| ) |
const |
|
pure virtual |
◆ mB
absolute value of an external, homogenous magnetic field
Definition at line 112 of file model.h.
◆ mJ
coupling constant
Definition at line 113 of file model.h.
The documentation for this class was generated from the following file: