Loading...
Searching...
No Matches
UnitCell Class Reference

The UnitCell class provides a representation of a crystal's unit cell.

`#include <avogadro/core/unitcell.h>`

## Public Member Functions

| UnitCell (Real a, Real b, Real c, Real alpha, Real beta, Real gamma)
| UnitCell (const Vector3 &a, const Vector3 &b, const Vector3 &c)
| UnitCell (const Matrix3 &cellMatrix)
| UnitCell (const UnitCell &other)
UnitCell & | operator= (UnitCell other)
Real | alpha () const
Real | beta () const
Real | gamma () const
void | setCellParameters (Real a, Real b, Real c, Real alpha, Real beta, Real gamma)
Real | volume () const
Vector3 | imageOffset (int i, int j, int k) const
const Matrix3 & | fractionalMatrix () const
void | setFractionalMatrix (const Matrix3 &m)
Vector3 | minimumImage (const Vector3 &v) const
Real | distance (const Vector3 &v1, const Vector3 &v2) const
Real | distanceSquared (const Vector3 &v1, const Vector3 &v2) const
bool | isRegular () const
Vector3 | aVector () const
Vector3 | bVector () const
Vector3 | cVector () const
void | setAVector (const Vector3 &v)
void | setBVector (const Vector3 &v)
void | setCVector (const Vector3 &v)
Real | a () const
Real | b () const
Real | c () const
const Matrix3 & | cellMatrix () const
void | setCellMatrix (const Matrix3 &m)
Vector3 | toFractional (const Vector3 &cart) const
void | toFractional (const Vector3 &cart, Vector3 &frac) const
Vector3 | toCartesian (const Vector3 &frac) const
void | toCartesian (const Vector3 &frac, Vector3 &cart) const
Vector3 | wrapFractional (const Vector3 &frac) const
void | wrapFractional (const Vector3 &frac, Vector3 &wrapped) const
Vector3 | wrapCartesian (const Vector3 &cart) const
void | wrapCartesian (const Vector3 &cart, Vector3 &wrapped) const

## Static Public Member Functions

static Vector3 | minimumImageFractional (const Vector3 &v)
static bool | isRegular (const Matrix3 &m)

## Member Function Documentation

## aVector()

Vector3 aVector | ( |  | ) | const

The lattice vector in the unit cell. Units: Angstrom

## bVector()

Vector3 bVector | ( |  | ) | const

The lattice vector in the unit cell. Units: Angstrom

## cVector()

Vector3 cVector | ( |  | ) | const

The lattice vector in the unit cell. Units: Angstrom

## setAVector()

void setAVector | ( | const Vector3 & | v | ) |

The lattice vector in the unit cell. Units: Angstrom

## setBVector()

void setBVector | ( | const Vector3 & | v | ) |

The lattice vector in the unit cell. Units: Angstrom

## setCVector()

void setCVector | ( | const Vector3 & | v | ) |

The lattice vector in the unit cell. Units: Angstrom

## a()

Real a | ( |  | ) | const

The length of the lattice vector in the unit cell. Units: Angstrom

## b()

Real b | ( |  | ) | const

The length of the lattice vector in the unit cell. Units: Angstrom

## c()

Real c | ( |  | ) | const

The length of the lattice vector in the unit cell. Units: Angstrom

## alpha()

Real alpha | ( |  | ) | const

The angle (radians) between the 'b' and 'c' lattice vectors.

## beta()

Real beta | ( |  | ) | const

The angle (radians) between the 'c' and 'a' lattice vectors.

## gamma()

Real gamma | ( |  | ) | const

The angle (radians) between the 'a' and 'b' lattice vectors.

## setCellParameters()

void setCellParameters | ( | Real | a,
|  | Real | b,
|  | Real | c,
|  | Real | alpha,
|  | Real | beta,
|  | Real | gamma )

Set the cell parameters defining the unit cell. a, b, and c are in Angstrom, alpha, beta, and gamma are in radians.

## volume()

Real volume | ( |  | ) | const

The volume of the unit cell in cubic Angstroms.

## imageOffset()

Vector3 imageOffset | ( | int | i,
|  | int | j,
|  | int | k ) const

Returns
  A vector pointing to the origin of the translational image that is i images in the a() direction, j images in the b() direction, and k images in the c() direction.

## cellMatrix()

const Matrix3 & cellMatrix | ( |  | ) | const

The cell matrix with lattice vectors as columns. Units: Angstrom

## setCellMatrix()

void setCellMatrix | ( | const Matrix3 & | m | ) |

The cell matrix with lattice vectors as columns. Units: Angstrom

## fractionalMatrix()

const Matrix3 & fractionalMatrix | ( |  | ) | const

The matrix used to convert cartesian to fractional coordinates.

## toFractional() [1/2]

Vector3 toFractional | ( | const Vector3 & | cart | ) | const

Convert the cartesian coordinate cart to fractional (lattice) units.

## toFractional() [2/2]

void toFractional | ( | const Vector3 & | cart,
|  | Vector3 & | frac ) const

Convert the cartesian coordinate cart to fractional (lattice) units.

## toCartesian() [1/2]

Vector3 toCartesian | ( | const Vector3 & | frac | ) | const

Convert the fractional (lattice) coordinate frac to cartesian units.

## toCartesian() [2/2]

void toCartesian | ( | const Vector3 & | frac,
|  | Vector3 & | cart ) const

Convert the cartesian coordinate cart to fractional (lattice) units.

## wrapFractional() [1/2]

Vector3 wrapFractional | ( | const Vector3 & | frac | ) | const

Adjust the fractional (lattice) coordinate frac so that it lies within the unit cell.

## wrapFractional() [2/2]

void wrapFractional | ( | const Vector3 & | frac,
|  | Vector3 & | wrapped ) const

Adjust the fractional (lattice) coordinate frac so that it lies within the unit cell.

## wrapCartesian() [1/2]

Vector3 wrapCartesian | ( | const Vector3 & | cart | ) | const

Adjust the cartesian coordinate cart so that it lies within the unit cell.

## wrapCartesian() [2/2]

void wrapCartesian | ( | const Vector3 & | cart,
|  | Vector3 & | wrapped ) const

Adjust the cartesian coordinate cart so that it lies within the unit cell.

## minimumImageFractional()

Vector3 minimumImageFractional | ( | const Vector3 & | v | ) |

static

Find the minimum fractional image of a fractional vector v. A minimum image has all fractional coordinates between -0.5 and 0.5.

## minimumImage()

Vector3 minimumImage | ( | const Vector3 & | v | ) | const

Find the minimum image of a Cartesian vector v. A minimum image has all fractional coordinates between -0.5 and 0.5

## distance()

Real distance | ( | const Vector3 & | v1,
|  | const Vector3 & | v2 ) const

Find the shortest distance between vectors v1 and v2.

## isRegular()

bool isRegular | ( | const Matrix3 & | m | ) |

static

Returns
  if m is regular, i.e. its determinant is nonzero

The documentation for this class was generated from the following file:

- unitcell.h