Geometry

#include "Spirit/Geometry.h"

This set of functions can be used to get information about the geometric setup of the system and to change it.

Note that it is not fully safe to change the geometry during a calculation, as this has not been so thoroughly tested.

Definition of Bravais lattice types

enum Bravais_Lattice_Type

Identifier for the Bravais lattice type.

Values:

enumerator Bravais_Lattice_Irregular = 0
enumerator Bravais_Lattice_Rectilinear = 1
enumerator Bravais_Lattice_SC = 2
enumerator Bravais_Lattice_Hex2D = 3
enumerator Bravais_Lattice_Hex2D_60 = 4
enumerator Bravais_Lattice_Hex2D_120 = 5
enumerator Bravais_Lattice_HCP = 6
enumerator Bravais_Lattice_BCC = 7
enumerator Bravais_Lattice_FCC = 8

Setters

void Geometry_Set_Boundary_Conditions(State *state, const bool *periodical, int idx_image = -1, int idx_chain = -1)

Set the boundary conditions along the translation directions [a, b, c].

void Geometry_Set_Bravais_Lattice_Type(State *state, Bravais_Lattice_Type lattice_type)

Set the type of Bravais lattice. Can be e.g. “sc” or “bcc”.

void Geometry_Set_N_Cells(State *state, int n_cells[3])

Set the number of basis cells in the three translation directions.

void Geometry_Set_Cell_Atoms(State *state, int n_atoms, scalar **atoms)

Set the number and positions of atoms in a basis cell. Positions are in units of the bravais vectors (scaled by the lattice constant).

void Geometry_Set_mu_s(State *state, scalar mu_s, int idx_image = -1, int idx_chain = -1)

Set the magnetic moments of basis cell atoms.

void Geometry_Set_spin_qn(State *state, int spin_qn, int idx_image = -1, int idx_chain = -1)

Set the spin quantum number of basis cell atoms. The value is to be specified as a half integer (i.e. spin_qn=5 means s=5/2)

void Geometry_Set_Cell_Atom_Types(State *state, int n_atoms, int *atom_types)

Set the types of the atoms in a basis cell.

void Geometry_Set_Bravais_Vectors(State *state, scalar ta[3], scalar tb[3], scalar tc[3])

Manually set the bravais vectors.

void Geometry_Set_Lattice_Constant(State *state, scalar lattice_constant)

Set the overall lattice scaling constant.

Getters

void Geometry_Get_Boundary_Conditions(State *state, bool *periodical, int idx_image = -1, int idx_chain = -1)

Retrieves the boundary conditions.

int Geometry_Get_NOS(State *state)
void Geometry_Get_Center(State *state, scalar center[3], int idx_image = -1, int idx_chain = -1)

Get Center as array (x,y,z).

void Geometry_Get_Bravais_Vectors(State *state, scalar a[3], scalar b[3], scalar c[3], int idx_image = -1, int idx_chain = -1)
int Geometry_Get_Dimensionality(State *state, int idx_image = -1, int idx_chain = -1)

Retrieve dimensionality of the system (0, 1, 2, 3).

void Geometry_Get_mu_s(State *state, scalar *mu_s, int idx_image = -1, int idx_chain = -1)

Get the magnetic moments of basis cell atoms.

void Geometry_Get_spin_qn(State *state, int *spin_qn, int idx_image = -1, int idx_chain = -1)

Get the spin quantum number of basis cell atoms. The values are to be read as half integers (i.e. spin_qn=5 means s=5/2)

void Geometry_Get_N_Cells(State *state, int n_cells[3], int idx_image = -1, int idx_chain = -1)

Get number of basis cells in the three translation directions.

int Geometry_Get_N_Cell_Atoms(State *state, int idx_image = -1, int idx_chain = -1)

Getters: Basis Cell

void Geometry_Get_Cell_Bounds(State *state, scalar min[3], scalar max[3], int idx_image = -1, int idx_chain = -1)
int Geometry_Get_Cell_Atoms(State *state, scalar **atoms, int idx_image = -1, int idx_chain = -1)

Getters: Triangulation and Tetrahedra

int Geometry_Get_Triangulation(State *state, const int **indices_ptr, int n_cell_step = 1, int idx_image = -1, int idx_chain = -1)
int Geometry_Get_Triangulation_Ranged(State *state, const int **indices_ptr, int n_cell_step, int ranges[6], int idx_image = -1, int idx_chain = -1)
int Geometry_Get_Tetrahedra(State *state, const int **indices_ptr, int n_cell_step = 1, int idx_image = -1, int idx_chain = -1)
int Geometry_Get_Tetrahedra_Ranged(State *state, const int **indices_ptr, int n_cell_step, int ranges[6], int idx_image = -1, int idx_chain = -1)