Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Scine::Molassembler::Shapes Namespace Reference

Symmetry definitions and properties. More...

Namespaces

 ConstexprProperties
 Compile-time calculation of shape classes' properties.
 
 Continuous
 Symmetry element, point group, and polyhedral shape continuous metrics.
 
 Data
 All symmetry data classes and some minor helper functions.
 
 Diophantine
 Functions to help treat a particular linear diophantine equation.
 
 Elements
 Namespace for classes and data of point group symmetry elements.
 
 Properties
 Runtime-computed properties of shapes.
 

Data Structures

struct  CoordinateSystem
 Coordinate system axis data class. More...
 
struct  InertialMoments
 Inertial moments data struct. More...
 
class  Partitioner
 Given S * E distinguishable objects, this class helps enumerate all partitions into S groups of size E. More...
 

Typedefs

using Vertex = Temple::StrongIndex< vertex_index_tag, unsigned >
 Index of a shape vertex.
 
using Permutation = std::vector< Vertex >
 Representation of a shape vertex permutation.
 
using RotationsList = std::vector< Permutation >
 The type to store shape rotations.
 
using AngleFunction = std::function< >
 Function returning angle between vertices. More...
 
using Tetrahedron = std::array< boost::optional< Vertex >, 4 >
 This is a four-vertex tetrahedron definition. More...
 
using TetrahedronList = std::vector< Tetrahedron >
 
using Coordinates = Eigen::Matrix< double, 3, Eigen::Dynamic >
 Representation of idealized shape coordinates (does not include centroid)
 
using InertialPositionsType = Eigen::Matrix< double, 3, Eigen::Dynamic >
 

Enumerations

enum  Top {
  Top::Line, Top::Asymmetric, Top::Prolate, Top::Oblate,
  Top::Spherical
}
 What kind of top is the particle collection? More...
 
enum  PointGroup : unsigned {
  C1, Ci, Cs, C2,
  C3, C4, C5, C6,
  C7, C8, C2h, C3h,
  C4h, C5h, C6h, C7h,
  C8h, C2v, C3v, C4v,
  C5v, C6v, C7v, C8v,
  S4, S6, S8, D2,
  D3, D4, D5, D6,
  D7, D8, D2h, D3h,
  D4h, D5h, D6h, D7h,
  D8h, D2d, D3d, D4d,
  D5d, D6d, D7d, D8d,
  T, Td, Th, O,
  Oh, I, Ih, Cinfv,
  Dinfh
}
 Point groups.
 
enum  Shape : unsigned {
  Shape::Line, Shape::Bent, Shape::EquilateralTriangle, Shape::VacantTetrahedron,
  Shape::T, Shape::Tetrahedron, Shape::Square, Shape::Seesaw,
  Shape::TrigonalPyramid, Shape::SquarePyramid, Shape::TrigonalBipyramid, Shape::Pentagon,
  Shape::Octahedron, Shape::TrigonalPrism, Shape::PentagonalPyramid, Shape::Hexagon,
  Shape::PentagonalBipyramid, Shape::CappedOctahedron, Shape::CappedTrigonalPrism, Shape::SquareAntiprism,
  Shape::Cube, Shape::TrigonalDodecahedron, Shape::HexagonalBipyramid, Shape::TricappedTrigonalPrism,
  Shape::CappedSquareAntiprism, Shape::HeptagonalBipyramid, Shape::BicappedSquareAntiprism, Shape::EdgeContractedIcosahedron,
  Shape::Icosahedron, Shape::Cuboctahedron
}
 Enumeration of all contained symmetry names. More...
 

Functions

Eigen::Matrix3d rotationMatrix (const CoordinateSystem &a, const CoordinateSystem &b)
 Gives the rotation matrix tranforming points between coordinate systems. More...
 
const std::string & name (Shape shape)
 Fetch the string name of a shape. More...
 
Shape nameFromString (const std::string &shapeNameString)
 Fetch the shape name from its string. More...
 
