8 #ifndef INCLUDE_MOLASSEMBLER_SHAPES_POINT_GROUP_ELEMENTS_H
9 #define INCLUDE_MOLASSEMBLER_SHAPES_POINT_GROUP_ELEMENTS_H
14 #include "boost/optional/optional_fwd.hpp"
18 #include <unordered_map>
22 namespace Molassembler {
30 using Vector = Eigen::Vector3d;
31 using Matrix = Eigen::Matrix3d;
32 using Ptr = std::unique_ptr<SymmetryElement>;
37 virtual Matrix matrix()
const = 0;
39 virtual boost::optional<Vector> vector()
const = 0;
41 virtual std::string
name()
const = 0;
48 Matrix matrix()
const final;
49 boost::optional<Vector> vector()
const final;
50 std::string
name()
const final;
57 Matrix matrix()
const final;
58 boost::optional<Vector> vector()
const final;
59 std::string
name()
const final;
65 const Eigen::Vector3d& passAxis,
72 static Rotation Cn(
const Eigen::Vector3d& axis,
unsigned n,
unsigned power = 1);
73 static inline Rotation Cn_z(
const unsigned n,
const unsigned power = 1) {
74 return Cn(Eigen::Vector3d::UnitZ(), n, power);
77 static Rotation Sn(
const Eigen::Vector3d& axis,
unsigned n,
unsigned power = 1);
80 Rotation operator * (
const Rotation& rhs)
const;
82 Matrix matrix()
const final;
83 boost::optional<Vector> vector()
const final;
84 std::string
name()
const final;
95 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
100 Reflection(
const Eigen::Vector3d& passNormal);
102 static Reflection sigma_xy();
103 static Reflection sigma_xz();
104 static Reflection sigma_yz();
106 Matrix matrix()
const final;
107 boost::optional<Vector> vector()
const final;
108 std::string
name()
const final;
113 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
144 using ElementIndexGroups = std::vector<std::vector<unsigned>>;
146 Eigen::Vector3d probePoint;
147 ElementIndexGroups groups;
149 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
160 std::vector<ElementGrouping>,
163 Eigen::aligned_allocator<std::pair<const unsigned, std::vector<ElementGrouping>>>
unsigned n
Rotation order.
Definition: PointGroupElements.h:89
#define PURITY_WEAK
Definition: Preprocessor.h:36
unsigned power
Power of the symmetry element (i.e. C3^2 is a rotation by 240°)
Definition: PointGroupElements.h:91
Eigen::Vector3d axis
Axis of rotation.
Definition: PointGroupElements.h:87
PURITY_STRONG unsigned order(PointGroup group)
Returns the number of symmetry elements in a point group.
Base class for symmetry elements.
Definition: PointGroupElements.h:29
PointGroup
Point groups.
Definition: PointGroups.h:20
NpGroupingsMapType npGroupings(const ElementsList &elements)
Generate all groupings of symmetry elements for those points in space for which some symmetry element...
Defines a set of useful preprocessor macros.
PURITY_WEAK ElementsList symmetryElements(PointGroup group) noexcept
Lists all symmetry elements for a point group.
i symmetry element
Definition: PointGroupElements.h:54
Abstraction of Cn and Sn symmetry elements.
Definition: PointGroupElements.h:63
E symmetry element.
Definition: PointGroupElements.h:45
bool reflect
Proper rotations reflect, improper rotations do not.
Definition: PointGroupElements.h:93
Definition: PointGroupElements.h:143
std::vector< std::unique_ptr< SymmetryElement >> ElementsList
Heterogeneous list of symmetry elements.
Definition: PointGroupElements.h:123
#define PURITY_STRONG
Definition: Preprocessor.h:65
std::unordered_map< unsigned, std::vector< ElementGrouping >, std::hash< unsigned >, std::equal_to<>, Eigen::aligned_allocator< std::pair< const unsigned, std::vector< ElementGrouping >>> > NpGroupingsMapType
Definition: PointGroupElements.h:164
const std::string & name(const Shape shape)
Fetch the string name of a shape.
Eigen::Vector3d normal
Normal of the reflection plane.
Definition: PointGroupElements.h:111
Reflection by a plane symmetry element.
Definition: PointGroupElements.h:99