CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::Monte::GrandCanonicalSettings Class Reference

#include <GrandCanonicalSettings.hh>

+ Inheritance diagram for CASM::Monte::GrandCanonicalSettings:

Detailed Description

Definition at line 11 of file GrandCanonicalSettings.hh.

Public Types

typedef Index size_type
 

Public Member Functions

 GrandCanonicalSettings ()
 Default constructor. More...
 
 GrandCanonicalSettings (const PrimClex &primclex, const fs::path &read_path)
 Construct EquilibriumMonteSettings by reading a settings JSON file. More...
 
GrandCanonicalConditions initial_conditions () const
 Expects initial_conditions. More...
 
GrandCanonicalConditions final_conditions () const
 Expects final_conditions. More...
 
GrandCanonicalConditions incremental_conditions () const
 Expects incremental_conditions. More...
 
std::vector< GrandCanonicalConditionscustom_conditions () const
 Expects custom_conditions. More...
 
ClexDescription formation_energy (const PrimClex &primclex) const
 Get formation energy cluster expansion. More...
 
template<typename SamplerInsertIterator >
SamplerInsertIterator samplers (const PrimClex &primclex, SamplerInsertIterator result) const
 Construct Samplers as specified in the Settings. More...
 
bool all_correlations () const
 Return true if all correlations should be sampled. More...
 
bool sample_by_pass () const
 Sample by pass? More...
 
bool sample_by_step () const
 Sample by step? More...
 
size_type sample_period () const
 Figure out how often to take samples. More...
 
bool is_equilibration_passes_first_run () const
 Returns true if explicit equilibration passes for the first run have been specified. More...
 
size_type equilibration_passes_first_run () const
 Number of explicit equilibration passes requsted for the first run. More...
 
bool is_equilibration_passes_each_run () const
 Returns true if explicit equilibration passes for each run have been specified. More...
 
size_type equilibration_passes_each_run () const
 Number of explicit equilibration passes requsted for each run. More...
 
bool is_N_pass () const
 Returns true if the number of passes has been specified. More...
 
size_type N_pass () const
 Returns the number of passes requested. More...
 
bool is_N_step () const
 Returns true if the number of steps has been specified. More...
 
size_type N_step () const
 Returns the number of steps requested. More...
 
bool is_N_sample () const
 Returns true if the number of samples has been specified. More...
 
size_type N_sample () const
 Returns the number of samples requested. More...
 
bool is_max_pass () const
 Returns true if a maximum number of passes has been specified. More...
 
size_type max_pass () const
 Maximum number of passes, required if sample by pass. More...
 
bool is_min_pass () const
 Returns true if a minimum number of passes has been specified. More...
 
size_type min_pass () const
 Minimum number of passes, default 0 if sample by pass. More...
 
bool is_max_step () const
 Returns true if a maximum number of steps has been specified. More...
 
size_type max_step () const
 Maximum number of steps, required if sample by step. More...
 
bool is_min_step () const
 Returns true if a minimum number of steps has been specified. More...
 
size_type min_step () const
 Minimum number of steps, default 0 if sample by step. More...
 
bool is_max_sample () const
 Returns true if a maximum number of samples has been specified. More...
 
size_type max_sample () const
 Maximum number of steps, default std::numeric_limit<size_type>::max() More...
 
bool is_min_sample () const
 Returns true if a minimum number of samples has been specified. More...
 
size_type min_sample () const
 Minimum number of steps, default 0. More...
 
size_type max_data_length () const
 Figure out how large data containers should be. More...
 
fs::path root () const
 
const PrimClexprimclex () const
 
Monte::ENSEMBLE ensemble () const
 Return type of Monte Carlo ensemble. More...
 
Monte::METHOD method () const
 Return type of Monte Carlo method. More...
 
bool debug () const
 Run in debug mode? More...
 
void set_debug (bool _debug)
 Set debug mode. More...
 
bool is_motif_configname () const
 Returns true if configname of configuration to use as starting motif has been specified. More...
 
std::string motif_configname () const
 Configname of configuration to use as starting motif. More...
 
bool is_motif_configdof () const
 Returns true if path to ConfigDoF file to use as starting motif has been specified. More...
 
ConfigDoF motif_configdof (Index supercell_volume) const
 ConfigDoF to use as starting motif. More...
 
fs::path motif_configdof_path () const
 Path to ConfigDoF file to use as starting motif. More...
 
Eigen::Matrix3l simulation_cell_matrix () const
 Supercell matrix defining the simulation cell. More...
 
virtual const Monte::DRIVE_MODE drive_mode () const
 Given a settings jsonParser figure out the drive mode. Expects drive_mode/incremental,custom. More...
 
bool dependent_runs () const
 If dependent runs, start subsequent calculations with the final state of the previous calculation. Default true. More...
 
double confidence () const
 Given a settings jsonParser figure out the global tolerance (probably for == operator). Expects tolerance/value. More...
 
bool write_trajectory () const
 Returns true if snapshots are requested. More...
 
bool write_POSCAR_snapshots () const
 Returns true if POSCARs of snapshots are requsted. Requires write_trajectory. More...
 
bool write_observations () const
 Writes all observations. More...
 
bool write_csv () const
 Write csv versions of files? (csv is the default format if no 'output_format' given) More...
 
bool write_json () const
 Write json versions of files? More...
 
const fs::path output_directory () const
 Directory where output should go. More...
 
bool is_enumeration () const
 Returns true if enumeration is requested. (Default false) More...
 
std::string enumeration_metric_args () const
 Returns 'casm query'-like enumeration metric args. More...
 
std::string enumeration_check_args () const
 Returns 'casm query'-like enumeration check args. More...
 
Monte::ENUM_SAMPLE_MODE enumeration_sample_mode () const
 Enumeration sample mode (default Monte::ENUM_SAMPLE_MODE::ON_SAMPLE) More...
 
bool enumeration_insert_canonical () const
 Insert configurations in their canonical form. More...
 
bool enumeration_check_existence () const
 Only insert configurations that are not already enumerated. More...
 
