12 std::unordered_set<std::string> _excluded_occupants)
15 m_excluded_occs(
std::move(_excluded_occupants)) {
16 if (components.empty()) {
22 throw std::runtime_error(
"Cannot construct DoFSet of type " +
type_name() +
23 ", number of rows in basis matrix is " +
28 throw std::runtime_error(
"Cannot construct DoFSet of type " +
type_name() +
29 ", number of columns in basis matrix is " +
31 " but number of variable names is " +
33 ". These numbers must be equal.");
36 for (std::string
const &
name : components)
53 Eigen::Ref<const Eigen::MatrixXd>
const &trans_mat) {
75 const std::vector<Index> &after_IDs) {
77 bool is_updated(
false);
83 if (ID_ind < after_IDs.size() && !
m_components[i].is_locked()) {
96 {SymGroupRepID(), Eigen::MatrixXd::Identity(_type.dim(), _type.dim())});
Specifies traits of (possibly) anisotropic crystal properties.
std::vector< std::string > const & standard_var_names() const
Return standard coordinate axes for continuous variable space.
bool global() const
Returns true if type is global.
void set_sequential_IDs()
std::vector< ContinuousDoF > m_components
ContinuousDoF components, one for each column in m_info->basis()
AnisoValTraits const & traits() const
Returns the AnisoValTraits object for the DoF type of this DoFSet.
static DoFSet make_default(AnisoValTraits const &_type)
void lock_IDs()
Locks IDs of components in this DoFSet so they can no longer be updated.
Index dim() const
Dimension of the DoFSet, equivalent to basis().cols()
bool update_IDs(const std::vector< Index > &before_IDs, const std::vector< Index > &after_IDs)
void transform_basis(Eigen::Ref< const Eigen::MatrixXd > const &trans_mat)
Equivalent to m_basis=trans_mat*m_basis. Invalidates SymGroupRepID.
DoFSet(AnisoValTraits const &_type, std::vector< std::string > components, DoFSetInfo _info, std::unordered_set< std::string > excluded_occupants={})
Eigen::MatrixXd const & basis() const
bool identical(DoFSet const &rhs) const
Returns true if "rhs" has identical components and basis to this DoFSet.
const_iterator end() const
Iterator pointing one past last ContinuousDoF component.
std::string const & type_name() const
const_iterator begin() const
Iterator pointing to the first ContinuousDoF component.
Type-safe ID object for communicating and accessing Symmetry representation info.
std::string to_string(ENUM val)
Return string representation of enum class.
IdentitySymRepBuilder Identity()
bool almost_equal(ClusterInvariants const &A, ClusterInvariants const &B, double tol)
Check if ClusterInvariants are equal.
Index find_index(Iterator begin, Iterator end, const T &value)
Equivalent to std::distance(begin, std::find(begin, end, value))
GenericDatumFormatter< std::string, DataObject > name()
bool compare_no_value(ContinuousDoF const &A, ContinuousDoF const &B)
INDEX_TYPE Index
For long integer indexing:
Eigen::MatrixXd set_basis(Eigen::Ref< const Eigen::MatrixXd > const &_basis)
void set_symrep_ID(SymGroupRepID _id)
Sets SymGroupRepID.
Eigen::MatrixXd const & basis() const