1 #ifndef CASM_SubOrbits_impl
2 #define CASM_SubOrbits_impl
10 namespace SubOrbits_impl {
25 return permute_it.
sym_op();
73 template <
typename GroupOpIterator,
typename SubgroupOpIterator>
74 template <
typename Element,
typename CopyApplyFunctionType,
75 typename PrepareFunctionType,
typename InvariantSubgroupOpIterator,
76 typename ElementOutputIterator>
79 Element
const &element, CopyApplyFunctionType copy_apply_f,
80 PrepareFunctionType prepare_f,
81 InvariantSubgroupOpIterator invariant_subgroup_begin,
82 InvariantSubgroupOpIterator invariant_subgroup_end,
83 ElementOutputIterator result)
const {
84 using namespace SubOrbits_impl;
98 typedef typename std::remove_cv<
typename std::remove_reference<decltype(
99 *std::declval<GroupOpIterator &>())>::type>::type OpType;
100 std::vector<std::set<OpType, OpCompare>> transform_to_suborbit_sets;
103 for (
auto group_it = m_group_begin; group_it != m_group_end; ++group_it) {
105 bool already_found =
false;
106 for (
auto const ¤t_set : transform_to_suborbit_sets) {
107 if (current_set.count(*group_it)) {
108 already_found =
true;
118 std::set<OpType, OpCompare> next_set;
119 auto invariant_subgroup_it = invariant_subgroup_begin;
120 for (; invariant_subgroup_it != invariant_subgroup_end;
121 ++invariant_subgroup_it) {
122 for (
auto subgroup_it = m_subgroup_begin; subgroup_it != m_subgroup_end;
124 next_set.insert((*subgroup_it) * (*group_it) *
125 (*invariant_subgroup_it));
128 transform_to_suborbit_sets.push_back(std::move(next_set));
133 for (
auto const ¤t_set : transform_to_suborbit_sets) {
135 prepare_f(copy_apply_f(
to_sym_op(*current_set.begin()), element));
140 template <
typename GroupOpIterator,
typename SubgroupOpIterator,
141 typename ElementIterator,
typename SymCompareType,
142 typename ElementOutputIterator>
144 GroupOpIterator group_begin, GroupOpIterator group_end,
145 SubgroupOpIterator subgroup_begin, SubgroupOpIterator subgroup_end,
146 ElementIterator element_begin, ElementIterator element_end,
147 SymCompareType
const &sym_compare, ElementOutputIterator result) {
149 group_begin, group_end, subgroup_begin, subgroup_end};
150 typedef typename std::remove_cv<
typename std::remove_reference<decltype(
151 *std::declval<GroupOpIterator &>())>::type>::type OpType;
152 auto copy_apply_f = [&](
SymOp const &op,
153 typename SymCompareType::Element obj) {
154 return sym_compare.copy_apply(op, obj);
156 auto prepare_f = [&](
typename SymCompareType::Element obj) {
157 return sym_compare.prepare(obj);
159 for (
auto it = element_begin; it != element_end; ++it) {
Output the orbit generators necessary to construct the sub-orbits corresponding to group -> subgroup ...
ElementOutputIterator operator()(Element const &element, CopyApplyFunctionType copy_apply_f, PrepareFunctionType prepare_f, InvariantSubgroupOpIterator invariant_subgroup_begin, InvariantSubgroupOpIterator invariant_subgroup_end, ElementOutputIterator result) const
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
Index master_group_index() const
Index of this operation within the master_group.
std::vector< PermuteIterator > make_invariant_subgroup(ConfigEnumInput const &config_enum_input)
SymOp const & to_sym_op(SymOp const &sym_op)
SymGroup invariant_subgroup(const SymGroup &super_group, const xtal::Lattice &lat)
Returns the subgroup of the given group that keeps the lattice invariant.
ElementOutputIterator make_suborbit_generators(GroupOpIterator group_begin, GroupOpIterator group_end, SubgroupOpIterator subgroup_begin, SubgroupOpIterator subgroup_end, ElementIterator element_begin, ElementIterator element_end, SymCompareType const &sym_compare, ElementOutputIterator result)
bool operator()(SymOp const &LHS, SymOp const &RHS) const
bool operator()(PermuteIterator const &LHS, PermuteIterator const &RHS) const