CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ClusterSitesSelector_impl.hh
Go to the documentation of this file.
1 #ifndef CASM_enumerator_ClusterSitesSelector_impl
2 #define CASM_enumerator_ClusterSitesSelector_impl
3 
8 
9 namespace CASM {
10 
14 template <typename Inserter>
16  ConfigEnumInput const &reference_config_enum_input,
17  std::vector<PrimPeriodicIntegralClusterOrbit> const &orbits,
18  Inserter result) {
19  if (orbits.size() == 0) {
20  return result;
21  }
22 
23  Configuration const &ref_config = reference_config_enum_input.configuration();
24  std::shared_ptr<Structure const> shared_prim =
25  ref_config.supercell().shared_prim();
26  SupercellSymInfo const &ref_supercell_sym_info =
27  ref_config.supercell().sym_info();
28  Configuration prim_ref_config = ref_config.primitive();
29  SupercellSymInfo const &prim_ref_supercell_sym_info =
30  prim_ref_config.supercell().sym_info();
31  PrimPeriodicSymCompare<IntegralCluster> prim_periodic_sym_compare =
32  orbits.begin()->sym_compare();
33 
34  // Construct orbit generating elements for orbits with
35  // prim_ref_supercell_sym_info.factor_group() symmetry
36  // - shared_prim->factor_group() -> prim_ref_supercell_sym_info.factor_group()
37  // symmetry breaking
38  std::vector<IntegralCluster> prim_ref_supercell_generators;
40  shared_prim->factor_group().begin(), shared_prim->factor_group().end(),
41  prim_ref_supercell_sym_info.factor_group().begin(),
42  prim_ref_supercell_sym_info.factor_group().end(),
43  prototype_iterator(orbits.begin()), prototype_iterator(orbits.end()),
44  prim_periodic_sym_compare,
45  std::back_inserter(prim_ref_supercell_generators));
46 
47  // Construct orbit generating elements for orbits with
48  // prim_ref_config.factor_group() symmetry
49  // - prim_ref_supercell_sym_info.factor_group() ->
50  // prim_ref_config.factor_group() symmetry breaking
51  ScelPeriodicSymCompare<IntegralCluster> prim_ref_supercell_sym_compare{
52  shared_prim, prim_ref_supercell_sym_info.transformation_matrix_to_super(),
53  shared_prim->lattice().tol()};
54  std::vector<PermuteIterator> prim_ref_config_fg =
55  prim_ref_config.factor_group();
56  std::vector<IntegralCluster> prim_ref_config_orbit_generators;
58  prim_ref_supercell_sym_info.permute_begin(),
59  prim_ref_supercell_sym_info.permute_end(), prim_ref_config_fg.begin(),
60  prim_ref_config_fg.end(), prim_ref_supercell_generators.begin(),
61  prim_ref_supercell_generators.end(), prim_ref_supercell_sym_compare,
62  std::back_inserter(prim_ref_config_orbit_generators));
63 
64  // Construct orbit generating elements for orbits with
65  // ref_config.factor_group() symmetry under periodic boundary conditions
66  // prim_ref_config.factor_group() -> ref_config.factor_group() w/ periodic
67  // boundar conditions
68  std::vector<PermuteIterator> ref_config_fg = ref_config.factor_group();
69  std::vector<Permutation> ref_config_inverse_permutations =
70  make_inverse_permutations(ref_config_fg.begin(), ref_config_fg.end());
71  auto ref_config_orbit_generators_pbc =
73  ref_supercell_sym_info, ref_config_inverse_permutations.begin(),
74  ref_config_inverse_permutations.end(),
75  prim_ref_config_orbit_generators.begin(),
76  prim_ref_config_orbit_generators.end());
77 
78  // Construct ConfigEnumInput with ref_config & cluster site indices
79  for (auto const &cluster_site_indices : ref_config_orbit_generators_pbc) {
80  *result++ = ConfigEnumInput{ref_config, cluster_site_indices};
81  }
82  return result;
83 }
84 
85 } // namespace CASM
86 
87 #endif
std::shared_ptr< Structure const > shared_prim
Configuration primitive() const
Return the primitive Configuration.
const Supercell & supercell() const
Get the Supercell for this Configuration.
std::vector< PermuteIterator > factor_group() const
Returns the subgroup of the Supercell factor group that leaves the Configuration unchanged.
Template class to be specialized for comparisons with periodic symmetry of the supercell lattice.
std::shared_ptr< Structure const > const & shared_prim() const
Definition: Supercell.cc:115
const SupercellSymInfo & sym_info() const
Definition: Supercell.cc:265
A class that collects all symmetry information for for performing symmetry transformations on the sit...
SymGroup const & factor_group() const
Subgroup of primitive-cell factor group operations that leave supercell lattice invariant.
permute_const_iterator permute_end() const
permute_const_iterator permute_begin() const
Eigen::Matrix3l transformation_matrix_to_super() const
long-int transformation from primitive lattice vectors to supercell lattice vectors supercell_lattice...
Configuration const & configuration() const
Main CASM namespace.
Definition: APICommand.hh:8
std::set< std::set< Index >, ClusterSiteIndicesCompare > make_orbit_generators_under_periodic_boundary_conditions(SupercellSymInfo const &sym_info, InversePermutationIterator inverse_permutations_begin, InversePermutationIterator inverse_permutations_end, ElementIterator element_begin, ElementIterator element_end)
Return "within_scel" orbit generators, as sets of cluster site indices.
Inserter select_cluster_sites(ConfigEnumInput const &reference_config_enum_input, std::vector< PrimPeriodicIntegralClusterOrbit > const &orbits, Inserter result)
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)
std::vector< Permutation > make_inverse_permutations(PermuteIteratorIt begin, PermuteIteratorIt end)
Make inverse permutations.
PrototypeIterator< OrbitIterator > prototype_iterator(OrbitIterator orbit_it)
Convert an Orbit iterator to a prototype iterator.
Definition: Orbit.hh:210