CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::AtomPosition Class Reference

#include <Molecule.hh>

+ Inheritance diagram for CASM::AtomPosition:

Detailed Description

Definition at line 56 of file Molecule.hh.

Public Types

typedef std::array< bool, 3 > sd_type
 
typedef Eigen::Vector3d vector_type
 
typedef vector_type::Index size_type
 

Public Member Functions

 AtomPosition (const Lattice &init_lattice)
 
 AtomPosition (double elem1, double elem2, double elem3, std::string sp_name, const Lattice &init_lattice, COORD_TYPE mode, sd_type _SD_flag=sd_type{{false, false, false}})
 
bool operator== (const AtomPosition &RHS) const
 
void print (std::ostream &stream, const Coordinate &trans, int spaces, bool SD_is_on=false) const
 
AtomPositionapply_sym (const SymOp &op)
 
AtomPositionapply_sym_no_trans (const SymOp &op)
 
Coordinate_impl::FracCoordinate frac ()
 Set the fractional coordinate vector. More...
 
const vector_typefrac () 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_typeconst_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_typecart () 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_typeconst_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...
 
Coordinateoperator+= (const Coordinate &RHS)
 Positive translation of this coordinate by RHS.cart() More...
 
Coordinateoperator-= (const Coordinate &RHS)
 Negative translation of this coordinate by RHS.cart() 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, double tol=TOL) const
 Returns true if this->min_dist(RHS)<tol. More...
 
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...
 
void set_lattice (const Lattice &new_lat, COORD_TYPE mode)
 Change the home lattice of the coordinate, selecting one representation (either CART or FRAC) that remains invariant. More...
 
void set_basis_ind (Index _basis_ind)
 Set basis Index. More...
 
Index basis_ind () const
 Access basis Index. More...
 
const Latticehome () 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...
 
jsonParserto_json (jsonParser &json) const
 
void from_json (const jsonParser &json)
 

Static Public Member Functions

static Coordinate origin (const Lattice &_home)
 construct a coordinate describing origin of _home lattice More...
 

Public Attributes

Specie specie
 
sd_type SD_flag
 

Member Typedef Documentation

typedef vector_type::Index CASM::Coordinate::size_type
inherited

Definition at line 37 of file Coordinate.hh.

typedef Eigen::Vector3d CASM::Coordinate::vector_type
inherited

Definition at line 36 of file Coordinate.hh.

Member Function Documentation

bool CASM::Coordinate::almost_equal ( const Coordinate RHS,
double  tol 
) const
inherited

Definition at line 66 of file Coordinate.cc.

Index CASM::Coordinate::basis_ind ( ) const
inlineinherited

Access basis Index.

Definition at line 190 of file Coordinate.hh.

Coordinate_impl::CartCoordinate CASM::Coordinate::cart ( )
inlineinherited

Set Cartesian coordinate vector and update fractional coordinate vector.

Definition at line 593 of file Coordinate.hh.

const vector_type& CASM::Coordinate::cart ( ) const
inlineinherited

const Access the Cartesian coordinate vector

Definition at line 87 of file Coordinate.hh.

Coordinate_impl::CartCoordinateComponent CASM::Coordinate::cart ( Coordinate::size_type  index)
inlineinherited

Set a component of the Cartesian coordinate vector.

Definition at line 599 of file Coordinate.hh.

const double& CASM::Coordinate::cart ( size_type  index) const
inlineinherited

const Access a component of the Cartesian coordinate vector

Definition at line 100 of file Coordinate.hh.

bool CASM::Coordinate::compare ( const Coordinate RHS,
double  tol = TOL 
) const
inherited

Returns true if this->min_dist(RHS)<tol.

Definition at line 73 of file Coordinate.cc.

bool CASM::Coordinate::compare ( const Coordinate RHS,
Coordinate translation,
double  tol = TOL 
) const
inherited

Returns true if this->min_dist(RHS)<tol if true, calculates

Parameters
translationsuch that *this = (RHS+translation)

Definition at line 80 of file Coordinate.cc.

bool CASM::Coordinate::compare_type ( const Coordinate RHS) const
inherited

Return true – Exists to allow duck-typing with Site.

Definition at line 86 of file Coordinate.cc.

const vector_type& CASM::Coordinate::const_cart ( ) const
inlineinherited

user override to force const Access the Cartesian coordinate vector

Definition at line 92 of file Coordinate.hh.

const double& CASM::Coordinate::const_cart ( size_type  index) const
inlineinherited

const Access a component of the Cartesian coordinate vector

Definition at line 105 of file Coordinate.hh.

const vector_type& CASM::Coordinate::const_frac ( ) const
inlineinherited

user override to force const Access the fractional coordinate vector

Definition at line 66 of file Coordinate.hh.

const double& CASM::Coordinate::const_frac ( size_type  index) const
inlineinherited

user override to force const Access the fractional coordinate vector

Definition at line 79 of file Coordinate.hh.

double CASM::Coordinate::dist ( const Coordinate neighbor) const
inherited

distance (in Angstr) of neighbor from *this

Definition at line 146 of file Coordinate.cc.

Coordinate_impl::FracCoordinate CASM::Coordinate::frac ( )
inlineinherited

Set the fractional coordinate vector.

