 |
A parallel C++ Library for Simulations in the Heisenberg Model
|
Go to the documentation of this file.
16 #include <cuda_runtime.h>
18 #include <curand_kernel.h>
24 #define CUDA_CALL(x) do { if((x)!=cudaSuccess) { \
25 printf("Error at %s:%d\n",__FILE__,__LINE__);\
32 #define CURAND_CALL(x) do { if((x)!=CURAND_STATUS_SUCCESS) { \
33 printf("Error at %s:%d\n",__FILE__,__LINE__);\
virtual void simulate() const =0
Model(float J, float3 B)
constructs a model describing spins on a grid
void setCouplingConstant(const float J)
sets the coupling constant of the model
An abstract class representing the model describing the spins. A model class has to derive from it an...
virtual float calcEnergy(const Grid< short int > &grid)=0
calculates the overall energy of the underlying grid according to the model
virtual void flip(const dim3 index, Grid< short int > &grid)=0
flips randomly a spin
float getCouplingConstant() const
returns the coupling constant of the model
virtual float calcMagnetization(const Grid< short int > &grid)=0
calculates the overall magnetization of the underlying grid according to the model
virtual float calcEnergy(const Grid< short int > &grid, const dim3 index)=0
returns the energy after one spin is flipped
A class storing spin values as a grid and certain meta information.
float3 getBField() const
returns the magnetic flux density of the model
void setBField(const float3 B)
sets the magnetic flux density of the model