chemfiles::
UnitCell
¶An 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 | ```
Public Types
Public Functions
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
(CellShape shape)¶Construct a cell of type `type`, with all lenghts set to 0 and all angles set to 90°
UnitCell
(CellShape shape, double a)¶Construct a cell of type `type`, with all lenghts set to `a` and all angles set to 90°
UnitCell
(CellShape shape, 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
() const¶Get a matricial representation of the cell.
raw_matricial
(double matrix[3][3]) const¶Populate C-style matricial representation of the cell. The array should have a 3 x 3 size.
shape
(CellShape shape)¶Set the cell shape to `shape`.
a
() const¶Get the first lenght (a) of the cell.
set_a
(double val)¶Set the first lenght (a) of the cell.
b
() const¶Get the second lenght (b) of the cell.
set_b
(double val)¶Set the second lenght (b) of the cell.
c
() const¶Get the third lenght (c) of the cell.
set_c
(double val)¶Set the third lenght (c) of the cell.
alpha
() const¶Get the first angle (alpha) of the cell.
set_alpha
(double val)¶Set the first angle (alpha) of the cell if possible.
beta
() const¶Get the second angle (beta) of the cell.
set_beta
(double val)¶Set the second angle (beta) of the cell if possible.
gamma
() const¶Get the third angle (gamma) of the cell.
set_gamma
(double val)¶Set the third angle (gamma) of the cell if possible.
volume
() const¶Get the unit cell volume.
wrap
(const Vector3D &vect) const¶Wrap the vector `vect` in the unit cell, using periodic boundary conditions.