17 namespace Coordinate_impl {
51 assert(
m_home &&
"home lattice pointer was set to null!");
106 }
else if (_mode ==
CART) {
109 throw std::runtime_error(
110 "Error: In Coordinate::as_vec, mode must be FRAC or CART");
201 assert(
m_home &&
"Coordinate doesn't have valid home lattice");
212 Eigen::IOFormat format = Eigen::IOFormat(7, 12))
const;
213 void print(std::ostream &stream,
char term = 0,
214 Eigen::IOFormat format = Eigen::IOFormat(7, 12))
const;
218 Eigen::IOFormat format = Eigen::IOFormat(7, 12))
const;
244 const Eigen::Ref<const Eigen::Matrix3d> &metric)
const;
250 assert(this->
m_home &&
"No home lattice to access");
254 void _set_frac(
const Eigen::Ref<const vector_type> &f) {
264 void _set_cart(
const Eigen::Ref<const vector_type> &c) {
300 namespace Coordinate_impl {
318 const Eigen::Ref<const Coordinate::vector_type> &vec) {
329 const Eigen::Ref<const Coordinate::vector_type> &vec) {
336 const Eigen::Ref<const Coordinate::vector_type> &vec) {
354 operator const Eigen::MatrixBase<Eigen::Vector3d> &()
const {
360 operator Eigen::Ref<const Eigen::Vector3d>()
const {
441 const Eigen::Ref<const Coordinate::vector_type> &vec) {
452 const Eigen::Ref<const Coordinate::vector_type> &vec) {
459 const Eigen::Ref<const Coordinate::vector_type> &vec) {
477 operator const Eigen::MatrixBase<Eigen::Vector3d> &()
const {
483 operator Eigen::Ref<const Eigen::Vector3d>()
const {
582 template <
typename ExternSymOp>
592 struct is_floating_point<
CASM::xtal::Coordinate_impl::FracCoordinateComponent> {
593 static const bool value =
true;
597 struct is_floating_point<
CASM::xtal::Coordinate_impl::CartCoordinateComponent> {
598 static const bool value =
true;
A class to enable assignment to a component of the Cartesian vector of a Coordinate.
CartCoordinateComponent & operator+=(double val)
CartCoordinateComponent & operator/=(double val)
CartCoordinateComponent & operator=(const CartCoordinateComponent &RHS)
Coordinate::size_type m_index
CartCoordinateComponent & operator*=(double val)
CartCoordinateComponent(Coordinate &coord, Coordinate::size_type index)
CartCoordinateComponent & operator=(double val)
CartCoordinateComponent & operator-=(double val)
A class to enable vector assignment to the Cartesian vector of a Coordinate.
CartCoordinate & operator/=(double val)
CartCoordinate & operator=(const Eigen::Ref< const Coordinate::vector_type > &vec)
CartCoordinate & operator-=(const Eigen::Ref< const Coordinate::vector_type > &vec)
CartCoordinate & operator+=(const Eigen::Ref< const Coordinate::vector_type > &vec)
CartCoordinate(Coordinate &coord)
CartCoordinate & operator=(const CartCoordinate &RHS)
CartCoordinate & operator*=(double val)
A class to enable assignment to a component of the fractional vector of a Coordinate.
Coordinate::size_type m_index
FracCoordinateComponent & operator=(const FracCoordinateComponent &RHS)
FracCoordinateComponent & operator-=(double val)
FracCoordinateComponent & operator*=(double val)
FracCoordinateComponent(Coordinate &coord, Coordinate::size_type index)
FracCoordinateComponent & operator+=(double val)
FracCoordinateComponent & operator=(double val)
FracCoordinateComponent & operator/=(double val)
A class to enable vector assignment to the fractional vector of a Coordinate.
FracCoordinate & operator*=(double val)
FracCoordinate & operator/=(double val)
FracCoordinate & operator=(const FracCoordinate &RHS)
FracCoordinate & operator-=(const Eigen::Ref< const Coordinate::vector_type > &vec)
FracCoordinate(Coordinate &coord)
FracCoordinate & operator+=(const Eigen::Ref< const Coordinate::vector_type > &vec)
FracCoordinate & operator=(const Eigen::Ref< const Coordinate::vector_type > &vec)
Represents cartesian and fractional coordinates.
bool almost_equal(const Coordinate &RHS) const
bool is_within() const
Checks to see if coordinate is in the unit cell, but does not translate it.
const double & const_frac(size_type index) const
user override to force const Access the fractional coordinate vector
const Lattice & home() const
Access the home lattice of the coordinate.
void print(std::ostream &stream, COORD_TYPE mode, char term=0, Eigen::IOFormat format=Eigen::IOFormat(7, 12)) const
double min_dist2(const Coordinate &neighbor, const Eigen::Ref< const Eigen::Matrix3d > &metric) const
Coordinate & operator+=(const Coordinate &RHS)
Positive translation of this coordinate by RHS.cart()
Coordinate_impl::CartCoordinate cart()
Set Cartesian coordinate vector and update fractional coordinate vector.
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 re...
bool is_lattice_shift(double tol=TOL) const
int voronoi_number() const
const Lattice & lattice() const
Access the home lattice of the coordinate.
void print_axis(std::ostream &stream, COORD_TYPE mode, char term=0, Eigen::IOFormat format=Eigen::IOFormat(7, 12)) const
Print normalized vector.
Eigen::Vector3d vector_type
const vector_type & const_frac() const
user override to force const Access the fractional coordinate vector
void _set_cart(size_type ind, double val)
void _set_frac(size_type ind, double val)
bool compare(const Coordinate &RHS) const
Returns true if this->min_dist(RHS)<this->lattice().tol()
Coordinate(const Lattice &_home)
Minimal constructor only takes a lattice.
const double & cart(size_type index) const
const Access a component of the Cartesian coordinate vector
Coordinate min_translation(const Coordinate &neighbor) const
Returns translation coordinate (in Angstr) to nearest periodic image of neighbor.
double robust_min_dist(const Coordinate &neighbor) const
Returns distance (in Angstr) to nearest periodic image of neighbor.
bool compare_type(const Coordinate &RHS) const
Return true – Exists to allow duck-typing with Site.
const vector_type & cart() const
const Access the Cartesian coordinate vector
bool voronoi_within()
Map coordinate into the voronoi cell using a lattice translation.
const double & const_cart(size_type index) const
const Access a component of the Cartesian coordinate vector
bool operator==(const Coordinate &RHS) const
vector_type::Index size_type
Coordinate & operator-=(const Coordinate &RHS)
Negative translation of this coordinate by RHS.cart()
vector_type as_vec(COORD_TYPE _mode) const
void _set_cart(const Eigen::Ref< const vector_type > &c)
bool operator!=(const Coordinate &RHS) const
void read(std::istream &stream, COORD_TYPE mode)
const double & frac(size_type index) const
const Access a component of the fractional coordinate vector
double min_dist(const Coordinate &neighbor) const
Returns distance (in Angstr) to nearest periodic image of neighbor.
Coordinate(Eigen::Ref< const vector_type > const &_vec, const Lattice &_home, COORD_TYPE _mode)
void _set_frac(const Eigen::Ref< const vector_type > &f)
Coordinate_impl::FracCoordinate frac()
Set the fractional coordinate vector.
const vector_type & frac() const
const Access the fractional coordinate vector
const vector_type & const_cart() const
user override to force const Access the Cartesian coordinate vector
Coordinate operator-() const
unary minus of this coordinate
double dist(const Coordinate &neighbor) const
distance (in Angstr) of neighbor from *this
const Eigen::Matrix3d & lat_column_mat() const
3x3 matrix with lattice vectors as its columne
const Eigen::Matrix3d & inv_lat_column_mat() const
Inverse of Lattice::lat_column_mat() It is the transformation matrix 'C2F', such that f = C2F * c whe...
Coordinate operator*(const SymOp &LHS, const Coordinate &RHS)
Coordinate operator-(const Coordinate &LHS, const Coordinate &RHS)
Coordinate operator+(const Coordinate &LHS, const Coordinate &RHS)
static Coordinate origin(const Lattice &_home)
construct a coordinate describing origin of _home lattice
xtal::Coordinate copy_apply(const xtal::SymOp &op, xtal::Coordinate coord)
Copy and apply SymOp to a Coordinate.
xtal::Coordinate & apply(const xtal::SymOp &op, xtal::Coordinate &coord)
apply SymOp to a Coordinate
INDEX_TYPE Index
For long integer indexing: