chemfiles::UnitCellAn UnitCell represent the box containing the atoms, and its periodicity.
A unit cell is fully represented by three lenghts (a, b, c); and three angles (alpha, beta, gamma). The angles are stored in degrees, and the lenghts 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 |
An unit cell also have a cell type, represented by the CellType enum.
Public Functions
UnitCell(const UnitCell & other)Copy constructor.
UnitCell(UnitCell && other)Move constructor.
UnitCell()Construct an INFINITE unit cell.
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 TRICLINIC unit cell of side size a, b, c, and cell angles alpha, beta, gamma
UnitCell(CellType type)Construct a cell of type type, with all lenghts set to 0 and all angles set to 90°
UnitCell(CellType type, double a)Construct a cell of type type, with all lenghts set to a and all angles set to 90°
UnitCell(CellType type, double a, double b, double c)Construct a cell of type type, with lenghts set to a ,b, d, and all angles set to 90°
matricial() constGet a matricial representation of the cell.
raw_matricial(double matrix[3][3]) constPopulate C-style matricial representation of the cell. The array should have a 3 x 3 size.
type() constGet the cell type.
type(CellType t)Set the cell type to t.
a() constGet the first lenght (a) of the cell.
set_a(double val)Set the first lenght (a) of the cell.
b() constGet the second lenght (b) of the cell.
set_b(double val)Set the second lenght (b) of the cell.
c() constGet the third lenght (c) of the cell.
set_c(double val)Set the third lenght (c) of the cell.
alpha() constGet the first angle (alpha) of the cell.
set_alpha(double val)Set the first angle (alpha) of the cell if possible.
beta() constGet the second angle (beta) of the cell.
set_beta(double val)Set the second angle (beta) of the cell if possible.
gamma() constGet the third angle (gamma) of the cell.
set_gamma(double val)Set the third angle (gamma) of the cell if possible.
volume() constGet the unit cell volume.
wrap(const Vector3D & vect) constWrap the vector vect in the unit cell, using periodic boundary conditions.
Values:
ORTHORHOMBIC = = 0 - Orthorhombic cell, with the three angles equals to 90°
TRICLINIC = = 1 - Triclinic cell, with any values for the angles.
INFINITE = = 2 - Infinite cell, to use when there is no cell.