|
AvogadroLibs 2.1.0-20261111
|
The Spacegroups class stores basic data about crystal spacegroups. More...
#include <avogadro/core/spacegroups.h>
Static Public Member Functions | |
| static unsigned short | hallNumber (const std::string &spaceGroup) |
| static unsigned short | hallNumberFromHallSymbol (const std::string &hallSymbol) |
| static std::string | normalizeHallSymbol (const std::string &hallSymbol) |
| static unsigned short | hallNumberFromTransforms (const std::vector< std::string > &operations) |
| static unsigned short | internationalNumberFromString (const std::string &spaceGroup) |
| static bool | setSpaceGroup (Molecule &molecule, const std::string &spaceGroup) |
| static const char * | internationalNumberKey () |
| static CrystalSystem | crystalSystem (unsigned short hallNumber) |
| static bool | cellLooksPrimitive (unsigned short hallNumber, const UnitCell &cell) |
| static unsigned short | internationalNumber (unsigned short hallNumber) |
| static const char * | schoenflies (unsigned short hallNumber) |
| static const char * | hallSymbol (unsigned short hallNumber) |
| static const char * | international (unsigned short hallNumber) |
| static const char * | internationalFull (unsigned short hallNumber) |
| static const char * | internationalShort (unsigned short hallNumber) |
| static const char * | setting (unsigned short hallNumber) |
| static unsigned short | transformsCount (unsigned short hallNumber) |
| static Array< Vector3 > | getTransforms (unsigned short hallNumber, const Vector3 &v) |
| static void | fillUnitCell (Molecule &mol, unsigned short hallNumber, double cartTol=1e-5, bool wrapToCell=true, bool allCopies=false) |
| static bool | fillUnitCellFromOperations (Molecule &mol, const std::vector< std::string > &operations, double cartTol=1e-5, bool wrapToCell=true, bool allCopies=false) |
| static void | fillTranslationalCopies (Molecule &mol, double cartTol=1e-5) |
| static void | reduceToAsymmetricUnit (Molecule &mol, unsigned short hallNumber, double cartTol=1e-5) |
| static Array< Index > | translationalUniqueAtoms (const Molecule &mol, double tolerance=0.001) |
Static Public Attributes | |
| static constexpr unsigned short | lastHallNumber = 530 |
The spacegroups class gives a simple interface to basic data about crystal spacegroups. The data is generated from information in spglib.
|
static |
Besides the strings in the table (Hall symbol, international symbols), this accepts the spellings other programs write: screw axes without the underscore ("P 63 m c", "P 1 21/c 1"), a trailing setting that selects an origin choice or the hexagonal / rhombohedral axes ("F d -3 m :2", "R -3 m :H"), the pre-1983 cubic notation ("I m 3 m") and a bare international table number ("229").
A symbol or number that fits several settings (origin choice, axes) is not guessed: 0 is returned. See internationalNumberFromString().
|
static |
hallSymbol, or 0 if there is none.Unlike hallNumber(), the international symbols and numbers are not accepted: a string that is not a Hall symbol of the table gives 0. Runs of white space are collapsed and a double quote is read as '=', as in the table, so "-P 2yn" and "P 3 2\"" (the table's "P 3 2=") match.
|
static |
hallSymbol in the spelling of the table: runs of white space (spaces, tabs and line endings) collapsed to one space, the ends trimmed, and '=' where a file has a double quote. The result is not checked against the table.
|
static |
operations, or 0 if no entry of the table has this set.This is how most crystallography programs resolve a setting: the symmetry operations a CIF file lists identify the origin choice and axes (which an H-M symbol often leaves out), and cannot disagree with the coordinates.
Each operation is written like "x,y,z", "-x+1/2,y,-z", "1/2+x,y,z" or "x-y,x,z+1/6". Letters may be upper case, spaces and quotes are ignored, and constants may be decimals (0.5, 0.3333, 0.6667) if they are close to a multiple of 1/12. Translations are taken modulo one. The order of the operations and repeats do not matter. All operations must be present and none may be extra. Text that is not an operation, or an empty list, gives 0.
Three pairs of entries in the table (hall numbers 322 and 324, 326 and 328, 330 and 332, all group 68) have the same operations and the same Hall symbol, and differ only in a setting label. The lower number is returned.
|
static |
|
static |
Record the space group that a file gives as a string (a symbol, with or without a setting, or a bare international table number) in molecule.
If the string identifies one setting, the Hall number of the molecule is set (see hallNumber()). If it only identifies the group, because several settings fit (origin choice, axes), the international table number is kept in the data map under internationalNumberKey(), so that the user can be asked for just those settings. A Hall number set later removes it.
The string is resolved once. A space group that is not recognized leaves the molecule unchanged.
|
static |
|
static |
|
static |
cell looks like a primitive cell although the space group (hallNumber) has a centred lattice (F, I, A, B or C), i.e. the cell is probably not the conventional cell the group's operations expect.The test is on the cell angles, with a tolerance of 5 degrees from 90. It depends on the crystal system, because conventional cells of some systems legitimately have angles other than 90:
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Fill a crystal with atoms by using transforms from a hall number. Nothing will be done if the molecule does not have a unit cell. The cartesian tolerance is used to check if an atom is already present at that location. If there is another atom within that distance, the new atom will not be placed there.
|
static |
Fill a crystal with atoms by applying a list of symmetry operations written like "x,y,z" or "-x+1/2,y+1/2,-z" (the grammar of hallNumberFromTransforms()), as given by a file, instead of the ones of a table entry. The operations are applied as listed; the set is not closed to a group, and need not be one. Identity operations and any atom that would land within cartTol of an existing atom are skipped, so applying the operations to a structure that is already expanded adds nothing.
mol unchanged, if the molecule has no unit cell or any operation cannot be parsed. An empty list is accepted and adds nothing.
|
static |
Add translational copies of atoms on the unit cell boundary. For atoms at fractional coordinate ~0, a copy is placed at ~1 and vice versa, plus edge and corner combinations. No symmetry operations are applied.
|
static |
Reduce a cell to its asymmetric unit. Nothing will be done if the molecule does not have a unit cell. The cartesian tolerance is used to check if an atom is present at a location within the tolerance distance. If an atom is present, the atom gets removed.
Get indices of translationally unique atoms, filtering out duplicates. Atoms with fractional coordinates near 1.0 that duplicate atoms near 0.0 (due to periodic boundary conditions) are excluded.
| mol | The molecule with a unit cell |
| tolerance | Fractional coordinate tolerance for duplicate detection |
|
staticconstexpr |
The highest Hall number. The Hall numbers run from 1 to this value; 0 means "no space group" throughout this class.