Index enumeration_N_halloffame () const
 Returns enumeration halloffame max size (default 100) More...
 
double enumeration_tol () const
 Returns enumeration halloffame tolerance (default 1e-8) More...
 
void print (std::ostream &stream, unsigned int indent=2, unsigned int prec=12) const
 Print json to stream. More...
 
void write (const std::string &file_name, unsigned int indent=2, unsigned int prec=12) const
 Write json to file. More...
 
void write (const boost::filesystem::path &mypath, unsigned int indent=2, unsigned int prec=12) const
 Write json to file. More...
 
bool operator!= (const jsonParser &json) const
 

Protected Types

typedef jsonParserIterator< false > iterator
 
typedef jsonParserIterator< true > const_iterator
 

Protected Member Functions

bool _is_setting (std::string level1, std::string level2) const
 Returns true if (*this)[level1].contains(level2) More...
 
bool _is_setting (std::string level1, std::string level2, std::string level3) const
 Returns true if (*this)[level1][level2].contains(level3) More...
 
template<typename T >
_get_setting (std::string level1, std::string msg) const
 Returns (*this)[level1].get<T>();. More...
 
template<typename T >
_get_setting (std::string level1, std::string level2, std::string msg) const
 Returns (*this)[level1][level2].get<T>();. More...
 
template<typename T >
_get_setting (std::string level1, std::string level2, std::string level3, std::string msg) const
 Returns (*this)[level1][level2][level3].get<T>();. More...
 
jsonParser _json () const
 
void print (std::ostream &stream, unsigned int indent=2, unsigned int prec=12) const
 Print json to stream. More...
 
void write (const std::string &file_name, unsigned int indent=2, unsigned int prec=12) const
 Write json to file. More...
 
void write (const boost::filesystem::path &mypath, unsigned int indent=2, unsigned int prec=12) const
 Write json to file. More...
 
bool operator!= (const jsonParser &json) const
 
bool read (std::istream &stream)
 Reads json from the stream. More...
 
bool read (const boost::filesystem::path &mypath)
 Reads json from a path. More...
 
bool almost_equal (const jsonParser &B, double tol) const
 
bool is_null () const
 Check if null type. More...
 
bool is_bool () const
 Check if bool type. More...
 
bool is_int () const
 Check if int type. More...
 
bool is_float () const
 Check if number type (not including int) More...
 
bool is_number () const
 Check if number type (including int) More...
 
bool is_string () const
 Check if string. More...
 
bool is_obj () const
 Check if object type. More...
 
bool is_array () const
 Check if array type. More...
 
jsonParseroperator[] (const std::string &name)
 
const jsonParseroperator[] (const std::string &name) const
 
jsonParseroperator[] (const size_type &element)
 
const jsonParseroperator[] (const size_type &element) const
 
jsonParserat (const fs::path &path)
 
const jsonParserat (const fs::path &path) const
 
jsonParserat (const size_type &element)
 
const jsonParserat (const size_type &element) const
 
size_type size () const
 
iterator begin ()
 Returns const_iterator to beginning of JSON object or JSON array. More...
 
const_iterator begin () const
 Returns iterator to beginning of JSON object or JSON array. More...
 
iterator end ()
 Returns iterator to end of JSON object or JSON array. More...
 
const_iterator end () const
 Returns const_iterator to end of JSON object or JSON array. More...
 
const_iterator cbegin () const
 Returns const_iterator to beginning of JSON object or JSON array. More...
 
const_iterator cend () const
 Returns const_iterator to end of JSON object or JSON array. More...
 
iterator find (const std::string &name)
 Return iterator to JSON object value with 'name'. More...
 
const_iterator find (const std::string &name) const
 Return const_iterator to JSON object value with 'name'. More...
 
jsonParser::iterator find_at (const fs::path &path)
 Return iterator to sub-object or element, or 'end' if not found. More...
 
jsonParser::const_iterator find_at (const fs::path &path) const
 Return iterator to sub-object or element, or 'end' if not found. More...
 
bool contains (const std::string &name) const
 Return true if JSON object contains 'name'. More...
 
size_type erase (const std::string &name)
 Erase key:value pair from an object. More...
 
template<typename T , typename... Args>
get (Args &&... args) const
 Get data from json, using one of several alternatives. More...
 
template<typename T , typename... Args>
void get (T &t, Args &&... args) const
 
template<typename T , typename... Args>
bool get_if (T &t, const std::string &key, Args &&... args) const
 
template<typename T , typename... Args>
get_if_else (const std::string &key, const T &default_value, Args &&... args) const
 
template<typename T , typename... Args>
bool get_else (T &t, const std::string &key, const T &default_value, Args &&... args) const
 
template<typename T , typename... Args>
std::unique_ptr< T > make (Args &&... args) const
 Get data from json. More...
 
template<typename T , typename... Args>
void make (std::unique_ptr< T > &ptr, Args &&... args) const
 Get data from json. More...
 
template<typename T , typename... Args>
bool make_if (std::unique_ptr< T > &ptr, const std::string &key, Args &&... args) const
 Get data from json if key exists. More...
 
template<typename T , typename... Args>
std::unique_ptr< T > make_optional (const std::string &key, Args &&... args) const
 Get data from json if key exists, else return empty ptr. More...
 
template<typename T , typename... Args>
std::unique_ptr< T > make_if_else (const std::string &key, std::unique_ptr< T > default_value, Args &&... args) const
 Get data from json if 'this' contains 'key', else return 'default_value'. More...
 
template<typename T , typename... Args>
bool make_else (std::unique_ptr< T > &ptr, const std::string &key, std::unique_ptr< T > default_value, Args &&... args) const
 Get data from json if key exists, else assign default_value. More...
 
template<typename T , typename... Args>
jsonParserpush_back (const T &value, Args &&... args)
 
template<typename T >
jsonParserput (const T &value)
 
jsonParserput_obj ()
 Puts new empty JSON object. More...
 
template<typename Iterator >
jsonParserput_obj (Iterator begin, Iterator end)
 
