1 #ifndef SuperlatticeEnumerator_HH
2 #define SuperlatticeEnumerator_HH
7 #include "casm/external/Eigen/Dense"
48 std::string
dirs =
"abc",
55 std::string msg =
"Error constructing ScelEnumProps: begin_volume < 1";
56 throw std::invalid_argument(msg);
59 for (
int i = 0; i <
m_dirs.size(); i++) {
62 "Error constructing ScelEnumProps: an element of dirs != 'a', 'b', "
64 throw std::invalid_argument(msg);
70 while (
m_dirs.size() != 3) {
81 Eigen::Matrix3i P = Eigen::Matrix3i::Zero();
119 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
151 Eigen::Matrix3i
matrix()
const;
227 template <
typename ExternSymGroupTypeIt>
255 const Eigen::Matrix3i &
gen_mat()
const;
322 const Eigen::Matrix3i &T,
324 bool fix_shape =
false);
326 template <
typename ExternSymGroupTypeIt>
328 ExternSymGroupTypeIt end,
331 bool fix_shape =
false) {
382 template <
typename ExternSymGroupTypeIt>
384 ExternSymGroupTypeIt end,
385 const Eigen::Matrix3i &T,
Eigen::VectorXi::Scalar value_type
Data structure for holding supercell enumeration properties.
A fake container of supercell matrices.
Iterators used with SuperlatticeEnumerator.
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
SuperlatticeEnumerator(ExternSymGroupTypeIt begin, ExternSymGroupTypeIt end, const Lattice &unit, const ScelEnumProps &enum_props)
bool operator!=(const SuperlatticeIterator &B) const
Iterator comparison.
const Lattice & reference
const_iterator end() const
A const iterator to the past-the-last volume.
SuperlatticeIterator const_iterator
const_iterator cend() const
A const iterator to the past-the-last volume.
Lattice m_super
A supercell, stored here so that iterator dereferencing will be OK. Only used when requested.
size_type end_volume() const
const Eigen::Matrix3i & gen_mat() const
Get the transformation matrix that's being applied to the unit vectors.
SuperlatticeIterator & operator=(const SuperlatticeIterator &B)
const SuperlatticeEnumerator & enumerator() const
const reference to the SuperlatticeEnumerator this is iterating with
void end_volume(size_type _end_volume)
Set the end volume.
Eigen::Matrix3i matrix() const
constructed supercell matrix
const Lattice m_unit
The unit cell of the supercells.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::forward_iterator_tag iterator_category
fixes alignment of m_deformation
Eigen::Matrix3i generating_matrix() const
Eigen::Matrix3i m_gen_mat
int dimension() const
Get the dimensions of the enumerator (1D, 2D or 3D)
const int m_dims
The number of lattice directions the enumeration is being done in.
bool operator==(const SuperlatticeIterator &B) const
Iterator comparison.
size_type begin_volume() const
Get the beginning volume.
Eigen::Matrix3i canonical_hnf(const Eigen::Matrix3i &T, const SymOpVector &effective_pg, const Lattice &ref_lattice)
Return canonical hermite normal form of the supercell matrix.
void _update_super()
Update m_super when required.
HermiteCounter::value_type volume() const
current volume
const Eigen::Matrix3i m_gen_mat
This matrix (G) specifies new lattice vectors to enumerate over column-wise, such that the resulting ...
std::vector< Eigen::Matrix3i > m_canon_hist
Keep track of the HNF matrices for the current determinant value.
pointer operator->() const
Access the supercell.
Eigen::Matrix3i enforce_min_volume(const Lattice &unit, const Eigen::Matrix3i &T, const SymOpVector &point_grp, Index volume, bool fix_shape=false)
Return a transformation matrix that ensures a supercell of at least some volume.
const int m_end_volume
The past-the-last volume supercells to be iterated over (what cend uses)
const_iterator citerator(size_type volume) const
A const iterator to a specified volume.
const Lattice & unit() const
Access the unit the is being made into superlattices.
const_iterator cbegin() const
A const iterator to the beginning volume.
void _try_increment()
Check if the current supercell matrix hermite normal form is in a canonical form.
SuperlatticeIterator & operator++()
Prefix increment operator. Increment to next unique supercell.
bool m_super_updated
Indicates if m_super reflects the current m_current supercell matrix.
SuperlatticeEnumerator(const Lattice &unit, const SymOpVector &point_grp, const ScelEnumProps &enum_props)
Construct a SuperlatticeEnumerator using custom point group operations.
const_iterator begin() const
A const iterator to the beginning volume, specify here how the iterator should jump through the enume...
reference operator*() const
Access the supercell.
size_type end_volume() const
Get the end volume.
size_type begin_volume() const
const int m_begin_volume
The first volume supercells to be iterated over (what cbegin uses)
notstd::cloneable_ptr< HermiteCounter > m_current
Current supercell matrix in HermitCounter form.
void begin_volume(size_type _begin_volume)
Set the beginning volume.
const SuperlatticeEnumerator * m_enum
Pointer to SuperlatticeEnumerator which holds the unit cell and point group.
SymOpVector m_point_group
The lattice of the unit cell.
ScelEnumProps(size_type begin_volume, size_type end_volume, std::string dirs="abc", Eigen::Matrix3i generating_matrix=Eigen::Matrix3i::Identity())
Constructor.
const SymOpVector & point_group() const
Access the unit point group.
void _increment()
Postfix increment operator. Increment to next unique supercell.
double volume(const Lattice &lat)
Returns the volume of a Lattice.
IdentitySymRepBuilder Identity()
std::vector< SymOp > SymOpVector
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.
INDEX_TYPE Index
For long integer indexing: