CASM
AClustersApproachtoStatisticalMechanics
|
#include <Site.hh>
Public Types | |
typedef Eigen::Vector3d | vector_type |
typedef vector_type::Index | size_type |
Public Member Functions | |
Site (const Lattice &init_home) | |
Site (const Coordinate &init_pos, const std::string &occ_name) | |
Site (const Coordinate &init_pos, std::initializer_list< Molecule > site_occ) | |
Construct site with initial position and the allowed Molecule. More... | |
const MoleculeOccupant & | site_occupant () const |
const Array< ContinuousDoF > & | displacement () const |
void | update_data_members (const Site &_ref_site) |
bool | is_vacant () const |
Checks if current occupant is a vacancy. More... | |
Index | nlist_ind () const |
access m_nlist_ind More... | |
std::string | occ_name () const |
Name of current occupant (name of molecule, but for single atom, molecule name is species name) More... | |
const Molecule & | occ () const |
bool | compare (const Coordinate &test_coord, double compare_tol=TOL) const |
bool | compare (const Site &test_site, double compare_tol=TOL) const |
bool | compare (const Site &test_site, const Coordinate &shift, double compare_tol=TOL) const |
bool | compare_type (const Site &test_site) const |
bool | operator== (const Site &test_site) const |
bool | almost_equal (const Site &test_site, double tol) const |
bool | contains (const std::string &name) const |
bool | contains (const std::string &name, int &index) const |
void | set_lattice (const Lattice &new_lat, COORD_TYPE mode) |
void | set_site_occupant (const MoleculeOccupant &new_dof) |
void | set_occ_value (int new_val) |
void | set_occ (const Molecule &new_occ) |
Array< std::string > | allowed_occupants () const |
void | set_basis_ind (Index) |
set basis_ind of site and its occupant functions More... | |
void | set_nlist_ind (Index) |
set m_nlist_ind of Site and its DoFs More... | |
Site & | apply_sym (const SymOp &op) |
Site & | apply_sym_no_trans (const SymOp &op) |
void | read (std::istream &stream, bool SD_is_on=false) |
void | read (std::istream &stream, std::string &elem, bool SD_is_on) |
void | print (std::ostream &stream) const |
void | print_occ (std::ostream &stream) const |
void | print_mol (std::ostream &stream, int spaces, char delim, bool SD_is_on=false) const |
Site & | operator+= (const Coordinate &translation) |
Site & | operator-= (const Coordinate &translation) |
jsonParser & | to_json (jsonParser &json) const |
void | from_json (const jsonParser &json) |
Coordinate_impl::FracCoordinate | frac () |
Set the fractional coordinate vector. More... | |
const vector_type & | frac () const |
const Access the fractional coordinate vector More... | |
Coordinate_impl::FracCoordinateComponent | frac (size_type index) |
Set a component of the fractional coordinate vector. More... | |
const double & | frac (size_type index) const |
const Access a component of the fractional coordinate vector More... | |
const vector_type & | const_frac () const |
user override to force const Access the fractional coordinate vector More... | |
const double & | const_frac (size_type index) const |
user override to force const Access the fractional coordinate vector More... | |
Coordinate_impl::CartCoordinate | cart () |
Set Cartesian coordinate vector and update fractional coordinate vector. More... | |
const vector_type & | cart () const |
const Access the Cartesian coordinate vector More... | |
Coordinate_impl::CartCoordinateComponent | cart (size_type index) |
Set a component of the Cartesian coordinate vector. More... | |
const double & | cart (size_type index) const |
const Access a component of the Cartesian coordinate vector More... | |
const vector_type & | const_cart () const |
user override to force const Access the Cartesian coordinate vector More... | |
const double & | const_cart (size_type index) const |
const Access a component of the Cartesian coordinate vector More... | |
Coordinate | operator- () const |
unary minus of this coordinate More... | |
bool | operator== (const Coordinate &RHS) const |
bool | operator!= (const Coordinate &RHS) const |
bool | almost_equal (const Coordinate &RHS, double tol) const |
bool | compare (const Coordinate &RHS, Coordinate &translation, double tol=TOL) const |
bool | compare_type (const Coordinate &RHS) const |
Return true – Exists to allow duck-typing with Site. More... | |
bool | within () |
bool | within (Coordinate &translation) |
bool | is_within () const |
Checks to see if coordinate is in the unit cell, but does not translate it. More... | |
int | voronoi_number () const |
int | voronoi_number (const Lattice &cell) const |
bool | voronoi_within () |
Map coordinate into the voronoi cell using a lattice translation. More... | |
bool | voronoi_within (Coordinate &translation) |
bool | is_lattice_shift (double tol=TOL) const |
Checks to see if coordinate is at a lattice translation with respect to the origin. More... | |
Index | basis_ind () const |
Access basis Index. More... | |
const Lattice & | home () const |
Access the home lattice of the coordinate. More... | |
void | read (std::istream &stream, COORD_TYPE mode) |
void | print (std::ostream &stream, COORD_TYPE mode, char term=0, int prec=7, int pad=5) const |
void | print (std::ostream &stream, char term=0, int prec=7, int pad=5) const |
void | print_axis (std::ostream &stream, COORD_TYPE mode, char term=0, int prec=7, int pad=5) const |
Print normalized vector. More... | |
double | dist (const Coordinate &neighbor) const |
distance (in Angstr) of neighbor from *this More... | |
double | min_dist (const Coordinate &neighbor) const |
Returns distance (in Angstr) to nearest periodic image of neighbor. More... | |
double | min_dist (const Coordinate &neighbor, Coordinate &translation) const |
Returns distance (in Angstr) to nearest periodic image of neighbor. More... | |
double | robust_min_dist (const Coordinate &neighbor) const |
Returns distance (in Angstr) to nearest periodic image of neighbor. More... | |
double | robust_min_dist (const Coordinate &neighbor, Coordinate &translation) const |
Returns distance (in Angstr) to nearest periodic image of neighbor. More... | |
double | min_dist2 (const Coordinate &neighbor, const Eigen::Ref< const Eigen::Matrix3d > &metric) const |
Finds same shift as min_dist but returns shift(CART).transpose()*metric*shift(CART) More... | |
Static Public Member Functions | |
static Coordinate | origin (const Lattice &_home) |
construct a coordinate describing origin of _home lattice More... | |
Private Member Functions | |
bool | _compare_type_no_ID (const Site &test_site) const |
Index | _type_ID () const |
Static Private Member Functions | |
static Array< Site > & | _type_prototypes () |
Private Attributes | |
Index | m_nlist_ind |
Index | m_type_ID |
Array< ContinuousDoF > | m_displacement |
MoleculeOccupant | m_site_occupant |
|
inherited |
Definition at line 37 of file Coordinate.hh.
|
inherited |
Definition at line 36 of file Coordinate.hh.
CASM::Site::Site | ( | const Coordinate & | init_pos, |
const std::string & | occ_name | ||
) |
CASM::Site::Site | ( | const Coordinate & | init_pos, |
std::initializer_list< Molecule > | site_occ | ||
) |
|
private |
Array< std::string > CASM::Site::allowed_occupants | ( | ) | const |
bool CASM::Site::almost_equal | ( | const Site & | test_site, |
double | tol | ||
) | const |
|
inherited |
Definition at line 66 of file Coordinate.cc.
|
inlineinherited |
Access basis Index.
Definition at line 190 of file Coordinate.hh.
|
inlineinherited |
Set Cartesian coordinate vector and update fractional coordinate vector.
Definition at line 593 of file Coordinate.hh.
|
inlineinherited |
const Access the Cartesian coordinate vector
Definition at line 87 of file Coordinate.hh.
|
inlineinherited |
Set a component of the Cartesian coordinate vector.
Definition at line 599 of file Coordinate.hh.
|
inlineinherited |
const Access a component of the Cartesian coordinate vector
Definition at line 100 of file Coordinate.hh.
bool CASM::Site::compare | ( | const Coordinate & | test_coord, |
double | compare_tol = TOL |
||
) | const |
bool CASM::Site::compare | ( | const Site & | test_site, |
const Coordinate & | shift, | ||
double | compare_tol = TOL |
||
) | const |
|
inherited |
Returns true if this->min_dist(RHS)<tol if true, calculates
translation | such that *this = (RHS+translation) |
Definition at line 80 of file Coordinate.cc.
bool CASM::Site::compare_type | ( | const Site & | test_site | ) | const |
|
inherited |
Return true – Exists to allow duck-typing with Site.
Definition at line 86 of file Coordinate.cc.
|
inlineinherited |
user override to force const Access the Cartesian coordinate vector
Definition at line 92 of file Coordinate.hh.
|
inlineinherited |
const Access a component of the Cartesian coordinate vector
Definition at line 105 of file Coordinate.hh.
|
inlineinherited |
user override to force const Access the fractional coordinate vector
Definition at line 66 of file Coordinate.hh.
|
inlineinherited |
user override to force const Access the fractional coordinate vector
Definition at line 79 of file Coordinate.hh.
bool CASM::Site::contains | ( | const std::string & | name, |
int & | index | ||
) | const |
|
inline |
|
inherited |
distance (in Angstr) of neighbor from *this
Definition at line 146 of file Coordinate.cc.
|
inlineinherited |
Set the fractional coordinate vector.
Definition at line 581 of file Coordinate.hh.
|
inlineinherited |
const Access the fractional coordinate vector
Definition at line 61 of file Coordinate.hh.
|
inlineinherited |
Set a component of the fractional coordinate vector.
Definition at line 587 of file Coordinate.hh.
|
inlineinherited |
const Access a component of the fractional coordinate vector
Definition at line 74 of file Coordinate.hh.
void CASM::Site::from_json | ( | const jsonParser & | json | ) |
|
inlineinherited |
Access the home lattice of the coordinate.
Definition at line 195 of file Coordinate.hh.
|
inherited |
Checks to see if coordinate is at a lattice translation with respect to the origin.
Definition at line 367 of file Coordinate.cc.
bool CASM::Site::is_vacant | ( | ) | const |
|
inherited |
Checks to see if coordinate is in the unit cell, but does not translate it.
Definition at line 301 of file Coordinate.cc.
|
inherited |
Returns distance (in Angstr) to nearest periodic image of neighbor.
Is unsafe if min_dist is comparable to half a lattice vector in length
Definition at line 155 of file Coordinate.cc.
|
inherited |
Returns distance (in Angstr) to nearest periodic image of neighbor.
This version calculates the translation such that (neighbor+translation) is the periodic nearest period image of neighbor
Definition at line 169 of file Coordinate.cc.
|
inherited |
Finds same shift as min_dist but returns shift(CART).transpose()*metric*shift(CART)
Definition at line 205 of file Coordinate.cc.
const Molecule & CASM::Site::occ | ( | ) | const |
Const reference to occupying molecule. ***WARNING*** only use if you are certain the occupant has been set. If you only need to know occupant name or whether site is vacant, use Site::is_vacant() or Site::occ_name() instead
std::string CASM::Site::occ_name | ( | ) | const |
|
inlineinherited |
Definition at line 120 of file Coordinate.hh.
Site & CASM::Site::operator+= | ( | const Coordinate & | translation | ) |
|
inherited |
unary minus of this coordinate
Definition at line 53 of file Coordinate.cc.
Site & CASM::Site::operator-= | ( | const Coordinate & | translation | ) |
|
inherited |
Definition at line 59 of file Coordinate.cc.
void CASM::Site::print | ( | std::ostream & | stream | ) | const |
|
inherited |
Definition at line 112 of file Coordinate.cc.
|
inherited |
Definition at line 107 of file Coordinate.cc.
|
inherited |
Print normalized vector.
Definition at line 129 of file Coordinate.cc.
void CASM::Site::print_mol | ( | std::ostream & | stream, |
int | spaces, | ||
char | delim, | ||
bool | SD_is_on = false |
||
) | const |
Print each AtomPosition in current molecule, with name of occupying atom
void CASM::Site::print_occ | ( | std::ostream & | stream | ) | const |
void CASM::Site::read | ( | std::istream & | stream, |
bool | SD_is_on = false |
||
) |
void CASM::Site::read | ( | std::istream & | stream, |
std::string & | elem, | ||
bool | SD_is_on | ||
) |
|
inherited |
Definition at line 92 of file Coordinate.cc.
|
inherited |
Returns distance (in Angstr) to nearest periodic image of neighbor.
It is safe in all cases, because it uses the lattice Wigner-Seitz cell to determine the nearest image, but this makes it slower than min_dist
Definition at line 179 of file Coordinate.cc.
|
inherited |
Returns distance (in Angstr) to nearest periodic image of neighbor.
This version calculates the translation such that (neighbor+translation) is the periodic nearest period image of neighbor It is safe in all cases, because it uses the lattice Wigner-Seitz cell to determine the nearest image, but this makes it slower than min_dist
Definition at line 190 of file Coordinate.cc.
void CASM::Site::set_basis_ind | ( | Index | new_ind | ) |
void CASM::Site::set_lattice | ( | const Lattice & | new_lat, |
COORD_TYPE | mode | ||
) |
void CASM::Site::set_nlist_ind | ( | Index | new_ind | ) |
|
inline |
|
inline |
jsonParser & CASM::Site::to_json | ( | jsonParser & | json | ) | const |
void CASM::Site::update_data_members | ( | const Site & | _ref_site | ) |
|
inherited |
Number of periodic images of this coordinate that are on voronoi cell boundary of its home lattice
Definition at line 317 of file Coordinate.cc.
|
inherited |
Number of periodic images of this coordinate that are on voronoi cell boundary of 'cell'
Definition at line 325 of file Coordinate.cc.
|
inherited |
Map coordinate into the voronoi cell using a lattice translation.
Definition at line 333 of file Coordinate.cc.
|
inherited |
Same as voronoi_within(), but lattice translation is stored in Coordinate translation such that coord_after = coord_before + translation returns true if *this was already within the voronoi cell
Definition at line 348 of file Coordinate.cc.
|
inherited |
Map coordinate into the unit cell using a lattice translation returns true if *this was already within the unit cell
Definition at line 261 of file Coordinate.cc.
|
inherited |
Same as within(), but lattice translation is stored in Coordinate translation, such that coord_after = coord_before + translation returns true if *this was already within the unit cell
Definition at line 280 of file Coordinate.cc.
|
private |
|
private |