jsonParserput_array ()
 Puts new empty JSON array. More...
 
jsonParserput_array (size_type N)
 Puts new JSON array. More...
 
template<typename T >
jsonParserput_array (size_type N, const T &t)
 Puts new JSON array, using the same value. More...
 
template<typename Iterator , typename... Args, typename CASM_TMP::enable_if_iterator< Iterator >::type * = nullptr>
jsonParserput_array (Iterator begin, Iterator end, Args &&... args)
 Puts new JSON array, from iterators. More...
 
jsonParserput_null ()
 Puts 'null' JSON value. More...
 

Static Protected Member Functions

static jsonParser parse (const std::string &str)
 Construct a jsonParser from a string containing JSON data. More...
 
static jsonParser parse (const fs::path &path)
 Construct a jsonParser from a file containing JSON data. More...
 
static jsonParser parse (std::istream &stream)
 Construct a jsonParser from a stream containing JSON data. More...
 
static jsonParser object ()
 Returns an empty json object. More...
 
template<typename Iterator >
static jsonParser object (Iterator begin, Iterator end)
 
static jsonParser array ()
 Returns an empty json array. More...
 
static jsonParser array (size_type N)
 Returns an empty json array. More...
 
template<typename T >
static jsonParser array (size_type N, const T &t)
 Puts new JSON array, using the same value. More...
 
template<typename Iterator >
static jsonParser array (Iterator begin, Iterator end, typename CASM_TMP::enable_if_iterator< Iterator >::type *=nullptr)
 Puts new JSON array, from iterators. More...
 
static jsonParser null ()
 Returns a null JSON value. More...
 

Private Member Functions

GrandCanonicalConditions _conditions (std::string name) const
 
GrandCanonicalConditions _conditions (const jsonParser &json) const
 
template<typename jsonParserIteratorType >
std::tuple< bool, double > _get_precision (jsonParserIteratorType it) const
 
template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator _make_comp_samplers (const PrimClex &primclex, jsonParserIteratorType it, SamplerInsertIterator result) const
 
template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator _make_comp_n_samplers (const PrimClex &primclex, jsonParserIteratorType it, SamplerInsertIterator result) const
 
template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator _make_site_frac_samplers (const PrimClex &primclex, jsonParserIteratorType it, SamplerInsertIterator result) const
 
template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator _make_atom_frac_samplers (const PrimClex &primclex, jsonParserIteratorType it, SamplerInsertIterator result) const
 
template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator _make_all_correlations_samplers (const PrimClex &primclex, jsonParserIteratorType it, SamplerInsertIterator result) const
 
template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator _make_non_zero_eci_correlations_samplers (const PrimClex &primclex, jsonParserIteratorType it, SamplerInsertIterator result) const
 
template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator _make_query_samplers (const PrimClex &primclex, jsonParserIteratorType it, SamplerInsertIterator result) const
 

Private Attributes

fs::path m_root
 
fs::path m_output_directory
 
const PrimClexm_primclex
 

Member Typedef Documentation

◆ const_iterator

Definition at line 89 of file jsonParser.hh.

◆ iterator

Definition at line 88 of file jsonParser.hh.

◆ size_type

Definition at line 55 of file MonteSettings.hh.

Constructor & Destructor Documentation

◆ GrandCanonicalSettings() [1/2]

CASM::Monte::GrandCanonicalSettings::GrandCanonicalSettings ( )
inline

Default constructor.

Definition at line 14 of file GrandCanonicalSettings.hh.

◆ GrandCanonicalSettings() [2/2]

CASM::Monte::GrandCanonicalSettings::GrandCanonicalSettings ( const PrimClex primclex,
const fs::path &  read_path 
)

Construct EquilibriumMonteSettings by reading a settings JSON file.

Definition at line 27 of file GrandCanonicalSettings.cc.

Member Function Documentation

◆ _conditions() [1/2]

GrandCanonicalConditions CASM::Monte::GrandCanonicalSettings::_conditions ( const jsonParser json) const
private

Definition at line 179 of file GrandCanonicalSettings.cc.

◆ _conditions() [2/2]

GrandCanonicalConditions CASM::Monte::GrandCanonicalSettings::_conditions ( std::string  name) const
private

Definition at line 162 of file GrandCanonicalSettings.cc.

◆ _get_precision()

template<typename jsonParserIteratorType >
std::tuple< bool, double > CASM::Monte::GrandCanonicalSettings::_get_precision ( jsonParserIteratorType  it) const
private

Definition at line 150 of file GrandCanonicalSettings_impl.hh.

◆ _get_setting() [1/3]

template<typename T >
T CASM::Monte::MonteSettings::_get_setting ( std::string  level1,
std::string  level2,
std::string  level3,
std::string  msg 
) const
protectedinherited

Returns (*this)[level1][level2][level3].get<T>();.

Definition at line 369 of file MonteSettings.hh.

◆ _get_setting() [2/3]

template<typename T >
T CASM::Monte::MonteSettings::_get_setting ( std::string  level1,
std::string  level2,
std::string  msg 
) const
protectedinherited

Returns (*this)[level1][level2].get<T>();.

Definition at line 332 of file MonteSettings.hh.

◆ _get_setting() [3/3]

template<typename T >
T CASM::Monte::MonteSettings::_get_setting ( std::string  level1,
std::string  msg 
) const
protectedinherited

Returns (*this)[level1].get<T>();.

Returns (*this)[level1][level2].get<T>();.

Definition at line 306 of file MonteSettings.hh.

◆ _is_setting() [1/2]

bool CASM::Monte::MonteSettings::_is_setting ( std::string  level1,
std::string  level2 
) const
protectedinherited

Returns true if (*this)[level1].contains(level2)

Definition at line 394 of file MonteSettings.cc.

◆ _is_setting() [2/2]

bool CASM::Monte::MonteSettings::_is_setting ( std::string  level1,
std::string  level2,
std::string  level3 
) const
protectedinherited

