20 void advance_past_corners(EigenCounter<Eigen::VectorXd> &counter,
22 while (counter.valid() &&
23 double(counter().transpose() * shape_factor * counter()) > 1.0 +
TOL) {
33 params.max_val, params.inc_val, params.dof,
34 params.auto_range, params.trim_corners) {}
38 std::vector<SymRepTools_v2::SubWedge>
const &wedges,
40 DoFKey const &strain_key,
bool auto_range,
bool trim_corners)
41 : m_strain_key(strain_key),
42 m_trim_corners(trim_corners),
43 m_current(initial_state.configuration()),
52 if (min_val.size() !=
m_wedges[0].trans_mat().cols() ||
53 min_val.size() != inc_val.size() || min_val.size() != max_val.size()) {
54 std::stringstream msg;
55 msg <<
"Error in ConfigEnumStrain: dimension mismatch";
56 throw std::runtime_error(msg.str());
61 for (
int d = 0; d < inc_val.size(); ++d) {
62 if (inc_val(d) == 0. || (max_val(d) - min_val(d)) / inc_val(d) > 1e4) {
63 std::stringstream msg;
64 msg <<
"Error in ConfigEnumStrain: Increment along dimension " << d + 1
65 <<
" is too small: " << inc_val(d);
66 throw std::runtime_error(msg.str());
75 for (
int i = 0; i < irrep_wedge.axes.cols(); ++i) {
76 if (irrep_wedge.mult[i] == 1) {
77 min_val(d) = -max_val(d);
89 int dim = min_val.size();
90 for (
int d = 0; d < dim; ++d) {
91 double mag =
max(abs(min_val(d)), abs(max_val(d)));
void set_global_dof(DoFKey const &_key, Eigen::Ref< const Eigen::VectorXd > const &_val)
Set global continuous DoF values.
static const std::string enumerator_name
Index subwedge_index() const
std::string name() const override
Derived enumerators must implement name, via ENUM_MEMBERS.
Eigen::VectorXd normal_coordinate() const
EigenCounter< Eigen::VectorXd > m_counter
Eigen::MatrixXd m_shape_factor
ConfigEnumStrain(ConfigEnumInput const &initial_state, ConfigEnumStrainParams const ¶ms)
void increment() override
Implements increment over all strain states.
std::vector< SymRepTools_v2::SubWedge > m_wedges
const ConfigDoF & configdof() const
const Access the DoF
A Counter allows looping over many incrementing variables in one loop.
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.
IdentitySymRepBuilder Identity()
void reset_properties(ConfigType &config)
INDEX_TYPE Index
For long integer indexing:
T max(const T &A, const T &B)