Function manipulating CHFL_CELL

CHFL_CELL * chfl_cell(double a, double b, double c)

Create an ORTHORHOMBIC UnitCell from the three lenghts.

Return
A pointer to the UnitCell, or NULL in case of error
Parameters
  • a -

    first lenght of the cell (in Angstroms)

  • b -

    second lenght of the cell (in Angstroms)

  • c -

    third lenght of the cell (in Angstroms)

CHFL_CELL * chfl_cell_from_frame(const CHFL_FRAME * frame)

Get the UnitCell from a frame.

Return
A pointer to the UnitCell, or NULL in case of error
Parameters
  • frame -

    the frame

int chfl_cell_lengths(const CHFL_CELL * cell, double * a, double * b, double * c)

Get the cell lenghts.

Return
The status code
Parameters
  • cell -

    the unit cell to read

  • a -

    first lenght of the cell (in Angstroms)

  • b -

    second lenght of the cell (in Angstroms)

  • c -

    third lenght of the cell (in Angstroms)

int chfl_cell_set_lengths(CHFL_CELL * cell, double a, double b, double c)

Set the unit cell lenghts.

Return
The status code
Parameters
  • cell -

    the unit cell to modify

  • a -

    first lenght of the cell (in Angstroms)

  • b -

    second lenght of the cell (in Angstroms)

  • c -

    third lenght of the cell (in Angstroms)

int chfl_cell_angles(const CHFL_CELL * cell, double * alpha, double * beta, double * gamma)

Get the cell angles, in degrees.

Return
The status code
Parameters
  • cell -

    the cell to read

  • alpha -

    angle of the cell between the vectors b and c (in degree)

  • beta -

    angle of the cell between the vectors a and c (in degree)

  • gamma -

    angle of the cell between the vectors a and b (in degree)

int chfl_cell_set_angles(CHFL_CELL * cell, double alpha, double beta, double gamma)

Set the cell angles, in degrees. This is only possible for TRICLINIC cells.

Return
The status code
Parameters
  • cell -

    the unit cell to modify

  • alpha -

    angle of the cell between the vectors b and c (in degree)

  • beta -

    angle of the cell between the vectors a and c (in degree)

  • gamma -

    angle of the cell between the vectors a and b (in degree)

int chfl_cell_matrix(const CHFL_CELL * cell, double(*) matrix[3])

Get the unit cell matricial representation.

Return
The status code
Parameters
  • cell -

    the unit cell to use

  • matrix -

    the matrix to fill. It should be a 3x3 matrix.

CHFL_CELL_TYPES enum

Available cell types in chemfiles.

Values:

  • CHFL_CELL_ORTHORHOMBIC = = 0 -

    The three angles are 90°

  • CHFL_CELL_TRICLINIC = = 1 -

    The three angles may not be 90°

  • CHFL_CELL_INFINITE = = 2 -

    Cell type when there is no periodic boundary conditions.

int chfl_cell_type(const CHFL_CELL * cell, chfl_cell_type_t * type)

Get the cell type.

Return
The status code
Parameters
  • cell -

    the unit cell to read

  • type -

    the type of the cell

int chfl_cell_set_type(CHFL_CELL * cell, chfl_cell_type_t type)

Set the cell type.

Return
The status code
Parameters
  • cell -

    the cell to modify

  • type -

    the new type of the cell

int chfl_cell_free(CHFL_CELL * cell)

Destroy an unit cell, and free the associated memory.

Return
The status code
Parameters
  • cell -

    The cell to destroy