CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <LinearIndexConverter.hh>
Converts back and forth between UnitCelland its linear index, where the linear index is guaranteed to preserve order based on the and the Smith Normal Form of the UnitCell.
By default, the constructed index converter will always accept UnitCell values that fall outside of the superlattice. When this happens, the given UnitCellCoord is brought into the superlattice using superlattice vector translations, and the index of the resulting UnitCell is returned.
Definition at line 131 of file LinearIndexConverter.hh.
Public Types | |
typedef UnitCellCoordIndexConverter::matrix_type | matrix_type |
Public Member Functions | |
UnitCellIndexConverter (const matrix_type &transformation_matrix) | |
UnitCell | bring_within (const UnitCell &ijk) const |
Bring the given UnitCell into the superlattice using lattice translations. More... | |
const UnitCell & | operator() (Index ix) const |
Given the linear index, retreive the corresponding UnitCell. More... | |
Index | operator() (const UnitCell &ijk) const |
void | always_bring_within () |
void | never_bring_within () |
Index | total_sites () const |
Returns the total number of sites within the superlattice. More... | |
Private Member Functions | |
UnitCellCoord | bring_within (const UnitCellCoord &bijk) const |
Index | operator() (const UnitCellCoord &bijk) const |
Index | total_sites () const |
Returns the total number of sites within the superlattice. More... | |
void | _throw_if_incompatible_index (Index ix) const |
Throws exception if the specified index is out of the allowed range. More... | |
void | _throw_if_incompatible_bijk (const UnitCellCoord &bijk) const |
Static Private Member Functions | |
static std::vector< UnitCellCoord > | _make_all_ordered_bijk_values (const impl::OrderedLatticePointGenerator &make_point, int basis_sites_in_prim) |
static void | _throw_if_bad_basis_sites_in_prim (int basis_sites_in_prim) |
Private Attributes | |
std::vector< UnitCellCoord > | m_linear_index_to_bijk |
Convert from linear index to UnitCellCoord. More... | |
std::unordered_map< UnitCellCoord, Index > | m_bijk_to_linear_index |
Convert from UnitCellCoord to linear index. More... | |
std::unordered_map< UnitCellCoord, Index > | m_bijk_to_linear_index_outside_of_superlattice |
int | m_basis_sites_in_prim |
bool | m_automatically_bring_bijk_within |
IntegralCoordinateWithin_f | m_bring_within_f |
Functor to bring UnitCellCoord values back into the superlattice. More... | |
Definition at line 133 of file LinearIndexConverter.hh.
|
inline |
Definition at line 134 of file LinearIndexConverter.hh.
|
staticprivateinherited |
Enumerates every possible UnitCellCoord and returns them in the expected order (blocks by basis site, with the Smith Normal Form order within each block
Definition at line 51 of file LinearIndexConverter.cc.
|
staticprivateinherited |
Throws exception if the number of sites specified in the tiling unit is less than 1
Definition at line 11 of file LinearIndexConverter.cc.
|
privateinherited |
Throws exception if the specified UnitCellCoord has a sublattice index that isn't compatible. If the state is set to not automatically bring the UnitCellCoord within the superlattice, then any UnitCellCoord outside the boundary will also trigger an exception
Definition at line 32 of file LinearIndexConverter.cc.
|
privateinherited |
Throws exception if the specified index is out of the allowed range.
Definition at line 22 of file LinearIndexConverter.cc.
void CASM::xtal::UnitCellCoordIndexConverter::always_bring_within |
Automatically bring UnitCellCoord values within the supercell when querying for the index (on by default)
Definition at line 59 of file LinearIndexConverter.cc.
Bring the given UnitCell into the superlattice using lattice translations.
Definition at line 142 of file LinearIndexConverter.hh.
|
inherited |
Bring the given UnitCellCoord into the superlattice using lattice translations
Definition at line 75 of file LinearIndexConverter.cc.
void CASM::xtal::UnitCellCoordIndexConverter::never_bring_within |
Prevent the index converter from bringing UnitCellCoord within the supercell when querying for the index
Definition at line 55 of file LinearIndexConverter.cc.
Given the UnitCell, retreive its corresponding linear index. If applicable, brings the UnitCell within the superlattice
Definition at line 154 of file LinearIndexConverter.hh.
|
inherited |
Given the UnitCellCoord, retreive its corresponding linear index. If applicable, brings the UnitCellCoord within the superlattice
Definition at line 88 of file LinearIndexConverter.cc.
Given the linear index, retreive the corresponding UnitCell.
Definition at line 148 of file LinearIndexConverter.hh.
|
inlineinherited |
Returns the total number of sites within the superlattice.
Definition at line 73 of file LinearIndexConverter.hh.
|
inline |
Returns the total number of sites within the superlattice.
Definition at line 73 of file LinearIndexConverter.hh.
|
privateinherited |
If set to true, UnitCellCoord values will be brought within the supercell before querying for the index
Definition at line 93 of file LinearIndexConverter.hh.
|
privateinherited |
How many blocks of "b", i.e. number of atoms in the primitive cell, as specified at construction
Definition at line 89 of file LinearIndexConverter.hh.
|
privateinherited |
Convert from UnitCellCoord to linear index.
Definition at line 80 of file LinearIndexConverter.hh.
|
mutableprivateinherited |
Stores a cache of UnitCellCoord values that landed outside of the superlattice
Definition at line 85 of file LinearIndexConverter.hh.
|
privateinherited |
Functor to bring UnitCellCoord values back into the superlattice.
Definition at line 96 of file LinearIndexConverter.hh.
|
privateinherited |
Convert from linear index to UnitCellCoord.
Definition at line 77 of file LinearIndexConverter.hh.