24 if (&it->supercell() != &(
sub_config().begin()->supercell())) {
25 throw std::runtime_error(
26 "Error constructing SuperConfigEnum: "
27 "Sub-Configurations with different Supercells");
34 notstd::make_cloneable<xtal::UnitCellIndexConverter>(
57 for (
int i = 0; i < total_sites; ++i) {
87 bool is_valid_config{
false};
121 auto const &dof_key = pair.first;
Basic std::vector like container (deprecated)
std::map< DoFKey, LocalContinuousConfigDoFValues > const & local_dofs() const
LocalContinuousConfigDoFValues const & local_dof(DoFKey const &_key) const
const ConfigDoF & configdof() const
const Access the DoF
const int & occ(Index site_l) const
Occupant variable on site l.
const Supercell & supercell() const
Get the Supercell for this Configuration.
void set_occ(Index site_l, int val)
Set occupant variable on site l.
A Counter allows looping over many incrementing variables in one loop.
SiteReference site_value(Index l)
Access site DoF value vector.
const Lattice & lattice() const
xtal::UnitCellIndexConverter & _unitcell_index_converter()
Access the UnitCellIndexConverter.
Supercell const & _sub_supercell() const
Access the sub-config supercell.
Array< int > const & counter() const
Access the current value of the counter.
Counter< Array< int > > m_counter
void increment() override
Implement increment.
Supercell const & _target_supercell()
Access the super-config supercell.
std::string name() const override
Derived enumerators must implement name, via ENUM_MEMBERS.
notstd::cloneable_ptr< xtal::UnitCellIndexConverter > m_unitcell_index_converter
std::vector< Configuration > & _sub_config()
Access the sub-configurations.
void _fill(Array< int > const &counter_val, Configuration &config)
Supercell const * m_sub_scel
notstd::cloneable_ptr< Configuration > m_current
The 'current' Configuration.
bool _check_current() const
Returns true if current() satisifies requested conditions.
std::vector< std::vector< Index > > m_index_map
m_current->occ(m_index_map[i][j]) = m_sub_scel[i].occ(j)
void _init()
Used by constructor.
std::vector< Configuration > const & sub_config() const
Access the sub-configurations.
std::vector< Configuration > m_sub_config
A vector containing each possible sub_config.
static const std::string enumerator_name
Index linear_index(const Coordinate &coord, double tol=TOL) const
Given a Coordinate and tolerance, return linear index into Configuration.
UnitCellCoord uccoord(Index linear_index) const
Return the integral coordinates corresponding to a linear index.
Eigen::Matrix3l transf_mat() const
const Structure & prim() const
bool valid() const
Returns false if enumeration is complete.
virtual jsonParser source(step_type step) const
void _invalidate()
Call if enumeration complete.
void _increment_step()
Increment current step value.
step_type step() const
Increments with each enumerated object.
void _set_step(step_type val)
Set current step value.
Index total_sites() const
Returns the total number of sites within the superlattice.
GenericVectorXdScelFormatter lattice()
Eigen::Matrix3l make_transformation_matrix_to_super(const Lattice &tiling_unit, const Lattice &superlattice, double tol)
ConfigDoF make_configdof(Structure const &prim, Index volume)
Construct zero-valued ConfigDoF.
INDEX_TYPE Index
For long integer indexing: