CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ClusterSpecs_impl.hh
Go to the documentation of this file.
1 #ifndef CASM_ClusterSpecs_impl
2 #define CASM_ClusterSpecs_impl
3 
8 #include "casm/symmetry/Orbit.hh"
9 
10 namespace CASM {
11 
12 template <typename FunctorType>
13 void for_all_orbits(ClusterSpecs const &cluster_specs,
14  std::vector<IntegralCluster> const &generating_elements,
15  FunctorType const &f) {
16  if (cluster_specs.periodicity_type() ==
18  auto orbits = cluster_specs.make_periodic_orbits(generating_elements);
19  f(orbits);
20  return;
21  } else if (cluster_specs.periodicity_type() ==
23  auto orbits = cluster_specs.make_local_orbits(generating_elements);
24  f(orbits);
25  return;
26  }
27  // else if(cluster_specs.periodicity_type() ==
28  // CLUSTER_PERIODICITY_TYPE::WITHIN_SCEL) {
29  // auto orbits = cluster_specs.make_within_scel_orbits(generating_elements);
30  // f(orbits);
31  // return;
32  // }
33 
34  throw libcasm_runtime_error("Error: unsupported orbit type");
35 }
36 
37 template <typename FunctorType>
38 void for_all_orbits(ClusterSpecs const &cluster_specs, std::ostream &status,
39  FunctorType const &f) {
40  if (cluster_specs.periodicity_type() ==
42  auto orbits = cluster_specs.make_periodic_orbits(status);
43  f(orbits);
44  return;
45  } else if (cluster_specs.periodicity_type() ==
47  auto orbits = cluster_specs.make_local_orbits(status);
48  f(orbits);
49  return;
50  }
51  // else if(cluster_specs.periodicity_type() ==
52  // CLUSTER_PERIODICITY_TYPE::WITHIN_SCEL) {
53  // auto orbits = cluster_specs.make_within_scel_orbits(status);
54  // f(orbits);
55  // return;
56  // }
57 
58  throw libcasm_runtime_error("Error: unsupported orbit type");
59 }
60 } // namespace CASM
61 
62 #endif
CLUSTER_PERIODICITY_TYPE periodicity_type() const
Definition: ClusterSpecs.cc:16
PeriodicOrbitVec make_periodic_orbits(IntegralClusterVec const &generating_elements) const
Definition: ClusterSpecs.cc:20
LocalOrbitVec make_local_orbits(IntegralClusterVec const &generating_elements) const
Definition: ClusterSpecs.cc:30
Main CASM namespace.
Definition: APICommand.hh:8
void for_all_orbits(ClusterSpecs const &cluster_specs, std::vector< IntegralCluster > const &generating_elements, FunctorType const &f)