std::string spaceFreeName (Shape shape)
 Fetch a space-free string of a shape for file naming. More...
 
unsigned size (Shape shape)
 Fetch the number of vertices of a shape. More...
 
const RotationsListrotations (Shape shape)
 Fetches a shape's list of rotations. More...
 
const Permutationmirror (Shape shape)
 Fetches the mirror index mapping for a particular shape. More...
 
AngleFunction angleFunction (Shape shape)
 Gets a shape's angle function. More...
 
Coordinates coordinates (Shape shape)
 Fetch a shape's idealized coordiantes. More...
 
PointGroup pointGroup (Shape shape)
 Get a shape's point group. More...
 
unsigned nameIndex (Shape shape)
 Returns the index of a shape within allShapes. More...
 
const TetrahedronListtetrahedra (Shape shape)
 Fetches the list of tetrahedra defined in a shape. More...
 
bool threeDimensional (Shape shape)
 Returns whether a shape is three dimensional. More...
 
InertialMoments principalInertialMoments (const InertialPositionsType &positions)
 Determine the inertial moments of a set of positions. More...
 
Top standardizeTop (Eigen::Ref< InertialPositionsType > normalizedPositions)
 Identifies the top of a set of positions and reorients the particle positions, aligning the main axis along z. More...
 
unsigned reorientAsymmetricTop (Eigen::Ref< InertialPositionsType > normalizedPositions)
 Searches for Cn axes along the coordinate system axes, aligns the highest order Cn axis found along the z axis. More...
 
double minimumAngle (Shape shape)
 Calculate the minimum angle in a symmetry. More...
 
double maximumAngle (Shape shape)
 Calculate the maximum angle in a symmetry. More...
 
boost::optional< const
Properties::ShapeTransitionGroup & > 
getMapping (Shape a, Shape b, const boost::optional< Vertex > &removedIndexOption=boost::none)
 Cached access to mappings. Populates the cache from constexpr if generated. More...
 
bool hasMultipleUnlinkedStereopermutations (Shape shape, unsigned nIdenticalLigands)
 Cached access to multiple unlinked values. More...
 
double tau (const std::vector< double > &angles)
 Calculates the tau value for four and five angle symmetries. More...
 

Variables

constexpr unsigned ORIGIN_PLACEHOLDER = std::numeric_limits<unsigned>::max()
 A placeholder value for constexpr tetrahedra specification of origin.
 
constexpr std::array< Shape,
nShapes
allShapes
 A list of all the enum class values. More...
 
const Temple::Array< std::pair
< double, double >, nShapes
shapeAngleBounds
 Precomputed min and max angle values in radians for all shapes.
 
constexpr unsigned nShapes = 30
 Total number of shapes.
 

Detailed Description

Symmetry definitions and properties.

Typedef Documentation

using Scine::Molassembler::Shapes::AngleFunction = typedef std::function< >

Function returning angle between vertices.

All angle functions can be called with arbitrary (valid) parameters without failing. Valid here means that a != b and less than the size of the shape requested.

They return angles in radians.

using Scine::Molassembler::Shapes::Tetrahedron = typedef std::array<boost::optional<Vertex>, 4>

This is a four-vertex tetrahedron definition.

All shapes use None to signal to replace this position with the central atom as it is not part of the vertex indexing scheme.

All shapes use boost::none to signal to replace this position with the central atom as it is not part of the vertex indexing scheme.

Enumeration Type Documentation

enum Scine::Molassembler::Shapes::Shape : unsigned
strong

Enumeration of all contained symmetry names.

List is in order of the number of symmetry positions

Enumerator
Line 

See Data::Line.

Bent 

See Data::Bent.

EquilateralTriangle 

See Data::EquilateralTriangle.

VacantTetrahedron 

See Data::VacantTetrahedron.

T 

See Data::T.

Tetrahedron 

See Data::Tetrahedron.

Square 

See Data::Square.