Definition at line 581 of file Coordinate.hh.

const vector_type& CASM::Coordinate::frac ( ) const
inlineinherited

const Access the fractional coordinate vector

Definition at line 61 of file Coordinate.hh.

Coordinate_impl::FracCoordinateComponent CASM::Coordinate::frac ( Coordinate::size_type  index)
inlineinherited

Set a component of the fractional coordinate vector.

Definition at line 587 of file Coordinate.hh.

const double& CASM::Coordinate::frac ( size_type  index) const
inlineinherited

const Access a component of the fractional coordinate vector

Definition at line 74 of file Coordinate.hh.

void CASM::Coordinate::from_json ( const jsonParser json)
inherited

Definition at line 398 of file Coordinate.cc.

const Lattice& CASM::Coordinate::home ( ) const
inlineinherited

Access the home lattice of the coordinate.

Definition at line 195 of file Coordinate.hh.

bool CASM::Coordinate::is_lattice_shift ( double  tol = TOL) const
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::Coordinate::is_within ( ) 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.

double CASM::Coordinate::min_dist ( const Coordinate neighbor) const
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.

double CASM::Coordinate::min_dist ( const Coordinate neighbor,
Coordinate translation 
) const
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.

double CASM::Coordinate::min_dist2 ( const Coordinate neighbor,
const Eigen::Ref< const Eigen::Matrix3d > &  metric 
) const
inherited

Finds same shift as min_dist but returns shift(CART).transpose()*metric*shift(CART)

Definition at line 205 of file Coordinate.cc.

bool CASM::Coordinate::operator!= ( const Coordinate RHS) const
inlineinherited

Definition at line 120 of file Coordinate.hh.

Coordinate & CASM::Coordinate::operator+= ( const Coordinate RHS)
inherited

Positive translation of this coordinate by RHS.cart()

Definition at line 38 of file Coordinate.cc.

Coordinate CASM::Coordinate::operator- ( ) const
inherited

unary minus of this coordinate

Definition at line 53 of file Coordinate.cc.

Coordinate & CASM::Coordinate::operator-= ( const Coordinate RHS)
inherited

Negative translation of this coordinate by RHS.cart()

Definition at line 45 of file Coordinate.cc.

bool CASM::Coordinate::operator== ( const Coordinate RHS) const
inherited

Definition at line 59 of file Coordinate.cc.

void CASM::Coordinate::print ( std::ostream &  stream,
COORD_TYPE  mode,
char  term = 0,
int  prec = 7,
int  pad = 5 
) const
inherited

Definition at line 112 of file Coordinate.cc.

void CASM::Coordinate::print ( std::ostream &  stream,
char  term = 0,
int  prec = 7,
int  pad = 5 
) const
inherited

Definition at line 107 of file Coordinate.cc.

void CASM::Coordinate::print_axis ( std::ostream &  stream,
COORD_TYPE  mode,
char  term = 0,
int  prec = 7,
int  pad = 5 
) const
inherited

Print normalized vector.

Definition at line 129 of file Coordinate.cc.

void CASM::Coordinate::read ( std::istream &  stream,
COORD_TYPE  mode 
)
inherited

Definition at line 92 of file Coordinate.cc.

double CASM::Coordinate::robust_min_dist ( const Coordinate neighbor) const
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.

double CASM::Coordinate::robust_min_dist ( const Coordinate neighbor,
Coordinate translation 
) const
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::Coordinate::set_basis_ind ( Index  _basis_ind)
inlineinherited

Set basis Index.

Definition at line 185 of file Coordinate.hh.

void CASM::Coordinate::set_lattice ( const Lattice new_lat,
COORD_TYPE  mode 
)
inherited

Change the home lattice of the coordinate, selecting one representation (either CART or FRAC) that remains invariant.

Parameters
invariant_mode

invariant_mode == CART: Cartesian coordinates stay the same, and fractional coordinates are updated Ex: (my_coord.set_lattice(superlattice, CART); // this is how superlattices get filled.

invariant_mode == FRAC: Fractional coordinates stay the same, and Cartesian coordinates are updated Ex: you can apply a strain by changing the lattice and keepin FRAC invariant (my_coord.set_lattice(strained_lattice, FRAC); Ex: you can apply a rotation by changing the lattice and keeping FRAC invariant (my_coord.set_lattice(rotated_lattice, FRAC);

Definition at line 245 of file Coordinate.cc.

jsonParser & CASM::Coordinate::to_json ( jsonParser json) const
inherited

Definition at line 383 of file Coordinate.cc.

int CASM::Coordinate::voronoi_number ( ) const
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.

int CASM::Coordinate::voronoi_number ( const Lattice cell) const
inherited

Number of periodic images of this coordinate that are on voronoi cell boundary of 'cell'

Definition at line 325 of file Coordinate.cc.

bool CASM::Coordinate::voronoi_within ( )
inherited

Map coordinate into the voronoi cell using a lattice translation.

Definition at line 333 of file Coordinate.cc.

bool CASM::Coordinate::voronoi_within ( Coordinate translation)
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.

bool CASM::Coordinate::within ( )
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.

bool CASM::Coordinate::within ( Coordinate translation)
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.


The documentation for this class was generated from the following files: