19 (
"occ",
"Perturb occupations")
38 fs::path cspecs_path, abs_cspecs_path;
42 std::vector<Index> subgrids;
43 std::vector<double> mags;
44 std::string strain_mode;
51 po::store(po::parse_command_line(args.
argc, args.
argv, perturb_opt.
desc()), vm);
55 if(vm.count(
"help")) {
57 args.
log << perturb_opt.
desc() << std::endl;
62 if(vm.count(
"desc")) {
64 args.
log << perturb_opt.
desc() << std::endl;
66 args.
log <<
"DESCRIPTION" << std::endl;
67 args.
log <<
" Generate supercells that are perturbations of a reference\n";
68 args.
log <<
" configuration. \n";
69 args.
log <<
" - using the --cspecs option, a bspecs.json type file is \n";
70 args.
log <<
" required to determine the extent of the perturbations. \n";
71 args.
log <<
" Currently only 'orbit_branch_specs' are supported. \n";
72 args.
log <<
" - perturbations are generated about selected reference \n";
73 args.
log <<
" configurations \n";
74 args.
log << std::endl;
86 args.
err_log <<
"ERROR: " << e.what() << std::endl << std::endl;
90 catch(std::exception &e) {
91 args.
err_log <<
"Unhandled Exception reached the top of main: "
92 << e.what() <<
", application will now exit" << std::endl;
108 std::unique_ptr<PrimClex> uniq_primclex;
188 if(vm.count(
"occ")) {
190 abs_cspecs_path = fs::absolute(cspecs_path);
195 if(!vm.count(
"config") || selection ==
"MASTER") {
202 args.
log <<
"\n***************************\n" << std::endl;
204 args.
log <<
"Generating perturbations about configurations " << std::endl << std::endl;
206 bool verbose =
false;
209 args.
log <<
" " << it->get_supercell().get_name() <<
"/" << it->get_id() << std::endl;
210 it->get_supercell().enumerate_perturb_configurations(*it, abs_cspecs_path, tol, verbose, print);
215 args.
log << perturb_opt.
desc() << std::endl;
217 args.
log <<
"DESCRIPTION" << std::endl;
218 args.
log <<
" Generate supercells that are perturbations of a reference\n";
219 args.
log <<
" configuration. \n";
220 args.
log <<
" - using the --cspecs option, a bspecs.json type file is \n";
221 args.
log <<
" required to determine the extent of the perturbations. \n";
222 args.
log <<
" Currently only 'orbit_branch_specs' are supported. \n";
223 args.
log <<
" - perturbations are generated about selected reference \n";
224 args.
log <<
" configurations \n";
225 args.
log << std::endl;
230 args.
log << std::endl <<
" DONE." << std::endl << std::endl;
232 args.
log <<
"Writing config_list..." << std::endl;
234 args.
log <<
" DONE" << std::endl;
236 args.
log << std::endl;
Data structure holding basic CASM command info.
void write_config_list(std::set< std::string > scel_to_delete={})
Specification of CASM project directory structure.
void initialize() override
Fill in the options descriptions accordingly.
void add_help_suboption()
Add a plain –help suboption.
iterator selected_config_begin()
void add_configlist_suboption(const fs::path &_default="MASTER")
Add –config suboption (defaults to MASTER)
const fs::path & selection_path() const
Returns the string corresponding to add_config_suboption()
static std::string path()
Get value_type string for path completion.
const po::options_description & desc()
Get the program options, filled with the initialized values.
COORD_MODE specifies the current coordinate mode (Fractional or Cartesian)
Read/modify settings of an already existing CASM project.
iterator selected_config_end()
po::options_description m_desc
Boost program options. All the derived classes have them, but will fill them up themselves.
PrimClex is the top-level data structure for a CASM project.
int perturb_command(const CommandArgs &args)
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...
void error(const std::string &what)
const fs::path & cspecs_path() const