Class Avogadro::Core::AvoSpglib#

class AvoSpglib#

The AvoSpglib class provides an interface between Avogadro and Spglib.

Public Functions

AvoSpglib()#
~AvoSpglib()#

Public Static Functions

static unsigned short getHallNumber(Molecule &mol, double cartTol = 1e-5)#

Use spglib to find the Hall number for a crystal. If the unit cell does not exist or if the algorithm fails, 0 will be returned.

If the algorithm succeeds, the hall number will be set in the molecule.

Parameters:
  • mol – The molecule to be handled.

  • cartTol – The cartesian tolerance for spglib.

Returns:

The Hall number for the crystal.

static bool reduceToPrimitive(Molecule &mol, double cartTol = 1e-5)#

Use spglib to reduce the crystal to a primitive cell. Unless the molecule is missing its unit cell, it will be edited by spglib. Positions are not idealized.

If the algorithm succeeds, the hall number will be set in the molecule.

Parameters:
  • mol – The molecule to be reduced to its primitive cell.

  • cartTol – The cartesian tolerance for spglib.

Returns:

False if the molecule has no unit cell or if the spglib algorithm failed. True otherwise.

static bool conventionalizeCell(Molecule &mol, double cartTol = 1e-5)#

Use spglib to refine the crystal to its conventional cell. Unless the molecule is missing its unit cell, it will be edited by spglib. Positions are idealized.

If the algorithm succeeds, the hall number will be set in the molecule.

Parameters:
  • mol – The molecule to be conventionalized.

  • cartTol – The cartesian tolerance for spglib.

Returns:

False if the molecule has no unit cell or if the spglib algorithm failed. True otherwise.

static bool symmetrize(Molecule &mol, double cartTol = 1e-5)#

Use spglib to symmetrize the crystal. Unless the molecule is missing its unit cell, it will be edited by spglib. It will be reduced to its primitive form, and positions will be idealized.

If the algorithm succeeds, the hall number will be set in the molecule.

Parameters:
  • mol – The molecule to be conventionalized.

  • cartTol – The cartesian tolerance for spglib.

Returns:

False if the molecule has no unit cell or if the spglib algorithm failed. True otherwise.