A parallel C++ Library for Simulations in the Heisenberg Model
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
HB::Ising::Ising Class Reference

#include <ising.h>

Inheritance diagram for HB::Ising::Ising:
Inheritance graph
[legend]
Collaboration diagram for HB::Ising::Ising:
Collaboration graph
[legend]

Public Types

using SimulationStrategy = std::function< void(const Ising &)>
 

Public Member Functions

 Ising (float J, float3 B, SimulationStrategy s)
 
float calcEnergy (const Grid< short int > &grid) final
 Computes the overall energy of the entire grid. More...
 
float calcMagnetization (const Grid< short int > &grid) final
 Computes the overall magnetization of the entire grid. More...
 
- Public Member Functions inherited from HB::Model
 Model ()=default
 
 Model (float J, float3 B)
 constructs a model describing spins on a grid More...
 
virtual ~Model ()=default
 
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...
 

Private Member Functions

float calcEnergy (const Grid< short int > &grid, const dim3 index) final
 Computes the energy difference, when random_point is flipped.
More...
 
void flip (const dim3 index, Grid< short int > &grid) final
 Computes the energy difference, when a random point is flipped.
More...
 
void simulate () const override
 

Private Attributes

SimulationStrategy mS
 

Additional Inherited Members

- Public Attributes inherited from HB::Model
float3 mB
 
float mJ
 

Detailed Description

Definition at line 7 of file ising.h.

Member Typedef Documentation

◆ SimulationStrategy

using HB::Ising::Ising::SimulationStrategy = std::function<void(const Ising&)>

Definition at line 10 of file ising.h.

Constructor & Destructor Documentation

◆ Ising()

HB::Ising::Ising::Ising ( float  J,
float3  B,
SimulationStrategy  s 
)
inline

Definition at line 12 of file ising.h.

Member Function Documentation

◆ calcEnergy() [1/2]

float HB::Ising::Ising::calcEnergy ( const Grid< short int > &  grid)
finalvirtual

Computes the overall energy of the entire grid.

Implements HB::Model.

◆ calcEnergy() [2/2]

float HB::Ising::Ising::calcEnergy ( const Grid< short int > &  grid,
const dim3  index 
)
finalprivatevirtual

Computes the energy difference, when random_point is flipped.

Implements HB::Model.

◆ calcMagnetization()

float HB::Ising::Ising::calcMagnetization ( const Grid< short int > &  grid)
finalvirtual

Computes the overall magnetization of the entire grid.

Implements HB::Model.

◆ flip()

void HB::Ising::Ising::flip ( const dim3  index,
Grid< short int > &  grid 
)
finalprivatevirtual

Computes the energy difference, when a random point is flipped.

Implements HB::Model.

◆ simulate()

void HB::Ising::Ising::simulate ( ) const
inlineoverrideprivatevirtual

Implements HB::Model.

Definition at line 35 of file ising.h.

Member Data Documentation

◆ mS

SimulationStrategy HB::Ising::Ising::mS
private

Definition at line 40 of file ising.h.


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