CASM  1.1.0
A Clusters Approach to Statistical Mechanics
Superlattice.cc
Go to the documentation of this file.
2 
3 namespace CASM {
4 namespace xtal {
6  const Lattice &superlattice)
7  : m_primitive_lattice(tiling_unit),
8  m_superlattice(superlattice),
9  m_transformation_matrix_to_super(
10  xtal::make_transformation_matrix_to_super(this->prim_lattice(),
11  this->superlattice(), TOL)),
12  m_size(std::abs(m_transformation_matrix_to_super.determinant())) {}
13 
15  const Eigen::Matrix3l &transformation_matrix)
16  : m_primitive_lattice(tiling_unit),
17  m_superlattice(
18  xtal::make_superlattice(tiling_unit, transformation_matrix)),
19  m_transformation_matrix_to_super(transformation_matrix),
20  m_size(std::abs(m_transformation_matrix_to_super.determinant())) {}
21 
23  const Lattice &superlattice) {
24  Superlattice result_superlattice(tiling_unit, superlattice);
25 
26  Eigen::Matrix3d trans_mat_inverse =
27  result_superlattice.transformation_matrix_to_super()
28  .cast<double>()
29  .inverse();
30  // By using the inverse transformatiom matrix, the new prim is guaranteed to
31  // perfectly tile the old prim
32  Lattice reconstructed_tiling_unit(
33  result_superlattice.superlattice().lat_column_mat() * trans_mat_inverse,
34  result_superlattice.prim_lattice().tol());
35 
36  // Pry right into the primate members and set the proper tiling unit
37  result_superlattice.m_primitive_lattice = reconstructed_tiling_unit;
38  return result_superlattice;
39 }
40 
41 } // namespace xtal
42 } // namespace CASM
const Eigen::Matrix3d & lat_column_mat() const
3x3 matrix with lattice vectors as its columne
Definition: Lattice.hh:110
double tol() const
Definition: Lattice.hh:195
const Lattice & prim_lattice() const
Definition: Superlattice.hh:20
const Eigen::Matrix3l & transformation_matrix_to_super() const
Definition: Superlattice.hh:24
const Lattice & superlattice() const
Definition: Superlattice.hh:18
static Superlattice smooth_prim(const Lattice &tiling_unit, const Lattice &superlattice)
Definition: Superlattice.cc:22
Superlattice(const Lattice &tiling_unit, const Lattice &superlattice)
Definition: Superlattice.cc:5
Lattice make_superlattice(const Lattice &lat, const Eigen::Matrix< IntegralType, 3, 3, Options > &transf_mat)
Returns a super Lattice. Transformation matrix must be integer.
Definition: Lattice.hh:287
Eigen::Matrix< typename Derived::Scalar, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > inverse(const Eigen::MatrixBase< Derived > &M)
Return the integer inverse matrix of an invertible integer matrix.
Eigen::Matrix3l make_transformation_matrix_to_super(const Lattice &tiling_unit, const Lattice &superlattice, double tol)
Definition: Lattice.cc:848
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::Matrix3d Matrix3d
const double TOL
Definition: definitions.hh:30
Matrix< long int, 3, 3 > Matrix3l
Definition: eigen.hh:12
Definition: stream_io.hh:24