Returns true if (*this)[level1][level2].contains(level3)

Definition at line 408 of file MonteSettings.cc.

◆ _json()

jsonParser CASM::Monte::MonteSettings::_json ( ) const
inlineprotectedinherited

Definition at line 193 of file MonteSettings.hh.

◆ _make_all_correlations_samplers()

template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator CASM::Monte::GrandCanonicalSettings::_make_all_correlations_samplers ( const PrimClex primclex,
jsonParserIteratorType  it,
SamplerInsertIterator  result 
) const
private

Definition at line 313 of file GrandCanonicalSettings_impl.hh.

◆ _make_atom_frac_samplers()

template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator CASM::Monte::GrandCanonicalSettings::_make_atom_frac_samplers ( const PrimClex primclex,
jsonParserIteratorType  it,
SamplerInsertIterator  result 
) const
private

Definition at line 264 of file GrandCanonicalSettings_impl.hh.

◆ _make_comp_n_samplers()

template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator CASM::Monte::GrandCanonicalSettings::_make_comp_n_samplers ( const PrimClex primclex,
jsonParserIteratorType  it,
SamplerInsertIterator  result 
) const
private

Definition at line 193 of file GrandCanonicalSettings_impl.hh.

◆ _make_comp_samplers()

template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator CASM::Monte::GrandCanonicalSettings::_make_comp_samplers ( const PrimClex primclex,
jsonParserIteratorType  it,
SamplerInsertIterator  result 
) const
private

Definition at line 160 of file GrandCanonicalSettings_impl.hh.

◆ _make_non_zero_eci_correlations_samplers()

template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator CASM::Monte::GrandCanonicalSettings::_make_non_zero_eci_correlations_samplers ( const PrimClex primclex,
jsonParserIteratorType  it,
SamplerInsertIterator  result 
) const
private

Definition at line 349 of file GrandCanonicalSettings_impl.hh.

◆ _make_query_samplers()

template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator CASM::Monte::GrandCanonicalSettings::_make_query_samplers ( const PrimClex primclex,
jsonParserIteratorType  it,
SamplerInsertIterator  result 
) const
private

Definition at line 389 of file GrandCanonicalSettings_impl.hh.

◆ _make_site_frac_samplers()

template<typename jsonParserIteratorType , typename SamplerInsertIterator >
SamplerInsertIterator CASM::Monte::GrandCanonicalSettings::_make_site_frac_samplers ( const PrimClex primclex,
jsonParserIteratorType  it,
SamplerInsertIterator  result 
) const
private

Definition at line 229 of file GrandCanonicalSettings_impl.hh.

◆ all_correlations()

bool CASM::Monte::GrandCanonicalSettings::all_correlations ( ) const

Return true if all correlations should be sampled.

Definition at line 136 of file GrandCanonicalSettings.cc.

◆ almost_equal()

bool CASM::jsonParser::almost_equal ( const jsonParser B,
double  tol 
) const
inherited

Definition at line 218 of file jsonParser.cc.

◆ array() [1/4]

static jsonParser CASM::jsonParser::array ( )
inlinestaticinherited

Returns an empty json array.

Definition at line 409 of file jsonParser.hh.

◆ array() [2/4]

template<typename Iterator >
static jsonParser CASM::jsonParser::array ( Iterator  begin,
Iterator  end,
typename CASM_TMP::enable_if_iterator< Iterator >::type *  = nullptr 
)
inlinestaticinherited

Puts new JSON array, from iterators.

Definition at line 429 of file jsonParser.hh.

◆ array() [3/4]

static jsonParser CASM::jsonParser::array ( size_type  N)
inlinestaticinherited

Returns an empty json array.

Definition at line 415 of file jsonParser.hh.

◆ array() [4/4]

template<typename T >
static jsonParser CASM::jsonParser::array ( size_type  N,
const T &  t 
)
inlinestaticinherited

Puts new JSON array, using the same value.

Definition at line 422 of file jsonParser.hh.

◆ at() [1/4]

jsonParser & CASM::jsonParser::at ( const fs::path &  path)
inherited

Return a reference to the sub-jsonParser (JSON value) with specified relative path Will throw if the 'path' doesn't exist.

  • If 'path' is 'A/B/C', then json.at(path) is equivalent to json[A][B][C]
  • If any sub-jsonParser is an array, it will attempt to convert the filename to int

Return a reference to the sub-jsonParser (JSON value) with specified relative path Will throw if the 'path' doesn't exist.

  • If 'path' is 'A/B/C', then json[path] is equivalent to json[A][B][C]
  • If any sub-jsonParser is an array, it will attempt to convert the filename to int

Definition at line 316 of file jsonParser.cc.

◆ at() [2/4]

const jsonParser & CASM::jsonParser::at ( const fs::path &  path) const
inherited

Return a reference to the sub-jsonParser (JSON value) with specified relative path Will throw if the 'path' doesn't exist.

  • If 'path' is 'A/B/C', then json.at(path) is equivalent to json[A][B][C]
  • If any sub-jsonParser is an array, it will attempt to convert the filename to int

Return a reference to the sub-jsonParser (JSON value) with specified relative path Will throw if the 'path' doesn't exist.

  • If 'path' is 'A/B/C', then json[path] is equivalent to json[A][B][C]
  • If any sub-jsonParser is an array, it will attempt to convert the filename to int

Definition at line 328 of file jsonParser.cc.

◆ at() [3/4]

jsonParser & CASM::jsonParser::at ( const size_type element)
inherited

Return a reference to the sub-jsonParser (JSON value) from index 'element' iff jsonParser is a JSON array

Definition at line 397 of file jsonParser.cc.

◆ at() [4/4]

const jsonParser & CASM::jsonParser::at ( const size_type element) const
inherited

Return a const reference to the sub-jsonParser (JSON value) from index 'element' iff jsonParser is a JSON array

Definition at line 410 of file jsonParser.cc.

◆ begin() [1/2]

jsonParser::iterator CASM::jsonParser::begin ( )
inherited

