CASM  1.1.0
A Clusters Approach to Statistical Mechanics
SupercellClusterOrbits.cc
Go to the documentation of this file.
2 
7 
8 namespace CASM {
9 
10 // Note:
11 // On their own `make_cluster_site_indices` and `make_cluster` only require
12 // `xtal::UnitCellCoordIndexConverter`, and not `SupercellSymInfo`. However,
13 // in this context they are always going to be used with `SupercellSymInfo`
14 // present to provide the permute group.
15 
17 std::set<Index> make_cluster_site_indices(IntegralCluster const &cluster,
18  SupercellSymInfo const &sym_info) {
19  std::set<Index> cluster_site_indices;
20  for (xtal::UnitCellCoord const &uccoord : cluster) {
21  cluster_site_indices.insert(
22  sym_info.unitcellcoord_index_converter()(uccoord));
23  }
24  return cluster_site_indices;
25 }
26 
28 IntegralCluster make_cluster(std::set<Index> const &cluster_site_indices,
29  Structure const &prim,
30  SupercellSymInfo const &sym_info) {
31  IntegralCluster cluster{prim};
32  for (Index site_index : cluster_site_indices) {
33  cluster.elements().push_back(
34  sym_info.unitcellcoord_index_converter()(site_index));
35  }
36  return cluster;
37 }
38 
47  Permutation const &inverse_permute,
48  std::set<Index> const &cluster_site_indices) {
49  std::set<Index> cluster_site_indices_after;
50  for (Index site_index : cluster_site_indices) {
51  cluster_site_indices_after.insert(inverse_permute[site_index]);
52  }
53  return cluster_site_indices_after;
54 }
55 
57 bool ClusterSiteIndicesCompare::operator()(std::set<Index> const &LHS,
58  std::set<Index> const &RHS) const {
59  if (LHS.size() < RHS.size()) {
60  return true;
61  }
62  if (LHS.size() > RHS.size()) {
63  return false;
64  }
65  return LHS < RHS;
66 }
67 
68 } // namespace CASM
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
A class that collects all symmetry information for for performing symmetry transformations on the sit...
const xtal::UnitCellCoordIndexConverter & unitcellcoord_index_converter() const
UnitCellCoordIndexConverter for this superstructure/primstructure pair Used to convert from lattice t...
Unit Cell Coordinates.
Main CASM namespace.
Definition: APICommand.hh:8
std::set< Index > make_cluster_site_indices(IntegralCluster const &cluster, SupercellSymInfo const &sym_info)
Return site indices of cluster sites.
IntegralCluster make_cluster(std::set< Index > const &cluster_site_indices, Structure const &prim, SupercellSymInfo const &sym_info)
Return cluster from cluster site indices.
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
std::set< Index > permute_cluster_site_indices(Permutation const &inverse_permute, std::set< Index > const &cluster_site_indices)
Rather than permute values, here we want to permute cluster site indices.
bool operator()(std::set< Index > const &LHS, std::set< Index > const &RHS) const
Sort std::set<Index> by size, then value (lexicographical compare)