CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
ConfigIO.cc
Go to the documentation of this file.
1 #include "casm/clex/ConfigIO.hh"
2 
3 #include <functional>
5 #include "casm/clex/PrimClex.hh"
6 #include "casm/clex/Norm.hh"
12 
13 namespace CASM {
14 
15  namespace ConfigIO_impl {
16 
18  bool MolDependent::parse_args(const std::string &args) {
19  if(args.size() > 0)
20  m_mol_names.push_back(args);
21  return true;
22  }
23 
25  void MolDependent::init(const Configuration &_tmplt) const {
26  auto struc_molecule = _tmplt.get_primclex().get_prim().get_struc_molecule();
27 
28  if(m_mol_names.size() == 0) {
29  for(Index i = 0; i < struc_molecule.size(); i++) {
30  _add_rule(std::vector<Index>({i}));
31  m_mol_names.push_back(struc_molecule[i].name);
32  }
33  }
34  else {
35  for(Index n = 0; n < m_mol_names.size(); n++) {
36  Index i = 0;
37  for(i = 0; i < struc_molecule.size(); i++) {
38  if(struc_molecule[i].name == m_mol_names[n]) {
39  _add_rule(std::vector<Index>({i}));
40  break;
41  }
42  }
43  if(i == struc_molecule.size())
44  throw std::runtime_error(std::string("Format tag: '") + name() + "(" +
45  m_mol_names[n] + ")' does not correspond to a viable composition.\n");
46  }
47  }
48  }
49 
51  std::vector<std::string> MolDependent::col_header(const Configuration &_tmplt) const {
52  std::vector<std::string> col;
53  for(Index c = 0; c < m_mol_names.size(); c++) {
54  col.push_back(name() + "(" + m_mol_names[c] + ")");
55  }
56  return col;
57  }
58  }
59 
60  namespace ConfigIO {
61 
62  // --- Comp implementations -----------
63 
64  const std::string Comp::Name = "comp";
65 
66  const std::string Comp::Desc =
67  "Parametric composition parameters, individual label as argument. "
68  "Without argument, all values are printed. Ex: comp(a), comp(b), etc.";
69 
72  return comp(config);
73  }
74 
76  bool Comp::validate(const Configuration &config) const {
77  return config.get_primclex().has_composition_axes();
78  }
79 
81  bool Comp::parse_args(const std::string &args) {
82  if(args.size() == 1) {
83  _add_rule(std::vector<Index>({(Index)(args[0] - 'a')}));
84  }
85  else if(args.size() > 1) {
86  throw std::runtime_error(std::string("Format tag: 'comp(") + args + ") is invalid.\n");
87  return false;
88  }
89  return true;
90  }
91 
93  std::vector<std::string> Comp::col_header(const Configuration &_tmplt) const {
94  std::vector<std::string> col;
95  for(Index c = 0; c < _index_rules().size(); c++) {
96  col.push_back(name() + "(" + (char)('a' + _index_rules()[c][0]) + ")");
97  }
98  return col;
99  }
100 
101 
102  // --- CompN implementations -----------
103 
104  const std::string CompN::Name = "comp_n";
105 
106  const std::string CompN::Desc =
107  "Number of each species per unit cell, including vacancies. "
108  "No argument prints all available values. Ex: comp_n, comp_n(Au), comp_n(Pt), etc.";
109 
112  return comp_n(config);
113  }
114 
115 
116  // --- SiteFrac implementations -----------
117 
118  const std::string SiteFrac::Name = "site_frac";
119 
120  const std::string SiteFrac::Desc =
121  "Fraction of sites occupied by a species, including vacancies. "
122  "No argument prints all available values. Ex: site_frac(Au), site_frac(Pt), etc.";
123 
126  return site_frac(config);
127  }
128 
129 
130  // --- AtomFrac implementations -----------
131 
132  const std::string AtomFrac::Name = "atom_frac";
133 
134  const std::string AtomFrac::Desc =
135  "Fraction of atoms that are a particular species, excluding vacancies. "
136  "Without argument, all values are printed. Ex: atom_frac(Au), atom_frac(Pt), etc.";
137 
140  return species_frac(config);
141  }
142 
143  // --- MagBase implementations ---
144 
145  const std::string MagBase::Name = "relaxed_mag";
146 
147  const std::string MagBase::Desc =
148  "Relaxed magnetic moment on each basis site. " ;
149 
151  bool MagBase::validate(const Configuration &config) const {
152  return config.calc_properties().contains("relaxed_mag");
153  }
154 
157  return relaxed_mag(config);
158  }
159 
160  // --- Corr implementations -----------
161 
162  const std::string Corr::Name = "corr";
163 
164  const std::string Corr::Desc =
165  "Correlation values (evaluated basis functions, normalized per primitive cell). "
166  "If no arguements, prints all correlations, using the basis set for the default "
167  "cluster expansion as listed by 'casm settings -l'. "
168  "If one argument, accepts either: "
169  "1) a cluster expansion name, for example 'corr(formation_energy)', and "
170  "evaluates all basis functions, or "
171  "2) an integer index or range of indices of basis functions to evaluate, "
172  "for example 'corr(6)', or 'corr(0:6)'. "
173  "If two arguments, accepts cluster expansion name and an integer index or "
174  "range of basis functions to evaluate, for example 'corr(formation_energy,6)' "
175  "or 'corr(formation_energy,0:6)'.";
176 
179  return correlations(config, m_clexulator);
180  }
181 
183  void Corr::init(const Configuration &_tmplt) const {
184  if(!m_clexulator.initialized()) {
185  const PrimClex &primclex = _tmplt.get_primclex();
186  ClexDescription desc = m_clex_name.empty() ?
187  primclex.settings().default_clex() : primclex.settings().clex(m_clex_name);
188  m_clexulator = primclex.clexulator(desc);
189  }
190 
192 
193  }
194 
197  bool Corr::parse_args(const std::string &args) {
198  std::vector<std::string> splt_vec;
199  boost::split(splt_vec, args, boost::is_any_of(","), boost::token_compress_on);
200 
201  if(!splt_vec.size()) {
202  return true;
203  }
204  else if(splt_vec.size() == 1) {
205  if((splt_vec[0].find_first_not_of("0123456789") == std::string::npos) ||
206  (splt_vec[0].find(':') != std::string::npos)) {
207  _parse_index_expression(splt_vec[0]);
208  }
209  else {
210  m_clex_name = splt_vec[0];
211  }
212  }
213  else if(splt_vec.size() == 2) {
214  m_clex_name = splt_vec[0];
215  _parse_index_expression(splt_vec[1]);
216  }
217  else {
218  std::stringstream ss;
219  ss << "Too many arguments for 'clex'. Received: " << args << "\n";
220  throw std::runtime_error(ss.str());
221  }
222  return true;
223  }
224 
225  // --- Clex implementations -----------
226 
227  const std::string Clex::Name = "clex";
228 
229  const std::string Clex::Desc =
230  "Predicted property value."
231  " Accepts arguments ($clex_name,$norm)."
232  " ($clex_name is a cluster expansion name as listed by 'casm settings -l', default=the default clex)"
233  " ($norm is the normalization, either 'per_species', or 'per_unitcell' <--default)";
234 
237  parse_args("");
238  }
239 
240  Clex::Clex(const Clexulator &clexulator, const ECIContainer &eci, const Norm<Configuration> &norm) :
241  ScalarAttribute<Configuration>(Name, Desc),
242  m_clexulator(clexulator),
243  m_eci(eci),
244  m_norm(norm) {
245  }
246 
248  double Clex::evaluate(const Configuration &config) const {
249  return m_eci * correlations(config, m_clexulator) / _norm(config);
250  }
251 
253  std::unique_ptr<Clex> Clex::clone() const {
254  return std::unique_ptr<Clex>(this->_clone());
255  }
256 
258  void Clex::init(const Configuration &_tmplt) const {
259  if(!m_clexulator.initialized()) {
260  const PrimClex &primclex = _tmplt.get_primclex();
261  ClexDescription desc = m_clex_name.empty() ?
262  primclex.settings().default_clex() : primclex.settings().clex(m_clex_name);
263  m_clexulator = primclex.clexulator(desc);
264  m_eci = primclex.eci(desc);
265  if(m_eci.index().back() >= m_clexulator.corr_size()) {
267  err_log.error<Log::standard>("bset and eci mismatch");
268  err_log << "basis set size: " << m_clexulator.corr_size() << std::endl;
269  err_log << "max eci index: " << m_eci.index().back() << std::endl;
270  throw std::runtime_error("Error: bset and eci mismatch");
271  }
272  }
273  }
274 
276  bool Clex::parse_args(const std::string &args) {
277  std::vector<std::string> splt_vec;
278  boost::split(splt_vec, args, boost::is_any_of(","), boost::token_compress_on);
279 
280  m_clex_name = "";
281  if(splt_vec.size()) {
282  m_clex_name = splt_vec[0];
283  }
284 
285  m_norm = notstd::make_cloneable<Norm<Configuration> >();
286  if(splt_vec.size() == 2) {
287  if(splt_vec[1] == "per_unitcell") {
288  m_norm = notstd::make_cloneable<Norm<Configuration> >();
289  }
290  else if(splt_vec[1] == "per_species") {
291  m_norm = notstd::make_cloneable<NormPerSpecies>();
292  }
293  else {
294  std::stringstream ss;
295  ss << "Error parsing second argument for 'clex'. Received: " << args << "\n";
296  throw std::runtime_error(ss.str());
297  }
298  }
299 
300  if(splt_vec.size() > 2) {
301  std::stringstream ss;
302  ss << "Too many arguments for 'clex'. Received: " << args << "\n";
303  throw std::runtime_error(ss.str());
304  }
305 
306  return true;
307  }
308 
310  double Clex::_norm(const Configuration &config) const {
311  return (*m_norm)(config);
312  }
313 
315  Clex *Clex::_clone() const {
316  return new Clex(*this);
317  }
318 
319 
320  /*End ConfigIO*/
321  }
322 
323  namespace ConfigIO {
324 
325  template<>
327  return Selected(_selection);
328  }
329 
330  template<>
332  return Selected(_selection);
333  }
334 
336  return Selected();
337  }
338 
339 
341  return GenericConfigFormatter<std::string>("configname",
342  "Configuration name, in the form 'SCEL#_#_#_#_#_#_#/#'",
343  [](const Configuration & config)->std::string {
344  return config.name();
345  });
346  }
347 
349  return GenericConfigFormatter<std::string>("scelname",
350  "Supercell name, in the form 'SCEL#_#_#_#_#_#_#'",
351  [](const Configuration & config)->std::string {
352  return config.get_supercell().get_name();
353  });
354  }
355 
356 
357 
359  return GenericConfigFormatter<std::string>("calc_status",
360  "Status of calculation.",
363  }
364 
366  return GenericConfigFormatter<std::string>("failure_type",
367  "Reason for calculation failure.",
370  }
371 
372 
374  return GenericConfigFormatter<Index>("scel_size",
375  "Supercell volume, given as the integer number of unit cells",
376  [](const Configuration & config)->Index {
377  return config.get_supercell().volume();
378  });
379  }
380 
382  return GenericConfigFormatter<Index>("multiplicity",
383  "Symmetric multiplicity of the configuration, excluding translational equivalents.",
384  [](const Configuration & config)->Index {
385  return config.get_prim().factor_group().size() / config.factor_group().size();
386  });
387  }
388 
390  return GenericConfigFormatter<std::string>("pointgroup_name",
391  "Name of the configuration's point group.",
392  [](const Configuration & config)->std::string{
393  return config.point_group().get_name();
394  });
395  }
396 
397  /*
398  GenericConfigFormatter<bool> selected() {
399  return GenericConfigFormatter<bool>("selected",
400  "Specifies whether configuration is selected (1/true) or not (0/false)",
401  [](const Configuration & config)->bool{
402  return config.selected();
403  });
404  }
405  */
406 
409  "relaxed_energy",
410  "DFT relaxed energy, normalized per primitive cell",
413  }
414 
417  "relaxed_energy_per_atom",
418  "DFT relaxed energy, normalized per atom",
421  }
422 
425  "reference_energy",
426  "reference energy, normalized per primitive cell, as determined by current reference states",
429  }
430 
433  "reference_energy_per_atom",
434  "reference energy, normalized per atom, as determined by current reference states",
437  }
438 
441  "formation_energy",
442  "DFT formation energy, normalized per primitive cell and measured "
443  "relative to current reference states",
446  }
447 
450  "formation_energy_per_atom",
451  "DFT formation energy, normalized per atom and measured relative to "
452  "current reference states",
455  }
456 
457  /*Generic1DDatumFormatter<std::vector<double>, Configuration >relaxation_strain() {
458  return Generic1DDatumFormatter<std::vector<double>, Configuration >("relaxation_strain",
459  "Green-Lagrange strain of dft-relaxed configuration, relative to the ideal crystal. Ordered as [E(0,0), E(1,1), E(2,2), E(1,2), E(0,2), E(0,1)]. Accepts index as argument on interval [0,5]",
460  CASM::relaxation_strain,
461  has_relaxation_strain,
462  [](const std::vector<double> &cont)->Index{
463  return 6;
464  });
465  }*/
466 
468  return GenericConfigFormatter<bool>("is_calculated",
469  "True (1) if all current properties have been been calculated for the configuration",
471  }
472 
474  return GenericConfigFormatter<bool>("is_primitive",
475  "True (1) if the configuration cannot be described within a smaller supercell",
477  }
478 
480  return GenericConfigFormatter<bool>("is_canonical",
481  "True (1) if the configuration cannot be transfromed by symmetry to a configuration with higher lexicographic order",
483  }
484 
486  return GenericConfigFormatter<double>("rms_force",
487  "Root-mean-square forces of relaxed configurations, determined from DFT (eV/Angstr.)",
489  has_rms_force);
490  }
491 
493  return GenericConfigFormatter<double>("basis_deformation",
494  "Cost function that describes the degree to which basis sites have relaxed",
497  }
498 
500  return GenericConfigFormatter<double>("lattice_deformation",
501  "Cost function that describes the degree to which lattice has relaxed.",
504  }
505 
507  return GenericConfigFormatter<double>("volume_relaxation",
508  "Change in volume due to relaxation, expressed as the ratio V/V_0.",
511  }
512 
514  return GenericConfigFormatter<double>("relaxed_magmom",
515  "Relaxed magnetic moment, normalized per primative cell.",
518  }
519 
521  return GenericConfigFormatter<double>("relaxed_magmom_per_atom",
522  "Relaxed magnetic moment, normalized per atom.",
525  }
526 
527 
528 
529  /*End ConfigIO*/
530  }
531 
532  template<>
534 
535  using namespace ConfigIO;
537 
538  dict.insert(
539  configname(),
540  scelname(),
541  calc_status(),
542  failure_type(),
544  );
545 
546  return dict;
547  }
548 
549  template<>
551 
552  using namespace ConfigIO;
554 
555  dict.insert(
556  is_calculated(),
557  is_canonical(),
558  is_primitive(),
559  //selected(),
560  selected_in(),
561  OnClexHull(),
562  OnHull()
563  );
564 
565  return dict;
566  }
567 
568  template<>
570 
571  using namespace ConfigIO;
573 
574  dict.insert(
575  scel_size(),
576  multiplicity()
577  );
578 
579  return dict;
580  }
581 
582  template<>
584 
585  using namespace ConfigIO;
587 
588  dict.insert(
589  Clex(),
590  HullDist(),
591  ClexHullDist(),
592  Novelty(),
593  relaxed_energy(),
599  rms_force(),
603  relaxed_magmom(),
605  );
606 
607  return dict;
608  }
609 
610  template<>
612 
613  using namespace ConfigIO;
615 
616  dict.insert(
617  AtomFrac(),
618  Comp(),
619  CompN(),
620  Corr(),
621  RelaxationStrain(),
622  DoFStrain(),
623  SiteFrac(),
624  StrucScore(),
625  MagBase()
626  );
627 
628  return dict;
629  }
630 
631 }
632 
bool parse_args(const std::string &args) override
Expects arguments of the form 'name' or 'name(Au)', 'name(Pt)', etc.
Definition: ConfigIO.cc:18
Clexulator clexulator(const ClexDescription &key) const
Definition: PrimClex.cc:1030
pair_type eci
Definition: settings.cc:112
ClexDescription & desc
Definition: settings.cc:104
void init(const Configuration &_tmplt) const override
Adds index rules corresponding to the parsed args.
Definition: ConfigIO.cc:25
Eigen::VectorXd evaluate(const Configuration &config) const override
Returns the mag sites.
Definition: ConfigIO.cc:156
Specifies a particular cluster expansion.
const std::string & name() const
Returns a name for the formatter, which becomes the tag used for parsing.
double rms_force(const Configuration &_config)
Root-mean-square forces of relaxed configurations, determined from DFT (eV/Angstr.)
std::string m_clex_name
Definition: ConfigIO.hh:382
static const std::string Name
Definition: ConfigIO.hh:206
ConfigIO::GenericConfigFormatter< std::string > failure_type()
Definition: ConfigIO.cc:365
Eigen::VectorXd evaluate(const Configuration &config) const override
Returns the parametric composition.
Definition: ConfigIO.cc:111
void init(const Configuration &_tmplt) const override
If not yet initialized, use the global clexulator and eci from the PrimClex.
Definition: ConfigIO.cc:258
std::vector< std::string > col_header(const Configuration &_tmplt) const override
col_header returns: {'comp(a)', 'comp(b)', ...'}
Definition: ConfigIO.cc:93
Eigen::VectorXd relaxed_mag(const Configuration &_config)
Returns the relaxed magnetic moment for each molecule.
static const std::string Desc
Definition: ConfigIO.hh:287
static const std::string Desc
Definition: ConfigIO.hh:247
PrimClex & get_primclex() const
Get the PrimClex for this Configuration.
notstd::cloneable_ptr< Norm< Configuration > > m_norm
Definition: ConfigIO.hh:385
double relaxed_magmom(const Configuration &_config)
Returns the relaxed magnetic moment, normalized per unit cell.
static const std::string Desc
Definition: ConfigIO.hh:133
ConfigIO::Selected selected_in(const ConfigSelection< IsConst > &_selection)
bool has_basis_deformation(const Configuration &_config)
bool has_formation_energy(const Configuration &_config)
PrimClex * primclex
Definition: settings.cc:101
ConfigIO::GenericConfigFormatter< std::string > calc_status()
Definition: ConfigIO.cc:358
std::vector< Molecule > get_struc_molecule() const
Returns an Array of each possible Molecule in this Structure.
Definition: Structure.cc:146
ConfigIO::GenericConfigFormatter< double > relaxed_energy()
Definition: ConfigIO.cc:407
ConfigIO::GenericConfigFormatter< double > relaxed_magmom()
Definition: ConfigIO.cc:513
IntegerAttributeDictionary< Configuration > make_integer_dictionary< Configuration >()
Definition: ConfigIO.cc:569
bool has_composition_axes() const
check if CompositionConverter object initialized
Definition: PrimClex.cc:231
bool has_lattice_deformation(const Configuration &_config)
static const std::string Desc
Definition: ConfigIO.hh:86
Correlation correlations(const ConfigDoF &configdof, const Supercell &scel, Clexulator &clexulator)
Returns correlations using 'clexulator'. Supercell needs a correctly populated neighbor list...
Definition: ConfigDoF.cc:200
bool has_relaxed_energy(const Configuration &_config)
void _add_rule(const std::vector< Index > &new_rule) const
bool initialized() const
Is runtime library loaded?
Definition: Clexulator.hh:355
size_type corr_size() const
Number of correlations.
Definition: Clexulator.hh:370
ECIContainer m_eci
Definition: ConfigIO.hh:384
Main CASM namespace.
Definition: complete.cpp:8
bool parse_args(const std::string &args) override
Expects 'clex', 'clex(formation_energy)', or 'clex(formation_energy_per_species)'.
Definition: ConfigIO.cc:276
Base class for creating scalar DatumFormatter.
Eigen::VectorXd comp(const Configuration &config)
Returns parametric composition, as calculated using PrimClex::param_comp.
void _parse_index_expression(const std::string &_expr)
std::pair< iterator, bool > insert(const value_type &value)
Insert single value.
Definition: unique_map.hh:169
static const std::string Desc
Definition: ConfigIO.hh:340
double relaxed_energy_per_species(const Configuration &config)
Returns the relaxed energy, normalized per species.
Eigen::VectorXd comp_n(const ConfigDoF &configdof, const Supercell &scel)
Returns comp_n, the number of each molecule per primitive cell, ordered as Structure::get_struc_molec...
Definition: ConfigDoF.cc:312
ConfigIO::GenericConfigFormatter< double > lattice_deformation()
Definition: ConfigIO.cc:499
double formation_energy(const Configuration &config)
Returns the formation energy, normalized per unit cell.
const ClexDescription & clex(std::string name) const
const Properties & calc_properties() const
ConfigIO::GenericConfigFormatter< double > rms_force()
Definition: ConfigIO.cc:485
ConfigIO::GenericConfigFormatter< double > relaxed_magmom_per_species()
Definition: ConfigIO.cc:520
Eigen::VectorXd evaluate(const Configuration &config) const override
Returns the atom fraction.
Definition: ConfigIO.cc:139
ConfigIO::GenericConfigFormatter< double > reference_energy()
Definition: ConfigIO.cc:423
static const int standard
Definition: Log.hh:15
double evaluate(const Configuration &config) const override
Returns the atom fraction.
Definition: ConfigIO.cc:248
std::string failure_type(const Configuration &_config)
double _norm(const Configuration &config) const
Returns the normalization.
Definition: ConfigIO.cc:310
void init(const Configuration &_tmplt) const override
If not yet initialized, use the global clexulator from the PrimClex.
Definition: ConfigIO.cc:183
ConfigIO::GenericConfigFormatter< bool > is_primitive()
Definition: ConfigIO.cc:473
T norm(const Tensor< T > &ttens)
Definition: Tensor.hh:968
EigenIndex Index
For long integer indexing:
Evaluates correlations.
Definition: Clexulator.hh:240
static const std::string Name
Definition: ConfigIO.hh:131
bool has_rms_force(const Configuration &_config)
GenericConfigFormatter< std::string > pointgroup_name()
Definition: ConfigIO.cc:389
static const std::string Desc
Definition: ConfigIO.hh:208
bool parse_args(const std::string &args) override
Expects arguments of the form 'comp' or 'comp(a)', 'comp(b)', etc.
Definition: ConfigIO.cc:81
StringAttributeDictionary< Configuration > make_string_dictionary< Configuration >()
Definition: ConfigIO.cc:533
Clexulator m_clexulator
Definition: ConfigIO.hh:383
bool is_canonical(const Configuration &_config)
returns true if _config no symmetry transformation applied to _config will increase its lexicographic...
double volume_relaxation(const Configuration &_config)
Change in volume due to relaxation, expressed as the ratio V/V_0.
bool is_calculated(const Configuration &config)
Return true if all current properties have been been calculated for the configuration.
Eigen::VectorXd evaluate(const Configuration &config) const override
Returns the site fraction.
Definition: ConfigIO.cc:125
ProjectSettings & settings()
Definition: PrimClex.hh:116
Eigen::VectorXd VectorXd
const std::vector< size_type > & index() const
const Access orbit indices of ECI values
Definition: ECIContainer.hh:49
BooleanAttributeDictionary< Configuration > make_boolean_dictionary< Configuration >()
Definition: ConfigIO.cc:550
ConfigIO::GenericConfigFormatter< double > volume_relaxation()
Definition: ConfigIO.cc:506
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:52
ConfigIO::GenericConfigFormatter< double > formation_energy()
Definition: ConfigIO.cc:439
std::vector< std::string > col_header(const Configuration &_tmplt) const override
col_header returns: {'name(Au)', 'name(Pt)', ...}
Definition: ConfigIO.cc:51
double relaxed_magmom_per_species(const Configuration &_config)
Returns the relaxed magnetic moment, normalized per species.
std::vector< std::string > m_mol_names
Definition: ConfigIO.hh:58
ConfigIO::GenericConfigFormatter< bool > is_calculated()
Definition: ConfigIO.cc:467
ScalarAttributeDictionary< Configuration > make_scalar_dictionary< Configuration >()
Definition: ConfigIO.cc:583
ConfigIO::GenericConfigFormatter< std::string > configname()
Constructs DataFormmaterDictionary containing all Configuration DatumFormatters.
Definition: ConfigIO.cc:340
static const std::string Name
Definition: ConfigIO.hh:169
Returns predicted formation energy.
Definition: ConfigIO.hh:334
Eigen::VectorXd site_frac(const Configuration &config)
Returns the composition as site fraction, in the order of Structure::get_struc_molecule.
static const std::string Name
Definition: ConfigIO.hh:84
double formation_energy_per_species(const Configuration &config)
Returns the formation energy, normalized per species.
double lattice_deformation(const Configuration &_config)
Cost function that describes the degree to which lattice has relaxed.
bool validate(const Configuration &config) const override
Returns true if the Configuration has relaxed_mag.
Definition: ConfigIO.cc:151
bool validate(const Configuration &config) const override
Returns true if the PrimClex has composition axes.
Definition: ConfigIO.cc:76
static const std::string Name
Definition: ConfigIO.hh:285
bool has_failure_type(const Configuration &_config)
ConfigIO::GenericConfigFormatter< double > basis_deformation()
Definition: ConfigIO.cc:492
ConfigIO::GenericConfigFormatter< double > reference_energy_per_species()
Definition: ConfigIO.cc:431
bool contains(const std::string &name) const
Return true if JSON object contains 'name'.
Definition: jsonParser.cc:500
const IndexContainer & _index_rules() const
bool has_volume_relaxation(const Configuration &_config)
static const std::string Name
Definition: ConfigIO.hh:338
double relaxed_energy(const Configuration &config)
Returns the relaxed energy, normalized per unit cell.
double basis_deformation(const Configuration &_config)
Cost function that describes the degree to which basis sites have relaxed.
virtual void init(const DataObject &_template_obj) const override
Default initialization adds rules for each element.
static const std::string Name
Definition: ConfigIO.hh:245
double reference_energy(const Configuration &config)
Returns the reference energy, normalized per unit cell.
Log & err_log
Definition: settings.cc:106
Log & default_err_log()
Definition: Log.hh:206
void error(const std::string &what)
Definition: Log.hh:86
bool has_relaxed_magmom(const Configuration &_config)
double reference_energy_per_species(const Configuration &config)
Returns the reference energy, normalized per species.
std::unique_ptr< Clex > clone() const
Clone using copy constructor.
Definition: ConfigIO.cc:253
std::string calc_status(const Configuration &_config)
Status of calculation.
Definition: Log.hh:9
Clex * _clone() const override
Clone using copy constructor.
Definition: ConfigIO.cc:315
ConfigIO::GenericConfigFormatter< Index > scel_size()
Definition: ConfigIO.cc:373
A DatumFormatter that returns a value of specified type, via functions that may be specified at runti...
ConfigIO::GenericConfigFormatter< std::string > scelname()
Definition: ConfigIO.cc:348
static const std::string Desc
Definition: ConfigIO.hh:171
ConfigIO::GenericConfigFormatter< Index > multiplicity()
Definition: ConfigIO.cc:381
Eigen::VectorXd evaluate(const Configuration &config) const override
Returns the atom fraction.
Definition: ConfigIO.cc:178
Data structure used for cluster expansions.
Definition: Clex.hh:24
const ClexDescription & default_clex() const
ConfigIO::GenericConfigFormatter< bool > is_canonical()
Definition: ConfigIO.cc:479
ConfigIO::GenericConfigFormatter< double > relaxed_energy_per_species()
Definition: ConfigIO.cc:415
bool is_primitive(const Configuration &_config)
returns true if _config describes primitive cell of the configuration it describes ...
bool parse_args(const std::string &args) override
Expects 'corr', 'corr(clex_name)', 'corr(index_expression)', or 'corr(clex_name,index_expression)'.
Definition: ConfigIO.cc:197
Eigen::VectorXd species_frac(const Configuration &config)
Returns the composition as species fraction, with [Va] = 0.0, in the order of Structure::get_struc_mo...
Parsing dictionary for constructing a DataFormatter object.
A Configuration represents the values of all degrees of freedom in a Supercell.
Eigen::VectorXd evaluate(const Configuration &config) const override
Returns the parametric composition.
Definition: ConfigIO.cc:71
const Structure & get_prim() const
const Access to primitive Structure
Definition: PrimClex.cc:260
bool has_reference_energy(const Configuration &_config)
Returns true if configuration is specified in given selection (default: MASTER)
const ECIContainer & eci(const ClexDescription &key) const
Definition: PrimClex.cc:1076
VectorXdAttributeDictionary< Configuration > make_vectorxd_dictionary< Configuration >()
Definition: ConfigIO.cc:611
ConfigIO::GenericConfigFormatter< double > formation_energy_per_species()
Definition: ConfigIO.cc:448
bool has_calc_status(const Configuration &_config)
A sparse container of ECI values and their corresponding orbit indices.
Definition: ECIContainer.hh:12