Returns const_iterator to beginning of JSON object or JSON array.

Returns iterator to beginning of JSON object or JSON array.

Definition at line 497 of file jsonParser.cc.

◆ begin() [2/2]

jsonParser::const_iterator CASM::jsonParser::begin ( ) const
inherited

Returns iterator to beginning of JSON object or JSON array.

Returns const_iterator to beginning of JSON object or JSON array.

Definition at line 507 of file jsonParser.cc.

◆ cbegin()

jsonParser::const_iterator CASM::jsonParser::cbegin ( ) const
inherited

Returns const_iterator to beginning of JSON object or JSON array.

Returns const iterator to beginning of const JSON object or JSON array.

Definition at line 510 of file jsonParser.cc.

◆ cend()

jsonParser::const_iterator CASM::jsonParser::cend ( ) const
inherited

Returns const_iterator to end of JSON object or JSON array.

Definition at line 533 of file jsonParser.cc.

◆ confidence()

double CASM::Monte::MonteSettings::confidence ( ) const
inherited

Given a settings jsonParser figure out the global tolerance (probably for == operator). Expects tolerance/value.

Requested confidence level. Default 0.95.

Definition at line 143 of file MonteSettings.cc.

◆ contains()

bool CASM::jsonParser::contains ( const std::string &  name) const
inherited

Return true if JSON object contains 'name'.

Definition at line 601 of file jsonParser.cc.

◆ custom_conditions()

std::vector< GrandCanonicalConditions > CASM::Monte::GrandCanonicalSettings::custom_conditions ( ) const

Expects custom_conditions.

Expects incremental_conditions.

Definition at line 61 of file GrandCanonicalSettings.cc.

◆ debug()

bool CASM::Monte::MonteSettings::debug ( ) const
inherited

Run in debug mode?

Definition at line 51 of file MonteSettings.cc.

◆ dependent_runs()

bool CASM::Monte::MonteSettings::dependent_runs ( ) const
inherited

If dependent runs, start subsequent calculations with the final state of the previous calculation. Default true.

Definition at line 121 of file MonteSettings.cc.

◆ drive_mode()

const Monte::DRIVE_MODE CASM::Monte::MonteSettings::drive_mode ( ) const
virtualinherited

Given a settings jsonParser figure out the drive mode. Expects drive_mode/incremental,custom.

Definition at line 114 of file MonteSettings.cc.

◆ end() [1/2]

jsonParser::iterator CASM::jsonParser::end ( )
inherited

Returns iterator to end of JSON object or JSON array.

Definition at line 520 of file jsonParser.cc.

◆ end() [2/2]

jsonParser::const_iterator CASM::jsonParser::end ( ) const
inherited

Returns const_iterator to end of JSON object or JSON array.

Returns iterator to end of JSON object or JSON array.

Definition at line 530 of file jsonParser.cc.

◆ ensemble()

Monte::ENSEMBLE CASM::Monte::MonteSettings::ensemble ( ) const
inherited

Return type of Monte Carlo ensemble.

Definition at line 41 of file MonteSettings.cc.

◆ enumeration_check_args()

std::string CASM::Monte::MonteSettings::enumeration_check_args ( ) const
inherited

Returns 'casm query'-like enumeration check args.

Returns 'casm query'-like enumeration check.

Expects a string that will convert to true if the current Configuration should be scored for enumeration. For instance, perhaps you only want to enumerate Configurations that are near or below the currently predicted convex hull. Then, use 'lt(clex_hull_dist(ALL),0.005)'. Default always returns true.

Uses boost::lexical_cast<bool> on the output to determine the result.

Definition at line 307 of file MonteSettings.cc.

◆ enumeration_check_existence()

bool CASM::Monte::MonteSettings::enumeration_check_existence ( ) const
inherited

Only insert configurations that are not already enumerated.

Insert configurations in their canonical form (default true)

Definition at line 330 of file MonteSettings.cc.

◆ enumeration_insert_canonical()

bool CASM::Monte::MonteSettings::enumeration_insert_canonical ( ) const
inherited

Insert configurations in their canonical form.

Insert configurations in their canonical form (default true)

Definition at line 344 of file MonteSettings.cc.

◆ enumeration_metric_args()

std::string CASM::Monte::MonteSettings::enumeration_metric_args ( ) const
inherited

Returns 'casm query'-like enumeration metric args.

Returns 'casm query'-like enumeration metric.

Expects a string containing the Configuration scoring metric. For instance, 'clex_hull_dist(ALL)' (which is the default).

Uses boost::lexical_cast<double> on the output to determine the result.

Definition at line 279 of file MonteSettings.cc.

◆ enumeration_N_halloffame()

Index CASM::Monte::MonteSettings::enumeration_N_halloffame ( ) const
inherited

Returns enumeration halloffame max size (default 100)

Definition at line 368 of file MonteSettings.cc.

◆ enumeration_sample_mode()

Monte::ENUM_SAMPLE_MODE CASM::Monte::MonteSettings::enumeration_sample_mode ( ) const
inherited

Enumeration sample mode (default Monte::ENUM_SAMPLE_MODE::ON_SAMPLE)

Definition at line 321 of file MonteSettings.cc.

◆ enumeration_tol()

double CASM::Monte::MonteSettings::enumeration_tol ( ) const
inherited

Returns enumeration halloffame tolerance (default 1e-8)

Definition at line 381 of file MonteSettings.cc.

◆ equilibration_passes_each_run()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::equilibration_passes_each_run ( ) const
inherited

Number of explicit equilibration passes requsted for each run.

Definition at line 484 of file MonteSettings.cc.

◆ equilibration_passes_first_run()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::equilibration_passes_first_run ( ) const
inherited

Number of explicit equilibration passes requsted for the first run.

Definition at line 470 of file MonteSettings.cc.

◆ erase()

json_spirit::mObject::size_type CASM::jsonParser::erase ( const std::string &  name)
inherited

Erase key:value pair from an object.

Erase key:value pair from an object Returns the number of elements erased, which will be 0 or 1

