106 int scel_volume = scel.
volume();
113 for(
Index prim_basis_site = 0; prim_basis_site < prim_basis; prim_basis_site++) {
116 const auto &allowed = scel.
get_prim().
basis[prim_basis_site].allowed_occupants();
117 std::vector<std::string> site_allowed_occ(allowed.cbegin(), allowed.cend());
119 if(site_allowed_occ.size() > 1) {
122 std::vector<std::vector<int> > single_possible_swap;
125 std::vector<int> single_site_to_mol;
128 for(
int possible_curr_occ = 0; possible_curr_occ < site_allowed_occ.size(); possible_curr_occ++) {
130 std::vector<int> swaps;
133 for(
int other_curr_occ = 0; other_curr_occ < site_allowed_occ.size(); other_curr_occ++) {
134 if(possible_curr_occ != other_curr_occ) {
140 single_possible_swap.push_back(swaps);
143 int mol_ind =
std::find(allowed_components.cbegin(), allowed_components.cend(), site_allowed_occ[possible_curr_occ]) - allowed_components.cbegin();
146 if(mol_ind == allowed_components.size()) {
147 std::cerr <<
"ERROR in Monte::populate_occ_exchange_tables" << std::endl;
148 std::cerr <<
"The possible components are " << allowed_components << std::endl;
149 std::cerr <<
"Could not find " << allowed_components[possible_curr_occ] <<
" in the allowed components of the PrimClex prim." << std::endl;
154 single_site_to_mol.push_back(mol_ind);
166 for(
int variable_site = prim_basis_site * scel_volume; variable_site < prim_basis_site * scel_volume + scel_volume; variable_site++) {
173 m_sublat.push_back(prim_basis_site);
182 std::vector<int> single_site_to_mol;
185 std::string only_site_occ = scel.
get_prim().
basis[prim_basis_site].allowed_occupants()[0];
188 int mol_ind =
std::find(allowed_components.cbegin(), allowed_components.cend(), only_site_occ) - allowed_components.cbegin();
189 if(mol_ind == allowed_components.size()) {
190 std::cerr <<
"ERROR in Monte::populate_occ_exchange_tables" << std::endl;
191 std::cerr <<
"The possible components are " << allowed_components << std::endl;
192 std::cerr <<
"Could not find " << only_site_occ <<
" in the allowed components of the PrimClex prim." << std::endl;
197 std::vector<std::vector<int> > single_possible_swap;
201 single_site_to_mol.push_back(mol_ind);
SiteExchanger(const Supercell &scel)
Constructor determine possible swaps in the given Supercell.
std::vector< std::vector< std::vector< int > > > m_possible_swap
For a given sublattice with a particular occupant, show what OTHER occupants it could be m_possible_s...
void push_back(const T &toPush)
const Structure & get_prim() const
Represents a supercell of the primitive parent crystal structure.
PrimClex & get_primclex() const
std::vector< std::string > components() const
The order of components in mol composition vectors.
EigenIndex Index
For long integer indexing:
Index volume() const
Return number of primitive cells that fit inside of *this.
Array< CoordType > basis
Lattice vectors that specifies periodicity of the crystal.
std::vector< Index > m_variable_sites
std::vector of indices into occupation array of m_confdof that have more than one allowed occupant ...
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.
const CompositionConverter & composition_axes() const
const Access CompositionConverter object
std::vector< int > m_sublat
m_sublat[i] is the sublattice index for site m_variable_sites[i]
std::vector< std::vector< int > > m_sublat_to_mol
Map the integer values from the possible swaps or variable sites arrays into actual species m_sublat_...