A parallel C++ Library for Simulations in the Heisenberg Model
Public Member Functions | Private Attributes | List of all members
HB::Grid< T > Class Template Reference

A class storing spin values as a grid and certain meta information. More...

#include <grid.h>

Public Member Functions

 Grid ()=default
 
 Grid (const short int spatialDimensions, const dim3 gridSize)
 constructs a grid and allocates memory More...
 
void calcNeighbourTable ()
 generates a table of the neighbouring points of each spin and stores it More...
 
void setGridSize (const dim3 gridSize)
 sets grid size nad resizes grid More...
 
dim3 getGridSize () const
 
thrust::host_vector< T > getGridData () const
 
void setGridData (const thrust::host_vector< T > &gridData)
 
thrust::host_vector< NBgetNeighbourTable () const
 
void setNeighbourTable (const thrust::host_vector< NB > &neighbourTable)
 
getSpin (const dim3 index) const
 
void setSpin (const dim3 index, const T spin)
 
NB getNeighbours (const dim3 index) const
 
short int getDim () const
 
void setDim (const short int dim)
 
void hotStart ()
 initializes all spins randomly between 0 and 2*pi
More...
 
void coldStart ()
 initializes all spins as up, i.e. mGrid.x[...] = 0.5*pi and mGrid.y[...] = 0
More...
 
herr_t saveGrid (const std::string path)
 saves grid as hdf5 file More...
 

Private Attributes

dim3 mGridSize
 copies grid and table to device More...
 
short int mDim
 
thrust::host_vector< T > mGridData
 
thrust::host_vector< NBmNeighbourTable
 

Detailed Description

template<class T>
class HB::Grid< T >

A class storing spin values as a grid and certain meta information.

Definition at line 35 of file grid.h.

Constructor & Destructor Documentation

◆ Grid() [1/2]

template<class T >
HB::Grid< T >::Grid ( )
default

◆ Grid() [2/2]

template<class T >
HB::Grid< T >::Grid ( const short int  spatialDimensions,
const dim3  gridSize 
)
inline

constructs a grid and allocates memory

Definition at line 43 of file grid.h.

Member Function Documentation

◆ calcNeighbourTable()

template<class T >
void HB::Grid< T >::calcNeighbourTable ( )

generates a table of the neighbouring points of each spin and stores it

◆ coldStart()

template<class T >
void HB::Grid< T >::coldStart ( )

initializes all spins as up, i.e. mGrid.x[...] = 0.5*pi and mGrid.y[...] = 0

◆ getDim()

template<class T >
short int HB::Grid< T >::getDim ( ) const
inline

Definition at line 113 of file grid.h.

◆ getGridData()

template<class T >
thrust::host_vector<T> HB::Grid< T >::getGridData ( ) const
inline

Definition at line 69 of file grid.h.

◆ getGridSize()

template<class T >
dim3 HB::Grid< T >::getGridSize ( ) const
inline

Definition at line 64 of file grid.h.

◆ getNeighbours()

template<class T >
NB HB::Grid< T >::getNeighbours ( const dim3  index) const
inline

Definition at line 105 of file grid.h.

◆ getNeighbourTable()

template<class T >
thrust::host_vector<NB> HB::Grid< T >::getNeighbourTable ( ) const
inline

Definition at line 79 of file grid.h.

◆ getSpin()

template<class T >
T HB::Grid< T >::getSpin ( const dim3  index) const
inline

Definition at line 89 of file grid.h.

◆ hotStart()

template<class T >
void HB::Grid< T >::hotStart ( )

initializes all spins randomly between 0 and 2*pi

◆ saveGrid()

template<class T >
herr_t HB::Grid< T >::saveGrid ( const std::string  path)

saves grid as hdf5 file

Parameters
pathPath to file

◆ setDim()

template<class T >
void HB::Grid< T >::setDim ( const short int  dim)
inline

Definition at line 115 of file grid.h.

◆ setGridData()

template<class T >
void HB::Grid< T >::setGridData ( const thrust::host_vector< T > &  gridData)
inline

Definition at line 74 of file grid.h.

◆ setGridSize()

template<class T >
void HB::Grid< T >::setGridSize ( const dim3  gridSize)
inline

sets grid size nad resizes grid

Definition at line 57 of file grid.h.

◆ setNeighbourTable()

template<class T >
void HB::Grid< T >::setNeighbourTable ( const thrust::host_vector< NB > &  neighbourTable)
inline

Definition at line 84 of file grid.h.

◆ setSpin()

template<class T >
void HB::Grid< T >::setSpin ( const dim3  index,
const T  spin 
)
inline

Definition at line 97 of file grid.h.

Member Data Documentation

◆ mDim

template<class T >
short int HB::Grid< T >::mDim
private

dimension of the spins

Definition at line 154 of file grid.h.

◆ mGridData

template<class T >
thrust::host_vector<T> HB::Grid< T >::mGridData
private

vector containg spins in row major format on host

Definition at line 155 of file grid.h.

◆ mGridSize

template<class T >
dim3 HB::Grid< T >::mGridSize
private

copies grid and table to device

copies grid to host three dimensional grid size

Definition at line 153 of file grid.h.

◆ mNeighbourTable

template<class T >
thrust::host_vector<NB> HB::Grid< T >::mNeighbourTable
private

vector containing neighbouring points in row major format on device

Definition at line 156 of file grid.h.


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