12 args.
log <<
"NEXT STEPS:\n\n";
15 "Initialize a CASM project\n\
16 - Create and cd to the directory where you want the project to be located.\n\
17 This will be called the 'project root directory' or project's 'location'.\n\
18 - Add a 'prim.json' file to the directory describing the primitive cell. \n\
19 See 'casm format --prim' for the format of the 'prim.json' file. \n\
20 - Execute: 'casm init' \n\
21 - Several directories are created: 'symmetry', 'basis_sets', \n\
22 'training_data', and 'cluster_expansions' \n\
23 - If necessary, set configuration options for runtime compilation and \n\
24 linking by using the 'casm settings' command or by setting environment \n\
28 Specifies compiler to use. In order of priority: \n\
29 1) User specified by 'casm settings --set-cxx' (use '' to clear) \n\
35 Compiler flags. In order of priority: \n\
36 1) User specified by 'casm settings --set-cxxflags' \n\
38 3) \"-O3 -Wall -fPIC --std=c++11\" \n\
41 Shared object construction flags. In order of priority: \n\
42 1) User specified by 'casm settings --set-soflags' \n\
44 3) \"-shared -lboost_system\" \n\
46 'casm headers and libraries': \n\
47 CASM header files and shared libraries are expected in the following\n\
49 In order of priority: \n\
50 1) User specified by 'casm settings --set-casm-includedir' and \n\
51 'casm settings --set-casm-libdir' \n\
52 2) $CASM_INCLUDEDIR and $CASM_LIBDIR \n\
53 3) $CASM_PREFIX/include and $CASM_PREFIX/lib \n\
54 3) (default search paths) \n\
56 Note: For the 'casm' Python package, $LIBCASM and $LIBCCASM, have \n\
57 highest priority for locating libcasm and libccasm, respectively. \n\
59 'boost headers and libraries': \n\
60 The boost libraries are expected in the following locations. \n\
61 In order of priority: \n\
62 1) User specified by 'casm settings --set-boost-includedir' and \n\
63 'casm settings --set-boost-libdir' and \n\
64 2) $CASM_BOOST_INCLUDEDIR and $CASM_BOOST_LIBDIR \n\
65 3) $CASM_BOOST_PREFIX/include $CASM_BOOST_PREFIX/lib \n\
66 4) (default search paths) \n\
68 Note: If shared libraries are installed in non-standard locations, you \n\
70 (Linux) export LD_LIBRARY_PATH=$CASM_PREFIX/lib:$CASM_BOOST_PREFIX/lib:$LD_LIBRARY_PATH \n\
71 (Mac) export DYLD_FALLBACK_LIBRARY_PATH=$CASM_PREFIX/lib:$CASM_BOOST_PREFIX/lib:$DYLD_FALLBACK_LIBRARY_PATH \n\
73 - Subsequently, work on the CASM project can be done by executing 'casm' \n\
74 from the project's root directory or any subdirectory. \n\
75 - See 'casm format --prim' for description and location of the 'prim.json' file.\n";
80 args.
log <<
"NEXT STEPS:\n\n";
83 "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";
96 args.
log <<
"NEXT STEPS:\n\n";
99 "Enumerate supercells\n\
100 - Execute: 'casm enum --method ScelEnum --max V' to enumerate supercells up to \n\
101 volume V (units: number of primitive cells). \n\
102 - Supercells are listed in the SCEL file.\n\
103 - See 'casm enum --desc ScelEnum' for extended help documentation on how to use the\n\
104 '--matrix' and '--lattice-directions' options to perform restricted \n\
105 supercell enumeration (i.e. 2d, 1d, multiples of other supercells). \n\
106 - See 'casm format' for a description and location of the \n\
113 args.
log <<
"NEXT STEPS:\n\n";
116 "Enumerate configurations\n\
117 - Several options are possible: \n\
118 - Execute: 'casm enum --method ConfigEnumAllOccupations --all' to \n\
119 enumerate configurations for all supercells. \n\
120 - Execute: 'casm enum --method ConfigEnumAllOccupations --min MINV --max MAXV' \n\
121 to enumerate configurations for supercells ranging in volume from \n\
122 MINV to MAXV (units: number of primitive cells). \n\
123 - Execute: 'casm enum --method ConfigEnumAllOccupations --scelname NAME' \n\
124 to enumerate configurations for a particular supercell. \n\
125 - Generated configurations are listed in the 'config_list.json' file. \n\
126 This file should not usually be edited manually. \n\
127 - Use the 'casm view' command to quickly view configurations in your \n\
128 favorite visualization program. See 'casm view -h' for help. \n\
129 - See 'casm enum --desc ConfigEnumAllOccupations' for extended help documentation on how to use \n\
130 '--filter' command to perform restricted enumeration of \n\
132 - Once you have a cluster expansion, see 'casm format --monte' for \n\
133 a description of how to save configurations enumerated during Monte \n\
134 Carlo calculations. \n\
135 - See 'casm format --config' for a description and location of \n\
136 the 'config_list.json' file. \n\n";
140 args.
log <<
"NEXT STEPS:\n\n";
143 "Calculate configuration properties\n\
145 Instructions for volume relaxed VASP energies: \n\n\
146 - Create INCAR, KPOINTS, POSCAR, SPECIES, and 'relax.json' files for \n\
147 VASP in: '$ROOT/training_data/settings/$CURR_CALCTYPE'. See \n\
148 'casm format --vasp' for a description and location of the VASP \n\
150 Instructions for volume relaxed Quantum Espresso energies: \n\n\
151 - Create $inputfile, SPECIES, and 'relax.json' (with calculator tag set) files for\n\
152 Quantum Espresso in: '$ROOT/training_data/settings/$CURR_CALCTYPE'. See\n\
153 'casm format --qe' for a description and location of the Quantum Espresso\n\
154 settings files. \n\n\
155 For either of the choices above do the following: \n\n\
156 - Select which configurations to calculate properties for using the \n\
157 'casm select' command. Use 'casm select --set-on' to select all \n\
158 configurations. By default, the 'selected' state of each \n\
159 configuration is stored by CASM in the master config_list.json file, \n\
160 located in the hidden '.casm' directory. The standard selections \n\
161 'MASTER', 'CALCULATED', 'ALL', or 'NONE' may always be used. \n\
162 - You can also save additional selection using the 'casm select -o' \n\
163 option to write a selection to a file. \n\
164 - Selections may be operated on to create new selections that are \n\
165 subsets, unions, or intersections of existing selections. \n\
166 - Selection files may also be edited manually or via programs for more \n\
167 complex selections than currently supported by 'casm select'. For all\n\
168 options related to selection configurations, see 'casm select -h'. \n\
169 - Selections may be used to query the properties of particular \n\
170 configurations using the 'casm query' command. See 'casm query -h' \n\
171 for the complete list of options. \n\
172 '$ROOT/training_data/$SCELNAME/$CONFIGID/$CURR_CALCTYPE/properties.calc.json'\n\
173 - Execute: 'casm-calc --setup' to setup VASP/QuantumEspresso input files for all\n\
174 selected configurations, but not submit the jobs. This is often a \n\
175 useful first step to check that input files have been prepared \n\
177 - Execute: 'casm-calc --submit' to submit VASP/QuantumEspresso jobs for all selected \n\
178 configurations. Only configurations which have not yet been \n\
179 calculated will run. \n\
180 - See 'casm-calc -h' for help and other options. \n\
181 - VASP/QuantumEspresso results will be stored at: \n\
182 '$ROOT/training_data/$SCELNAME/$CONFIGID/$CURR_CALCTYPE/properties.calc.json'\n\
183 Results in 'properties.calc.json' are expected to be ordered to match\n\
184 the 'POS' file at '$ROOT/training_data/$SCELNAME/$CONFIGID/POS' \n\
185 - Execute 'casm update' to read in calculation results from the \n\
186 'properties.calc.json' files once completed. \n\n";
192 args.
log <<
"NEXT STEPS:\n\n";
195 "Set chemical reference\n"
197 "- The chemical reference determines the value of the formation energy \n"
198 " and chemical potentials calculated by CASM. \n\n"
200 "- Chemical references states are set by specifying a hyperplane in \n"
201 " energy/atom - composition (as atom_frac) space. This may be done by \n"
202 " specifying the hyperplane explicitly, or by specifying several \n"
203 " reference states with energy/atom and composition (as atom_frac) for \n"
204 " enough states to span the composition space of the allowed occupants \n"
205 " specified in the prim. For consistency with other CASM projects, \n"
206 " additional reference states extending to other compositional \n"
207 " dimensions may be included also. \n\n"
209 "- Execute 'casm ref --set-auto' to automatically set project level \n"
210 " references using DFT calculated energies from configurations with \n"
211 " extreme parametric compositions.\n\n"
213 "- Execute 'casm ref --set '...JSON...'' to manually set the project \n"
214 " level reference energies. See 'casm ref --help' for more information.\n\n"
216 "- It is also possible to specialize the chemical reference at the \n"
217 " supercell or configuration level. \n\n"
219 "- See 'casm format' for a description and location of the \n"
220 " 'chemical_reference.json' file. \n\n";
225 args.
log <<
"NEXT STEPS:\n\n";
228 "Generate basis functions \n\
230 Instructions for generating basis functions: \n\n\
231 - Write a '$ROOT/basis_sets/$CURR_BSET/bspecs.json' file containing \n\
232 specifications for how which orbits to include and which site basis \n\
233 functions to use in generating cluster expansion basis functions. \n\
234 See 'casm format --bspecs' for an example file. \n\
235 - Execute 'casm bset -u' to generate basis functions. If you edit the \n\
236 'bspecs.json' file, execute 'casm bset -u' again to update basis \n\
238 - See 'casm format --bspecs' for description and location of the \n\
239 'bspecs.json' file.\n\n";
243 args.
log <<
"NEXT STEPS:\n\n";
246 "Fit effective cluster interactions (ECI)\n\
248 Instructions for fitting ECI: \n\n\
249 - Create a new directory within the CASM project, for example: \n\
250 mkdir fit_1 && cd fit_1 \n\
251 - Select which configurations to use as the training data with the \n\
252 'casm select' command. To select all calculated configurations: \n\
253 casm select --set 'is_calculated' -o train \n\
254 - See 'casm select -h' for more options. \n\
255 - Create a 'casm-learn' input file. Several example input files can be \n\
256 generated from 'casm-learn --exMethodName'. For example: \n\
257 casm-learn --exGeneticAlgorithm > fit_1_ga.json \n\
258 This file can be edited to adjust the problem being solved (training \n\
259 data, weighting scheme, cross validation sets and scoring, linear \n\
260 estimator method, feature selection method, etc.) \n\
261 - See 'casm-learn --settings-format' for description and help with the \n\
263 - Execute: 'casm-learn -s fit_1_ga.json' \n\
264 - Results are stored in a Hall Of Fame file containing the best \n\
265 solutions as determined from cross validation scores. \n\
266 - Different estimator methods (LinearRegression, Lasso, etc.) and \n\
267 different feature selection methods (GeneticAlgorithm, RFE, etc.) can\n\
268 be used with the same problem specs (training data, weighting scheme,\n\
269 cross validation sets and scoring) and compared in a single Hall Of \n\
271 - When some candidate ECI have been stored in a Hall Of Fame, use the \n\
272 'casm-learn --checkhull' option to check if ground state configurations \n\
273 are accurately predicted by the cluster expansion. \n\
274 - When ready, use 'casm-learn --select' to write an 'eci.json' file to \n\
275 use for Monte Carlo. \n\
276 - See 'casm format --eci' for a description and location of the \n\
277 'eci.json' files.\n\n";
282 args.
log <<
"NEXT STEPS:\n\n";
285 "Monte Carlo calculations\n\
287 - Use 'casm monte' to run Monte Carlo calculations. \n\
288 - See 'casm monte --format' and 'casm monte -h' for help. \n\n";
307 if(!fs::exists(eci_path) && fs::exists(eci_out) && fs::exists(basis_json_path)) {
310 args.
log <<
"Converting: \n " << eci_out <<
"\nto:\n " << eci_path << std::endl;
319 for(
int i = 0; i <
eci.index().size(); ++i) {
320 auto index =
eci.index()[i];
321 auto value =
eci.value()[i];
322 basis_json[
"cluster_functions"][index][
"eci"] = value;
326 basis_json.
write(eci_path);
327 args.
err_log <<
"DONE" << std::endl << std::endl;
343 namespace Completer {
350 (
"next,n",
"Write next steps")
351 (
"warning,w",
"Suppress warnings")
352 (
"details,d",
"Print detailed information")
353 (
"all,a",
"Print all 'casm status -n' help messages");
365 args.
log << std::setw(6) <<
"INDEX" <<
" " << std::setw(30) <<
"SUPERCELL" <<
" " <<
"#CONFIGS G / C / S" << std::endl;
366 args.
log <<
"---------------------------------------------------------------------------" << std::endl;
369 int calc = 0, sel = 0;
382 args.
log << std::setw(6) << i <<
" " << std::setw(30) << primclex.
get_supercell(i).
get_name() <<
" " << gen <<
" / " << calc <<
" / " << sel << std::endl;
384 args.
log <<
"---------------------------------------------------------------------------" << std::endl;
385 args.
log << std::setw(6) <<
" " <<
" " << std::setw(30) <<
"TOTAL" <<
" " << tot_gen <<
" / " << tot_calc <<
" / " << tot_sel << std::endl;
386 args.
log <<
"\nG:Generated, C:Calculated, S:Selected" << std::endl << std::endl;
391 po::variables_map vm;
396 po::store(po::parse_command_line(args.
argc, args.
argv, status_opt.
desc()), vm);
400 if(vm.count(
"help")) {
402 args.
log << status_opt.
desc() << std::endl;
407 if(vm.count(
"desc")) {
409 args.
log << status_opt.
desc() << std::endl;
410 args.
log <<
"DESCRIPTION" << std::endl;
411 args.
log <<
" Get status information for the current CASM project.\n\n";
419 catch(po::error &e) {
420 args.
err_log <<
"ERROR: " << e.what() << std::endl << std::endl;
424 catch(std::exception &e) {
425 args.
err_log <<
"Unhandled Exception reached the top of main: "
426 << e.what() <<
", application will now exit" << std::endl;
433 args.
log <<
"\n#################################\n\n";
435 args.
log <<
"CASM status:\n\n";
437 if(vm.count(
"all")) {
438 args.
log <<
"\n#################################\n\n";
446 args.
log <<
"1) Project initialized: FALSE\n\n";
448 if(vm.count(
"next")) {
449 args.
log <<
"\n#################################\n\n";
454 args.
log <<
"For next steps, run 'casm status -n'\n\n";
463 if(!fs::exists(dir.
prim())) {
464 args.
log <<
" ERROR\n\n";
466 args.
log <<
"- Found a CASM project, but no '" << dir.
prim() <<
"' file." << std::endl;
467 args.
log <<
"- CASMP project location: " << root << std::endl;
468 args.
log <<
"Please add a prim.json file, or rm the '.casm' directory." << std::endl << std::endl;
476 std::unique_ptr<PrimClex> uniq_primclex;
483 std::string
property = desc.
property;
485 std::string
ref = desc.
ref;
487 std::string
eci = desc.
eci;
490 args.
log <<
"1) Project initialized: TRUE\n\n";
491 args.
log <<
"- Project name: " << primclex.
name() << std::endl;
492 args.
log <<
"- Project location: " << primclex.
get_path().string() << std::endl;
498 args.
log <<
"- Lattice point group size: " << prim_pg.
size() << std::endl;
499 args.
log <<
"- Lattice point group is " << prim_pg.
get_name() << std::endl;
502 if(!vm.count(
"warning")) {
504 args.
log <<
"*** Warning: Finding a factor group that is larger than the lattice \n"
505 <<
" point group implies that your structure is not primitive." << std::endl;
508 args.
log << std::endl << std::endl;
512 if(vm.count(
"all")) {
513 args.
log <<
"\n#################################\n\n";
514 args.
log <<
"\n2) Composition axes \n\n";
519 args.
log <<
"2) Composition axes \n";
521 args.
log <<
"- Composition axes selected: ";
524 args.
log <<
"FALSE\n\n";
526 if(vm.count(
"next")) {
527 args.
log <<
"\n#################################\n\n";
532 args.
log <<
"For next steps, run 'casm status -n'\n\n";
538 args.
log <<
"TRUE\n\n\n";
552 if(vm.count(
"all")) {
553 args.
log <<
"\n#################################\n\n";
554 args.
log <<
"3) Generate configurations \n\n";
562 args.
log <<
"\n3) Generate configurations \n";
570 int calc = 0, sel = 0;
586 args.
log <<
"- Number of configurations generated: " << tot_gen <<
"\n";
587 args.
log <<
"- Number of configurations currently selected: " << tot_sel <<
"\n";
591 if(vm.count(
"next")) {
592 args.
log <<
"\n#################################\n\n";
597 args.
log <<
"For next steps, run 'casm status -n'\n\n";
605 if(vm.count(
"next")) {
606 args.
log <<
"\n#################################\n\n";
611 args.
log <<
"For next steps, run 'casm status -n'\n\n";
614 if(vm.count(
"details")) {
618 args.
log <<
"For the number of configurations generated, calculated,\n and selected by supercell, run 'casm status -d'\n\n";
624 args.
log << std::endl << std::endl;
629 if(vm.count(
"all")) {
630 args.
log <<
"\n#################################\n\n";
631 args.
log <<
"4) Calculate configuration properties\n\n";
636 args.
log <<
"4) Calculate configuration properties\n";
638 args.
log <<
"- Current calctype: " << calctype <<
"\n";
639 args.
log <<
"- Current cluster expansion: " << desc.
name <<
"\n";
640 args.
log <<
"- Number of configurations calculated: " << tot_calc <<
" / " << tot_gen <<
" generated (Update with 'casm update')\n\n";
642 if(vm.count(
"details")) {
646 args.
log <<
"For the number of configurations generated, calculated,\n and selected by supercell, run 'casm status -d'\n\n";
650 if(vm.count(
"next")) {
651 args.
log <<
"\n#################################\n\n";
656 args.
log <<
"For next steps, run 'casm status -n'\n\n";
662 args.
log << std::endl;
668 if(vm.count(
"all")) {
669 args.
log <<
"\n#################################\n\n";
670 args.
log <<
"5) Choose chemical reference\n\n";
674 args.
log <<
"5) Choose chemical reference\n";
676 args.
log <<
"- Chemical reference set: ";
678 args.
log <<
"TRUE" <<
"\n";
681 args.
log <<
"FALSE" <<
"\n";
686 args.
log <<
"To show the chemical reference, run 'casm ref -d'\n\n";
690 args.
log <<
"No chemical reference set." << std::endl << std::endl;
692 if(vm.count(
"next")) {
693 args.
log <<
"\n#################################\n\n";
698 args.
log <<
"For next steps, run 'casm status -n'\n\n";
704 args.
log << std::endl;
710 if(vm.count(
"all")) {
711 args.
log <<
"\n#################################\n\n";
712 args.
log <<
"6) Generate basis functions: \n\n";
716 args.
log <<
"6) Generate basis functions: ";
719 args.
log <<
"FALSE\n\n";
721 if(vm.count(
"next")) {
722 args.
log <<
"\n#################################\n\n";
727 args.
log <<
"For next steps, run 'casm status -n'\n\n";
732 args.
log <<
"TRUE\n\n\n";
737 if(vm.count(
"all")) {
738 args.
log <<
"\n#################################\n\n";
739 args.
log <<
"7) Fit effective cluster interactions (ECI): \n\n";
743 args.
log <<
"7) Fit effective cluster interactions (ECI): ";
745 if(!fs::exists(dir.
eci(
property, calctype, ref, bset, eci))) {
746 args.
log <<
"FALSE\n\n";
748 if(vm.count(
"next")) {
749 args.
log <<
"\n#################################\n\n";
754 args.
log <<
"For next steps, run 'casm status -n'\n\n";
759 args.
log <<
"TRUE\n\n\n";
763 args.
log << std::endl;
765 if(vm.count(
"next") || vm.count(
"all")) {
766 args.
log <<
"\n#################################\n\n";
767 args.
log <<
"8) Monte Carlo Calculations: \n\n";
771 args.
log <<
"For next steps, run 'casm status -n'\n\n";
const Configuration & get_config(Index i) const
Data structure holding basic CASM command info.
fs::path eci(std::string property, std::string calctype, std::string ref, std::string bset, std::string eci) const
Returns path to eci.json.
boost::container::stable_vector< Supercell > & get_supercell_list()
Access entire supercell_list.
std::string get_name() const
Return supercell name.
void initialize() override
Fill in the options descriptions accordingly.
Specifies a particular cluster expansion.
void bset_uncalculated(const CommandArgs &args)
bool selected() const
True if this Configuration is currently selected in the MASTER config list.
void generate_point_group(SymGroup &point_group, double pg_tol=TOL) const
Populate.
Specification of CASM project directory structure.
const DirectoryStructure & dir() const
void write(const std::string &file_name, unsigned int indent=2, unsigned int prec=12) const
Write json to file.
const SymGroup & point_group() const
fs::path get_path() const
Return casm project directory path.
void add_help_suboption()
Add a plain –help suboption.
bool has_composition_axes() const
check if CompositionConverter object initialized
ConfigList & get_config_list()
int update_format(fs::path root, const CommandArgs &args)
const Lattice & lattice() const
fs::path prim() const
Return prim.json path.
std::vector< std::string > all_eci(std::string property, std::string calctype, std::string ref, std::string bset) const
Check filesystem directory structure and return list of all eci names.
Represents a supercell of the primitive parent crystal structure.
std::string name() const
Return project name.
std::vector< std::string > all_property() const
Check filesystem directory structure and return list of all property names.
bool has_chemical_reference() const
check if ChemicalReference object initialized
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
std::string name() const
Get project name.
const Properties & calc_properties() const
const po::options_description & desc()
Get the program options, filled with the initialized values.
const MasterSymGroup & factor_group() const
Read/modify settings of an already existing CASM project.
int status_command(const CommandArgs &args)
fs::path eci_out(std::string property, std::string calctype, std::string ref, std::string bset, std::string eci) const
Returns path to eci.out.
fs::path clexulator_src(std::string project, std::string bset) const
Returns path to global clexulator source file.
const Array< std::complex< double > >::X2 & character_table() const
void montecarlo(const CommandArgs &args)
fs::path basis(std::string bset) const
void status_unitialized(const CommandArgs &args)
po::options_description m_desc
Boost program options. All the derived classes have them, but will fill them up themselves.
ProjectSettings & settings()
ECIContainer read_eci_out(const fs::path &filepath)
Read eci.out file from specified path (deprecated)
PrimClex is the top-level data structure for a CASM project.
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...
static jsonParser parse(const std::string &str)
Construct a jsonParser from a string containing JSON data.
const Supercell & get_supercell(Index i) const
const Access supercell by index
bool contains(const std::string &name) const
Return true if JSON object contains 'name'.
void print_details(const CommandArgs &args, const PrimClex &primclex)
void configs_ungenerated(const CommandArgs &args)
void configs_uncalculated(const CommandArgs &args)
std::vector< std::string > all_calctype() const
Check filesystem directory structure and return list of all calctype names.
int update_eci_format(fs::path root, const CommandArgs &args)
void composition_unselected(const CommandArgs &args)
const std::string & get_name() const
std::vector< std::string > all_bset() const
Check filesystem directory structure and return list of all basis set names.
void references_unset(const CommandArgs &args)
const ClexDescription & default_clex() const
void supercells_ungenerated(const CommandArgs &args)
std::vector< std::string > all_ref(std::string calctype) const
Check filesystem directory structure and return list of all ref names for a given calctype...
const Structure & get_prim() const
const Access to primitive Structure
void eci_uncalculated(const CommandArgs &args)