4 template<
typename ClustType>
14 template<
typename ClustType>
21 template<
typename ClustType>
28 template<
typename ClustType>
30 return at(no).prototype;
35 template<
typename ClustType>
37 return at(no).prototype;
42 template<
typename ClustType>
49 template<
typename ClustType>
56 template<
typename ClustType>
63 template<
typename ClustType>
65 for(
Index no = 0; no < size(); no++)
66 orbit(no).set_lattice(new_lat, mode);
67 pivot.set_lattice(new_lat, mode);
73 template<
typename ClustType>
75 if(&(pivot.home()) != &(new_pivot.home())) {
76 std::cerr <<
"WARNING!!! In GenericOrbitBranch::set_pivot(), the new 'pivot' clust has a different home lattice than the old pivot cluster.\n"
77 <<
" This may result in unexpected behavior!\n";
79 set_lattice(new_pivot.home(),
CART);
88 template<
typename ClustType>
93 else if(num_sites() != new_orbit.
prototype.size()) {
94 std::cerr <<
"WARNING: Trying to add " << new_orbit.
prototype.size()
95 <<
"-site Orbit to an OrbitBranch intended for " << num_sites()
96 <<
"-site Orbits. Continuing...\n";
106 template<
typename ClustType>
108 for(
Index no = 0; no < size(); no++)
115 template<
typename ClustType>
124 stream <<
"-----------------------------------------------\n";
125 for(
Index i = 0; i < size(); i++) {
126 stream <<
"Asymmetric Point # " << i + 1 <<
" of " << size() <<
":\n";
131 at(i).at(0).at(0).print_occ(stream);
133 stream <<
"\n\nEquivalent points are: \n";
135 for(
Index j = 1; j < at(i).size(); j++) {
137 at(i).at(j).at(0).print_occ(stream);
142 stream <<
"-----------------------------------------------\n";
149 template<
typename ClustType>
151 for(
Index i = 0; i < size(); i++) {
152 for(
Index j = i + 1; j < size(); j++) {
154 if(std::abs(orbit(i).max_length() - orbit(j).max_length()) <
TOL && orbit(i).min_length() > orbit(j).min_length()) {
159 else if(orbit(i).max_length() > orbit(j).max_length() +
TOL) {
169 template<
typename ClustType>
171 for(
Index i = 0; i < size(); i++) {
172 if(orbit(i).contains(test_clust, tol))
180 template<
typename ClustType>
182 if(size() == 0)
return false;
184 if(
find(test_clust, tol) < size()) {
193 template<
typename ClustType>
198 std::cerr <<
"WARNING in GenericOrbitBranch::generate_asymmetric_unit()\n"
199 <<
"This OrbitBranch is not empty\n"
200 <<
"and is about to be overwritten!\n";
206 if(basis.
size() == 0)
208 set_lattice(basis[0].home(),
FRAC);
209 ClustType tclust(basis[0].home());
214 for(nb = 0; nb < basis.
size(); nb++) {
218 tclust.push_back(basis[nb]);
222 for(no = 0; no < size(); no++) {
223 if(at(no).contains(tclust, tol)) {
234 back().get_equivalent(factor_group, tol);
237 for(no = 0; no < size(); no++) {
238 at(no).collect_basis_info(basis);
250 template<
typename ClustType>
253 ClustType tclust(pivot.home());
254 bool found_any =
false;
256 for(no = 0; no < size(); no++) {
259 for(ne = 0; ne < size(no); ne++) {
261 tclust = equiv(no, ne);
266 while(tclust.map_onto_subcluster(pivot, tmaps)) {
271 if(torbit.
size() == 0) {
282 if(torbit.
size() != 0) {
292 template<
typename ClustType>
300 for(
Index i = 0; i < size(); i++) {
301 json[
"orbits"][i] = at(i);
305 json[
"m_num_sites"] = m_num_sites;
308 json[
"pivot"] = pivot;
311 json[
"index"] = index;
319 template<
typename ClustType>
327 this->resize(json[
"orbits"].size(), orbit);
328 for(
int i = 0; i < json[
"orbits"].
size(); i++) {
size_type size() const
Returns array size if *this is a JSON array, object size if *this is a JSON object, 1 otherwise.
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.
void from_json(ClexDescription &desc, const jsonParser &json)
void push_back(const ClustType &toPush)
bool contains(const ClustType &test_clust, double tol) const
If cluster exists in current OrbitBranch, return true.
bool contains(const ClustType &test_clust, double tol) const
void set_pivot(const ClustType &new_pivot)
GenericOrbit< ClustType > & orbit(Index no)
Method to access orbits.
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...
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
void print(std::ostream &stream, COORD_TYPE mode=FRAC)
EigenIndex Index
For long integer indexing:
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.
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.
jsonParser & put_obj()
Puts new empty JSON object.
void set_index(Index ind) const
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)
Basic std::vector like container (deprecated)
jsonParser & put_array()
Puts new empty JSON array.