chfl_cell
type¶
- 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:
% init [subroutine] ::
chfl_cell%init()
% copy [subroutine] ::
chfl_cell%copy()
% from_matrix [subroutine] ::
chfl_cell%from_matrix()
% lengths [function] ::
chfl_cell%lengths()
% set_lengths [subroutine] ::
chfl_cell%set_lengths()
% angles [function] ::
chfl_cell%angles()
% set_angles [subroutine] ::
chfl_cell%set_angles()
% matrix [function] ::
chfl_cell%matrix()
% shape [function] ::
chfl_cell%shape()
% set_shape [subroutine] ::
chfl_cell%set_shape()
% volume [function] ::
chfl_cell%volume()
% wrap [subroutine] ::
chfl_cell%wrap()
% free [subroutine] ::
chfl_cell%free()
- subroutine chfl_cell%init(lengths[, angles, status])¶
Initialize this unit cell with an unit cell having the given
lengths
and optionalangles
. If all angles are 90°, the unit cell shape isCHFL_CELL_ORTHORHOMBIC
, else it isCHFL_CELL_TRICLINIC
.This subroutine allocate memory which must be released with
chfl_cell%free()
.- Parameters:
lengths (3) [real] :: cell lengths, in angstroms
- Options:
angles (3) [real] :: cell angles, in degrees
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_cell%copy(cell[, status])¶
Initialize this unit cell with a copy of
cell
. This subroutine allocate memory which must be released withchfl_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
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_cell%from_matrix(matrix[, status])¶
Initialize this unit cell from it’s matricial representation, i.e the matrix containing the three cell vectors. This subroutine allocate memory which must be released with
chfl_cell%free()
.- Parameters:
matrix (3, 3) [real(kind=real64)] :: matrix representation of the unit cell
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function 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
, usechfl_last_error()
to learn more about the error.
- function 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
, usechfl_last_error()
to learn more about the error.
- subroutine 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
, usechfl_last_error()
to learn more about the error.
- function 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
, usechfl_last_error()
to learn more about the error.
- subroutine 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 theCHFL_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
, usechfl_last_error()
to learn more about the error.
- function 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
, usechfl_last_error()
to learn more about the error.
- function 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
, usechfl_last_error()
to learn more about the error.
The cell shapes are integers which
kind
is thechfl_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
- subroutine 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
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_cell%wrap(vector[, status])¶
Wrap a
vector
in this unit cell so that all its components are beteen-L/2
andL/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
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_cell%free()¶
Destroy an unit cell, and free the associated memory