Definition at line 607 of file jsonParser.cc.

◆ final_conditions()

GrandCanonicalConditions CASM::Monte::GrandCanonicalSettings::final_conditions ( ) const

Expects final_conditions.

Definition at line 49 of file GrandCanonicalSettings.cc.

◆ find() [1/2]

jsonParser::iterator CASM::jsonParser::find ( const std::string &  name)
inherited

Return iterator to JSON object value with 'name'.

Definition at line 543 of file jsonParser.cc.

◆ find() [2/2]

jsonParser::const_iterator CASM::jsonParser::find ( const std::string &  name) const
inherited

Return const_iterator to JSON object value with 'name'.

Definition at line 548 of file jsonParser.cc.

◆ find_at() [1/2]

jsonParser::iterator CASM::jsonParser::find_at ( const fs::path &  path)
inherited

Return iterator to sub-object or element, or 'end' if not found.

Return iterator to sub-object or element, or 'end' if not found

  • If path.empty(), return iterator that dereferences to this, and one increment results in end

Definition at line 556 of file jsonParser.cc.

◆ find_at() [2/2]

jsonParser::const_iterator CASM::jsonParser::find_at ( const fs::path &  path) const
inherited

Return iterator to sub-object or element, or 'end' if not found.

Return iterator to sub-object or element, or 'end' if not found

  • If path.empty(), return iterator that dereferences to this, and one increment results in end

Definition at line 596 of file jsonParser.cc.

◆ formation_energy()

ClexDescription CASM::Monte::GrandCanonicalSettings::formation_energy ( const PrimClex primclex) const

Get formation energy cluster expansion.

Definition at line 85 of file GrandCanonicalSettings.cc.

◆ incremental_conditions()

GrandCanonicalConditions CASM::Monte::GrandCanonicalSettings::incremental_conditions ( ) const

Expects incremental_conditions.

Definition at line 54 of file GrandCanonicalSettings.cc.

◆ initial_conditions()

GrandCanonicalConditions CASM::Monte::GrandCanonicalSettings::initial_conditions ( ) const

Expects initial_conditions.

Definition at line 38 of file GrandCanonicalSettings.cc.

◆ is_array()

bool CASM::jsonParser::is_array ( ) const
inherited

Check if array type.

Definition at line 275 of file jsonParser.cc.

◆ is_bool()

bool CASM::jsonParser::is_bool ( ) const
inherited

Check if bool type.

Definition at line 257 of file jsonParser.cc.

◆ is_enumeration()

bool CASM::Monte::MonteSettings::is_enumeration ( ) const
inherited

Returns true if enumeration is requested. (Default false)

Definition at line 266 of file MonteSettings.cc.

◆ is_equilibration_passes_each_run()

bool CASM::Monte::EquilibriumMonteSettings::is_equilibration_passes_each_run ( ) const
inherited

Returns true if explicit equilibration passes for each run have been specified.

Definition at line 478 of file MonteSettings.cc.

◆ is_equilibration_passes_first_run()

bool CASM::Monte::EquilibriumMonteSettings::is_equilibration_passes_first_run ( ) const
inherited

Returns true if explicit equilibration passes for the first run have been specified.

Definition at line 464 of file MonteSettings.cc.

◆ is_float()

bool CASM::jsonParser::is_float ( ) const
inherited

Check if number type (not including int)

Definition at line 263 of file jsonParser.cc.

◆ is_int()

bool CASM::jsonParser::is_int ( ) const
inherited

Check if int type.

Definition at line 260 of file jsonParser.cc.

◆ is_max_pass()

bool CASM::Monte::EquilibriumMonteSettings::is_max_pass ( ) const
inherited

Returns true if a maximum number of passes has been specified.

Definition at line 524 of file MonteSettings.cc.

◆ is_max_sample()

bool CASM::Monte::EquilibriumMonteSettings::is_max_sample ( ) const
inherited

Returns true if a maximum number of samples has been specified.

Definition at line 568 of file MonteSettings.cc.

◆ is_max_step()

bool CASM::Monte::EquilibriumMonteSettings::is_max_step ( ) const
inherited

Returns true if a maximum number of steps has been specified.

Definition at line 546 of file MonteSettings.cc.

◆ is_min_pass()

bool CASM::Monte::EquilibriumMonteSettings::is_min_pass ( ) const
inherited

Returns true if a minimum number of passes has been specified.

Definition at line 535 of file MonteSettings.cc.

◆ is_min_sample()

bool CASM::Monte::EquilibriumMonteSettings::is_min_sample ( ) const
inherited

Returns true if a minimum number of samples has been specified.

Returns true if a minimum number of sample has been specified.

Definition at line 580 of file MonteSettings.cc.

◆ is_min_step()

bool CASM::Monte::EquilibriumMonteSettings::is_min_step ( ) const
inherited

Returns true if a minimum number of steps has been specified.

Definition at line 557 of file MonteSettings.cc.

◆ is_motif_configdof()

bool CASM::Monte::MonteSettings::is_motif_configdof ( ) const
inherited

Returns true if path to ConfigDoF file to use as starting motif has been specified.

Definition at line 80 of file MonteSettings.cc.

◆ is_motif_configname()

bool CASM::Monte::MonteSettings::is_motif_configname ( ) const
inherited

Returns true if configname of configuration to use as starting motif has been specified.

Definition at line 66 of file MonteSettings.cc.

◆ is_N_pass()

bool CASM::Monte::EquilibriumMonteSettings::is_N_pass ( ) const
inherited

Returns true if the number of passes has been specified.

Definition at line 490 of file MonteSettings.cc.

◆ is_N_sample()

bool CASM::Monte::EquilibriumMonteSettings::is_N_sample ( ) const
inherited

Returns true if the number of samples has been specified.

Definition at line 513 of file MonteSettings.cc.

◆ is_N_step()

bool CASM::Monte::EquilibriumMonteSettings::is_N_step ( ) const
inherited

Returns true if the number of steps has been specified.

Definition at line 501 of file MonteSettings.cc.

