CASM  1.1.0
A Clusters Approach to Statistical Mechanics
OrbitGeneration.hh
Go to the documentation of this file.
1 #ifndef CASM_OrbitGeneration
2 #define CASM_OrbitGeneration
3 
4 #include <set>
5 #include <utility>
6 
8 
9 namespace CASM {
10 
11 // class PrimClex;
12 class SymGroup;
13 template <typename SymCompareType>
14 class Orbit;
15 
21 template <typename _OrbitType>
22 struct OrbitGeneratorCompare;
23 
24 template <typename _OrbitType>
25 struct CanonicalGenerator;
26 
31 template <typename OrbitType>
33  std::set<typename OrbitType::Element, OrbitGeneratorCompare<OrbitType>>;
34 
40 template <typename _OrbitType>
42  typedef _OrbitType OrbitType;
43  typedef typename OrbitType::Element Element;
44  typedef typename OrbitType::SymCompareType SymCompareType;
45 
46  OrbitGenerators(const SymGroup &_group, const SymCompareType &_sym_compare);
47 
49  std::pair<typename OrbitGeneratorSet<OrbitType>::iterator, bool> insert(
50  const Element &test);
51 
53  std::pair<typename OrbitGeneratorSet<OrbitType>::iterator, bool>
54  insert_canonical(const Element &test);
55 
57  template <typename OrbitOutputIterator>
58  OrbitOutputIterator make_orbits(OrbitOutputIterator result);
59 
60  // /// \brief Construct Orbit from all generating elements, including PrimClex
61  // /// pointer
62  // template <typename OrbitOutputIterator>
63  // OrbitOutputIterator make_orbits(OrbitOutputIterator result,
64  // const PrimClex &primclex);
65 
66  const SymGroup &group;
68 
69  private:
72 
73  public:
75 };
76 
78 template <typename SymCompareType>
79 std::vector<Orbit<SymCompareType>> generate_orbits(
80  std::vector<typename SymCompareType::Element> const &generating_elements,
81  SymGroup const &generating_group, SymCompareType const &sym_compare);
82 
89 template <typename _OrbitType>
91  typedef _OrbitType OrbitType;
92  typedef typename OrbitType::Element Element;
93  typedef typename OrbitType::SymCompareType SymCompareType;
94 
96 
97  OrbitGeneratorCompare(const SymCompareType &_sym_compare);
98 
99  bool operator()(const Element &A, const Element &B) const;
100 };
101 
108 template <typename _OrbitType>
110  typedef _OrbitType OrbitType;
111  typedef typename OrbitType::Element Element;
112  typedef typename OrbitType::SymCompareType SymCompareType;
113 
114  const std::vector<SymOp> &generating_group;
116 
117  CanonicalGenerator(const std::vector<SymOp> &_generating_group,
118  const SymCompareType &_sym_compare);
119 
122  Element operator()(const Element &e) const;
123 
125  const SymOp &to_canonical() const;
126 
128  const SymOp &from_canonical() const;
129 
130  private:
131  mutable const SymOp *m_to_canonical;
132 };
133 
140 template <typename _OrbitType>
141 struct IsCanonical {
142  typedef _OrbitType OrbitType;
143  typedef typename OrbitType::Element Element;
144  typedef typename OrbitType::SymCompareType SymCompareType;
145 
146  const std::vector<SymOp> &generating_group;
148 
149  IsCanonical(const std::vector<SymOp> &_generating_group,
150  const SymCompareType &_sym_compare);
151 
153  bool operator()(const Element &e) const;
154 };
155 
156 // /// \brief Functor to find the canonical generating element for an orbit
157 // ///
158 // /// - Uses generating PermuteIterator range, SymCompareType::prepare,
159 // SymCompareType::compare
160 // ///
161 // /// \ingroup OrbitGeneration
162 // ///
163 // template<typename _SymCompareType>
164 // struct PermuteCanonicalGenerator {
165 //
166 // typedef _SymCompareType SymCompareType;
167 // typedef typename _SymCompareType::Element Element;
168 //
169 // PermuteIterator permute_begin;
170 // PermuteIterator permute_end;
171 // SymCompareType const &sym_compare;
172 //
173 // PermuteCanonicalGenerator(
174 // PermuteIterator _permute_begin,
175 // PermuteIterator _permute_end,
176 // SymCompareType const &_sym_compare);
177 //
178 // /// \brief Applies symmetry to return an equivalent Element in a canonical
179 // form Element operator()(Element const &e) const;
180 //
181 // /// \brief After using call operator, this can be checked
182 // PermuteIterator const &to_canonical() const;
183 //
184 // /// \brief After using call operator, this can be checked
185 // PermuteIterator const &from_canonical() const;
186 //
187 // private:
188 //
189 // mutable PermuteIterator const *m_to_canonical;
190 // };
191 
192 } // namespace CASM
193 
194 #endif
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
Definition: SymGroup.hh:42
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
Definition: SymOp.hh:28
std::set< typename OrbitType::Element, OrbitGeneratorCompare< OrbitType > > OrbitGeneratorSet
An std::set of Orbit.
Main CASM namespace.
Definition: APICommand.hh:8
std::vector< Orbit< SymCompareType > > generate_orbits(std::vector< typename SymCompareType::Element > const &generating_elements, SymGroup const &generating_group, SymCompareType const &sym_compare)
Construct orbits from a vector of generating elements.
const SymOp & from_canonical() const
After using call operator, this can be checked.
OrbitType::Element Element
const SymOp & to_canonical() const
After using call operator, this can be checked.
CanonicalGenerator(const std::vector< SymOp > &_generating_group, const SymCompareType &_sym_compare)
const std::vector< SymOp > & generating_group
OrbitType::SymCompareType SymCompareType
const SymCompareType & sym_compare
Element operator()(const Element &e) const
Applies symmetry to return an equivalent Element in a canonical form.
Functor to find to check if element is in canonical form.
OrbitType::SymCompareType SymCompareType
OrbitType::Element Element
const std::vector< SymOp > & generating_group
const SymCompareType & sym_compare
IsCanonical(const std::vector< SymOp > &_generating_group, const SymCompareType &_sym_compare)
bool operator()(const Element &e) const
Applies symmetry to check if any Element is greater than e.
OrbitGeneratorCompare(const SymCompareType &_sym_compare)
const SymCompareType & sym_compare
OrbitType::Element Element
bool operator()(const Element &A, const Element &B) const
OrbitType::SymCompareType SymCompareType
Data structure that holds canonical generating elements and can then make sorted orbits.
OrbitGeneratorSet< OrbitType > elements
OrbitOutputIterator make_orbits(OrbitOutputIterator result)
Construct Orbit from all generating elements.
const SymCompareType & sym_compare
std::pair< typename OrbitGeneratorSet< OrbitType >::iterator, bool > insert(const Element &test)
Try inserting an element, after generating the canonical form.
OrbitType::SymCompareType SymCompareType
OrbitGenerators(const SymGroup &_group, const SymCompareType &_sym_compare)
std::pair< typename OrbitGeneratorSet< OrbitType >::iterator, bool > insert_canonical(const Element &test)
Try inserting an element, assuming it is in canonical form.
OrbitType::Element Element
CanonicalGenerator< OrbitType > m_generate_canonical
const SymGroup & group
OrbitGeneratorCompare< OrbitType > m_element_compare