CASM  1.1.0
A Clusters Approach to Statistical Mechanics
status.cc
Go to the documentation of this file.
5 #include "casm/clex/PrimClex.hh"
12 
13 namespace CASM {
14 void status_unitialized(const CommandArgs &args) {
15  log() << "NEXT STEPS:\n\n";
16 
17  log() << "Initialize a CASM project\n\
18 - Create and cd to the directory where you want the project to be located.\n\
19  This will be called the 'project root directory' or project's 'location'.\n\
20 - Add a 'prim.json' file to the directory describing the primitive cell. \n\
21  See 'casm format --prim' for the format of the 'prim.json' file. \n\
22 - Execute: 'casm init' \n\
23 - Several directories are created: 'basis_sets', 'cluster_expansions', \n\
24  'reports', 'symmetry', and 'training_data' \n\
25 - If necessary, set configuration options for runtime compilation and \n\
26  linking by using the 'casm settings' command or by setting environment \n\
27  variables. \n\
28  \n\
29  'cxx': \n\
30  Specifies compiler to use. In order of priority: \n\
31  1) User specified by 'casm settings --set-cxx' (use '' to clear) \n\
32  2) $CASM_CXX \n\
33  3) $CXX \n\
34  4) \"g++\" \n\
35 \n\
36  'cxxflags': \n\
37  Compiler flags. In order of priority: \n\
38  1) User specified by 'casm settings --set-cxxflags' \n\
39  2) $CASM_CXXFLAGS \n\
40  3) \"-O3 -Wall -fPIC --std=c++17\" \n\
41 \n\
42  'soflags': \n\
43  Shared object construction flags. In order of priority: \n\
44  1) User specified by 'casm settings --set-soflags' \n\
45  2) $CASM_SOFLAGS \n\
46  3) \"-shared -lboost_system\" \n\
47 \n\
48  'casm headers and libraries': \n\
49  CASM header files and shared libraries are expected in the following\n\
50  locations. \n\
51  In order of priority: \n\
52  1) User specified by 'casm settings --set-casm-includedir' and \n\
53  'casm settings --set-casm-libdir' \n\
54  2) $CASM_INCLUDEDIR and $CASM_LIBDIR \n\
55  3) $CASM_PREFIX/include and $CASM_PREFIX/lib \n\
56  3) (default search paths) \n\
57 \n\
58  Note: For the 'casm' Python package, $LIBCASM and $LIBCCASM, have \n\
59  highest priority for locating libcasm and libccasm, respectively. \n\
60 \n\
61  'boost headers and libraries': \n\
62  The boost libraries are expected in the following locations. \n\
63  In order of priority: \n\
64  1) User specified by 'casm settings --set-boost-includedir' and \n\
65  'casm settings --set-boost-libdir' and \n\
66  2) $CASM_BOOST_INCLUDEDIR and $CASM_BOOST_LIBDIR \n\
67  3) $CASM_BOOST_PREFIX/include $CASM_BOOST_PREFIX/lib \n\
68  4) (default search paths) \n\
69 \n\
70  Note: If shared libraries are installed in non-standard locations, you \n\
71  may need to set: \n\
72  (Linux) export LD_LIBRARY_PATH=$CASM_PREFIX/lib:$CASM_BOOST_PREFIX/lib:$LD_LIBRARY_PATH \n\
73  (Mac) export DYLD_FALLBACK_LIBRARY_PATH=$CASM_PREFIX/lib:$CASM_BOOST_PREFIX/lib:$DYLD_FALLBACK_LIBRARY_PATH \n\
74 \n\
75 - Subsequently, work on the CASM project can be done by executing 'casm' \n\
76  from the project's root directory or any subdirectory. \n\
77 - See 'casm format --prim' for description and location of the 'prim.json' file.\n";
78 }
79 
81  log() << "NEXT STEPS:\n\n";
82 
83  log() << "Select composition axes\n\
84 - Execute: 'casm composition -d' to display standard composition axes. \n\
85 - Then execute 'casm composition -s <#>' to select one of the listed axes.\n\
86 - If no standard composition axis is satisfactory, edit the file \n\
87  'composition_axes.json' to add your own custom composition axes to the \n\
88  'custom_axes' JSON object.\n\
89 - See 'casm format --comp' for description and the location of \n\
90  the 'composition_axes.json' file.\n\n";
91 }
92 
94  log() << "NEXT STEPS:\n\n";
95 
96  log() << "Enumerate supercells\n\
97 - Execute: 'casm enum --method ScelEnum --max V' to enumerate supercells up to \n\
98  volume V (units: number of primitive cells). \n\
99 - Supercells are listed in the SCEL file as well as scel_list.json \n\
100  This file should not usually be edited manually.\n\
101 - See 'casm enum --desc ScelEnum' for extended help documentation on how to use the\n\
102  '--matrix' and '--lattice-directions' options to perform restricted \n\
103  supercell enumeration (i.e. 2d, 1d, multiples of other supercells). \n\
104 - See 'casm format' for a description and location of the \n\
105  'SCEL' file.\n\n";
106 }
107 
108 void configs_ungenerated(const CommandArgs &args) {
109  log() << "NEXT STEPS:\n\n";
110 
111  log() << "Enumerate configurations\n\
112 - Several options are possible: \n\
113 - Execute: 'casm enum --method ConfigEnumAllOccupations --all' to \n\
114  enumerate configurations for all supercells. \n\
115 - Execute: 'casm enum --method ConfigEnumAllOccupations --min MINV --max MAXV' \n\
116  to enumerate configurations for supercells ranging in volume from \n\
117  MINV to MAXV (units: number of primitive cells). \n\
118 - Execute: 'casm enum --method ConfigEnumAllOccupations --scelname NAME' \n\
119  to enumerate configurations for a particular supercell. \n\
120 - Generated configurations are listed in the 'config_list.json' file. \n\
121  This file should not usually be edited manually. \n\
122 - Use the 'casm view' command to quickly view configurations in your \n\
123  favorite visualization program. See 'casm view -h' for help. \n\
124 - See 'casm enum --desc ConfigEnumAllOccupations' for extended help documentation on how to use \n\
125  '--filter' command to perform restricted enumeration of \n\
126  configurations. \n\
127 - Once you have a cluster expansion, see 'casm format --monte' for \n\
128  a description of how to save configurations enumerated during Monte \n\
129  Carlo calculations. \n\
130  \n\n";
131 }
132 
134  log() << "NEXT STEPS:\n\n";
135 
136  log() << "Calculate configuration properties\n\
137  \n\
138 Instructions for volume relaxed VASP energies: \n\n\
139 - Create INCAR, KPOINTS, POSCAR, SPECIES, and 'relax.json' files for \n\
140  VASP in: '$ROOT/training_data/settings/$CURR_CALCTYPE'. See \n\
141  'casm format --vasp' for a description and location of the VASP \n\
142  settings files. \n\
143 Instructions for volume relaxed Quantum Espresso energies: \n\n\
144 - Create $inputfile, SPECIES, and 'relax.json' (with calculator tag set) files for\n\
145  Quantum Espresso in: '$ROOT/training_data/settings/$CURR_CALCTYPE'. See\n\
146  'casm format --qe' for a description and location of the Quantum Espresso\n\
147  settings files. \n\n\
148 For either of the choices above do the following: \n\n\
149 - Select which configurations to calculate properties for using the \n\
150  'casm select' command. Use 'casm select --set-on -c ALL' to select all\n\
151  configurations. By default, the 'selected' state of each \n\
152  configuration is stored by CASM in the master_selection file, \n\
153  located in the hidden '.casm' directory. The standard selections \n\
154  'MASTER', 'CALCULATED', 'ALL', or 'NONE' may always be used. \n\
155 - You can also save additional selection using the 'casm select -o' \n\
156  option to write a selection to a file. \n\
157 - Selections may be operated on to create new selections that are \n\
158  subsets, unions, or intersections of existing selections. \n\
159 - Selection files may also be edited manually or via programs for more \n\
160  complex selections than currently supported by 'casm select'. For all\n\
161  options related to selection configurations, see 'casm select -h'. \n\
162 - Selections may be used to query the properties of particular \n\
163  configurations using the 'casm query' command. See 'casm query -h' \n\
164  for the complete list of options. \n\
165  '$ROOT/training_data/$SCELNAME/$CONFIGID/$CURR_CALCTYPE/properties.calc.json'\n\
166 - Execute: 'casm-calc --setup' to setup VASP/QuantumEspresso input files for all\n\
167  selected configurations, but not submit the jobs. This is often a \n\
168  useful first step to check that input files have been prepared \n\
169  correctly. \n\
170 - Execute: 'casm-calc --submit' to submit VASP/QuantumEspresso jobs for all selected \n\
171  configurations. Only configurations which have not yet been \n\
172  calculated will run. \n\
173 - See 'casm-calc -h' for help and other options. \n\
174 - VASP/QuantumEspresso results will be stored at: \n\
175  '$ROOT/training_data/$SCELNAME/$CONFIGID/$CURR_CALCTYPE/properties.calc.json'\n\
176  Results in 'properties.calc.json' are expected to be ordered to match\n\
177  the 'POS' file at '$ROOT/training_data/$SCELNAME/$CONFIGID/POS' \n\
178 - Execute 'casm update' to read in calculation results from the \n\
179  'properties.calc.json' files once completed. \n\n";
180 }
181 
182 void references_unset(const CommandArgs &args) {
183  log() << "NEXT STEPS:\n\n";
184 
185  log() << "Set chemical reference\n"
186  " "
187  " \n"
188  "- The chemical reference determines the value of the formation "
189  "energy \n"
190  " and chemical potentials calculated by CASM. "
191  " \n\n"
192 
193  "- Chemical references states are set by specifying a hyperplane in "
194  " \n"
195  " energy/atom - composition (as atom_frac) space. This may be done "
196  "by \n"
197  " specifying the hyperplane explicitly, or by specifying several "
198  " \n"
199  " reference states with energy/atom and composition (as atom_frac) "
200  "for \n"
201  " enough states to span the composition space of the allowed "
202  "occupants \n"
203  " specified in the prim. For consistency with other CASM projects, "
204  " \n"
205  " additional reference states extending to other compositional "
206  " \n"
207  " dimensions may be included also. "
208  " \n\n"
209 
210  "- Execute 'casm ref --set-auto' to automatically set project level "
211  " \n"
212  " references using DFT calculated energies from configurations "
213  "with \n"
214  " extreme parametric compositions.\n\n"
215 
216  "- Execute 'casm ref --set '...JSON...'' to manually set the "
217  "project \n"
218  " level reference energies. See 'casm ref --help' for more "
219  "information.\n\n"
220 
221  "- It is also possible to specialize the chemical reference at the "
222  " \n"
223  " supercell or configuration level. "
224  " \n\n"
225 
226  "- See 'casm format' for a description and location of the "
227  " \n"
228  " 'chemical_reference.json' file. "
229  " \n\n";
230 }
231 
232 void bset_uncalculated(const CommandArgs &args) {
233  log() << "NEXT STEPS:\n\n";
234 
235  log() << "Generate basis functions \n\
236  \n\
237 Instructions for generating basis functions: \n\n\
238 - Write a '$ROOT/basis_sets/$CURR_BSET/bspecs.json' file containing \n\
239  specifications for how which orbits to include and which site basis \n\
240  functions to use in generating cluster expansion basis functions. \n\
241  See 'casm format --bspecs' for an example file. \n\
242 - Execute 'casm bset -u' to generate basis functions. If you edit the \n\
243  'bspecs.json' file, execute 'casm bset -u' again to update basis \n\
244  functions. \n\
245 - See 'casm format --bspecs' for description and location of the \n\
246  'bspecs.json' file.\n\n";
247 }
248 
249 void eci_uncalculated(const CommandArgs &args) {
250  log() << "NEXT STEPS:\n\n";
251 
252  log() << "Fit effective cluster interactions (ECI)\n\
253  \n\
254 Instructions for fitting ECI: \n\n\
255 - Create a new directory within the CASM project, for example: \n\
256  mkdir fit_1 && cd fit_1 \n\
257 - Select which configurations to use as the training data with the \n\
258  'casm select' command. To select all calculated configurations: \n\
259  casm select --set 'is_calculated' -o train \n\
260 - See 'casm select -h' for more options. \n\
261 - Create a 'casm-learn' input file. Several example input files can be \n\
262  generated from 'casm-learn --exMethodName'. For example: \n\
263  casm-learn --exGeneticAlgorithm > fit_1_ga.json \n\
264  This file can be edited to adjust the problem being solved (training \n\
265  data, weighting scheme, cross validation sets and scoring, linear \n\
266  estimator method, feature selection method, etc.) \n\
267 - See 'casm-learn --settings-format' for description and help with the \n\
268  input file. \n\
269 - Execute: 'casm-learn -s fit_1_ga.json' \n\
270 - Results are stored in a Hall Of Fame file containing the best \n\
271  solutions as determined from cross validation scores. \n\
272 - Different estimator methods (LinearRegression, Lasso, etc.) and \n\
273  different feature selection methods (GeneticAlgorithm, RFE, etc.) can\n\
274  be used with the same problem specs (training data, weighting scheme,\n\
275  cross validation sets and scoring) and compared in a single Hall Of \n\
276  Fame. \n\
277 - When some candidate ECI have been stored in a Hall Of Fame, use the \n\
278  'casm-learn --checkhull' option to check if ground state configurations \n\
279  are accurately predicted by the cluster expansion. \n\
280 - When ready, use 'casm-learn --select' to write an 'eci.json' file to \n\
281  use for Monte Carlo. \n\
282 - See 'casm format --eci' for a description and location of the \n\
283  'eci.json' files.\n\n";
284 }
285 
286 void montecarlo(const CommandArgs &args) {
287  log() << "NEXT STEPS:\n\n";
288 
289  log() << "Monte Carlo calculations\n\
290  \n\
291 - Use 'casm monte' to run Monte Carlo calculations. \n\
292 - See 'casm monte --format' and 'casm monte -h' for help. \n\n";
293 }
294 
295 namespace Completer {
297 
300 
301  m_desc.add_options()("next,n", "Write next steps")(
302  "warning,w", "Suppress warnings")("details,d",
303  "Print detailed information")(
304  "all,a", "Print all 'casm status -n' help messages");
305 
306  return;
307 }
308 } // namespace Completer
309 
310 struct PrintDetails {
311  PrintDetails(const CommandArgs &_args, const PrimClex &_primclex)
312  : args(_args), primclex(_primclex) {}
313 
316 
317  template <typename ConfigType>
318  void eval() const {
319  int tot_gen = 0;
320  int tot_calc = 0;
321  int tot_sel = 0;
322 
323  log() << traits<ConfigType>::name << ":" << std::endl;
324  log() << std::setw(6) << "INDEX"
325  << " " << std::setw(30) << "SUPERCELL"
326  << " "
327  << "#CONFIGS G / C / S" << std::endl;
328  log() << "-----------------------------------------------------------------"
329  "----------"
330  << std::endl;
331  Index i = 0;
332  DB::Selection<ConfigType> master_selection(primclex);
333  for (const Supercell &scel : primclex.db<Supercell>()) {
334  int gen = primclex.db<ConfigType>().scel_range_size(scel.name());
335  int calc = 0, sel = 0;
336  for (const auto &config :
337  primclex.db<ConfigType>().scel_range(scel.name())) {
338  if (master_selection.data()[config.name()]) {
339  sel++;
340  }
341  if (is_calculated(config)) {
342  calc++;
343  }
344  }
345  tot_gen += gen;
346  tot_calc += calc;
347  tot_sel += sel;
348  log() << std::setw(6) << i << " " << std::setw(30) << scel.name()
349  << " " << gen << " / " << calc << " / " << sel << std::endl;
350  ++i;
351  }
352  log() << "-----------------------------------------------------------------"
353  "----------"
354  << std::endl;
355  log() << std::setw(6) << " "
356  << " " << std::setw(30) << "TOTAL"
357  << " " << tot_gen << " / " << tot_calc << " / " << tot_sel
358  << std::endl;
359  log() << "\nG:Generated, C:Calculated, S:Selected" << std::endl
360  << std::endl;
361  }
362 };
363 
364 int status_command(const CommandArgs &args) {
365  po::variables_map vm;
366 
368  Completer::StatusOption status_opt;
369  try {
370  po::store(
371  po::parse_command_line(args.argc(), args.argv(), status_opt.desc()),
372  vm); // can throw
373 
376  if (vm.count("help")) {
377  log() << "\n";
378  log() << status_opt.desc() << std::endl;
379 
380  return 0;
381  }
382 
383  if (vm.count("desc")) {
384  log() << "\n";
385  log() << status_opt.desc() << std::endl;
386  log() << "DESCRIPTION" << std::endl;
387  log() << " Get status information for the current CASM project.\n\n";
388 
389  return 0;
390  }
391 
392  po::notify(vm); // throws on error, so do after help in case
393  // there are any problems
394  } catch (po::error &e) {
395  err_log() << "ERROR: " << e.what() << std::endl << std::endl;
396  err_log() << status_opt.desc() << std::endl;
397  return 1;
398  } catch (std::exception &e) {
399  err_log() << "Unhandled Exception reached the top of main: " << e.what()
400  << ", application will now exit" << std::endl;
401  return 1;
402  }
403 
405 
406  log() << "\n#################################\n\n";
407 
408  log() << "CASM status:\n\n";
409 
410  if (vm.count("all")) {
411  log() << "\n#################################\n\n";
412  status_unitialized(args);
413  }
414 
415  const fs::path &root = args.root;
416 
417  if (root.empty()) {
418  log() << "1) Project initialized: FALSE\n\n";
419 
420  if (vm.count("next")) {
421  log() << "\n#################################\n\n";
422 
423  status_unitialized(args);
424  } else {
425  log() << "For next steps, run 'casm status -n'\n\n";
426  }
427 
428  return 0;
429  }
430 
431  {
432  DirectoryStructure dir(root);
433 
434  if (!fs::exists(dir.prim())) {
435  log() << " ERROR\n\n";
436 
437  log() << "- Found a CASM project, but no " << dir.prim() << " file."
438  << std::endl;
439  log() << "- CASM project location: " << root << std::endl;
440  log() << "Please add a prim.json file, or rm the '.casm' directory."
441  << std::endl
442  << std::endl;
443 
444  return 1;
445  }
446  }
447 
448  // If 'args.primclex', use that, else construct PrimClex in 'uniq_primclex'
449  // Then whichever exists, store reference in 'primclex'
450  std::unique_ptr<PrimClex> uniq_primclex;
451  PrimClex &primclex = make_primclex_if_not(args, uniq_primclex);
452 
453  const DirectoryStructure &dir = primclex.dir();
454  const ProjectSettings &settings = primclex.settings();
455  const ClexDescription &desc = settings.default_clex();
456 
457  std::string property = desc.property;
458  std::string calctype = desc.calctype;
459  std::string ref = desc.ref;
460  std::string bset = desc.bset;
461  std::string eci = desc.eci;
462 
463  log() << "1) Project initialized: TRUE\n\n";
464  log() << "- Project name: " << primclex.settings().project_name()
465  << std::endl;
466  log() << "- Project location: " << primclex.dir().root_dir().string()
467  << std::endl;
468 
469  // it'd be nice to just read this...
471  log() << "- Lattice point group size: " << prim_pg.size() << std::endl;
472  log() << "- Lattice point group is " << prim_pg.get_name() << std::endl;
473  log() << "- Factor group size: " << primclex.prim().factor_group().size()
474  << std::endl;
475  log() << "- Crystal point group is: "
476  << primclex.prim().point_group().get_name() << std::endl;
477  if (!vm.count("warning")) {
478  if (primclex.prim().factor_group().size() > prim_pg.size()) {
479  log() << "*** Warning: Finding a factor group that is larger than the "
480  "lattice \n"
481  << " point group implies that your structure is not "
482  "primitive."
483  << std::endl;
484  }
485  }
486  log() << std::endl << std::endl;
487 
489 
490  if (vm.count("all")) {
491  log() << "\n#################################\n\n";
492  log() << "\n2) Composition axes \n\n";
494  }
495 
496  log() << "2) Composition axes \n";
497 
498  log() << "- Composition axes selected: ";
499 
501  log() << "FALSE\n\n";
502 
503  if (vm.count("next")) {
504  log() << "\n#################################\n\n";
505 
507  } else {
508  log() << "For next steps, run 'casm status -n'\n\n";
509  }
510 
511  return 0;
512  }
513 
514  log() << "TRUE\n\n\n";
515  /*
516  // It'd be nice to note standard vs. custom axes, and just '*' the current
517  composition axes log() << "- Standard & custom composition axes: " <<
518  std::endl << std::endl;
519  primclex.get_param_comp().print_composition_axes(log());
520  log() << std::endl;
521  log() << "- Current composition axes: " << std::endl << std::endl;
522  primclex.get_param_comp().print_curr_composition_axes(log());
523  log() << std::endl << std::endl;
524  */
525 
527 
528  if (vm.count("all")) {
529  log() << "\n#################################\n\n";
530  log() << "3) Generate configurations \n\n";
531 
533 
534  configs_ungenerated(args);
535  }
536 
537  log() << "\n3) Generate configurations \n";
538 
540  int tot_gen = master_selection.size();
541  int tot_sel = master_selection.selected_size();
542  int tot_calc = 0;
543  for (const auto &config : master_selection.all()) {
544  tot_calc += is_calculated(config);
545  }
546 
547  log() << "- Number of supercells generated: "
548  << primclex.db<Supercell>().size() << "\n";
549  log() << "- Number of configurations generated: " << tot_gen << "\n";
550  log() << "- Number of configurations currently selected: " << tot_sel << "\n";
551 
552  if (primclex.db<Supercell>().size() == 0) {
553  if (vm.count("next")) {
554  log() << "\n#################################\n\n";
555 
557  } else {
558  log() << "For next steps, run 'casm status -n'\n\n";
559  }
560 
561  return 0;
562  }
563 
564  if (tot_gen == 0) {
565  if (vm.count("next")) {
566  log() << "\n#################################\n\n";
567 
568  configs_ungenerated(args);
569  } else {
570  log() << "For next steps, run 'casm status -n'\n\n";
571  }
572 
573  if (vm.count("details")) {
575  } else {
576  log() << "For the number of configurations generated, calculated,\n and "
577  "selected by supercell, run 'casm status -d'\n\n";
578  }
579 
580  return 0;
581  }
582 
583  log() << std::endl << std::endl;
584 
586 
587  if (vm.count("all")) {
588  log() << "\n#################################\n\n";
589  log() << "4) Calculate configuration properties\n\n";
590  configs_uncalculated(args);
591  }
592 
593  log() << "4) Calculate configuration properties\n";
594  log() << "- Current calctype: " << calctype << "\n";
595  log() << "- Current cluster expansion: " << desc.name << "\n";
596  log() << "- Number of configurations calculated: " << tot_calc << " / "
597  << tot_gen << " generated (Update with 'casm update')\n\n";
598 
599  if (vm.count("details")) {
601  } else {
602  log() << "For the number of configurations generated, calculated,\n and "
603  "selected by supercell, run 'casm status -d'\n\n";
604  }
605 
606  if (tot_calc == 0) {
607  if (vm.count("next")) {
608  log() << "\n#################################\n\n";
609 
610  configs_uncalculated(args);
611  } else {
612  log() << "For next steps, run 'casm status -n'\n\n";
613  }
614 
615  return 0;
616  }
617 
618  log() << std::endl;
619 
621 
622  if (vm.count("all")) {
623  log() << "\n#################################\n\n";
624  log() << "5) Choose chemical reference\n\n";
625  references_unset(args);
626  }
627 
628  log() << "5) Choose chemical reference\n";
629 
630  log() << "- Chemical reference set: ";
632  log() << "TRUE"
633  << "\n";
634  } else {
635  log() << "FALSE"
636  << "\n";
637  }
638  log() << "\n";
639 
641  log() << "To show the chemical reference, run 'casm ref -d'\n\n";
642  } else {
643  log() << "No chemical reference set." << std::endl << std::endl;
644 
645  if (vm.count("next")) {
646  log() << "\n#################################\n\n";
647 
648  references_unset(args);
649  } else {
650  log() << "For next steps, run 'casm status -n'\n\n";
651  }
652 
653  return 0;
654  }
655 
656  log() << std::endl;
657 
659 
660  if (vm.count("all")) {
661  log() << "\n#################################\n\n";
662  log() << "6) Generate basis functions: \n\n";
663  bset_uncalculated(args);
664  }
665 
666  log() << "6) Generate basis functions: ";
667 
668  if (!fs::exists(dir.clexulator_src(settings.project_name(), bset))) {
669  log() << "FALSE\n\n";
670 
671  if (vm.count("next")) {
672  log() << "\n#################################\n\n";
673 
674  bset_uncalculated(args);
675  } else {
676  log() << "For next steps, run 'casm status -n'\n\n";
677  }
678 
679  return 0;
680  }
681  log() << "TRUE\n\n\n";
682 
684 
685  if (vm.count("all")) {
686  log() << "\n#################################\n\n";
687  log() << "7) Fit effective cluster interactions (ECI): \n\n";
688  eci_uncalculated(args);
689  }
690 
691  log() << "7) Fit effective cluster interactions (ECI): ";
692 
693  if (!fs::exists(dir.eci(property, calctype, ref, bset, eci))) {
694  log() << "FALSE\n\n";
695 
696  if (vm.count("next")) {
697  log() << "\n#################################\n\n";
698 
699  eci_uncalculated(args);
700  } else {
701  log() << "For next steps, run 'casm status -n'\n\n";
702  }
703 
704  return 0;
705  }
706  log() << "TRUE\n\n\n";
707 
709 
710  log() << std::endl;
711 
712  if (vm.count("next") || vm.count("all")) {
713  log() << "\n#################################\n\n";
714  log() << "8) Monte Carlo Calculations: \n\n";
715  montecarlo(args);
716  } else {
717  log() << "For next steps, run 'casm status -n'\n\n";
718  }
719 
720  return 0;
721 };
722 
723 } // namespace CASM
int argc() const
Definition: CLIParse.hh:20
char ** argv() const
Definition: CLIParse.hh:22
const po::options_description & desc()
Get the program options, filled with the initialized values.
Definition: Handlers.cc:321
void add_help_suboption()
Add a plain –help and –desc suboptions.
Definition: Handlers.cc:561
po::options_description m_desc
Definition: Handlers.hh:260
void initialize() override
Fill in the options descriptions accordingly.
Definition: status.cc:298
Index selected_size() const
Definition: Selection.cc:275
map_type & data()
Definition: Selection.cc:250
Index size() const
Definition: Selection.cc:260
boost::iterator_range< iterator > all()
Definition: Selection.cc:222
Specification of CASM project directory structure.
fs::path prim() const
Return prim.json path.
fs::path root_dir() const
Return casm project directory path.
fs::path eci(std::string property, std::string calctype, std::string ref, std::string bset, std::string eci) const
Returns path to eci.json.
fs::path clexulator_src(std::string project_name, std::string bset) const
Returns path to clexulator source file.
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:55
std::string project_name() const
Get project name.
ClexDescription const & default_clex() const
Get default ClexDescription.
const SymGroup & point_group() const
Definition: Structure.cc:110
const Lattice & lattice() const
Definition: Structure.hh:100
const MasterSymGroup & factor_group() const
Definition: Structure.cc:107
Represents a supercell of the primitive parent crystal structure.
Definition: Supercell.hh:51
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
Definition: SymGroup.hh:42
const std::string & get_name() const
Definition: SymGroup.cc:1668
static SymGroup lattice_point_group(Lattice const &_lat)
Definition: SymGroup.cc:779
PrimClex & make_primclex_if_not(const CommandArgs &args, std::unique_ptr< PrimClex > &uniq_primclex)
If !_primclex, construct new PrimClex stored in uniq_primclex, then return reference to existing or c...
DB::Database< T > & db() const
Definition: PrimClex.cc:302
ProjectSettings & settings()
Definition: PrimClex.cc:224
bool has_chemical_reference() const
check if ChemicalReference object initialized
Definition: PrimClex.cc:250
const DirectoryStructure & dir() const
Access DirectoryStructure object. Throw if not set.
Definition: PrimClex.cc:230
bool has_composition_axes() const
check if CompositionConverter object initialized
Definition: PrimClex.cc:238
const PrimType & prim() const
const Access to primitive Structure
Definition: PrimClex.cc:262
ConfigIO::GenericConfigFormatter< jsonParser > config()
Definition: ConfigIO.cc:777
void for_each_config_type(F f)
Main CASM namespace.
Definition: APICommand.hh:8
void references_unset(const CommandArgs &args)
Definition: status.cc:182
void eci_uncalculated(const CommandArgs &args)
Definition: status.cc:249
Log & log()
Definition: Log.hh:424
bool is_calculated(const ConfigType &config, std::string calctype="")
Return true if all required properties have been been calculated for the configuration.
Definition: Calculable.cc:137
void composition_unselected(const CommandArgs &args)
Definition: status.cc:80
void configs_uncalculated(const CommandArgs &args)
Definition: status.cc:133
void montecarlo(const CommandArgs &args)
Definition: status.cc:286
void supercells_ungenerated(const CommandArgs &args)
Definition: status.cc:93
void configs_ungenerated(const CommandArgs &args)
Definition: status.cc:108
int status_command(const CommandArgs &args)
Definition: status.cc:364
void status_unitialized(const CommandArgs &args)
Definition: status.cc:14
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
void bset_uncalculated(const CommandArgs &args)
Definition: status.cc:232
Log & err_log()
Definition: Log.hh:426
pair_type ref
Definition: settings.cc:144
pair_type eci
Definition: settings.cc:146
PrimClex * primclex
Definition: settings.cc:135
ClexDescription & desc
Definition: settings.cc:138
pair_type calctype
Definition: settings.cc:143
pair_type property
Definition: settings.cc:142
DirectoryStructure const & dir
Definition: settings.cc:136
pair_type bset
Definition: settings.cc:145
Specifies a particular cluster expansion.
Data structure holding basic CASM command info.
void eval() const
Definition: status.cc:318
const CommandArgs & args
Definition: status.cc:314
const PrimClex & primclex
Definition: status.cc:315
PrintDetails(const CommandArgs &_args, const PrimClex &_primclex)
Definition: status.cc:311