Seesaw 

See Data::Seesaw.

TrigonalPyramid 

See Data::TrigonalPyramid.

SquarePyramid 

See Data::SquarePyramid.

TrigonalBipyramid 

See Data::TrigonalBipyramid.

Pentagon 

See Data::Pentagon.

Octahedron 

See Data::Octahedron.

TrigonalPrism 

See Data::TrigonalPrism.

PentagonalPyramid 

See Data::PentagonalPyramid.

Hexagon 

See Data::Hexagon.

PentagonalBipyramid 

See Data::PentagonalBipyramid.

CappedOctahedron 

See Data::CappedOctahedron.

CappedTrigonalPrism 

See Data::CappedTrigonalPrism.

SquareAntiprism 

See Data::SquareAntiprism.

Cube 

See Data::Cube.

TrigonalDodecahedron 

See Data::TrigonalDodecahedron.

HexagonalBipyramid 

See Data::HexagonalBipyramid.

TricappedTrigonalPrism 

See Data::TricappedTrigonalPrism.

CappedSquareAntiprism 

See Data::CappedSquareAntiPrism.

HeptagonalBipyramid 

See Data::HeptagonalBipyramid.

BicappedSquareAntiprism 

See Data::BicappedSquareAntiprism.

EdgeContractedIcosahedron 

See Data::EdgeContractedIcosahedron.

Icosahedron 

See Data::Icosahedron.

Cuboctahedron 

See Data::Cuboctahedron.

What kind of top is the particle collection?

Enumerator
Line 

Line top: 0 ≅ IA << IB = IC.

Asymmetric 

Asymmetric top: IA < IB < IC, degeneracy 0.

Prolate 

Prolate top (think rugby football): IA < IB = IC.

Oblate 

Oblate top (think disc): IA = IB < IC.

Spherical 

Spherical top: IA = IB = IC.

Function Documentation

AngleFunction Scine::Molassembler::Shapes::angleFunction ( Shape  shape)

Gets a shape's angle function.

Complexity \(\Theta(1)\)

Coordinates Scine::Molassembler::Shapes::coordinates ( Shape  shape)

Fetch a shape's idealized coordiantes.

Complexity \(\Theta(1)\)

boost::optional<const Properties::ShapeTransitionGroup&> Scine::Molassembler::Shapes::getMapping ( Shape  a,
Shape  b,
const boost::optional< Vertex > &  removedIndexOption = boost::none 
)

Cached access to mappings. Populates the cache from constexpr if generated.

Complexity \(\Theta(S!)\) where \(S\) is the size of the symmetry if the transition is not cached, \(\Theta(1)\) otherwise.

Parameters
aSource shape
bTarget shape
removedIndexOptionThe symmetry position removed from source if the transition is to be a symmetry position loss. Necessary if the size of the target is one less than that of the source. Defaults to None.
Returns
The symmetry transition if possible, None otherwise
bool Scine::Molassembler::Shapes::hasMultipleUnlinkedStereopermutations ( Shape  shape,
unsigned  nIdenticalLigands 
)

Cached access to multiple unlinked values.

Populates the cache with allHasMultipleUnlinkedStereopermutations if the constexpr number of unlinked stereopermutations was calculated at runtime. If not, calculates the value and stores it in the cache.

Complexity \(\Theta(S!)\) where \(S\) is the size of the symmetry if the symmetry and number of identical ligands is not cached, \(\Theta(1)\) otherwise

Parameters
symmetryNamesymmetry for which to check the value
nIdenticalLigandsnumber of equivalent ligands
Returns
Whether there are multiple stereopermutations assuming no ligands are linked
double Scine::Molassembler::Shapes::maximumAngle ( Shape  shape)

Calculate the maximum angle in a symmetry.

Calculates the maximum angle between symmetry positions in a symmetry class

Complexity \(\Theta(S^2)\)

double Scine::Molassembler::Shapes::minimumAngle ( Shape  shape)

