UnitCell
¶An UnitCell represent the box containing the atoms, and its periodicity
A unit cell is fully represented by three lengths (a, b, c); and three angles (alpha, beta, gamma). The angles are stored in degrees, and the lengths in Angstroms.
A cell also has a matricial representation, by projecting the three base vector into an orthonormal base. We choose to represent such matrix as an upper triangular matrix:
| a_x b_x c_x |
| 0 b_y c_y |
| 0 0 c_z |
Public Types
Public Functions
UnitCell
()¶Construct an INFINITE
unit cell, with all lengths set to 0
UnitCell
(double a)¶Construct a cubic unit cell of side size a
UnitCell
(double a, double b, double c)¶Construct an ORTHOROMBIC
unit cell of side size a
, b
, c
UnitCell
(double a, double b, double c, double alpha, double beta, double gamma)¶Construct a unit cell of side size a
, b
, c
, and cell angles alpha
, beta
, gamma
.
If all of alpha
, beta
and gamma
are 90.0, then the cell is ORTHOROMBIC
. Else a TRICLINIC
cell is created.
UnitCell
(const Matrix3D &matrix)¶Construct a unit cell via from an upper triangular matrix.
If a matrix of all zeros is given, then an infinite cell is created.
If only the diagonal of the matrix is non-zero, then the cell is ORTHOROMBIC
. Else a TRICLINIC
cell is created.
matrix
() const¶Get the cell matrix, defined as the upper triangular matrix
| a_x b_x c_x |
| 0 b_y c_y |
| 0 0 c_z |
set_shape
(CellShape shape)¶Set the cell shape to shape
Error
: if shape
is ORTHORHOMBIC
and some angles are not 90°, or if shape
is INFINITE
and some lengths are not 0.0. a
() const¶Get the first lenght (a) of the cell
set_a
(double val)¶Set the first lenght (a) of the cell
Error
: if the cell shape is INFINITE
. b
() const¶Get the second lenght (b) of the cell
set_b
(double val)¶Set the second lenght (b) of the cell
Error
: if the cell shape is INFINITE
. c
() const¶Get the third lenght (c) of the cell
set_c
(double val)¶Set the third lenght (c) of the cell
Error
: if the cell shape is INFINITE
. alpha
() const¶Get the first angle (alpha) of the cell
set_alpha
(double val)¶Set the first angle (alpha) of the cell
Error
: if the cell shape is not TRICLINIC
. beta
() const¶Get the second angle (beta) of the cell
set_beta
(double val)¶Set the second angle (beta) of the cell if possible
Error
: if the cell shape is not TRICLINIC
. gamma
() const¶Get the third angle (gamma) of the cell
set_gamma
(double val)¶Set the third angle (gamma) of the cell if possible
Error
: if the cell shape is not TRICLINIC
. volume
() const¶Get the unit cell volume