◆ is_null()

bool CASM::jsonParser::is_null ( ) const
inherited

Check if null type.

Definition at line 254 of file jsonParser.cc.

◆ is_number()

bool CASM::jsonParser::is_number ( ) const
inherited

Check if number type (including int)

Definition at line 266 of file jsonParser.cc.

◆ is_obj()

bool CASM::jsonParser::is_obj ( ) const
inherited

Check if object type.

Definition at line 272 of file jsonParser.cc.

◆ is_string()

bool CASM::jsonParser::is_string ( ) const
inherited

Check if string.

Definition at line 269 of file jsonParser.cc.

◆ max_data_length()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::max_data_length ( ) const
inherited

Figure out how large data containers should be.

Definition at line 594 of file MonteSettings.cc.

◆ max_pass()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::max_pass ( ) const
inherited

Maximum number of passes, required if sample by pass.

Definition at line 529 of file MonteSettings.cc.

◆ max_sample()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::max_sample ( ) const
inherited

Maximum number of steps, default std::numeric_limit<size_type>::max()

Maximum number of steps.

Definition at line 573 of file MonteSettings.cc.

◆ max_step()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::max_step ( ) const
inherited

Maximum number of steps, required if sample by step.

Maximum number of steps.

Definition at line 551 of file MonteSettings.cc.

◆ method()

Monte::METHOD CASM::Monte::MonteSettings::method ( ) const
inherited

Return type of Monte Carlo method.

Definition at line 46 of file MonteSettings.cc.

◆ min_pass()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::min_pass ( ) const
inherited

Minimum number of passes, default 0 if sample by pass.

Minimum number of passes.

Definition at line 540 of file MonteSettings.cc.

◆ min_sample()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::min_sample ( ) const
inherited

Minimum number of steps, default 0.

Definition at line 585 of file MonteSettings.cc.

◆ min_step()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::min_step ( ) const
inherited

Minimum number of steps, default 0 if sample by step.

Minimum number of steps.

Definition at line 562 of file MonteSettings.cc.

◆ motif_configdof()

ConfigDoF CASM::Monte::MonteSettings::motif_configdof ( Index  supercell_volume) const
inherited

ConfigDoF to use as starting motif.

Definition at line 85 of file MonteSettings.cc.

◆ motif_configdof_path()

fs::path CASM::Monte::MonteSettings::motif_configdof_path ( ) const
inherited

Path to ConfigDoF file to use as starting motif.

Definition at line 96 of file MonteSettings.cc.

◆ motif_configname()

std::string CASM::Monte::MonteSettings::motif_configname ( ) const
inherited

Configname of configuration to use as starting motif.

Definition at line 71 of file MonteSettings.cc.

◆ N_pass()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::N_pass ( ) const
inherited

Returns the number of passes requested.

Definition at line 495 of file MonteSettings.cc.

◆ N_sample()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::N_sample ( ) const
inherited

Returns the number of samples requested.

Definition at line 518 of file MonteSettings.cc.

◆ N_step()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::N_step ( ) const
inherited

Returns the number of steps requested.

Definition at line 507 of file MonteSettings.cc.

◆ null()

static jsonParser CASM::jsonParser::null ( )
inlinestaticinherited

Returns a null JSON value.

Definition at line 437 of file jsonParser.hh.

◆ object() [1/2]

static jsonParser CASM::jsonParser::object ( )
inlinestaticinherited

Returns an empty json object.

Definition at line 395 of file jsonParser.hh.

◆ object() [2/2]

template<typename Iterator >
static jsonParser CASM::jsonParser::object ( Iterator  begin,
Iterator  end 
)
inlinestaticinherited

Puts new JSON object, from iterators over a range of values of type std::pair<std::string, T>

Definition at line 403 of file jsonParser.hh.

◆ operator!=() [1/2]

bool CASM::jsonParser::operator!= ( const jsonParser json) const
inlineinherited

Definition at line 173 of file jsonParser.hh.

◆ operator!=() [2/2]

bool CASM::jsonParser::operator!=
inlineinherited

Definition at line 173 of file jsonParser.hh.

◆ operator[]() [1/4]

jsonParser & CASM::jsonParser::operator[] ( const size_type element)
inherited

Return a reference to the sub-jsonParser (JSON value) from index 'element' iff jsonParser is a JSON array

Definition at line 385 of file jsonParser.cc.

◆ operator[]() [2/4]

const jsonParser & CASM::jsonParser::operator[] ( const size_type element) const
inherited

Return a const reference to the sub-jsonParser (JSON value) from index 'element' iff jsonParser is a JSON array

Definition at line 391 of file jsonParser.cc.

◆ operator[]() [3/4]

jsonParser & CASM::jsonParser::operator[] ( const std::string &  name)
inherited

Return a reference to the sub-jsonParser (JSON value) with 'name' if it exists If it does not exist, create it with an empty JSON object and return a reference to it

Return a reference to the sub-jsonParser (JSON value) with 'name' if it exists If it does not exist, create it with value == 'null' and return a reference

Definition at line 283 of file jsonParser.cc.

◆ operator[]() [4/4]

const jsonParser & CASM::jsonParser::operator[] ( const std::string &  name) const
inherited

Return a reference to the sub-jsonParser (JSON value) with 'name' if it exists. Will throw if the 'name' doesn't exist.

Definition at line 297 of file jsonParser.cc.

◆ output_directory()

const fs::path CASM::Monte::MonteSettings::output_directory ( ) const
inherited

Directory where output should go.

Definition at line 136 of file MonteSettings.cc.

◆ parse() [1/3]

jsonParser CASM::jsonParser::parse ( const fs::path &  path)
staticinherited

Construct a jsonParser from a file containing JSON data.

Definition at line 614 of file jsonParser.cc.

◆ parse() [2/3]

static jsonParser CASM::jsonParser::parse ( const std::string &  str)
inlinestaticinherited

Construct a jsonParser from a string containing JSON data.

Definition at line 382 of file jsonParser.hh.

