14 std::vector<std::string> splt_vec;
15 boost::split(splt_vec, args, boost::is_any_of(
","), boost::token_compress_on);
16 std::string tmetric_name =
"GL";
17 std::string index_expr;
19 if (splt_vec.size()) {
20 tmetric_name = splt_vec[0];
22 if (splt_vec.size() >= 2) {
23 index_expr = splt_vec[1];
25 if (splt_vec.size() == 3) {
28 if (splt_vec.size() > 3) {
30 ss <<
"Too many arguments for 'relaxation_strain'. Received: " << args
32 throw std::runtime_error(ss.str());
38 if (index_expr.size() > 0) {
52 for (
Index i = 0; i < 6; i++) _add_rule(std::vector<Index>({i}));
58 return _config.calc_properties(
m_calctype).global.count(
"Ustrain");
65 std::vector<std::string> col;
68 for (; it != end_it; ++it) {
69 std::stringstream t_ss;
72 col.push_back(t_ss.str());
86 _config.calc_properties(
m_calctype).global.at(
"Ustrain")));
92 std::vector<std::string> splt_vec;
93 boost::split(splt_vec, args, boost::is_any_of(
","), boost::token_compress_on);
94 std::string tmetric_name =
"GL";
95 std::string index_expr;
97 if (splt_vec.size()) {
98 tmetric_name = splt_vec[0];
100 if (splt_vec.size() == 2) {
101 index_expr = splt_vec[1];
103 if (splt_vec.size() > 2) {
104 std::stringstream ss;
105 ss <<
"Too many arguments for 'dof_strain'. Received: " << args <<
"\n";
106 throw std::runtime_error(ss.str());
112 if (index_expr.size() > 0) {
125 for (
Index i = 0; i < size; i++) _add_rule(std::vector<Index>({i}));
131 std::vector<std::string> col;
134 for (; it != end_it; ++it) {
135 std::stringstream t_ss;
137 col.push_back(t_ss.str());
151 std::stringstream msg;
152 msg <<
"Error in DoFStrain: Prim does not have strain DoF.";
153 throw std::runtime_error(msg.str());
GlobalContinuousConfigDoFValues const & global_dof(DoFKey const &_key) const
std::string m_metric_name
StrainConverter m_straincalc
std::vector< std::string > col_header(const Configuration &_config) const override
bool init(const Configuration &_tmplt) const override
notstd::cloneable_ptr< StrainConverter > m_prim_straincalc
Eigen::VectorXd evaluate(const Configuration &_config) const override
bool parse_args(const std::string &args) override
Default implementation calls _parse_index_expression.
std::string short_header(const Configuration &_config) const override
std::shared_ptr< Structure const > m_shared_prim
bool parse_args(const std::string &args) override
Default implementation calls _parse_index_expression.
std::string m_metric_name
std::string short_header(const Configuration &_config) const override
StrainConverter m_straincalc
bool validate(const Configuration &_config) const override
Eigen::VectorXd evaluate(const Configuration &_config) const override
std::vector< std::string > col_header(const Configuration &_config) const override
bool init(const Configuration &_tmplt) const override
const ConfigDoF & configdof() const
const Access the DoF
const Supercell & supercell() const
Get the Supercell for this Configuration.
Eigen::MatrixXd standard_values() const
Get global DoF values as standard DoF values.
Matrix3d rollup_E(Eigen::Ref< const VectorXd > const &_unrolled_E) const
VectorXd unrolled_strain_metric(Eigen::Ref< const Matrix3d > const &F) const
void set_mode(const std::string &mode_name)
std::shared_ptr< Structure const > const & shared_prim() const
bool has_strain_dof(BasicStructure const &structure)
DoFKey get_strain_dof_key(BasicStructure const &structure)
std::string get_strain_metric(DoFKey strain_dof_key)
INDEX_TYPE Index
For long integer indexing: