20 std::string custom_options =
"";
22 std::string examples =
24 " To enumerate all occupations in supercells up to and including size "
26 " casm enum --method ConfigEnumAllOccupations -i '{\"supercells\": "
29 " To enumerate all occupations in all existing supercells:\n"
30 " casm enum --method ConfigEnumAllOccupations --all\n"
32 " To enumerate all occupations in particular supercells:\n"
33 " casm enum --method ConfigEnumAllOccupations -i \n"
36 " \"SCEL1_1_1_1_0_0_0\",\n"
37 " \"SCEL2_1_2_1_0_0_0\",\n"
38 " \"SCEL4_1_4_1_0_0_0\"\n"
58 std::runtime_error error_if_invalid{
59 "Error reading ConfigEnumAllOccupations JSON input"};
75 auto input_parser_ptr =
76 parser.
parse_as<std::vector<std::pair<std::string, ConfigEnumInput>>>(
80 auto const &named_initial_states = *input_parser_ptr->value;
85 auto make_enumerator_f = [&](
Index index, std::string
name,
93 formatter.
push_back(ConfigEnumIO::name<ConfigEnumDataType>(),
94 ConfigEnumIO::selected<ConfigEnumDataType>(),
95 ConfigEnumIO::is_new<ConfigEnumDataType>(),
96 ConfigEnumIO::is_existing<ConfigEnumDataType>());
99 ConfigEnumIO::is_excluded_by_filter<ConfigEnumDataType>());
102 ConfigEnumIO::initial_state_index<ConfigEnumDataType>(),
103 ConfigEnumIO::initial_state_name<ConfigEnumDataType>(),
104 ConfigEnumIO::initial_state_configname<ConfigEnumDataType>(),
105 ConfigEnumIO::n_selected_sites<ConfigEnumDataType>());
108 log.
begin(
"ConfigEnumAllOccupations enumeration");
111 named_initial_states.begin(),
112 named_initial_states.end(), formatter);
static const std::string enumerator_name
void run(PrimClex &primclex, jsonParser const &json_options, jsonParser const &cli_options_as_json) const override
std::string name() const override
Enumeration method name (i.e. "ConfigEnumAllOccupations")
std::string desc() const override
void end_section()
End a section.
void set_verbosity(int _verbosity)
void custom(const std::string &what)
Log & subsection()
Create a subsection.
void begin(const std::string &what)
PrimClex is the top-level data structure for a CASM project.
Represents a supercell of the primitive parent crystal structure.
ConfigEnumData< ConfigEnumSiteDoFs, ConfigEnumInput > ConfigEnumDataType
std::string standard_ConfigEnumInput_help()
void print_initial_states(Log &log, NamedInitialStatesType const &named_initial_states)
ParentInputParser make_enum_parent_parser(Log &log, jsonParser const &json_options, jsonParser const &cli_options_as_json)
Combine –input / –settings JSON with CLI options.
void enumerate_configurations(PrimClex const &primclex, ConfigEnumOptions const &options, MakeEnumeratorFunction make_enumerator_f, InputNameValuePairIterator name_value_pairs_begin, InputNameValuePairIterator name_value_pairs_end, DataFormatter< ConfigEnumDataType > const &formatter)
Enumerate configurations.
void report_and_throw_if_invalid(KwargsParser const &parser, Log &log, ErrorType error)
void print_options(Log &log, ConfigEnumOptions const &options)
INDEX_TYPE Index
For long integer indexing:
Options for the enumerate_configurations function.
int verbosity
Printing verbosity level.
std::function< bool(Configuration const &)> filter
If filter(configuration)==true, keep configuration, else skip.