15 log() <<
"NEXT STEPS:\n\n";
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\
30 Specifies compiler to use. In order of priority: \n\
31 1) User specified by 'casm settings --set-cxx' (use '' to clear) \n\
37 Compiler flags. In order of priority: \n\
38 1) User specified by 'casm settings --set-cxxflags' \n\
40 3) \"-O3 -Wall -fPIC --std=c++17\" \n\
43 Shared object construction flags. In order of priority: \n\
44 1) User specified by 'casm settings --set-soflags' \n\
46 3) \"-shared -lboost_system\" \n\
48 'casm headers and libraries': \n\
49 CASM header files and shared libraries are expected in the following\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\
58 Note: For the 'casm' Python package, $LIBCASM and $LIBCCASM, have \n\
59 highest priority for locating libcasm and libccasm, respectively. \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\
70 Note: If shared libraries are installed in non-standard locations, you \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\
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";
81 log() <<
"NEXT STEPS:\n\n";
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";
94 log() <<
"NEXT STEPS:\n\n";
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\
109 log() <<
"NEXT STEPS:\n\n";
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\
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\
134 log() <<
"NEXT STEPS:\n\n";
136 log() <<
"Calculate configuration properties\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\
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\
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";
183 log() <<
"NEXT STEPS:\n\n";
185 log() <<
"Set chemical reference\n"
188 "- The chemical reference determines the value of the formation "
190 " and chemical potentials calculated by CASM. "
193 "- Chemical references states are set by specifying a hyperplane in "
195 " energy/atom - composition (as atom_frac) space. This may be done "
197 " specifying the hyperplane explicitly, or by specifying several "
199 " reference states with energy/atom and composition (as atom_frac) "
201 " enough states to span the composition space of the allowed "
203 " specified in the prim. For consistency with other CASM projects, "
205 " additional reference states extending to other compositional "
207 " dimensions may be included also. "
210 "- Execute 'casm ref --set-auto' to automatically set project level "
212 " references using DFT calculated energies from configurations "
214 " extreme parametric compositions.\n\n"
216 "- Execute 'casm ref --set '...JSON...'' to manually set the "
218 " level reference energies. See 'casm ref --help' for more "
221 "- It is also possible to specialize the chemical reference at the "
223 " supercell or configuration level. "
226 "- See 'casm format' for a description and location of the "
228 " 'chemical_reference.json' file. "
233 log() <<
"NEXT STEPS:\n\n";
235 log() <<
"Generate basis functions \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\
245 - See 'casm format --bspecs' for description and location of the \n\
246 'bspecs.json' file.\n\n";
250 log() <<
"NEXT STEPS:\n\n";
252 log() <<
"Fit effective cluster interactions (ECI)\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\
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\
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";
287 log() <<
"NEXT STEPS:\n\n";
289 log() <<
"Monte Carlo calculations\n\
291 - Use 'casm monte' to run Monte Carlo calculations. \n\
292 - See 'casm monte --format' and 'casm monte -h' for help. \n\n";
295 namespace Completer {
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");
317 template <
typename ConfigType>
324 log() << std::setw(6) <<
"INDEX"
325 <<
" " << std::setw(30) <<
"SUPERCELL"
327 <<
"#CONFIGS G / C / S" << std::endl;
328 log() <<
"-----------------------------------------------------------------"
334 int gen =
primclex.
db<ConfigType>().scel_range_size(scel.name());
335 int calc = 0, sel = 0;
337 primclex.
db<ConfigType>().scel_range(scel.name())) {
348 log() << std::setw(6) << i <<
" " << std::setw(30) << scel.name()
349 <<
" " << gen <<
" / " << calc <<
" / " << sel << std::endl;
352 log() <<
"-----------------------------------------------------------------"
355 log() << std::setw(6) <<
" "
356 <<
" " << std::setw(30) <<
"TOTAL"
357 <<
" " << tot_gen <<
" / " << tot_calc <<
" / " << tot_sel
359 log() <<
"\nG:Generated, C:Calculated, S:Selected" << std::endl
365 po::variables_map vm;
371 po::parse_command_line(args.
argc(), args.
argv(), status_opt.
desc()),
376 if (vm.count(
"help")) {
378 log() << status_opt.
desc() << std::endl;
383 if (vm.count(
"desc")) {
385 log() << status_opt.
desc() << std::endl;
386 log() <<
"DESCRIPTION" << std::endl;
387 log() <<
" Get status information for the current CASM project.\n\n";
394 }
catch (po::error &e) {
395 err_log() <<
"ERROR: " << e.what() << std::endl << std::endl;
398 }
catch (std::exception &e) {
399 err_log() <<
"Unhandled Exception reached the top of main: " << e.what()
400 <<
", application will now exit" << std::endl;
406 log() <<
"\n#################################\n\n";
408 log() <<
"CASM status:\n\n";
410 if (vm.count(
"all")) {
411 log() <<
"\n#################################\n\n";
415 const fs::path &root = args.
root;
418 log() <<
"1) Project initialized: FALSE\n\n";
420 if (vm.count(
"next")) {
421 log() <<
"\n#################################\n\n";
425 log() <<
"For next steps, run 'casm status -n'\n\n";
435 log() <<
" ERROR\n\n";
437 log() <<
"- Found a CASM project, but no " <<
dir.
prim() <<
" file."
439 log() <<
"- CASM project location: " << root << std::endl;
440 log() <<
"Please add a prim.json file, or rm the '.casm' directory."
450 std::unique_ptr<PrimClex> uniq_primclex;
463 log() <<
"1) Project initialized: TRUE\n\n";
471 log() <<
"- Lattice point group size: " << prim_pg.size() << std::endl;
472 log() <<
"- Lattice point group is " << prim_pg.
get_name() << std::endl;
475 log() <<
"- Crystal point group is: "
477 if (!vm.count(
"warning")) {
479 log() <<
"*** Warning: Finding a factor group that is larger than the "
481 <<
" point group implies that your structure is not "
486 log() << std::endl << std::endl;
490 if (vm.count(
"all")) {
491 log() <<
"\n#################################\n\n";
492 log() <<
"\n2) Composition axes \n\n";
496 log() <<
"2) Composition axes \n";
498 log() <<
"- Composition axes selected: ";
501 log() <<
"FALSE\n\n";
503 if (vm.count(
"next")) {
504 log() <<
"\n#################################\n\n";
508 log() <<
"For next steps, run 'casm status -n'\n\n";
514 log() <<
"TRUE\n\n\n";
528 if (vm.count(
"all")) {
529 log() <<
"\n#################################\n\n";
530 log() <<
"3) Generate configurations \n\n";
537 log() <<
"\n3) Generate configurations \n";
540 int tot_gen = master_selection.
size();
543 for (
const auto &
config : master_selection.
all()) {
547 log() <<
"- Number of supercells generated: "
549 log() <<
"- Number of configurations generated: " << tot_gen <<
"\n";
550 log() <<
"- Number of configurations currently selected: " << tot_sel <<
"\n";
553 if (vm.count(
"next")) {
554 log() <<
"\n#################################\n\n";
558 log() <<
"For next steps, run 'casm status -n'\n\n";
565 if (vm.count(
"next")) {
566 log() <<
"\n#################################\n\n";
570 log() <<
"For next steps, run 'casm status -n'\n\n";
573 if (vm.count(
"details")) {
576 log() <<
"For the number of configurations generated, calculated,\n and "
577 "selected by supercell, run 'casm status -d'\n\n";
583 log() << std::endl << std::endl;
587 if (vm.count(
"all")) {
588 log() <<
"\n#################################\n\n";
589 log() <<
"4) Calculate configuration properties\n\n";
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";
599 if (vm.count(
"details")) {
602 log() <<
"For the number of configurations generated, calculated,\n and "
603 "selected by supercell, run 'casm status -d'\n\n";
607 if (vm.count(
"next")) {
608 log() <<
"\n#################################\n\n";
612 log() <<
"For next steps, run 'casm status -n'\n\n";
622 if (vm.count(
"all")) {
623 log() <<
"\n#################################\n\n";
624 log() <<
"5) Choose chemical reference\n\n";
628 log() <<
"5) Choose chemical reference\n";
630 log() <<
"- Chemical reference set: ";
641 log() <<
"To show the chemical reference, run 'casm ref -d'\n\n";
643 log() <<
"No chemical reference set." << std::endl << std::endl;
645 if (vm.count(
"next")) {
646 log() <<
"\n#################################\n\n";
650 log() <<
"For next steps, run 'casm status -n'\n\n";
660 if (vm.count(
"all")) {
661 log() <<
"\n#################################\n\n";
662 log() <<
"6) Generate basis functions: \n\n";
666 log() <<
"6) Generate basis functions: ";
669 log() <<
"FALSE\n\n";
671 if (vm.count(
"next")) {
672 log() <<
"\n#################################\n\n";
676 log() <<
"For next steps, run 'casm status -n'\n\n";
681 log() <<
"TRUE\n\n\n";
685 if (vm.count(
"all")) {
686 log() <<
"\n#################################\n\n";
687 log() <<
"7) Fit effective cluster interactions (ECI): \n\n";
691 log() <<
"7) Fit effective cluster interactions (ECI): ";
694 log() <<
"FALSE\n\n";
696 if (vm.count(
"next")) {
697 log() <<
"\n#################################\n\n";
701 log() <<
"For next steps, run 'casm status -n'\n\n";
706 log() <<
"TRUE\n\n\n";
712 if (vm.count(
"next") || vm.count(
"all")) {
713 log() <<
"\n#################################\n\n";
714 log() <<
"8) Monte Carlo Calculations: \n\n";
717 log() <<
"For next steps, run 'casm status -n'\n\n";
const po::options_description & desc()
Get the program options, filled with the initialized values.
void add_help_suboption()
Add a plain –help and –desc suboptions.
po::options_description m_desc
void initialize() override
Fill in the options descriptions accordingly.
Index selected_size() const
boost::iterator_range< iterator > all()
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.
std::string project_name() const
Get project name.
ClexDescription const & default_clex() const
Get default ClexDescription.
const SymGroup & point_group() const
const Lattice & lattice() const
const MasterSymGroup & factor_group() const
Represents a supercell of the primitive parent crystal structure.
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
const std::string & get_name() const
static SymGroup lattice_point_group(Lattice const &_lat)
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
ProjectSettings & settings()
bool has_chemical_reference() const
check if ChemicalReference object initialized
const DirectoryStructure & dir() const
Access DirectoryStructure object. Throw if not set.
bool has_composition_axes() const
check if CompositionConverter object initialized
const PrimType & prim() const
const Access to primitive Structure
ConfigIO::GenericConfigFormatter< jsonParser > config()
void for_each_config_type(F f)
void references_unset(const CommandArgs &args)
void eci_uncalculated(const CommandArgs &args)
bool is_calculated(const ConfigType &config, std::string calctype="")
Return true if all required properties have been been calculated for the configuration.
void composition_unselected(const CommandArgs &args)
void configs_uncalculated(const CommandArgs &args)
void montecarlo(const CommandArgs &args)
void supercells_ungenerated(const CommandArgs &args)
void configs_ungenerated(const CommandArgs &args)
int status_command(const CommandArgs &args)
void status_unitialized(const CommandArgs &args)
INDEX_TYPE Index
For long integer indexing:
void bset_uncalculated(const CommandArgs &args)
DirectoryStructure const & dir
Specifies a particular cluster expansion.
Data structure holding basic CASM command info.
const PrimClex & primclex
PrintDetails(const CommandArgs &_args, const PrimClex &_primclex)