Calculate the minimum angle in a symmetry.

Calculates the minimum angle between symmetry positions in a symmetry class

Complexity \(\Theta(S^2)\)

See Also
ConstexprProperties::calculateSmallestAngle
const Permutation& Scine::Molassembler::Shapes::mirror ( Shape  shape)

Fetches the mirror index mapping for a particular shape.

Complexity \(\Theta(1)\)

const std::string& Scine::Molassembler::Shapes::name ( Shape  shape)

Fetch the string name of a shape.

Complexity \(\Theta(1)\)

Shape Scine::Molassembler::Shapes::nameFromString ( const std::string &  shapeNameString)

Fetch the shape name from its string.

Complexity \(\Theta(S)\)

Exceptions
std::logic_errorif no matching shape can be found
unsigned Scine::Molassembler::Shapes::nameIndex ( Shape  shape)

Returns the index of a shape within allShapes.

Complexity \(\Theta(S)\)

PointGroup Scine::Molassembler::Shapes::pointGroup ( Shape  shape)

Get a shape's point group.

Complexity \(\Theta(1)\)

InertialMoments Scine::Molassembler::Shapes::principalInertialMoments ( const InertialPositionsType &  positions)

Determine the inertial moments of a set of positions.

Precondition
Assumes positions are in an inertial frame (COM is origin)
unsigned Scine::Molassembler::Shapes::reorientAsymmetricTop ( Eigen::Ref< InertialPositionsType >  normalizedPositions)

Searches for Cn axes along the coordinate system axes, aligns the highest order Cn axis found along the z axis.

Parameters
normalizedPositionsParticle positions
Note
Call standardizeTop() and use this if you get an asymmetric top.
Returns
The order of the highest Cn axis found. If no axis is found along the coordinate system axes, the result is 1, and particle positions are unaffected.
Eigen::Matrix3d Scine::Molassembler::Shapes::rotationMatrix ( const CoordinateSystem &  a,
const CoordinateSystem &  b 
)

Gives the rotation matrix tranforming points between coordinate systems.

You can transform points from a using the result of this function into coordinate system b.

Parameters
aSource coordinate system
bTarget coordinate system
Returns
Rotation matrix transforming points from system a into b
const RotationsList& Scine::Molassembler::Shapes::rotations ( Shape  shape)

Fetches a shape's list of rotations.

Complexity \(\Theta(1)\)

unsigned Scine::Molassembler::Shapes::size ( Shape  shape)

Fetch the number of vertices of a shape.

Complexity \(\Theta(1)\)

std::string Scine::Molassembler::Shapes::spaceFreeName ( Shape  shape)

Fetch a space-free string of a shape for file naming.

Complexity \(\Theta(1)\)

Top Scine::Molassembler::Shapes::standardizeTop ( Eigen::Ref< InertialPositionsType >  normalizedPositions)

Identifies the top of a set of positions and reorients the particle positions, aligning the main axis along z.

Parameters
normalizedPositionsParticle positions
Returns
The top of the molecule
double Scine::Molassembler::Shapes::tau ( const std::vector< double > &  angles)
inline

Calculates the tau value for four and five angle symmetries.

Complexity \(\Theta(1)\)

Parameters
anglesA sorted vector of the angles in your central symmetry. This must be of size four or five.
Returns
τ₄' or τ₅
const TetrahedronList& Scine::Molassembler::Shapes::tetrahedra ( Shape  shape)

Fetches the list of tetrahedra defined in a shape.

Complexity \(\Theta(1)\)

bool Scine::Molassembler::Shapes::threeDimensional ( Shape  shape)

Returns whether a shape is three dimensional.

Complexity \(\Theta(1)\)

Variable Documentation

constexpr std::array<Shape, nShapes> Scine::Molassembler::Shapes::allShapes
Initial value:
= Detail::makeAllShapes(
std::make_index_sequence<nShapes>()
)

A list of all the enum class values.