◆ parse() [3/3]

static jsonParser CASM::jsonParser::parse ( std::istream &  stream)
inlinestaticinherited

Construct a jsonParser from a stream containing JSON data.

Definition at line 392 of file jsonParser.hh.

◆ primclex()

const PrimClex & CASM::Monte::MonteSettings::primclex ( ) const
inherited

Definition at line 36 of file MonteSettings.cc.

◆ print() [1/2]

void CASM::jsonParser::print ( std::ostream &  stream,
unsigned int  indent = 2,
unsigned int  prec = 12 
) const
inherited

Print json to stream.

Writes json to stream.

Definition at line 188 of file jsonParser.cc.

◆ print() [2/2]

void CASM::jsonParser::print
inherited

Print json to stream.

Writes json to stream.

Definition at line 134 of file jsonParser.cc.

◆ put_array() [1/2]

jsonParser& CASM::jsonParser::put_array ( )
inlineinherited

Puts new empty JSON array.

Definition at line 362 of file jsonParser.hh.

◆ put_array() [2/2]

jsonParser& CASM::jsonParser::put_array ( size_type  N)
inlineinherited

Puts new JSON array.

Definition at line 365 of file jsonParser.hh.

◆ put_null()

jsonParser& CASM::jsonParser::put_null ( )
inlineinherited

Puts 'null' JSON value.

Definition at line 377 of file jsonParser.hh.

◆ put_obj()

jsonParser& CASM::jsonParser::put_obj ( )
inlineinherited

Puts new empty JSON object.

Definition at line 354 of file jsonParser.hh.

◆ read() [1/2]

bool CASM::jsonParser::read ( const boost::filesystem::path &  mypath)
inherited

Reads json from a path.

◆ read() [2/2]

bool CASM::jsonParser::read ( std::istream &  stream)
inherited

Reads json from the stream.

Definition at line 168 of file jsonParser.cc.

◆ root()

fs::path CASM::Monte::MonteSettings::root ( ) const
inherited

Definition at line 34 of file MonteSettings.cc.

◆ sample_by_pass()

bool CASM::Monte::EquilibriumMonteSettings::sample_by_pass ( ) const
inherited

Sample by pass?

Definition at line 433 of file MonteSettings.cc.

◆ sample_by_step()

bool CASM::Monte::EquilibriumMonteSettings::sample_by_step ( ) const
inherited

Sample by step?

Definition at line 440 of file MonteSettings.cc.

◆ sample_period()

EquilibriumMonteSettings::size_type CASM::Monte::EquilibriumMonteSettings::sample_period ( ) const
inherited

Figure out how often to take samples.

Definition at line 447 of file MonteSettings.cc.

◆ samplers()

template<typename SamplerInsertIterator >
SamplerInsertIterator CASM::Monte::GrandCanonicalSettings::samplers ( const PrimClex primclex,
SamplerInsertIterator  result 
) const

Construct Samplers as specified in the Settings.

Construct MonteSamplers as specified in the MonteSettings.

The requested MonteSamplers are inserted in 'result' as std::pair<std::string, notstd::cloneable_ptr<MonteSampler> >

Definition at line 22 of file GrandCanonicalSettings_impl.hh.

◆ set_debug()

void CASM::Monte::MonteSettings::set_debug ( bool  _debug)
inherited

Set debug mode.

Definition at line 60 of file MonteSettings.cc.

◆ simulation_cell_matrix()

Eigen::Matrix3l CASM::Monte::MonteSettings::simulation_cell_matrix ( ) const
inherited

Supercell matrix defining the simulation cell.

Definition at line 102 of file MonteSettings.cc.

◆ size()

jsonParser::size_type CASM::jsonParser::size ( ) const
inherited

Returns array size if *this is a JSON array, object size if *this is a JSON object, 1 otherwise

Definition at line 487 of file jsonParser.cc.

◆ write() [1/4]

void CASM::jsonParser::write ( const boost::filesystem::path &  mypath,
unsigned int  indent = 2,
unsigned int  prec = 12 
) const
inherited

Write json to file.

◆ write() [2/4]

void CASM::jsonParser::write
inherited

Write json to file.

◆ write() [3/4]

void CASM::jsonParser::write ( const std::string &  file_name,
unsigned int  indent = 2,
unsigned int  prec = 12 
) const
inherited

Write json to file.

Definition at line 196 of file jsonParser.cc.

◆ write() [4/4]

void CASM::jsonParser::write
inherited

Write json to file.

Definition at line 138 of file jsonParser.cc.

◆ write_csv()

bool CASM::Monte::MonteSettings::write_csv ( ) const
inherited

Write csv versions of files? (csv is the default format if no 'output_format' given)

Definition at line 194 of file MonteSettings.cc.

◆ write_json()

bool CASM::Monte::MonteSettings::write_json ( ) const
inherited

Write json versions of files?

Definition at line 229 of file MonteSettings.cc.

◆ write_observations()

bool CASM::Monte::MonteSettings::write_observations ( ) const
inherited

Writes all observations.

Definition at line 180 of file MonteSettings.cc.

◆ write_POSCAR_snapshots()

bool CASM::Monte::MonteSettings::write_POSCAR_snapshots ( ) const
inherited

Returns true if POSCARs of snapshots are requsted. Requires write_trajectory.

Definition at line 167 of file MonteSettings.cc.

◆ write_trajectory()

bool CASM::Monte::MonteSettings::write_trajectory ( ) const
inherited

Returns true if snapshots are requested.

Definition at line 153 of file MonteSettings.cc.

Member Data Documentation

◆ m_output_directory

fs::path CASM::Monte::MonteSettings::m_output_directory
privateinherited

Definition at line 197 of file MonteSettings.hh.

◆ m_primclex

const PrimClex* CASM::Monte::MonteSettings::m_primclex
privateinherited

Definition at line 198 of file MonteSettings.hh.

◆ m_root

fs::path CASM::Monte::MonteSettings::m_root
privateinherited

Definition at line 196 of file MonteSettings.hh.


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