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 |
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[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.
a
(double val)Set the first lenght (a) of the cell.
b
() constGet the second lenght (b) of the cell.
b
(double val)Set the second lenght (b) of the cell.
c
() constGet the third lenght (c) of the cell.
c
(double val)Set the third lenght (c) of the cell.
alpha
() constGet the first angle (alpha) of the cell.
alpha
(double val)Set the first angle (alpha) of the cell if possible.
beta
() constGet the second angle (beta) of the cell.
beta
(double val)Set the second angle (beta) of the cell if possible.
gamma
() constGet the third angle (gamma) of the cell.
gamma
(double val)Set the third angle (gamma) of the cell if possible.
volume
() constGet the unit cell volume.
periodic_x
() constGet the cell periodicity for the x axis.
periodic_y
() constGet the cell periodicity for the y axis.
periodic_z
() constGet the cell periodicity for the z axis.
full_periodic
() constTrue if the cell is periodic in the three dimmensions.
periodic_x
(bool p)Set the cell periodicity for the x axis.
periodic_y
(bool p)Set the cell periodicity for the y axis.
periodic_z
(bool p)Set the cell periodicity for the z axis.
full_periodic
(bool p)Set the cell periodicity in three dimmensions.
wrap
(const Vector3D & vect) constWrap the vector vect
in the unit cell.
Values:
ORTHOROMBIC
= = 0
- Orthorombic 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.