CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
Orbit.hh
Go to the documentation of this file.
1 #ifndef ORBIT_HH
2 #define ORBIT_HH
3 
4 #include <iostream>
5 
7 
8 namespace CASM {
9 
10  template<typename CoordType> class BasicStructure;
11  class Site;
12 
13  template<typename ClustType>
14  class GenericOrbit;
15 
16  class SiteCluster;
18 
19  class HopCluster;
21 
22  class FunctionVisitor;
23 
24  class BasisSet;
25 
26  //GenericOrbit class definition begins here:
31  template<typename ClustType>
32  class GenericOrbit : public Array<ClustType > {
33  private:
35  mutable Index index;
39 
40  public:
44 
47  ClustType prototype;
48 
52 
53  GenericOrbit(const ClustType &init_prototype) : index(-1), permute_rep_ID(-1), coord_rep_ID(-1), prototype(init_prototype) {};
54 
56  void set_lattice(const Lattice &new_home, COORD_TYPE mode);
57 
63  void get_equivalent(const SymGroup &sym_group, double tol);
64 
66  GenericOrbit &apply_sym(const SymOp &op);
67 
71  bool contains(const ClustType &test_clust, double tol) const;
75  bool contains(const typename ClustType::WhichCoordType &test_site, double tol) const;
76 
78  Index find(const ClustType &test_clust, double tol) const;
81  Index find(const ClustType &test_clust, Coordinate &trans, double tol) const;
82 
87 
90 
94 
96  double max_length() const {
97  return prototype.max_length();
98  }
100  double min_length() const {
101  return prototype.min_length();
102  }
103 
104  //Not implemented
105  void read(std::istream &stream, int num_sites, COORD_TYPE mode);
107  void read(std::istream &stream, COORD_TYPE mode, const SymGroup &sym_group); //Modified by Ivy
108 
109 
112 
115 
119 
120  //Access index, which is private
121  Index get_index() const {
122  return this->index;
123  };
124 
125  //Allows you to set the index since it's private
126  void set_index(Index ind) const { //Added by Ivy 05/05/2013 -- This may be a temporary fix depending on how we want to treat index
127  this->index = ind;
128  };
129 
130  jsonParser &to_json(jsonParser &json) const;
131 
133  void from_json(const jsonParser &json);
134 
135  };
136 
137  // Some template weirdness is not allowing this to compile on flux.
138  // So I'm specializing for SiteCluster in ClusterFunctions.hh/.cc
139  /*
140  template<typename ClustType>
141  jsonParser &to_json(const GenericOrbit<ClustType> &orbit, jsonParser &json) {
142  return orbit.to_json(json);
143  }
144 
146  template<typename ClustType>
147  void from_json(GenericOrbit<ClustType> &orbit, const jsonParser &json) {
148  orbit.from_json(json);
149  }
150  */
151 
152 
153 };
154 
156 
157 #endif
158 
jsonParser & to_json(jsonParser &json) const
Definition: Orbit_impl.hh:424
ClustType prototype
Definition: Orbit.hh:47
ReturnArray< std::string > delta_occfunc_flower_function_cpp_strings(BasisSet site_basis, const Array< FunctionVisitor * > &labelers, Index nlist_index, Index b_index, Index f_index)
Definition: Orbit_impl.hh:364
ReturnArray< std::string > flower_function_cpp_strings(const Array< FunctionVisitor * > &labelers, Index nlist_index)
nlist_index is the index into the nlist for the site the flower centers on
Definition: Orbit_impl.hh:312
void read(std::istream &stream, int num_sites, COORD_TYPE mode)
GenericOrbit & apply_sym(const SymOp &op)
Apply symmetry to prototype and all the clusters in the orbit.
Definition: Orbit_impl.hh:106
Index size() const
Definition: Array.hh:145
Index get_index() const
Definition: Orbit.hh:121
Array< GenericOrbit * > sub_cluster
Pointers to all orbits whose clusters are subclusters of clusters in this orbit.
Definition: Orbit.hh:38
void from_json(const jsonParser &json)
Assumes the prototype lattice is already set.
Definition: Orbit_impl.hh:458
bool contains(const ClustType &test_clust, double tol) const
Definition: Orbit_impl.hh:124
Index permute_rep_ID
Definition: Orbit.hh:36
Main CASM namespace.
Definition: complete.cpp:8
Index coord_rep_ID
Definition: Orbit.hh:36
Array< Array< SymOp > > equivalence_map
Definition: Orbit.hh:51
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
Definition: SymGroup.hh:33
double tol
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
Definition: SymOp.hh:28
Represents cartesian and fractional coordinates.
Definition: Coordinate.hh:34
EigenIndex Index
For long integer indexing:
Index find(const ClustType &test_clust, double tol) const
Same as contains, but returns index of equivalent cluster that maps onto test_clust.
Definition: Orbit_impl.hh:156
SymGroupRep const * get_full_permutation_representation()
get permutation representation of every operation in equivalence_map to describe how operations permu...
double min_length() const
return min_length of clusters in Orbit
Definition: Orbit.hh:100
GenericOrbit< SiteCluster > SiteOrbit
Definition: Orbit.hh:16
ReturnArray< std::string > orbit_function_cpp_strings(const Array< FunctionVisitor * > &labelers)
returns Array of std::string, each of which is
Definition: Orbit_impl.hh:278
ClustType & at(Index ind)
Definition: Array.hh:157
void get_equivalent(const SymGroup &sym_group, double tol)
Definition: Orbit_impl.hh:34
SymGroupRep const * get_full_coord_representation()
void collect_basis_info(const Array< typename ClustType::WhichCoordType > &basis, const Coordinate &shift)
calls collect_basis_info on all clusters in orbit
Definition: Orbit_impl.hh:188
GenericOrbit< HopCluster > HopOrbit
Definition: Orbit.hh:19
double max_length() const
return max_length of clusters in Orbit
Definition: Orbit.hh:96
GenericOrbit(const ClustType &init_prototype)
Definition: Orbit.hh:53
SymGroupRep is an alternative representation of a SymGroup for something other than real space...
Definition: SymGroupRep.hh:30
void set_index(Index ind) const
Definition: Orbit.hh:126
Index index
Linear index of this orbit, when many orbits are stored in a complicated structure (e...
Definition: Orbit.hh:35
void set_lattice(const Lattice &new_home, COORD_TYPE mode)
calls set_lattice on prototype, and all equivalent clusters
Definition: Orbit_impl.hh:12
Basic std::vector like container (deprecated)