NanoMagMC  v0.2
Monte Carlo Simulation Software for Atomistic Models of Magnetic Materials
Public Member Functions | List of all members
particle::field::field_type Class Reference

Base class for fields. More...

#include <field_type.hpp>

Public Member Functions

 field_type ()
 Default constructor. More...
 
 field_type (bool ising_in, bool periodic_in, int d_in, int edgesize_in, double J_mod, double D_mod, std::string J_filename)
 
 ~field_type ()
 Destructor. More...
 
void set_default_spins ()
 Set default spins. More...
 
xt::xtensorf< double, xt::xshape< 4 > > & access (int index)
 
std::vector< int > & get_neigh (int index)
 
std::vector< int > & get_adj (int index)
 
double & get_J (int i, int j)
 
xt::xtensorf< double, xt::xshape< 4 > > & get_D_vec (int i, int j)
 
xt::xtensorf< int, xt::xshape< 4 > > & get_loc (int index)
 
void add_spin (xt::xtensorf< int, xt::xshape< 4 >> &loc)
 
void set_neigh ()
 Determine the neighbours of the spins. More...
 
unsigned int get_size ()
 
int get_dim ()
 
int get_edge ()
 
void set_rand (int index)
 
void set_up (int index)
 
void set_down (int index)
 
void set_spin (int index, xt::xtensorf< double, xt::xshape< 4 > > &in)
 
void gen_rand ()
 Generate a random spin state. More...
 
xt::xtensorf< double, xt::xshape< 4 > > & get_rand ()
 
void all_rand ()
 Set all spins to a random state. More...
 
void all_zero ()
 Set all spins to a zero state. More...
 
void print_setup (const std::string filename, const std::string groupname, const int Tmax, const int Hmax)
 
void print (std::string filename, std::string arrname)
 
void send_data (int dest_rank)
 
void recv_data (int src_rank)
 
bool use_J ()
 Are the exchanges on? More...
 
bool use_D ()
 Are the dmis on? More...
 

Detailed Description

Base class for fields.

Constructor & Destructor Documentation

particle::field::field_type::field_type ( )
inline

Default constructor.

particle::field::field_type::field_type ( bool  ising_in,
bool  periodic_in,
int  d_in,
int  edgesize_in,
double  J_mod,
double  D_mod,
std::string  J_filename 
)

Constructor

Parameters
ising_inIs this an ising field?
periodic_inIs the field periodic?
d_inThe dimension of the field
edgesize_inThe edgelength of the lattice
J_modA modifier for the strength of the exchange
D_modA modifier for the strength of the DMI
J_filenameThe filename where the exchanges and DMIs are stored
particle::field::field_type::~field_type ( )
inline

Destructor.

Member Function Documentation

xt::xtensorf<double, xt::xshape<4> >& particle::field::field_type::access ( int  index)
inline

Access an individual spin

Parameters
indexThe index of the spin site
Returns
A reference to the spin value as a valarray
void particle::field::field_type::add_spin ( xt::xtensorf< int, xt::xshape< 4 >> &  loc)

Add a new spin to the field of spins

Parameters
locThe location of the new spin
void particle::field::field_type::all_rand ( )

Set all spins to a random state.

void particle::field::field_type::all_zero ( )

Set all spins to a zero state.

void particle::field::field_type::gen_rand ( )

Generate a random spin state.

std::vector<int>& particle::field::field_type::get_adj ( int  index)
inline

Get the neighbours of a spin site

Parameters
indexThe index of the spin site
Returns
A vector containing the indices of the neighbours of the chosen spin
xt::xtensorf<double, xt::xshape<4> >& particle::field::field_type::get_D_vec ( int  i,
int  j 
)
inline

Get the DMI vector with the neighbours of a spin site

Parameters
iThe index of the spin site
jThe index of the chosen neighbour
Returns
The DMI vector between the two spins
int particle::field::field_type::get_dim ( )
inline

Get the dimension in the field

Returns
The dimension of the field
int particle::field::field_type::get_edge ( )
inline

Get the edgesize of the field

Returns
The edgesize of the field
double& particle::field::field_type::get_J ( int  i,
int  j 
)
inline

Get the exchanges with the neighbours of a spin site

Parameters
iThe index of the spin site
jThe index of the chosen neighbour
Returns
The exchange between the two spins
xt::xtensorf<int, xt::xshape<4> >& particle::field::field_type::get_loc ( int  index)
inline

Get the location of a spin site

Parameters
indexThe index of the spin site
Returns
A vector containing the location of the neighbours of the chosen spin
std::vector<int>& particle::field::field_type::get_neigh ( int  index)
inline

Get the neighbours of a spin site

Parameters
indexThe index of the spin site
Returns
A vector containing the indices of the neighbours of the chosen spin
xt::xtensorf<double, xt::xshape<4> >& particle::field::field_type::get_rand ( )
inline

Return the randomly generated state

Returns
The random state as a valarray
unsigned int particle::field::field_type::get_size ( )
inline

Get the number of spins in the field

Returns
The number of spins in the field
void particle::field::field_type::print ( std::string  filename,
std::string  arrname 
)

Print the lattice to a file

/param filename The name of the HDF5 file /param arrname The name of the particular array to be printed to

void particle::field::field_type::print_setup ( const std::string  filename,
const std::string  groupname,
const int  Tmax,
const int  Hmax 
)

Set up the HDF5 file for array printing

/param filename The name of the HDF5 file /param groupname The name of the group within the file to store the lattices /param Tmax The number of temperatures /param Hmax The number of fields

void particle::field::field_type::recv_data ( int  src_rank)

Recieve the field from another process

Parameters
src_rankThe rank of the process recieving from
void particle::field::field_type::send_data ( int  dest_rank)

Send the field to another process

Parameters
dest_rankThe target process' rank
void particle::field::field_type::set_default_spins ( )

Set default spins.

void particle::field::field_type::set_down ( int  index)
inline

Set a spin to the down state

Parameters
indexThe location of the spin to be changed
void particle::field::field_type::set_neigh ( )

Determine the neighbours of the spins.

void particle::field::field_type::set_rand ( int  index)
inline

Set a spin to the already generated random state

Parameters
indexThe location of the spin to be changed
void particle::field::field_type::set_spin ( int  index,
xt::xtensorf< double, xt::xshape< 4 > > &  in 
)
inline

Set a spin to the down state

Parameters
indexThe location of the spin to be changed
void particle::field::field_type::set_up ( int  index)
inline

Set a spin to the down state

Parameters
indexThe location of the spin to be changed
bool particle::field::field_type::use_D ( )
inline

Are the dmis on?

bool particle::field::field_type::use_J ( )
inline

Are the exchanges on?


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