CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
OrbitBranch.hh
Go to the documentation of this file.
1 
2 #ifndef ORBITBRANCH_HH
3 #define ORBITBRANCH_HH
4 
5 #include <iostream>
6 #include <fstream>
7 
10 
11 namespace CASM {
12  class Lattice;
13 
14  class Supercell;
15 
16  template<typename ClustType>
17  class GenericOrbitBranch;
18 
19  template<typename ClustType>
21 
24 
25  //GenericOrbitBranch Class definition begins here:
29  template<typename ClustType>
30  class GenericOrbitBranch : public Array< GenericOrbit<ClustType> > {
33  public:
34 
38 
41  ClustType pivot;
42 
45 
46  GenericOrbitBranch(const Lattice &init_home) : m_num_sites(-1), pivot(init_home) { };
47  GenericOrbitBranch(const Lattice &init_home, Index tnum_sites) : m_num_sites(tnum_sites), pivot(init_home) { };
48  GenericOrbitBranch(const ClustType &init_pivot) : m_num_sites(-1), pivot(init_pivot) { };
49  GenericOrbitBranch(const ClustType &init_pivot, Index tnum_sites) : m_num_sites(tnum_sites), pivot(init_pivot) { };
50 
51  void clear();
52 
55  const GenericOrbit<ClustType> &orbit(Index no) const;
56 
58  Index num_sites() const {
59  return m_num_sites;
60  };
61 
63  ClustType &prototype(Index no);
64  const ClustType &prototype(Index no) const;
65 
67  const ClustType &equiv(Index no, Index ne) const;
68  ClustType &equiv(Index no, Index ne);
69 
71  Index size(Index no) const;
72 
74  void set_lattice(const Lattice &new_lat, COORD_TYPE mode);
75 
76  void set_pivot(const ClustType &new_pivot);
77 
80  void push_back(const GenericOrbit<ClustType> &new_orbit);
81 
82  void print(std::ostream &stream, COORD_TYPE mode = FRAC);
83 
85  void sort(); //Done - Alex
86 
87  // Alex did these
90  Index find(const ClustType &test_clust, double tol)const;
91 
93  bool contains(const ClustType &test_clust, double tol)const;
94 
97 
98  void generate_asymmetric_unit(const Array<typename ClustType::WhichCoordType > &basis, const SymGroup &factor_group, double tol);
99 
102  bool extract_orbits_including(const ClustType &pivot, GenericOrbitBranch &flowerbranch, double tol) const;
103 
104  //Translation operators need to be defined
106  return (*this);
107  };
109  return (*this);
110  };
111 
112  jsonParser &to_json(jsonParser &json) const;
113 
115  void from_json(const jsonParser &json);
116 
117  };
118 
119  // Some template weirdness is not allowing this to compile on flux.
120  // So I'm specializing for SiteCluster in ClusterFunctions.hh/.cc
121  /*
122  template<typename ClustType>
123  jsonParser &to_json(const GenericOrbitBranch<ClustType> &branch, jsonParser &json) {
124  return branch.to_json(json);
125  }
126 
128  template<typename ClustType>
129  void from_json(GenericOrbitBranch<ClustType> &branch, const jsonParser &json) {
130  branch.from_json(json);
131  }
132  */
133 };
134 
136 
137 #endif
Index num_sites() const
How many points are allowed in clusters belonging to this OrbitBranch.
Definition: OrbitBranch.hh:58
const ClustType & equiv(Index no, Index ne) const
Method to access equivalent clusters of Orbit 'no'.
Index find(const ClustType &test_clust, double tol) const
void sort()
Sorts all of the orbits in OrbitBranch by max_length.
Array< Index > index
'index' is index of each orbit in an ordered linear array
Definition: OrbitBranch.hh:44
bool contains(const ClustType &test_clust, double tol) const
If cluster exists in current OrbitBranch, return true.
GenericOrbitBranch & operator+=(const Coordinate &shift)
Definition: OrbitBranch.hh:105
void set_pivot(const ClustType &new_pivot)
GenericOrbitBranch< SiteCluster > SiteOrbitBranch
Definition: OrbitBranch.hh:20
GenericOrbit< ClustType > & orbit(Index no)
Method to access orbits.
GenericOrbitBranch(const Lattice &init_home, Index tnum_sites)
Definition: OrbitBranch.hh:47
Main CASM namespace.
Definition: complete.cpp:8
jsonParser & to_json(jsonParser &json) const
void push_back(const GenericOrbit< ClustType > &new_orbit)
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
Definition: SymGroup.hh:33
double tol
GenericOrbitBranch(const Lattice &init_home)
Definition: OrbitBranch.hh:46
GenericOrbitree< SiteCluster > SiteOrbitree
Definition: Clex.hh:14
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
Definition: SymOp.hh:28
void print(std::ostream &stream, COORD_TYPE mode=FRAC)
Represents cartesian and fractional coordinates.
Definition: Coordinate.hh:34
EigenIndex Index
For long integer indexing:
GenericOrbitBranch & operator-=(const Coordinate &shift)
Definition: OrbitBranch.hh:108
GenericOrbitBranch(const ClustType &init_pivot, Index tnum_sites)
Definition: OrbitBranch.hh:49
GenericOrbit< ClustType > & at(Index ind)
Definition: Array.hh:157
void from_json(const jsonParser &json)
Assumes the pivot lattice is already set.
ClustType & prototype(Index no)
Method to access prototypes.
void set_lattice(const Lattice &new_lat, COORD_TYPE mode)
Calls set_lattice on all orbits of OrbitBranch.
Index m_num_sites
The number of points for all Orbits in this OrbitBranch.
Definition: OrbitBranch.hh:32
GenericOrbitBranch(const ClustType &init_pivot)
Definition: OrbitBranch.hh:48
GenericOrbitBranch & apply_sym(const SymOp &op)
apply_sym to everything in this OrbitBranch (i.e, pivot and all Orbits)
bool extract_orbits_including(const ClustType &pivot, GenericOrbitBranch &flowerbranch, double tol) const
void generate_asymmetric_unit(const Array< typename ClustType::WhichCoordType > &basis, const SymGroup &factor_group, double tol)
GenericOrbit< ClustType > & back()
Definition: Array.hh:177
Basic std::vector like container (deprecated)