CASM  1.1.0
A Clusters Approach to Statistical Mechanics
IntegralCoordinateWithin.hh
Go to the documentation of this file.
1 #ifndef UNITCELLWITHIN_HH
2 #define UNITCELLWITHIN_HH
3 
4 #include <array>
5 #include <vector>
6 
7 #include "casm/external/Eigen/Core"
8 #include "casm/global/eigen.hh"
10 
11 namespace CASM {
12 namespace xtal {
13 class UnitCell;
14 class UnitCellCoord;
15 
24  public:
25  typedef Eigen::Matrix<long, 3, 3> matrix_type;
26  typedef Eigen::Matrix<long, 3, 1> vector_type;
27 
33  const matrix_type &superlattice_transformation_matrix)
34  : m_transformation_matrix(superlattice_transformation_matrix),
36  adjugate(superlattice_transformation_matrix)) {
38  }
39 
41  const Eigen::Matrix3i &superlattice_transformation_matrix)
43  matrix_type(superlattice_transformation_matrix.cast<long>())) {}
44 
46  vector_type operator()(const vector_type &ijk) const;
47 
48  template <typename UnitCellType>
49  UnitCellType operator()(const UnitCellType &ijk) const {
50  return UnitCellType(this->operator()(static_cast<vector_type>(ijk)));
51  }
52 
53  UnitCellCoord operator()(const UnitCellCoord &bijk) const;
54 
55  private:
59 
63 
66  const matrix_type &transformation_matrix);
67 };
68 
69 //********************************************************************************************************************************//
70 
71 namespace impl {
72 
123  public:
126 
129  OrderedLatticePointGenerator(const matrix_type &transformation_matrix);
130 
133  vector_type operator()(Index ix) const;
134 
136  long int size() const { return m_total_lattice_points; }
137 
138  private:
140 
141  // Can map ijk values within the supercell
143 
153 
156  std::array<int, 2> m_stride;
157 
161 
165 };
166 
169 std::vector<UnitCell> make_lattice_points(
170  const OrderedLatticePointGenerator::matrix_type &transformation_matrix);
171 } // namespace impl
172 
173 //********************************************************************************************************************************//
174 
175 std::vector<UnitCell> make_lattice_points(
176  const Eigen::Matrix3l &transformation_matrix);
177 
178 class Lattice;
181 std::vector<UnitCell> make_lattice_points(const Lattice &tiling_unit,
182  const Lattice &superlattice,
183  double tol);
184 
185 } // namespace xtal
186 } // namespace CASM
187 
188 #endif
IntegralCoordinateWithin_f(const matrix_type &superlattice_transformation_matrix)
vector_type operator()(const vector_type &ijk) const
Brings the given lattice point within the superlattice.
static void _throw_if_bad_transformation_matrix(const matrix_type &transformation_matrix)
Throws exception if the transformation matrix has determinant 0.
IntegralCoordinateWithin_f(const Eigen::Matrix3i &superlattice_transformation_matrix)
UnitCellType operator()(const UnitCellType &ijk) const
Unit Cell Coordinates.
IntegralCoordinateWithin_f::vector_type vector_type
vector_type _make_smith_normal_form_lattice_point(Index ix) const
vector_type _normalize_lattice_point(const vector_type &mnp) const
IntegralCoordinateWithin_f::matrix_type matrix_type
OrderedLatticePointGenerator(const matrix_type &transformation_matrix)
long int size() const
Returns the total number of unique lattice points that can be generated.
Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > adjugate(const Eigen::MatrixBase< Derived > &M)
Return adjugate matrix.
std::vector< UnitCell > make_lattice_points(const OrderedLatticePointGenerator::matrix_type &transformation_matrix)
std::vector< UnitCell > make_lattice_points(const Eigen::Matrix3l &transformation_matrix)
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Matrix< long int, 3, 3 > Matrix3l
Definition: eigen.hh:12