CASM  1.1.0
A Clusters Approach to Statistical Mechanics
enumerate_configurations.hh
Go to the documentation of this file.
1 #ifndef CASM_enum_enumerate_configurations
2 #define CASM_enum_enumerate_configurations
3 
4 #include <functional>
5 #include <map>
6 #include <string>
7 
10 
11 namespace CASM {
12 
13 class Configuration;
14 class PrimClex;
15 class Supercell;
16 
17 namespace DB {
18 template <typename T>
19 class Database;
20 }
21 
25 
27  std::string method_name;
28 
31  bool primitive_only = true;
32 
34  std::string filter_expression;
35 
37  std::function<bool(Configuration const &)> filter;
38 
40  bool dry_run = false;
41 
43  int verbosity = 10;
44 
46  PrimClex const *primclex_ptr = nullptr;
47 
50  bool output_configurations = false;
51 
54 
57 };
58 
61 template <typename EnumeratorType, typename InitialStateType>
63  ConfigEnumData(PrimClex const &_primclex, Index _initial_state_index,
64  std::string const &_initial_state_name,
65  InitialStateType const &_initial_state,
66  EnumeratorType const &_enumerator,
67  Configuration const &_configuration)
68  : primclex(_primclex),
69  initial_state_index(_initial_state_index),
70  initial_state_name(_initial_state_name),
71  initial_state(_initial_state),
72  enumerator(_enumerator),
73  configuration(_configuration) {}
74 
77  std::string const &initial_state_name;
78  InitialStateType const &initial_state;
79  EnumeratorType const &enumerator;
81 
82  bool is_excluded_by_filter = false;
84 };
85 
87 template <typename MakeEnumeratorFunction, typename InputNameValuePairIterator,
88  typename ConfigEnumDataType>
90  PrimClex const &primclex, ConfigEnumOptions const &options,
91  MakeEnumeratorFunction make_enumerator_f,
92  InputNameValuePairIterator name_value_pairs_begin,
93  InputNameValuePairIterator name_value_pairs_end,
94  DataFormatter<ConfigEnumDataType> const &formatter);
95 
96 } // namespace CASM
97 
98 #endif
Extract data from objects of 'DataObject' class.
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:55
ConfigEnumData< ConfigEnumSiteDoFs, ConfigEnumInput > ConfigEnumDataType
Main CASM namespace.
Definition: APICommand.hh:8
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.
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
PrimClex * primclex
Definition: settings.cc:135
ConfigEnumData(PrimClex const &_primclex, Index _initial_state_index, std::string const &_initial_state_name, InitialStateType const &_initial_state, EnumeratorType const &_enumerator, Configuration const &_configuration)
EnumeratorType const & enumerator
InitialStateType const & initial_state
Configuration const & configuration
ConfigInsertResult insert_result
std::string const & initial_state_name
Options for the enumerate_configurations function.
bool dry_run
If dry_run==true, do not save results, just print to screen.
int verbosity
Printing verbosity level.
FormattedDataFileOptions output_options
Options for construcing FormattedDataFile object.
std::string method_name
Method name, for printing progress.
std::function< bool(Configuration const &)> filter
If filter(configuration)==true, keep configuration, else skip.
ConfigEnumOptions(PrimClex const &primclex)
bool output_filtered_configurations
If true, include output for configurations that were filtered out.
std::string filter_expression
If not empty, expression used to construct filter.
PrimClex const * primclex_ptr
Use while transitioning Supercell to no longer need a PrimClex const *
Holds results of Configuration::insert.