12 int basis_sites_in_prim) {
13 if (basis_sites_in_prim < 1) {
14 throw std::runtime_error(
15 "UnitCellCoords require at least one basis site in the tiling unit, "
16 "but you specified " +
24 throw std::runtime_error(
"The specified index is out of range. There are " +
26 " available sites, but you specified index " +
35 throw std::runtime_error(
36 "The given UnitCellCoord has a sublattice index that exceeds the "
42 throw std::runtime_error(
43 "The given UnitCellCoord lands outside of the superlattice, and you "
44 "requested to not allow this");
50 std::vector<UnitCellCoord>
53 int basis_sites_in_prim) {
54 std::vector<UnitCellCoord> all_bijk_values;
55 auto total_lattice_points = make_point.
size();
57 for (
int b = 0; b < basis_sites_in_prim; ++b) {
58 for (
Index ijk_ix = 0; ijk_ix < total_lattice_points; ++ijk_ix) {
59 auto ijk = make_point(ijk_ix);
60 all_bijk_values.emplace_back(b, std::move(ijk));
64 return all_bijk_values;
80 this->m_bring_within_f(bijk.
unitcell()));
102 return found_it->second;
const UnitCell & unitcell() const
UnitCellCoord bring_within(const UnitCellCoord &bijk) const
int m_basis_sites_in_prim
std::vector< UnitCellCoord > m_linear_index_to_bijk
Convert from linear index to UnitCellCoord.
void never_bring_within()
void _throw_if_incompatible_index(Index ix) const
Throws exception if the specified index is out of the allowed range.
static void _throw_if_bad_basis_sites_in_prim(int basis_sites_in_prim)
void _throw_if_incompatible_bijk(const UnitCellCoord &bijk) const
void always_bring_within()
std::unordered_map< UnitCellCoord, Index > m_bijk_to_linear_index
Convert from UnitCellCoord to linear index.
std::unordered_map< UnitCellCoord, Index > m_bijk_to_linear_index_outside_of_superlattice
static std::vector< UnitCellCoord > _make_all_ordered_bijk_values(const impl::OrderedLatticePointGenerator &make_point, int basis_sites_in_prim)
Index total_sites() const
Returns the total number of sites within the superlattice.
const UnitCellCoord & operator()(Index ix) const
Given the linear index, retreive the corresponding UnitCellCoord.
bool m_automatically_bring_bijk_within
IntegralCoordinateWithin_f m_bring_within_f
Functor to bring UnitCellCoord values back into the superlattice.
long int size() const
Returns the total number of unique lattice points that can be generated.
std::string to_string(ENUM val)
Return string representation of enum class.
INDEX_TYPE Index
For long integer indexing: