CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ConfigEnumSiteDoFs.hh
Go to the documentation of this file.
1 #ifndef CASM_ConfigEnumSiteDoFs
2 #define CASM_ConfigEnumSiteDoFs
3 
7 
8 namespace CASM {
9 
10 class ConfigEnumInput;
11 
22 
62 
63  // The following specify min / increment / max amplitude of normal modes
64  // (columns of axes) applied to the initial enumeration state
65 
72 
79 
86 
87  // Even if "axes" are rank deficient, the site DoF space defined by axes may
88  // quickly become very high dimensional (number of sites x mean site DoF
89  // dimension), so rather than sample the entire space, ConfigEnumSiteDoFs
90  // perturbs the input configuration by applying a linear combination of normal
91  // modes (collective excitations represented by columns of axes).
92 
93  // The parameters "min_nonzero" and "max_nonzero" specifies how many normal
94  // mode amplitudes should be nonzero (inclusive range [min_nonzero,
95  // max_nonzero]). The method generates all n choose k (n=site DoF space
96  // dimension, k iterates through [min_nonzer, max_nonzero]) combinations of
97  // normal modes in that range, and for each combination applies all the k
98  // chosen normal modes with amplitudes specified by "min" / "increment" /
99  // "max". Note that this may quickly become very large, depending on n, k, and
100  // the range specified by "min" / "increment" / "max".;
101 
105 
109 };
110 
115 class ConfigEnumSiteDoFs : public InputEnumeratorBase<Configuration> {
116  // -- Required members -------------------
117 
118  public:
120  ConfigEnumSiteDoFs(ConfigEnumInput const &_in_config,
121  ConfigEnumSiteDoFsParams const &params);
122 
124  ConfigEnumSiteDoFs(ConfigEnumInput const &_init, DoFKey const &_dof,
125  Eigen::Ref<const Eigen::MatrixXd> const &_axes,
126  Eigen::Ref<const Eigen::VectorXd> const &min_val,
127  Eigen::Ref<const Eigen::VectorXd> const &max_val,
128  Eigen::Ref<const Eigen::VectorXd> const &inc_val,
129  Index _min_nonzero, Index _max_nonzero);
130 
131  std::string name() const override;
132 
133  static const std::string enumerator_name;
134 
136  void increment() override;
137 
138  private:
139  void _set_dof();
140 
141  bool _increment_combo();
142 
143  bool _check_sparsity() const;
144 
145  bool _check_current() const;
146 
147  // -- Unique -------------------
149 
151 
153 
155 
157 
159 
161 
163 
165 
167 
168  std::vector<Index> m_sites;
169 
170  std::vector<Index> m_dof_dims;
171 
173 
175 
176  std::vector<Index> m_combo;
177 
179 };
180 
181 } // namespace CASM
182 
183 #endif
notstd::cloneable_ptr< Configuration > m_current
static const std::string enumerator_name
void increment() override
Implements increment over all strain states.
ConfigEnumSiteDoFs(ConfigEnumInput const &_in_config, ConfigEnumSiteDoFsParams const &params)
See ConfigEnumSiteDoFsParams for method and parameter details.
std::vector< Index > m_dof_dims
std::vector< Index > m_sites
LocalContinuousConfigDoFValues * m_dof_vals
std::string name() const override
Derived enumerators must implement name, via ENUM_MEMBERS.
EigenCounter< Eigen::VectorXd > m_counter
std::vector< Index > m_combo
bool _check_current() const
Returns true if current() is primitive and canonical.
A Counter allows looping over many incrementing variables in one loop.
Definition: Counter.hh:109
Base class for implementing specialized input enumerators.
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd
std::string DoFKey
Definition: DoFDecl.hh:7
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Eigen::VectorXd VectorXd