44 Eigen::Ref<const Eigen::VectorXi>
const &_occupation) {
46 std::stringstream msg;
47 msg <<
"Size mismatch in ConfigDoF::set_occupation(): "
49 <<
", received size=" << _occupation.size();
50 throw std::runtime_error(msg.str());
64 std::map<DoFKey, GlobalContinuousConfigDoFValues>
const &
70 DoFKey const &_key)
const {
73 throw std::runtime_error(
74 "Attempting to access uninitialized ConfigDoF value for '" + _key +
82 throw std::runtime_error(
83 "Attempting to access uninitialized ConfigDoF value for '" + _key +
100 Eigen::Ref<const Eigen::VectorXd>
const &_val) {
103 throw std::runtime_error(
104 "Attempting to assign global ConfigDoF values of type " + _key +
105 " but no such value type has been allocated.\n");
107 if (it->second.values().size() != _val.size()) {
108 std::stringstream msg;
109 msg <<
"Size mismatch in ConfigDoF::set_global_dof(): "
110 <<
"For key=\"" << _key
111 <<
"\", expected size=" << it->second.values().size()
112 <<
", received size=" << _val.size();
113 throw std::runtime_error(msg.str());
116 it->second.set_values(_val);
125 DoFKey const &_key)
const {
128 throw std::runtime_error(
129 "Attempting to access uninitialized ConfigDoF value for '" + _key +
137 throw std::runtime_error(
138 "Attempting to access uninitialized ConfigDoF value for '" + _key +
155 Eigen::Ref<const Eigen::MatrixXd>
const &_val) {
158 throw std::runtime_error(
159 "Attempting to assign local ConfigDoF values of type " + _key +
160 " but no such value type has been allocated.\n");
163 if (it->second.values().rows() != _val.rows() ||
164 it->second.values().cols() != _val.cols()) {
165 std::stringstream msg;
166 msg <<
"Size mismatch in ConfigDoF::set_local_dof(): "
167 <<
"For key=\"" << _key
168 <<
"\", expected rows=" << it->second.values().rows()
169 <<
", received rows=" << _val.rows()
170 <<
", expected cols=" << it->second.values().cols()
171 <<
", received cols=" << _val.cols();
172 throw std::runtime_error(msg.str());
175 it->second.set_values(_val);
185 dof.second.values());
206 tmp.
sublat(b).topRows(rows) =
208 dof.second.sublat(b).topRows(rows);
211 dof.second.site_value(l) = tmp.
site_value(tperm[l]);
222 dof.second.set_values(
224 dof.second.values());
247 dof.second.sublat(b);
Index size() const
Number of sites in the ConfigDoF.
std::map< DoFKey, LocalContinuousConfigDoFValues > const & local_dofs() const
void set_global_dof(DoFKey const &_key, Eigen::Ref< const Eigen::VectorXd > const &_val)
Set global continuous DoF values.
void swap(ConfigDoF &RHS)
Index n_vol() const
Integer volume of ConfigDoF.
std::map< DoFKey, GlobalContinuousConfigDoFValues > const & global_dofs() const
bool has_local_dof(DoFKey const &_key) const
LocalDiscreteConfigDoFValues m_occupation
bool has_occupation() const
Index n_sublat() const
Number of sublattices in ConfigDoF.
ConfigDoF & apply_sym_no_permute(SymOp const &_op)
void setZero()
Set all DoF values to zero.
void set_local_dof(DoFKey const &_key, Eigen::Ref< const Eigen::MatrixXd > const &_val)
Set local continuous DoF values.
bool has_global_dof(DoFKey const &_key) const
GlobalContinuousConfigDoFValues const & global_dof(DoFKey const &_key) const
Eigen::VectorXi const & occupation() const
Const reference occupation values.
ConfigDoF & apply_sym(PermuteIterator const &it)
double tol() const
Tolerance for comparison of continuous DoF values.
int & occ(Index i)
Reference occupation value on site i.
std::map< std::string, LocalContinuousConfigDoFValues > m_local_dofs
LocalContinuousConfigDoFValues const & local_dof(DoFKey const &_key) const
void set_occupation(Eigen::Ref< const Eigen::VectorXi > const &_occupation)
Set occupation values.
std::map< std::string, GlobalContinuousConfigDoFValues > m_global_dofs
void setZero()
Set DoF values to zero.
SiteReference site_value(Index l)
Access site DoF value vector.
SublatReference sublat(Index b)
Access matrix block of values for all sites on one sublattice.
void setZero()
Set DoF values to zero.
std::vector< SymGroupRepID > const & symrep_IDs() const
int & occ(Index i)
Reference occupation value on site i.
Eigen::VectorXi const & values() const
void set_values(Eigen::Ref< ValueType const > const &_values)
Set occupation values (values are indices into Site::occupant_dof())
void setZero()
Set occupation values to zero.
SupercellSymInfo const & sym_info() const
Reference the SupercellSymInfo containing the operations being pointed at.
SymOpRepresentation const & global_dof_rep(DoFKey const &_key) const
SymOpRepresentation const & local_dof_rep(DoFKey const &_key, Index b) const
SymOpRepresentation const & occ_rep(Index b) const
Permutation combined_permute() const
bool has_aniso_occs() const
true if any species are anisotropic, such that the occ_symreps are non-trivial
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
SymOpRepresentation const & representation(SymGroupRepID _rep_ID) const
virtual Permutation const * permutation() const
Permutation const * get_permutation_rep(SymGroupRepID _rep_ID) const
get pointer to permutation representation corresponding to _rep_ID
virtual Eigen::MatrixXd const * MatrixXd() const
SymPermutation describes how a symmetry operation permutes a list of 'things' For example,...
Permutation const * permutation() const override
Access the permutation array 'm_permute'.
void swap(ConfigDoF &A, ConfigDoF &B)
INDEX_TYPE Index
For long integer indexing: