CASM  1.1.0
A Clusters Approach to Statistical Mechanics
MonteDriver.hh
Go to the documentation of this file.
1 #ifndef CASM_MonteDriver_HH
2 #define CASM_MonteDriver_HH
3 
4 #include <string>
5 #include <vector>
6 
9 
10 namespace CASM {
11 class PrimClex;
12 class Log;
13 
14 namespace Monte {
15 class MonteCarloEnum;
16 
29 template <typename RunType>
30 class MonteDriver {
31  public:
32  typedef typename RunType::CondType CondType;
33  typedef typename RunType::SettingsType SettingsType;
34 
36  MonteDriver(const PrimClex &primclex, const SettingsType &settings, Log &_log,
37  Log &_err_log);
38 
40  void run();
41 
42  private:
44  bool debug() const { return m_debug; }
45 
48  std::vector<CondType> make_conditions_list(const PrimClex &primclex,
49  const SettingsType &settings);
50 
52  void single_run(Index cond_index);
53 
56 
59 
62 
66 
69 
72 
74  RunType m_mc;
75 
78  const std::vector<CondType> m_conditions_list;
79 
81  bool m_debug;
82 
85 };
86 
88 template <typename RunType>
89 bool monte_carlo_step(RunType &monte_run);
90 
91 } // namespace Monte
92 } // namespace CASM
93 
94 #endif
Definition: Log.hh:48
void run()
Run everything requested by the MonteSettings.
Log & m_log
target for log messages
Definition: MonteDriver.hh:58
bool debug() const
run in debug mode?
Definition: MonteDriver.hh:44
void single_run(Index cond_index)
Converge the MonteCarlo for conditions 'cond_index'.
const std::vector< CondType > m_conditions_list
Definition: MonteDriver.hh:78
RunType::SettingsType SettingsType
Definition: MonteDriver.hh:33
MonteDriver(const PrimClex &primclex, const SettingsType &settings, Log &_log, Log &_err_log)
Constructor via MonteSettings.
bool m_debug
run in debug mode?
Definition: MonteDriver.hh:81
MonteCarloDirectoryStructure m_dir
describes where to write output
Definition: MonteDriver.hh:68
const Monte::DRIVE_MODE m_drive_mode
Specifies how to build the conditions list from the settings.
Definition: MonteDriver.hh:71
RunType::CondType CondType
Definition: MonteDriver.hh:32
std::vector< CondType > make_conditions_list(const PrimClex &primclex, const SettingsType &settings)
Log & m_err_log
target for error messages
Definition: MonteDriver.hh:61
Index _find_starting_conditions() const
Check for existing calculations to find starting conditions.
RunType m_mc
Specialized Monte Carlo object to use throughout.
Definition: MonteDriver.hh:74
notstd::cloneable_ptr< MonteCarloEnum > m_enum
Enumerated configurations encountered during Monte Carlo calculations.
Definition: MonteDriver.hh:84
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:55
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
bool monte_carlo_step(RunType &monte_run)
Perform a single monte carlo step, return true if accepted.
DRIVE_MODE
How to change conditions.
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
PrimClex * primclex
Definition: settings.cc:135