CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::Monte::MonteDriver< RunType > Class Template Reference

#include <MonteDriver.hh>

Detailed Description

template<typename RunType>
class CASM::Monte::MonteDriver< RunType >

MonteDriver consists of a specialized MonteCarlo object and a list of conditions to equilibrate at. The first condition in the list requires a starting configuration (read from the setting), while subsequent conditions are calculated using the final state of the previous condition.

The different kinds of drive modes the user can specify are: INCREMENTAL: Given a delta in condition values, increment the conditions by the delta after each point CUSTOM: Calculate for a list of condition values

Definition at line 30 of file MonteDriver.hh.

Public Types

typedef RunType::CondType CondType
 
typedef RunType::SettingsType SettingsType
 

Public Member Functions

 MonteDriver (const PrimClex &primclex, const SettingsType &settings, Log &_log, Log &_err_log)
 Constructor via MonteSettings. More...
 
void run ()
 Run everything requested by the MonteSettings. More...
 

Private Member Functions

bool debug () const
 run in debug mode? More...
 
std::vector< CondTypemake_conditions_list (const PrimClex &primclex, const SettingsType &settings)
 
void single_run (Index cond_index)
 Converge the MonteCarlo for conditions 'cond_index'. More...
 
Index _find_starting_conditions () const
 Check for existing calculations to find starting conditions. More...
 

Private Attributes

Logm_log
 target for log messages More...
 
Logm_err_log
 target for error messages More...
 
SettingsType m_settings
 
MonteCarloDirectoryStructure m_dir
 describes where to write output More...
 
const Monte::DRIVE_MODE m_drive_mode
 Specifies how to build the conditions list from the settings. More...
 
RunType m_mc
 Specialized Monte Carlo object to use throughout. More...
 
const std::vector< CondTypem_conditions_list
 
bool m_debug
 run in debug mode? More...
 
notstd::cloneable_ptr< MonteCarloEnumm_enum
 Enumerated configurations encountered during Monte Carlo calculations. More...
 

Member Typedef Documentation

◆ CondType

template<typename RunType >
typedef RunType::CondType CASM::Monte::MonteDriver< RunType >::CondType

Definition at line 32 of file MonteDriver.hh.

◆ SettingsType

template<typename RunType >
typedef RunType::SettingsType CASM::Monte::MonteDriver< RunType >::SettingsType

Definition at line 33 of file MonteDriver.hh.

Constructor & Destructor Documentation

◆ MonteDriver()

template<typename RunType >
CASM::Monte::MonteDriver< RunType >::MonteDriver ( const PrimClex primclex,
const SettingsType settings,
Log _log,
Log _err_log 
)

Constructor via MonteSettings.

Definition at line 20 of file MonteDriver_impl.hh.

Member Function Documentation

◆ _find_starting_conditions()

template<typename RunType >
Index CASM::Monte::MonteDriver< RunType >::_find_starting_conditions
private

Check for existing calculations to find starting conditions.

Checks existing files to determine where to restart a path.

  • Will overwrite or cause to overwrite files in cases where the final state or results summary do not exist for some conditions

Definition at line 155 of file MonteDriver_impl.hh.

◆ debug()

template<typename RunType >
bool CASM::Monte::MonteDriver< RunType >::debug ( ) const
inlineprivate

run in debug mode?

Definition at line 44 of file MonteDriver.hh.

◆ make_conditions_list()

template<typename RunType >
std::vector< typename MonteDriver< RunType >::CondType > CASM::Monte::MonteDriver< RunType >::make_conditions_list ( const PrimClex primclex,
const SettingsType settings 
)
private

Return the appropriate std::vector of conditions to visit based from settings. Use for construction.

Reads from the settings and constructs an appropriate std::vector of conditions for MonteDriver to visit.

Options are:

  • Single: only visit initial conditions (Returns empty array)
  • Custom: Provide explicit list of conditions to visit
  • Incremental: specify initial conditions, final conditions and regular intervals

Definition at line 378 of file MonteDriver_impl.hh.

◆ run()

template<typename RunType >
void CASM::Monte::MonteDriver< RunType >::run

Run everything requested by the MonteSettings.

Run calculations for all conditions, outputting data as you finish each one.

  • Assumes existing "output_dir/conditions.i/final_state.json" files indicates finished calculations that are already included in the results summary "output_dir/results.X", and that no other results are written to the results summary.
  • If there are existing results, uses "output_dir/conditions.i/final_state.json" as the initial state for the next run

Definition at line 47 of file MonteDriver_impl.hh.

◆ single_run()

template<typename RunType >
void CASM::Monte::MonteDriver< RunType >::single_run ( Index  cond_index)
private

Converge the MonteCarlo for conditions 'cond_index'.

Definition at line 234 of file MonteDriver_impl.hh.

Member Data Documentation

◆ m_conditions_list

template<typename RunType >
const std::vector<CondType> CASM::Monte::MonteDriver< RunType >::m_conditions_list
private

List of specialized conditions to visit in sequential order. Does not include initial conditions.

Definition at line 78 of file MonteDriver.hh.

◆ m_debug

template<typename RunType >
bool CASM::Monte::MonteDriver< RunType >::m_debug
private

run in debug mode?

Definition at line 81 of file MonteDriver.hh.

◆ m_dir

template<typename RunType >
MonteCarloDirectoryStructure CASM::Monte::MonteDriver< RunType >::m_dir
private

describes where to write output

Definition at line 68 of file MonteDriver.hh.

◆ m_drive_mode

template<typename RunType >
const Monte::DRIVE_MODE CASM::Monte::MonteDriver< RunType >::m_drive_mode
private

Specifies how to build the conditions list from the settings.

Definition at line 71 of file MonteDriver.hh.

◆ m_enum

template<typename RunType >
notstd::cloneable_ptr<MonteCarloEnum> CASM::Monte::MonteDriver< RunType >::m_enum
private

Enumerated configurations encountered during Monte Carlo calculations.

Definition at line 84 of file MonteDriver.hh.

◆ m_err_log

template<typename RunType >
Log& CASM::Monte::MonteDriver< RunType >::m_err_log
private

target for error messages

Definition at line 61 of file MonteDriver.hh.

◆ m_log

template<typename RunType >
Log& CASM::Monte::MonteDriver< RunType >::m_log
private

target for log messages

Definition at line 58 of file MonteDriver.hh.

◆ m_mc

template<typename RunType >
RunType CASM::Monte::MonteDriver< RunType >::m_mc
private

Specialized Monte Carlo object to use throughout.

Definition at line 74 of file MonteDriver.hh.

◆ m_settings

template<typename RunType >
SettingsType CASM::Monte::MonteDriver< RunType >::m_settings
private

Copy of initial settings given at construction. Will expand to have MonteCarlo states dumped into it.

Definition at line 65 of file MonteDriver.hh.


The documentation for this class was generated from the following files: