libcrystfel  0.10.1
Data Structures | Typedefs | Enumerations | Functions
cell.h File Reference

Data Structures

struct  rvec
 
struct  g6
 

Typedefs

typedef struct _unitcell UnitCell
 

Enumerations

enum  LatticeType {
  L_TRICLINIC,
  L_MONOCLINIC,
  L_ORTHORHOMBIC,
  L_TETRAGONAL,
  L_RHOMBOHEDRAL,
  L_HEXAGONAL,
  L_CUBIC
}
 

Functions

UnitCellcell_new (void)
 
UnitCellcell_new_from_cell (const UnitCell *orig)
 
void cell_free (UnitCell *cell)
 
UnitCellcell_new_from_parameters (double a, double b, double c, double alpha, double beta, double gamma)
 
UnitCellcell_new_from_reciprocal_axes (struct rvec as, struct rvec bs, struct rvec cs)
 
UnitCellcell_new_from_direct_axes (struct rvec as, struct rvec bs, struct rvec cs)
 
int cell_has_parameters (const UnitCell *cell)
 
void cell_set_cartesian (UnitCell *cell, double ax, double ay, double az, double bx, double by, double bz, double cx, double cy, double cz)
 
void cell_set_parameters (UnitCell *cell, double a, double b, double c, double alpha, double beta, double gamma)
 
int cell_get_parameters (UnitCell *cell, double *a, double *b, double *c, double *alpha, double *beta, double *gamma)
 
int cell_get_cartesian (UnitCell *cell, double *ax, double *ay, double *az, double *bx, double *by, double *bz, double *cx, double *cy, double *cz)
 
int cell_get_reciprocal (UnitCell *cell, double *asx, double *asy, double *asz, double *bsx, double *bsy, double *bsz, double *csx, double *csy, double *csz)
 
void cell_set_reciprocal (UnitCell *cell, double asx, double asy, double asz, double bsx, double bsy, double bsz, double csx, double csy, double csz)
 
LatticeType cell_get_lattice_type (const UnitCell *cell)
 
void cell_set_lattice_type (UnitCell *cell, LatticeType lattice_type)
 
struct g6 cell_get_G6 (UnitCell *cell)
 
char cell_get_centering (const UnitCell *cell)
 
void cell_set_centering (UnitCell *cell, char centering)
 
char cell_get_unique_axis (const UnitCell *cell)
 
void cell_set_unique_axis (UnitCell *cell, char unique_axis)
 
UnitCellcell_transform_gsl_direct (UnitCell *in, gsl_matrix *m)
 
UnitCellcell_transform_rational (UnitCell *cell, RationalMatrix *m)
 
UnitCellcell_transform_rational_inverse (UnitCell *cell, RationalMatrix *m)
 
UnitCellcell_transform_intmat (UnitCell *cell, IntegerMatrix *m)
 
UnitCellcell_transform_intmat_inverse (UnitCell *cell, IntegerMatrix *m)
 

Detailed Description

Unit cell structure

Typedef Documentation

◆ UnitCell

typedef struct _unitcell UnitCell

Opaque data structure representing a unit cell.

This data structure is opaque. You must use the available accessor functions to read and write its contents.

Enumeration Type Documentation

◆ LatticeType

An enumeration of the possible lattice types: triclinic, monoclinic, orthorhombic, tetragonal, rhombohedral, hexagonal and cubic.

Function Documentation

◆ cell_free()

void cell_free ( UnitCell cell)
Parameters
cellA UnitCell to free.

Frees a UnitCell, and all internal resources concerning that cell.

◆ cell_has_parameters()

int cell_has_parameters ( const UnitCell cell)
Parameters
cellA UnitCell
Returns
True if cell has its parameters specified.

◆ cell_new()

UnitCell* cell_new ( void  )

Create a new UnitCell.

Returns
the new unit cell, or NULL on failure.

◆ cell_transform_intmat()

UnitCell* cell_transform_intmat ( UnitCell cell,
IntegerMatrix m 
)
Parameters
cellA UnitCell.
mAn IntegerMatrix.

Applies m to cell.

This is just a convenience function which turns m into a RationalMatrix and then calls cell_transform_rational(). See the documentation for that function for some important information.

Returns
Transformed copy of cell.

◆ cell_transform_intmat_inverse()

UnitCell* cell_transform_intmat_inverse ( UnitCell cell,
IntegerMatrix m 
)
Parameters
cellA UnitCell.
mAn IntegerMatrix

Applies the inverse of m to cell.

Returns
Transformed copy of cell.

◆ cell_transform_rational()

UnitCell* cell_transform_rational ( UnitCell cell,
RationalMatrix m 
)
Parameters
cellA UnitCell.
mA RationalMatrix.

Applies m to cell.

This function will determine the centering of the resulting unit cell, producing '?' if any lattice points cannot be accounted for. Note that if there are 'excess' lattice points in the transformed cell, the centering will still be '?' even if the lattice points for another centering are all present.

The lattice type will be set to triclinic, and the unique axis to '?'.

Returns
Transformed copy of cell.

◆ cell_transform_rational_inverse()

UnitCell* cell_transform_rational_inverse ( UnitCell cell,
RationalMatrix m 
)
Parameters
cellA UnitCell.
mA RationalMatrix

Applies the inverse of m to cell.

Returns
Transformed copy of cell.