chfl_cell
type¶chfl_cell
¶A chfl_cell
represent the box containing the atoms, and its
periodicity. An 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.
Type fields: |
|
---|
chfl_cell%
init
(lengths[, angles, status])¶Initialize this unit cell with an unit cell having the given lengths
and
optional angles
. If all angles are 90°, the unit cell shape is
CHFL_CELL_ORTHORHOMBIC
, else it is CHFL_CELL_TRICLINIC
.
This subroutine allocate memory which must be released with
chfl_cell%free()
.
Parameters: | lengths (3) [real] :: cell lengths, in angstroms |
---|---|
Options: |
|
chfl_cell%
copy
(cell[, status])¶Initialize this unit cell with a copy of cell
. This subroutine allocate
memory which must be released with chfl_cell%free()
.
Parameters: | cell [type(chfl_cell)] :: cell to copy |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
volume
([status])¶Get the volume of the unit cell in angstroms cubes.
Return: | real |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
lengths
([status])¶Get the unit cell lengths in angstroms.
Return: | real (3) |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
set_lengths
(lengths[, status])¶Set the unit cell lengths to lengths
.
Parameters: | lengths (3) [real] :: new cell lengths, in angstroms |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
angles
([status])¶Get the unit cell angles in degrees.
Return: | real (3) |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
set_angles
(alpha, beta, gamma[, status])¶Set the cell angles to angles
. Trying to set cell angles on a cell which
is not triclinic (does not have the CHFL_CELL_TRICLINIC
shape) is
an error.
Parameters: | angles (3) [real] :: new cell angles, in degrees |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
matrix
([status])¶Get the unit cell matricial representation.
The unit cell representation is obtained by aligning the a vector along the x axis and putting the b vector in the xy plane. This make the matrix an upper triangular matrix:
| a_x b_x c_x |
| 0 b_y c_y |
| 0 0 c_z |
Return: | real (3, 3) |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
shape
([status])¶Get the unit cell shape.
Return: | integer (chfl_cellshape) |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
The cell shapes are integers which kind
is the chfl_cellshape
parameter.
chfl_cellshape
[integer]¶Integer kind parameter for representing unit cel shape.
CHFL_CELL_ORTHORHOMBIC
[integer(chfl_cellshape)]¶Cell shape for cell where the three angles are 90°
CHFL_CELL_TRICLINIC
[integer(chfl_cellshape)]¶Cell shape for cell where the three angles may not be 90°
CHFL_CELL_INFINITE
[integer(chfl_cellshape)]¶Cell type when there is no periodic boundary conditions
chfl_cell%
set_shape
(shape[, status])¶Set the unit cell shape to shape
Parameters: | shape [integer(chfl_cellshape)] :: the new shape of the cell |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
wrap
(vector[, status])¶Wrap a vector
in this unit cell so that all its components are beteen
-L/2
and L/2
.
Parameters: | vector (3) [real] :: vector to wrap in the cell |
---|---|
Options: | status [integer(chfl_status)] :: status code of the operation. If it
is not CHFL_SUCCESS , use chfl_last_error() to learn
more about the error. |
chfl_cell%
free
()¶Destroy an unit cell, and free the associated memory