CASM
AClustersApproachtoStatisticalMechanics
|
#include <Cluster.hh>
A cluster is a group of points (CoordType) in the crystal A CoordType is any type that derives from Coordinate
Definition at line 22 of file Cluster.hh.
Public Types | |
typedef CoordType | WhichCoordType |
typedef Array< CoordType > | X1 |
typedef Array< X1 > | X2 |
typedef Array< X2 > | X3 |
typedef Array< X3 > | X4 |
typedef Array< X4 > | X5 |
typedef Array< X5 > | X6 |
typedef Array< X6 > | X7 |
typedef Array< X7 > | X8 |
typedef Array< X8 > | X9 |
typedef CoordType | value_type |
typedef Index | size_type |
typedef CoordType * | iterator |
typedef const CoordType * | const_iterator |
Public Member Functions | |
GenericCluster (const Lattice &init_home) | |
const Lattice & | home () const |
const SymGroup & | clust_group () const |
const SymGroupRep::RemoteHandle & | permute_rep () const |
void | set_clust_group (const Array< SymOp > &new_group) |
void | set_permute_rep (SymGroupRepID perm_rep_ID) |
void | set_lattice (const Lattice &new_home, COORD_TYPE mode) |
void | push_back (const CoordType &new_coord) |
void | within (Index pivot_ind=0) |
Translate entire cluster so that point at(pivot_ind) is inside unit cell. More... | |
void | within (Index pivot_ind, Coordinate &trans) |
Translate entire cluster so that point at(pivot_ind) is inside unit cell. More... | |
void | all_within () |
Map every point of cluster inside unit cell. More... | |
void | update_data_members (const BasicStructure< CoordType > &ref_struc) |
*bool | image_check (const Lattice &cell, int nV=0) const |
Checks to see if cluster is "compact" relative to (Lattice cell) in other words, period images of the cluster points are farther away than the points themselves. Returns true if cluster is not "compact". More... | |
GenericCluster & | permute (const Array< Index > &perm) |
permute sites of the cluster, and everything that depends on the site order More... | |
GenericCluster & | permute (const Permutation &perm) |
GenericCluster & | apply_sym (const SymOp &op) |
apply symmetry to all points of the cluster More... | |
GenericCluster & | apply_sym_no_trans (const SymOp &op) |
apply symmetry to all points of the cluster without translation More... | |
void | generate_clust_group (const SymGroup &super_group, std::vector< Permutation > *perm_array_ptr=nullptr, double tol=TOL) |
Finds the sub_group of super_group that is the point group of the cluster. More... | |
std::vector< Permutation > | clust_group_permutations (double tol) const |
Finds the Permutation corresponding to each element of clust_group. More... | |
void | calc_properties () |
gets max_length and min_length More... | |
void | calc_properties (GenericCluster< CoordType > phenom_clust) |
calculate min/max lengths relative the phenom_clust & this cluster More... | |
double | max_length () const |
double | min_length () const |
Coordinate | geometric_center () const |
Returns the geometric center of "mass" of a cluster (treats all sites as having equal mass) More... | |
void | prepare_prototype () |
Performs preparatory steps on prototype before doing Orbit::get_equivalent() More... | |
bool | contains (const GenericCluster &test_cluster) const |
is test_cluster a subcluster of (*this) More... | |
bool | contains_periodic (const CoordType &test_coord, double tol) const |
Like Array<CoordType>::contains(), but takes periodicity mode into account. More... | |
Index | find (const CoordType &test_elem, double tol) const |
is test_cluster a subcluster of (*this), and how do the indices map points of test_cluster More... | |
bool | find (const GenericCluster &test_cluster, Array< Index > &index, double tol) const |
is test_cluster a subcluster of (*this), and how do the indices map 'index' is populated with the indices of (*this) that correspond to the points of test_cluster More... | |
bool | map_onto_subcluster (const GenericCluster &pivot, double tol=TOL) |
bool | map_onto_subcluster (const GenericCluster &pivot, int num_maps, double tol=TOL) |
void | collect_basis_info (const Array< CoordType > &basis) |
Figure out which basis atoms in basis correspond to the points in cluster (*this) More... | |
void | collect_basis_info (const Array< CoordType > &basis, const Coordinate &shift) |
void | read (std::istream &stream, int num_sites, COORD_TYPE mode, bool SD_is_on) |
void | read (std::istream &stream, COORD_TYPE mode) |
Reads the cluster. More... | |
void | print (std::ostream &stream, char delim= '\n', COORD_TYPE mode=COORD_DEFAULT) const |
void | print_shifted (std::ostream &stream, const Coordinate &shift, char delim= '\n', COORD_TYPE mode=COORD_DEFAULT) const |
void | print_sites (std::ostream &stream, int space, char delim= '\n', COORD_TYPE mode=COORD_DEFAULT) const |
void | print_basis_info (std::ostream &stream, int space, char delim= '\n', COORD_TYPE mode=COORD_DEFAULT) const |
void | print_decorated_sites (std::ostream &stream, int space, char delim= '\n', COORD_TYPE mode=COORD_DEFAULT) const |
void | merge (const GenericCluster &RHS) |
adds unique points of 'RHS' to (*this) More... | |
void | merge (const CoordType &RHS) |
Adds new point to cluster, but only if it is unique. More... | |
GenericCluster & | operator+= (const Coordinate &RHS) |
in=place translation of a cluster More... | |
GenericCluster & | operator-= (const Coordinate &RHS) |
GenericCluster | operator+ (const GenericCluster &RHS) |
create translated cluster More... | |
bool | operator== (const GenericCluster &RHS) const |
are two clusters identical, to within a permutation More... | |
bool | is_equivalent (const GenericCluster &test_clust) const |
are two clusters identical, to within permutation and translation More... | |
bool | is_equivalent (const GenericCluster &test_clust, Coordinate &trans) const |
are two clusters identical, to within permutation and translation translation that maps clusters is stored in 'trans' More... | |
bool | map_onto (const GenericCluster &test_clust, double tol) |
if is_equivalent(test_clust) is true, return true and map (*this) onto test_clust More... | |
bool | map_onto (const GenericCluster &test_clust, Coordinate &trans, double tol) |
jsonParser & | to_json (jsonParser &json) const |
Write GenericCluster to json. Does not write lattice. More... | |
void | from_json (const jsonParser &json) |
Index | size () const |
void | swap (Array< CoordType > &RHS) |
CoordType & | at (Index ind) |
const CoordType & | at (Index ind) const |
const CoordType & | operator[] (Index ind) const |
CoordType & | operator[] (Index ind) |
CoordType & | back () |
const CoordType & | back () const |
CoordTypeconst * | begin () const |
CoordType * | begin () |
CoordTypeconst * | cbegin () const |
CoordTypeconst * | end () const |
CoordType * | end () |
CoordTypeconst * | cend () const |
void | pop_back () |
void | remove (Index ind) |
void | clear () |
void | resize (Index new_N) |
void | resize (Index new_N, const CoordType &fill_val) |
void | reserve (Index new_max) |
void | sort (const CompareType &comp) |
void | sort (Array< Index > &ind_order) |
void | sort () |
Array & | append (const Array &new_tail) |
Array & | append_unique (const Array &new_tail) |
void | swap_elem (Index i, Index j) |
Array & | ipermute (const Array< Index > &perm_array) |
bool | next_permute () |
ReturnArray< Index > | as_perm_inverse () const |
ReturnArray< Index > | as_perm_transform_by (const Array< Index > &trans_perm) const |
const CoordType & | max () const |
const CoordType & | min () const |
ReturnArray< CoordType > | sub_array (Index ind_begin, Index ind_end) const |
CoordType | sum () const |
bool | is_ascending () const |
bool | is_descending () const |
bool | is_constant () const |
bool | is_permute () const |
bool | has_fixed_points () const |
Checks whether any values are equal to their index – only valid for Array<Index> More... | |
bool | operator== (const Array< CoordType > &RHS) const |
bool | operator!= (const Array< CoordType > &RHS) const |
bool | operator< (const Array< CoordType > &RHS) const |
bool | operator> (const Array< CoordType > &RHS) const |
bool | operator<= (const Array< CoordType > &RHS) const |
bool | operator>= (const Array< CoordType > &RHS) const |
bool | all_in (const Array &superset) const |
Index | coincidence (const Array &superset) const |
Index | incidences (const CoordType &test_elem) const |
Index | find (const CoordType &test_elem) const |
Index | reverse_find (const CoordType &test_elem) const |
Same as find, but starts from the last element of the Array. More... | |
Index | almost_find (const CoordType &test_elem, double tol_val=TOL) const |
Index | almost_reverse_find (const CoordType &test_elem, double tol_val=TOL) const |
Same as almost_find, but start from the last element of the Array. More... | |
bool | contains (const CoordType &test_elem) const |
bool | almost_contains (const CoordType &test_elem, double tol_val=TOL) const |
void | print_column (std::ostream &stream, const std::string &indent="") const |
Static Public Member Functions | |
static ReturnArray< CoordType > | sequence (const CoordType &initial, const CoordType &final) |
Returns an array with the sequence (initial, ++initial, ..., final), inclusive. More... | |
static ReturnArray< CoordType > | sequence (const CoordType &initial, const CoordType &increment, const CoordType &final) |
Protected Member Functions | |
SymGroup & | _clust_group () |
SymGroupRep::RemoteHandle & | _permute_rep () |
Private Attributes | |
Lattice const * | m_lat_ptr |
double | m_min_length |
double | m_max_length |
SymGroup | m_clust_group |
SymGroupRep::RemoteHandle | m_permute_rep |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
typedef CoordType CASM::GenericCluster< CoordType >::WhichCoordType |
Definition at line 37 of file Cluster.hh.
|
inherited |
CASM::GenericCluster< CoordType >::GenericCluster | ( | const Lattice & | init_home | ) |
Definition at line 9 of file Cluster_impl.hh.
|
inlineprotected |
Definition at line 193 of file Cluster.hh.
|
inlineprotected |
Definition at line 197 of file Cluster.hh.
|
inherited |
void CASM::GenericCluster< CoordType >::all_within | ( | ) |
Map every point of cluster inside unit cell.
Definition at line 183 of file Cluster_impl.hh.
|
inlineinherited |
|
inherited |
|
inherited |
Same as almost_find, but start from the last element of the Array.
|
inherited |
|
inherited |
GenericCluster< CoordType > & CASM::GenericCluster< CoordType >::apply_sym | ( | const SymOp & | op | ) |
apply symmetry to all points of the cluster
Definition at line 74 of file Cluster_impl.hh.
GenericCluster< CoordType > & CASM::GenericCluster< CoordType >::apply_sym_no_trans | ( | const SymOp & | op | ) |
apply symmetry to all points of the cluster without translation
Definition at line 85 of file Cluster_impl.hh.
|
inherited |
Construct permutation that undoes the permutation performed by 'this' Inverse operation is calculated the same, regardless of permutation convention
|
inherited |
Given N distinct objects labeled from 0 to N-1, a permutation 'P_permute' that physically permutes the objects (with labels) in terms of their labels, and a permutation 'L_permute' that permutes their labels only, rewrite 'P_permute' in terms of the relabeling induced by 'L_permute' Rearrange 'this' permutation to form an equivalent permutation for any list that has already been permuted by trans_perm. Does not (nearly certain of this) depend on permutation convention
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
void CASM::GenericCluster< CoordType >::calc_properties | ( | ) |
gets max_length and min_length
Definition at line 681 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::calc_properties | ( | GenericCluster< CoordType > | phenom_clust | ) |
calculate min/max lengths relative the phenom_clust & this cluster
Definition at line 717 of file Cluster_impl.hh.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Definition at line 46 of file Cluster.hh.
std::vector< Permutation > CASM::GenericCluster< _CoordType >::clust_group_permutations | ( | double | tol | ) | const |
Finds the Permutation corresponding to each element of clust_group.
Definition at line 124 of file Cluster_impl.hh.
|
inherited |
void CASM::GenericCluster< CoordType >::collect_basis_info | ( | const Array< CoordType > & | basis | ) |
Figure out which basis atoms in basis correspond to the points in cluster (*this)
Definition at line 431 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::collect_basis_info | ( | const Array< CoordType > & | basis, |
const Coordinate & | shift | ||
) |
Figure out which basis atoms in basis correspond to the points in cluster (*this) when cluster is translated by 'shift'
Definition at line 411 of file Cluster_impl.hh.
bool CASM::GenericCluster< CoordType >::contains | ( | const GenericCluster< CoordType > & | test_cluster | ) | const |
is test_cluster a subcluster of (*this)
Definition at line 235 of file Cluster_impl.hh.
|
inlineinherited |
bool CASM::GenericCluster< CoordType >::contains_periodic | ( | const CoordType & | test_coord, |
double | tol | ||
) | const |
Like Array<CoordType>::contains(), but takes periodicity mode into account.
Definition at line 251 of file Cluster_impl.hh.
|
inlineinherited |
|
inlineinherited |
Index CASM::GenericCluster< CoordType >::find | ( | const CoordType & | test_elem, |
double | tol | ||
) | const |
is test_cluster a subcluster of (*this), and how do the indices map points of test_cluster
Definition at line 262 of file Cluster_impl.hh.
bool CASM::GenericCluster< CoordType >::find | ( | const GenericCluster< CoordType > & | test_cluster, |
Array< Index > & | index, | ||
double | tol | ||
) | const |
is test_cluster a subcluster of (*this), and how do the indices map 'index' is populated with the indices of (*this) that correspond to the points of test_cluster
Definition at line 276 of file Cluster_impl.hh.
|
inherited |
void CASM::GenericCluster< CoordType >::from_json | ( | const jsonParser & | json | ) |
re-throw exceptions
Definition at line 258 of file Cluster.hh.
void CASM::GenericCluster< _CoordType >::generate_clust_group | ( | const SymGroup & | super_group, |
std::vector< Permutation > * | perm_array_ptr = nullptr , |
||
double | tol = TOL |
||
) |
Finds the sub_group of super_group that is the point group of the cluster.
Definition at line 100 of file Cluster_impl.hh.
Coordinate CASM::GenericCluster< CoordType >::geometric_center | ( | ) | const |
Returns the geometric center of "mass" of a cluster (treats all sites as having equal mass)
Definition at line 220 of file Cluster_impl.hh.
|
inherited |
Checks whether any values are equal to their index – only valid for Array<Index>
|
inline |
Definition at line 42 of file Cluster.hh.
bool CASM::GenericCluster< CoordType >::image_check | ( | const Lattice & | cell, |
int | nV = 0 |
||
) | const |
Checks to see if cluster is "compact" relative to (Lattice cell) in other words, period images of the cluster points are farther away than the points themselves. Returns true if cluster is not "compact".
Definition at line 201 of file Cluster_impl.hh.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
bool CASM::GenericCluster< CoordType >::is_equivalent | ( | const GenericCluster< CoordType > & | test_clust | ) | const |
are two clusters identical, to within permutation and translation
Definition at line 591 of file Cluster_impl.hh.
bool CASM::GenericCluster< CoordType >::is_equivalent | ( | const GenericCluster< CoordType > & | test_clust, |
Coordinate & | trans | ||
) | const |
are two clusters identical, to within permutation and translation translation that maps clusters is stored in 'trans'
Definition at line 608 of file Cluster_impl.hh.
|
inherited |
Checks that Array contains values from 0 to perm_array.size()-1 and that no value is repeated does not depend on definition of permutation convention
bool CASM::GenericCluster< CoordType >::map_onto | ( | const GenericCluster< CoordType > & | test_clust, |
double | tol | ||
) |
if is_equivalent(test_clust) is true, return true and map (*this) onto test_clust
Definition at line 629 of file Cluster_impl.hh.
bool CASM::GenericCluster< CoordType >::map_onto | ( | const GenericCluster< CoordType > & | test_clust, |
Coordinate & | trans, | ||
double | tol | ||
) |
if is_equivalent(test_clust) is true, return true and map (*this) onto test_clust translation that maps clusters is stored in 'trans'
Definition at line 654 of file Cluster_impl.hh.
bool CASM::GenericCluster< CoordType >::map_onto_subcluster | ( | const GenericCluster< CoordType > & | pivot, |
double | tol = TOL |
||
) |
if pivot is a sub_cluster, return true and translate (*this) by a lattice translation so that the points of 'pivot' are coincident with subcluster points in (*this)
Definition at line 299 of file Cluster_impl.hh.
bool CASM::GenericCluster< CoordType >::map_onto_subcluster | ( | const GenericCluster< CoordType > & | pivot, |
int | num_maps, | ||
double | tol = TOL |
||
) |
Definition at line 355 of file Cluster_impl.hh.
|
inherited |
|
inline |
Definition at line 108 of file Cluster.hh.
void CASM::GenericCluster< CoordType >::merge | ( | const GenericCluster< CoordType > & | RHS | ) |
adds unique points of 'RHS' to (*this)
Merge adds the unique points of RHS onto the current cluster.
Definition at line 540 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::merge | ( | const CoordType & | RHS | ) |
Adds new point to cluster, but only if it is unique.
|
inherited |
|
inline |
Definition at line 112 of file Cluster.hh.
|
inherited |
|
inlineinherited |
GenericCluster CASM::GenericCluster< CoordType >::operator+ | ( | const GenericCluster< CoordType > & | RHS | ) |
create translated cluster
GenericCluster< CoordType > & CASM::GenericCluster< CoordType >::operator+= | ( | const Coordinate & | RHS | ) |
in=place translation of a cluster
Definition at line 552 of file Cluster_impl.hh.
GenericCluster< CoordType > & CASM::GenericCluster< CoordType >::operator-= | ( | const Coordinate & | RHS | ) |
Definition at line 561 of file Cluster_impl.hh.
|
inherited |
|
inlineinherited |
bool CASM::GenericCluster< CoordType >::operator== | ( | const GenericCluster< CoordType > & | RHS | ) | const |
are two clusters identical, to within a permutation
Definition at line 570 of file Cluster_impl.hh.
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
GenericCluster< CoordType > & CASM::GenericCluster< CoordType >::permute | ( | const Array< Index > & | perm | ) |
permute sites of the cluster, and everything that depends on the site order
Definition at line 55 of file Cluster_impl.hh.
GenericCluster< CoordType > & CASM::GenericCluster< CoordType >::permute | ( | const Permutation & | perm | ) |
Definition at line 68 of file Cluster_impl.hh.
|
inline |
Definition at line 50 of file Cluster.hh.
|
inlineinherited |
|
inline |
Performs preparatory steps on prototype before doing Orbit::get_equivalent()
Definition at line 120 of file Cluster.hh.
void CASM::GenericCluster< CoordType >::print | ( | std::ostream & | stream, |
char | delim = '\n' , |
||
COORD_TYPE | mode = COORD_DEFAULT |
||
) | const |
Definition at line 756 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::print_basis_info | ( | std::ostream & | stream, |
int | space, | ||
char | delim = '\n' , |
||
COORD_TYPE | mode = COORD_DEFAULT |
||
) | const |
Definition at line 817 of file Cluster_impl.hh.
|
inherited |
void CASM::GenericCluster< CoordType >::print_decorated_sites | ( | std::ostream & | stream, |
int | space, | ||
char | delim = '\n' , |
||
COORD_TYPE | mode = COORD_DEFAULT |
||
) | const |
Definition at line 838 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::print_shifted | ( | std::ostream & | stream, |
const Coordinate & | shift, | ||
char | delim = '\n' , |
||
COORD_TYPE | mode = COORD_DEFAULT |
||
) | const |
Definition at line 776 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::print_sites | ( | std::ostream & | stream, |
int | space, | ||
char | delim = '\n' , |
||
COORD_TYPE | mode = COORD_DEFAULT |
||
) | const |
Definition at line 797 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::push_back | ( | const CoordType & | new_coord | ) |
Definition at line 523 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::read | ( | std::istream & | stream, |
int | num_sites, | ||
COORD_TYPE | mode, | ||
bool | SD_is_on | ||
) |
void CASM::GenericCluster< CoordType >::read | ( | std::istream & | stream, |
COORD_TYPE | mode | ||
) |
Reads the cluster.
Reads the cluster in the specified mode
stream | Input file stream |
mode | Cartesian or fractional mode |
Definition at line 457 of file Cluster_impl.hh.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Same as find, but starts from the last element of the Array.
|
staticinherited |
Returns an array with the sequence (initial, ++initial, ..., final), inclusive.
Returns an array with the sequence (initial, ++initial, ..., final), inclusive requires that operator<() and operator++() are defined on type T
|
staticinherited |
Returns an array with the sequence (initial, initial+increment, ..., final?), inclusive if final is in the sequence requires that operator<() and operator+=() are defined on type T
Returns an array with the sequence (initial, initial+increment, ..., final?), inclusive if final is in the sequence
|
inline |
Definition at line 54 of file Cluster.hh.
void CASM::GenericCluster< CoordType >::set_lattice | ( | const Lattice & | new_home, |
COORD_TYPE | mode | ||
) |
Definition at line 21 of file Cluster_impl.hh.
|
inline |
Definition at line 58 of file Cluster.hh.
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
jsonParser & CASM::GenericCluster< CoordType >::to_json | ( | jsonParser & | json | ) | const |
Write GenericCluster to json. Does not write lattice.
Definition at line 227 of file Cluster.hh.
void CASM::GenericCluster< CoordType >::update_data_members | ( | const BasicStructure< CoordType > & | ref_struc | ) |
Definition at line 33 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::within | ( | Index | pivot_ind = 0 | ) |
Translate entire cluster so that point at(pivot_ind) is inside unit cell.
Definition at line 139 of file Cluster_impl.hh.
void CASM::GenericCluster< CoordType >::within | ( | Index | pivot_ind, |
Coordinate & | trans | ||
) |
Translate entire cluster so that point at(pivot_ind) is inside unit cell.
Coordinate | trans contains translation used to map within |
Definition at line 161 of file Cluster_impl.hh.
|
private |
Definition at line 204 of file Cluster.hh.
|
private |
Definition at line 202 of file Cluster.hh.
|
private |
Definition at line 203 of file Cluster.hh.
|
private |
Definition at line 203 of file Cluster.hh.
|
private |
Definition at line 205 of file Cluster.hh.