Base class for fields.
More...
#include <field_type.hpp>
|
| 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...
|
|
particle::field::field_type::field_type |
( |
| ) |
|
|
inline |
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_in | Is this an ising field? |
periodic_in | Is the field periodic? |
d_in | The dimension of the field |
edgesize_in | The edgelength of the lattice |
J_mod | A modifier for the strength of the exchange |
D_mod | A modifier for the strength of the DMI |
J_filename | The filename where the exchanges and DMIs are stored |
particle::field::field_type::~field_type |
( |
| ) |
|
|
inline |
xt::xtensorf<double, xt::xshape<4> >& particle::field::field_type::access |
( |
int |
index | ) |
|
|
inline |
Access an individual spin
- Parameters
-
index | The 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
-
loc | The 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
-
index | The 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
-
i | The index of the spin site |
j | The 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
-
i | The index of the spin site |
j | The 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
-
index | The 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
-
index | The 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_rank | The rank of the process recieving from |
void particle::field::field_type::send_data |
( |
int |
dest_rank | ) |
|
Send the field to another process
- Parameters
-
dest_rank | The target process' rank |
void particle::field::field_type::set_default_spins |
( |
| ) |
|
void particle::field::field_type::set_down |
( |
int |
index | ) |
|
|
inline |
Set a spin to the down state
- Parameters
-
index | The 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
-
index | The 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
-
index | The 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
-
index | The location of the spin to be changed |
bool particle::field::field_type::use_D |
( |
| ) |
|
|
inline |
bool particle::field::field_type::use_J |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: