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

#include <GrandCanonical.hh>

+ Inheritance diagram for CASM::Monte::GrandCanonical:

Detailed Description

Derives from base MonteCarlo class, to be used for simulations at constant temperature and chemical potential.

As with all the other derived Monte Carlo classes, member functions must follow a specific naming convention to be used with templated routines currently defined in MonteDriver.hh: -conditions -set_conditions -propose -check -accept -reject -write_results

Definition at line 31 of file GrandCanonical.hh.

Public Types

typedef GrandCanonicalEvent EventType
 
typedef GrandCanonicalConditions CondType
 
typedef GrandCanonicalSettings SettingsType
 
typedef Monte::size_type size_type
 
typedef std::map< std::string, double > ScalarPropertyMap
 a map of keyname to property value More...
 
typedef std::map< std::string, Eigen::VectorXd > VectorPropertyMap
 a map of keyname to property value Eigen::VectorXd More...
 
typedef std::map< std::string, notstd::cloneable_ptr< MonteSampler >, SamplerNameCompareSamplerMap
 a map of keyname to MonteSampler More...
 
typedef std::vector< std::pair< size_type, size_type > > SampleTimes
 a vector of std::pair(pass, step) indicating when samples were taken More...
 

Public Member Functions

 GrandCanonical (const PrimClex &primclex, const SettingsType &settings, Log &_log)
 Constructs a GrandCanonical object and prepares it for running based on Settings. More...
 
size_type steps_per_pass () const
 Return number of steps per pass. Equals number of sites with variable occupation. More...
 
const CondTypeconditions () const
 Return current conditions. More...
 
void set_conditions (const CondType &new_conditions)
 Set conditions and clear previously collected data. More...
 
void set_configdof (const ConfigDoF &configdof, const std::string &msg="")
 Set configdof and clear previously collected data. More...
 
std::pair< ConfigDoF, std::string > set_state (const GrandCanonicalConditions &new_conditions, const GrandCanonicalSettings &settings)
 Set configdof and conditions and clear previously collected data. More...
 
void set_state (const CondType &new_conditions, const ConfigDoF &configdof, const std::string &msg="")
 Set configdof and conditions and clear previously collected data. More...
 
const EventTypepropose ()
 Propose a new event, calculate delta properties, and return reference to it. More...
 
bool check (const EventType &event)
 Based on a random number, decide if the change in energy from the proposed event is low enough to be accepted. More...
 
void accept (const EventType &event)
 Accept proposed event. Change configuration accordingly and update energies etc. More...
 
void reject (const EventType &event)
 Nothing needs to be done to reject a GrandCanonicalEvent. More...
 
void write_results (size_type cond_index) const
 Write results to files. More...
 
double lte_grand_canonical_free_energy () const
 Calculate the single spin flip low temperature expansion of the grand canonical potential. More...
 
const double & formation_energy () const
 Formation energy, normalized per primitive cell. More...
 
const double & potential_energy () const
 Potential energy, normalized per primitive cell. More...
 
const Eigen::VectorXd & corr () const
 Correlations, normalized per primitive cell. More...
 
const Eigen::VectorXd & comp_n () const
 Number of atoms of each type, normalized per primitive cell. More...
 
double potential_energy (const Configuration &config) const
 Get potential energy. More...
 
const MonteSettingssettings () const
 const Access settings used for construction More...
 
const PrimClexprimclex () const
 const Access the PrimClex that *this is based on More...
 
const Supercellsupercell () const
 const Access the Supercell that *this is based on More...
 
void set_nlist ()
 Set a pointer to the SuperNeighborList once it is ready. More...
 
const SuperNeighborListnlist () const
 const Access the SuperNeighborList via pointer stored by 'set_nlist' More...
 
const Configurationconfig () const
 const Access current microstate More...
 
const ConfigDoFconfigdof () const
 const Access current microstate More...
 
void reset (const ConfigDoF &dof)
 Set current microstate and clear samplers. More...
 
const ScalarPropertyMapscalar_properties () const
 const Access scalar properties map More...
 
const double & scalar_property (std::string property_name) const
 const Access a particular scalar property More...
 
const VectorPropertyMapvector_properties () const
 const Access vector properties map More...
 
const Eigen::VectorXd & vector_property (std::string property_name) const
 const Access a particular vector property More...
 
void sample_data (const MonteCounter &counter)
 Samples all requested property data, and stores pass and step number sample was taken at. More...
 
void clear_samples ()
 Clear all data from all samplers. More...
 
bool must_converge () const
 Return true if convergence is requested. More...
 
std::pair< bool, size_typeis_equilibrated () const
 Returns pair(true, equil_samples) if required equilibration has occured for all samplers that must converge. More...
 
bool check_convergence_time () const
 Returns true if a convergence check is due. More...
 
bool is_converged () const
 Check to see if all the properties required to converge have converged. More...
 
const SamplerMapsamplers () const
 const Access sampler map More...
 
const SampleTimessample_times () const
 const Access a vector of std::pair<pass, step> indicating when samples were taken More...
 
const std::vector< ConfigDoF > & trajectory () const
 const Access snapshots of the Monte Carlo calculation More...
 
bool debug () const
 return true if running in debug mode More...
 

Static Public Attributes

static const ENSEMBLE ensemble
 

Protected Member Functions

const PrimClex_primclex () const
 Access the PrimClex that *this is based on. More...
 
const Supercell_supercell () const
 Access the Supercell that *this is based on. More...
 
Configuration_config () const
 Access current microstate. More...
 
ConfigDoF_configdof () const
 Access current microstate. More...
 
Log_log () const
 
MTRand & _mtrand ()
 
ScalarPropertyMap_scalar_properties ()
 Access scalar properties map. More...
 
double & _scalar_property (std::string property_name)
 Access a particular scalar property. More...
 
VectorPropertyMap_vector_properties ()
 const Access vector properties map More...
 
Eigen::VectorXd & _vector_property (std::string property_name)
 const Access a particular vector property More...
 

Private Member Functions

double & _formation_energy ()
 Formation energy, normalized per primitive cell. More...
 
double & _potential_energy ()
 Potential energy, normalized per primitive cell. More...
 
Eigen::VectorXd & _corr ()
 Correlations, normalized per primitive cell. More...
 
Eigen::VectorXd & _comp_n ()
 Number of atoms of each type, normalized per primitive cell. More...
 
Clexulator const & _clexulator () const
 
const ECIContainer_eci () const
 
void _set_dCorr (GrandCanonicalEvent &event, Index mutating_site, int sublat, int current_occupant, int new_occupant, bool use_deltas, bool all_correlations) const
 Calculate delta correlations for an event. More...
 
void _print_correlations (const Eigen::VectorXd &corr, std::string title, std::string colheader, bool all_correlations) const
 Print correlations to _log() More...
 
void _update_deltas (GrandCanonicalEvent &event, Index mutating_site, int sublat, int current_occupant, int new_occupant) const
 Calculate delta properties for an event and update the event with those properties. More...
 
void _update_properties ()
 Calculate properties given current conditions. More...
 
ConfigDoF _default_motif () const
 Generate supercell filling ConfigDoF from default configuration. More...
 
std::pair< ConfigDoF, std::string > _auto_motif (const GrandCanonicalConditions &cond) const
 Generate minimum potential energy ConfigDoF. More...
 
std::pair< ConfigDoF, std::string > _restricted_auto_motif (const GrandCanonicalConditions &cond) const
 Generate minimum potential energy ConfigDoF for this supercell. More...
 
ConfigDoF _configname_motif (const std::string &configname) const
 Generate supercell filling ConfigDoF from configuration. More...
 
void _set_check_convergence_time () const
 Set the next time convergence is due to be checked. More...
 

Private Attributes

const SiteExchanger m_site_swaps
 Keeps track of what sites can change to what. More...
 
GrandCanonicalConditions m_condition
 
Clex m_formation_energy_clex
 Holds Clexulator and ECI references. More...
 
bool m_all_correlations
 
EventType m_event
 Event to propose, check, accept/reject: More...
 
bool m_use_deltas
 If the supercell is large enough, calculate delta correlations directly. More...
 
double * m_formation_energy
 Formation energy, normalized per primitive cell. More...
 
double * m_potential_energy
 Potential energy, normalized per primitive cell. More...
 
Eigen::VectorXd * m_corr
 Correlations, normalized per primitive cell. More...
 
Eigen::VectorXd * m_comp_n
 Number of atoms of each type, normalized per primitive cell. More...
 
ScalarPropertyMap m_scalar_property
 a map of keyname to property value More...
 
VectorPropertyMap m_vector_property
 a map of keyname to property value Eigen::VectorXd More...
 
const MonteSettingsm_settings
 Contains all input settings. More...
 
const PrimClexm_primclex
 PrimClex for this system. More...
 
Supercell m_scel
 Supercell for the calculation. More...
 
const SuperNeighborListm_nlist
 Pointer to SuperNeighborList. More...
 
Configuration m_config
 Stores all degrees of freedom of the current microstate. More...
 
ConfigDoFm_configdof
 
MTRand m_twister
 Random number generator. More...
 
bool m_write_trajectory = false
 Save trajectory? More...
 
std::vector< ConfigDoFm_trajectory
 Snapshots of the Monte Carlo simulation, taken by sample_data() if m_write_trajectory is true. More...
 
bool m_must_converge
 True if any MonteSampler must converge. More...
 
Logm_log
 Target for messages. More...
 
SamplerMap m_sampler
 a map of pair<keyname, index> to MonteSampler More...
 
SampleTimes m_sample_time
 a vector of std::pair(pass, step) indicating when samples were taken More...
 
std::pair< bool, size_typem_is_equil
 
bool m_is_equil_uptodate = false
 
bool m_is_converged
 
bool m_is_converged_uptodate = false
 
size_type m_next_convergence_check = 100
 
size_type m_convergence_check_period = 100
 
bool m_debug
 

Member Typedef Documentation

◆ CondType

◆ EventType

◆ SamplerMap

a map of keyname to MonteSampler

  • scalar example: m_sampler["formation_energy"]
  • vector example: m_sampler["corr(12)"]

Definition at line 65 of file MonteCarlo.hh.

◆ SampleTimes

typedef std::vector<std::pair<size_type, size_type> > CASM::Monte::MonteCarlo::SampleTimes
inherited

a vector of std::pair(pass, step) indicating when samples were taken

Definition at line 69 of file MonteCarlo.hh.

◆ ScalarPropertyMap

typedef std::map<std::string, double> CASM::Monte::MonteCarlo::ScalarPropertyMap
inherited

a map of keyname to property value

  • example: m_scalar_property["formation_energy"]

Definition at line 51 of file MonteCarlo.hh.

◆ SettingsType

◆ size_type

Definition at line 46 of file MonteCarlo.hh.

◆ VectorPropertyMap

typedef std::map<std::string, Eigen::VectorXd> CASM::Monte::MonteCarlo::VectorPropertyMap
inherited

a map of keyname to property value Eigen::VectorXd

  • example: m_vector_property["corr"]

Definition at line 56 of file MonteCarlo.hh.

Constructor & Destructor Documentation

◆ GrandCanonical()

CASM::Monte::GrandCanonical::GrandCanonical ( const PrimClex primclex,
const SettingsType settings,
Log log 
)

Constructs a GrandCanonical object and prepares it for running based on Settings.

Constructs a GrandCanonical object and prepares it for running based on MonteSettings.

  • Does not set 'state': conditions or ConfigDoF

Definition at line 42 of file GrandCanonical.cc.

Member Function Documentation

◆ _auto_motif()

std::pair< ConfigDoF, std::string > CASM::Monte::GrandCanonical::_auto_motif ( const GrandCanonicalConditions cond) const
private

Generate minimum potential energy ConfigDoF.

Raises exception if it doesn't tile the supercell

Definition at line 690 of file GrandCanonical.cc.

◆ _clexulator()

Clexulator const& CASM::Monte::GrandCanonical::_clexulator ( ) const
inlineprivate

Definition at line 115 of file GrandCanonical.hh.

◆ _comp_n()

Eigen::VectorXd& CASM::Monte::GrandCanonical::_comp_n ( )
inlineprivate

Number of atoms of each type, normalized per primitive cell.

Definition at line 113 of file GrandCanonical.hh.

◆ _config()

Configuration& CASM::Monte::MonteCarlo::_config ( ) const
inlineprotectedinherited

Access current microstate.

  • This can be used by a const member if it undoes any changes to the ConfigDoF before returning

Definition at line 181 of file MonteCarlo.hh.

◆ _configdof()

ConfigDoF& CASM::Monte::MonteCarlo::_configdof ( ) const
inlineprotectedinherited

Access current microstate.

  • This can be used by a const member if it undoes any changes to the ConfigDoF before returning

Definition at line 187 of file MonteCarlo.hh.

◆ _configname_motif()

ConfigDoF CASM::Monte::GrandCanonical::_configname_motif ( const std::string &  configname) const
private

Generate supercell filling ConfigDoF from configuration.

Definition at line 816 of file GrandCanonical.cc.

◆ _corr()

Eigen::VectorXd& CASM::Monte::GrandCanonical::_corr ( )
inlineprivate

Correlations, normalized per primitive cell.

Definition at line 110 of file GrandCanonical.hh.

◆ _default_motif()

ConfigDoF CASM::Monte::GrandCanonical::_default_motif ( ) const
private

Generate supercell filling ConfigDoF from default configuration.

Definition at line 679 of file GrandCanonical.cc.

◆ _eci()

const ECIContainer& CASM::Monte::GrandCanonical::_eci ( ) const
inlineprivate

Definition at line 119 of file GrandCanonical.hh.

◆ _formation_energy()

double& CASM::Monte::GrandCanonical::_formation_energy ( )
inlineprivate

Formation energy, normalized per primitive cell.

Definition at line 104 of file GrandCanonical.hh.

◆ _log()

Log& CASM::Monte::MonteCarlo::_log ( ) const
inlineprotectedinherited

Definition at line 189 of file MonteCarlo.hh.

◆ _mtrand()

MTRand& CASM::Monte::MonteCarlo::_mtrand ( )
inlineprotectedinherited

Definition at line 191 of file MonteCarlo.hh.

◆ _potential_energy()

double& CASM::Monte::GrandCanonical::_potential_energy ( )
inlineprivate

Potential energy, normalized per primitive cell.

Definition at line 107 of file GrandCanonical.hh.

◆ _primclex()

const PrimClex& CASM::Monte::MonteCarlo::_primclex ( ) const
inlineprotectedinherited

Access the PrimClex that *this is based on.

Definition at line 172 of file MonteCarlo.hh.

◆ _print_correlations()

void CASM::Monte::GrandCanonical::_print_correlations ( const Eigen::VectorXd &  corr,
std::string  title,
std::string  colheader,
bool  all_correlations 
) const
private

Print correlations to _log()

Definition at line 558 of file GrandCanonical.cc.

◆ _restricted_auto_motif()

std::pair< ConfigDoF, std::string > CASM::Monte::GrandCanonical::_restricted_auto_motif ( const GrandCanonicalConditions cond) const
private

Generate minimum potential energy ConfigDoF for this supercell.

Definition at line 734 of file GrandCanonical.cc.

◆ _scalar_properties()

ScalarPropertyMap& CASM::Monte::MonteCarlo::_scalar_properties ( )
inlineprotectedinherited

Access scalar properties map.

Definition at line 194 of file MonteCarlo.hh.

◆ _scalar_property()

double& CASM::Monte::MonteCarlo::_scalar_property ( std::string  property_name)
inlineprotectedinherited

Access a particular scalar property.

Definition at line 197 of file MonteCarlo.hh.

◆ _set_check_convergence_time()

void CASM::Monte::MonteCarlo::_set_check_convergence_time ( ) const
privateinherited

Set the next time convergence is due to be checked.

Currently set to 10 samples from the time this function is called

Definition at line 200 of file MonteCarlo.cc.

◆ _set_dCorr()

void CASM::Monte::GrandCanonical::_set_dCorr ( GrandCanonicalEvent event,
Index  mutating_site,
int  sublat,
int  current_occupant,
int  new_occupant,
bool  use_deltas,
bool  all_correlations 
) const
private

Calculate delta correlations for an event.

Definition at line 475 of file GrandCanonical.cc.

◆ _supercell()

const Supercell& CASM::Monte::MonteCarlo::_supercell ( ) const
inlineprotectedinherited

Access the Supercell that *this is based on.

Definition at line 175 of file MonteCarlo.hh.

◆ _update_deltas()

void CASM::Monte::GrandCanonical::_update_deltas ( GrandCanonicalEvent event,
Index  mutating_site,
int  sublat,
int  current_occupant,
int  new_occupant 
) const
private

Calculate delta properties for an event and update the event with those properties.

Update delta properties in 'event'.

Definition at line 590 of file GrandCanonical.cc.

◆ _update_properties()

void CASM::Monte::GrandCanonical::_update_properties ( )
private

Calculate properties given current conditions.

Definition at line 624 of file GrandCanonical.cc.

◆ _vector_properties()

VectorPropertyMap& CASM::Monte::MonteCarlo::_vector_properties ( )
inlineprotectedinherited

const Access vector properties map

Definition at line 202 of file MonteCarlo.hh.

◆ _vector_property()

Eigen::VectorXd& CASM::Monte::MonteCarlo::_vector_property ( std::string  property_name)
inlineprotectedinherited

const Access a particular vector property

Definition at line 205 of file MonteCarlo.hh.

◆ accept()

void CASM::Monte::GrandCanonical::accept ( const EventType event)

Accept proposed event. Change configuration accordingly and update energies etc.

Once you've found an event that passes the random number test, you want to accept it. This routine will apply all the changes in the event to *this (change occupation of one atom) and update the formation energy, generalized enthalpy, number of species and correlations values.

Definition at line 300 of file GrandCanonical.cc.

◆ check()

bool CASM::Monte::GrandCanonical::check ( const EventType event)

Based on a random number, decide if the change in energy from the proposed event is low enough to be accepted.

Definition at line 270 of file GrandCanonical.cc.

◆ check_convergence_time()

bool CASM::Monte::MonteCarlo::check_convergence_time ( ) const
inherited

Returns true if a convergence check is due.

Currently set to every 10 samples

Definition at line 190 of file MonteCarlo.cc.

◆ clear_samples()

void CASM::Monte::MonteCarlo::clear_samples ( )
inherited

Clear all data from all samplers.

Definition at line 50 of file MonteCarlo.cc.

◆ comp_n()

const Eigen::VectorXd& CASM::Monte::GrandCanonical::comp_n ( ) const
inline

Number of atoms of each type, normalized per primitive cell.

Definition at line 97 of file GrandCanonical.hh.

◆ conditions()

const GrandCanonical::CondType & CASM::Monte::GrandCanonical::conditions ( ) const

Return current conditions.

Definition at line 93 of file GrandCanonical.cc.

◆ config()

const Configuration& CASM::Monte::MonteCarlo::config ( ) const
inlineinherited

const Access current microstate

Definition at line 90 of file MonteCarlo.hh.

◆ configdof()

const ConfigDoF& CASM::Monte::MonteCarlo::configdof ( ) const
inlineinherited

const Access current microstate

Definition at line 93 of file MonteCarlo.hh.

◆ corr()

const Eigen::VectorXd& CASM::Monte::GrandCanonical::corr ( ) const
inline

Correlations, normalized per primitive cell.

Definition at line 94 of file GrandCanonical.hh.

◆ debug()

bool CASM::Monte::MonteCarlo::debug ( ) const
inlineinherited

return true if running in debug mode

Definition at line 162 of file MonteCarlo.hh.

◆ formation_energy()

const double& CASM::Monte::GrandCanonical::formation_energy ( ) const
inline

Formation energy, normalized per primitive cell.

Definition at line 88 of file GrandCanonical.hh.

◆ is_converged()

bool CASM::Monte::MonteCarlo::is_converged ( ) const
inherited

Check to see if all the properties required to converge have converged.

  • Calls is_equilibrated() to check if required equilibration has occured
  • If equilibrated, checks if the required convergence has occured for all sampler that must converge
  • Convergence is checked only for the range of observations that were taken after all samplers that must converge have equilibrated

Definition at line 126 of file MonteCarlo.cc.

◆ is_equilibrated()

std::pair< bool, Monte::size_type > CASM::Monte::MonteCarlo::is_equilibrated ( ) const
inherited

Returns pair(true, equil_samples) if required equilibration has occured for all samplers that must converge.

  • equil_samples is the number of samples required for all samplers that must equilibrate to equilibrate
  • If must_converge() == false, always returns false

Definition at line 69 of file MonteCarlo.cc.

◆ lte_grand_canonical_free_energy()

double CASM::Monte::GrandCanonical::lte_grand_canonical_free_energy ( ) const

Calculate the single spin flip low temperature expansion of the grand canonical potential.

Returns low temperature expansion estimate of the grand canonical free energy. Works with the current ConfigDoF as groundstate.

Quick derivation: Z: partition function boltz(x): exp(-x/kBT) \Omega: (E-SUM(chem_pot*comp_n))*N N: number of unit cells in supercell

The partition function is Z=SUM(boltz(\Omega_s)) summing over all microstates s

\Omega_s can be split into groundstate \Omega_0 and a delta energy D\Omega \Omega_s=\Omega_0+D\Omega_s Z=boltz(\Omega_0)*SUM(boltz(D\Omega_s)) summing over all microstates

For low temperatures we can approximate Z by truncating the sum after microstates that only involve point defects and no defects Z=boltz(\Omega_0)*SUM(boltz(D\Omega_s)) summing over all states with only point defects or no defects

The free energy is Phi=-kB*T*ln(Z) Phi=-kB*T*(-\Omega_0/kBT+ln(SUM(boltz(D\Omega_s)) Sum is over point defects and no defects (in which case D\Omega_s == 0) Phi=(\Omega_0-kB*T(ln(SUM(boltz(D\Omega_s)))))/N

Definition at line 358 of file GrandCanonical.cc.

◆ must_converge()

bool CASM::Monte::MonteCarlo::must_converge ( ) const
inlineinherited

Return true if convergence is requested.

Definition at line 135 of file MonteCarlo.hh.

◆ nlist()

const SuperNeighborList& CASM::Monte::MonteCarlo::nlist ( ) const
inlineinherited

const Access the SuperNeighborList via pointer stored by 'set_nlist'

Definition at line 87 of file MonteCarlo.hh.

◆ potential_energy() [1/2]

const double& CASM::Monte::GrandCanonical::potential_energy ( ) const
inline

Potential energy, normalized per primitive cell.

Definition at line 91 of file GrandCanonical.hh.

◆ potential_energy() [2/2]

double CASM::Monte::GrandCanonical::potential_energy ( const Configuration config) const

Get potential energy.

  • if(&config == &this->config()) { return potential_energy(); }, else calculate potential_energy = formation_energy - comp_x.dot(param_chem_pot)

Definition at line 464 of file GrandCanonical.cc.

◆ primclex()

const PrimClex& CASM::Monte::MonteCarlo::primclex ( ) const
inlineinherited

const Access the PrimClex that *this is based on

Definition at line 77 of file MonteCarlo.hh.

◆ propose()

const GrandCanonical::EventType & CASM::Monte::GrandCanonical::propose ( )

Propose a new event, calculate delta properties, and return reference to it.

Randomly picks a site that's allowed more than one occupant, and randomly picks what occupant it changes to. Then calculates delta properties associated with that change.

Definition at line 199 of file GrandCanonical.cc.

◆ reject()

void CASM::Monte::GrandCanonical::reject ( const EventType event)

Nothing needs to be done to reject a GrandCanonicalEvent.

Definition at line 320 of file GrandCanonical.cc.

◆ reset()

void CASM::Monte::MonteCarlo::reset ( const ConfigDoF dof)
inlineinherited

Set current microstate and clear samplers.

Definition at line 98 of file MonteCarlo.hh.

◆ sample_data()

void CASM::Monte::MonteCarlo::sample_data ( const MonteCounter counter)
inherited

Samples all requested property data, and stores pass and step number sample was taken at.

Definition at line 34 of file MonteCarlo.cc.

◆ sample_times()

const SampleTimes& CASM::Monte::MonteCarlo::sample_times ( ) const
inlineinherited

const Access a vector of std::pair<pass, step> indicating when samples were taken

Definition at line 153 of file MonteCarlo.hh.

◆ samplers()

const SamplerMap& CASM::Monte::MonteCarlo::samplers ( ) const
inlineinherited

const Access sampler map

Definition at line 149 of file MonteCarlo.hh.

◆ scalar_properties()

const ScalarPropertyMap& CASM::Monte::MonteCarlo::scalar_properties ( ) const
inlineinherited

const Access scalar properties map

Definition at line 106 of file MonteCarlo.hh.

◆ scalar_property()

const double& CASM::Monte::MonteCarlo::scalar_property ( std::string  property_name) const
inlineinherited

const Access a particular scalar property

Definition at line 111 of file MonteCarlo.hh.

◆ set_conditions()

void CASM::Monte::GrandCanonical::set_conditions ( const CondType new_conditions)

Set conditions and clear previously collected data.

Definition at line 98 of file GrandCanonical.cc.

◆ set_configdof()

void CASM::Monte::GrandCanonical::set_configdof ( const ConfigDoF configdof,
const std::string &  msg = "" 
)

Set configdof and clear previously collected data.

Definition at line 112 of file GrandCanonical.cc.

◆ set_nlist()

void CASM::Monte::MonteCarlo::set_nlist ( )
inlineinherited

Set a pointer to the SuperNeighborList once it is ready.

Definition at line 83 of file MonteCarlo.hh.

◆ set_state() [1/2]

void CASM::Monte::GrandCanonical::set_state ( const CondType new_conditions,
const ConfigDoF configdof,
const std::string &  msg = "" 
)

Set configdof and conditions and clear previously collected data.

Definition at line 172 of file GrandCanonical.cc.

◆ set_state() [2/2]

std::pair< ConfigDoF, std::string > CASM::Monte::GrandCanonical::set_state ( const GrandCanonicalConditions new_conditions,
const GrandCanonicalSettings settings 
)

Set configdof and conditions and clear previously collected data.

Returns
Specified ConfigDoF and configname (or configdof path)

Definition at line 128 of file GrandCanonical.cc.

◆ settings()

const MonteSettings& CASM::Monte::MonteCarlo::settings ( ) const
inlineinherited

const Access settings used for construction

Definition at line 74 of file MonteCarlo.hh.

◆ steps_per_pass()

Index CASM::Monte::GrandCanonical::steps_per_pass ( ) const

Return number of steps per pass. Equals number of sites with variable occupation.

Definition at line 88 of file GrandCanonical.cc.

◆ supercell()

const Supercell& CASM::Monte::MonteCarlo::supercell ( ) const
inlineinherited

const Access the Supercell that *this is based on

Definition at line 80 of file MonteCarlo.hh.

◆ trajectory()

const std::vector<ConfigDoF>& CASM::Monte::MonteCarlo::trajectory ( ) const
inlineinherited

const Access snapshots of the Monte Carlo calculation

If requested, snapshots are taken at the same time as samples. So examine sample_times for pass and step information.

Definition at line 159 of file MonteCarlo.hh.

◆ vector_properties()

const VectorPropertyMap& CASM::Monte::MonteCarlo::vector_properties ( ) const
inlineinherited

const Access vector properties map

Definition at line 116 of file MonteCarlo.hh.

◆ vector_property()

const Eigen::VectorXd& CASM::Monte::MonteCarlo::vector_property ( std::string  property_name) const
inlineinherited

const Access a particular vector property

Definition at line 121 of file MonteCarlo.hh.

◆ write_results()

void CASM::Monte::GrandCanonical::write_results ( size_type  cond_index) const

Write results to files.

Definition at line 452 of file GrandCanonical.cc.

Member Data Documentation

◆ ensemble

const Monte::ENSEMBLE CASM::Monte::GrandCanonical::ensemble
static
Initial value:

Definition at line 33 of file GrandCanonical.hh.

◆ m_all_correlations

bool CASM::Monte::GrandCanonical::m_all_correlations
private

If true, calculate all correlations; if false, calculate correlations with non-zero eci

Definition at line 164 of file GrandCanonical.hh.

◆ m_comp_n

Eigen::VectorXd* CASM::Monte::GrandCanonical::m_comp_n
private

Number of atoms of each type, normalized per primitive cell.

Definition at line 185 of file GrandCanonical.hh.

◆ m_condition

GrandCanonicalConditions CASM::Monte::GrandCanonical::m_condition
private

Conditions (T, mu). Initially determined by m_settings, but can be changed halfway through the run

Definition at line 157 of file GrandCanonical.hh.

◆ m_config

Configuration CASM::Monte::MonteCarlo::m_config
mutableprivateinherited

Stores all degrees of freedom of the current microstate.

'mutable' is used for case where the DoF are modified to calculate event property values and then reverted within a const function

Definition at line 236 of file MonteCarlo.hh.

◆ m_configdof

ConfigDoF& CASM::Monte::MonteCarlo::m_configdof
privateinherited

Reference to m_config.configdof(), to avoid invalidating id every time used

Definition at line 240 of file MonteCarlo.hh.

◆ m_convergence_check_period

size_type CASM::Monte::MonteCarlo::m_convergence_check_period = 100
privateinherited

Definition at line 281 of file MonteCarlo.hh.

◆ m_corr

Eigen::VectorXd* CASM::Monte::GrandCanonical::m_corr
private

Correlations, normalized per primitive cell.

Definition at line 182 of file GrandCanonical.hh.

◆ m_debug

bool CASM::Monte::MonteCarlo::m_debug
privateinherited

Definition at line 284 of file MonteCarlo.hh.

◆ m_event

EventType CASM::Monte::GrandCanonical::m_event
private

Event to propose, check, accept/reject:

Definition at line 167 of file GrandCanonical.hh.

◆ m_formation_energy

double* CASM::Monte::GrandCanonical::m_formation_energy
private

Formation energy, normalized per primitive cell.

Definition at line 176 of file GrandCanonical.hh.

◆ m_formation_energy_clex

Clex CASM::Monte::GrandCanonical::m_formation_energy_clex
private

Holds Clexulator and ECI references.

Definition at line 160 of file GrandCanonical.hh.

◆ m_is_converged

bool CASM::Monte::MonteCarlo::m_is_converged
mutableprivateinherited

Definition at line 276 of file MonteCarlo.hh.

◆ m_is_converged_uptodate

bool CASM::Monte::MonteCarlo::m_is_converged_uptodate = false
mutableprivateinherited

Definition at line 277 of file MonteCarlo.hh.

◆ m_is_equil

std::pair<bool, size_type> CASM::Monte::MonteCarlo::m_is_equil
mutableprivateinherited

Definition at line 274 of file MonteCarlo.hh.

◆ m_is_equil_uptodate

bool CASM::Monte::MonteCarlo::m_is_equil_uptodate = false
mutableprivateinherited

Definition at line 275 of file MonteCarlo.hh.

◆ m_log

Log& CASM::Monte::MonteCarlo::m_log
privateinherited

Target for messages.

Definition at line 256 of file MonteCarlo.hh.

◆ m_must_converge

bool CASM::Monte::MonteCarlo::m_must_converge
privateinherited

True if any MonteSampler must converge.

Definition at line 253 of file MonteCarlo.hh.

◆ m_next_convergence_check

size_type CASM::Monte::MonteCarlo::m_next_convergence_check = 100
mutableprivateinherited

Definition at line 280 of file MonteCarlo.hh.

◆ m_nlist

const SuperNeighborList* CASM::Monte::MonteCarlo::m_nlist
privateinherited

Pointer to SuperNeighborList.

Definition at line 230 of file MonteCarlo.hh.

◆ m_potential_energy

double* CASM::Monte::GrandCanonical::m_potential_energy
private

Potential energy, normalized per primitive cell.

Definition at line 179 of file GrandCanonical.hh.

◆ m_primclex

const PrimClex& CASM::Monte::MonteCarlo::m_primclex
privateinherited

PrimClex for this system.

Definition at line 224 of file MonteCarlo.hh.

◆ m_sample_time

SampleTimes CASM::Monte::MonteCarlo::m_sample_time
privateinherited

a vector of std::pair(pass, step) indicating when samples were taken

Definition at line 270 of file MonteCarlo.hh.

◆ m_sampler

SamplerMap CASM::Monte::MonteCarlo::m_sampler
privateinherited

a map of pair<keyname, index> to MonteSampler

  • scalar example: m_sampler[std::make_pair("formation_energy", 0)]
  • vector example: m_sampler[std::make_pair("corr", 12)]

Definition at line 266 of file MonteCarlo.hh.

◆ m_scalar_property

ScalarPropertyMap CASM::Monte::MonteCarlo::m_scalar_property
privateinherited

a map of keyname to property value

  • example: m_scalar_property["formation_energy"]

Definition at line 213 of file MonteCarlo.hh.

◆ m_scel

Supercell CASM::Monte::MonteCarlo::m_scel
privateinherited

Supercell for the calculation.

Definition at line 227 of file MonteCarlo.hh.

◆ m_settings

const MonteSettings& CASM::Monte::MonteCarlo::m_settings
privateinherited

Contains all input settings.

Definition at line 221 of file MonteCarlo.hh.

◆ m_site_swaps

const SiteExchanger CASM::Monte::GrandCanonical::m_site_swaps
private

Keeps track of what sites can change to what.

Definition at line 153 of file GrandCanonical.hh.

◆ m_trajectory

std::vector<ConfigDoF> CASM::Monte::MonteCarlo::m_trajectory
privateinherited

Snapshots of the Monte Carlo simulation, taken by sample_data() if m_write_trajectory is true.

Definition at line 250 of file MonteCarlo.hh.

◆ m_twister

MTRand CASM::Monte::MonteCarlo::m_twister
privateinherited

Random number generator.

Definition at line 243 of file MonteCarlo.hh.

◆ m_use_deltas

bool CASM::Monte::GrandCanonical::m_use_deltas
private

If the supercell is large enough, calculate delta correlations directly.

Definition at line 171 of file GrandCanonical.hh.

◆ m_vector_property

VectorPropertyMap CASM::Monte::MonteCarlo::m_vector_property
privateinherited

a map of keyname to property value Eigen::VectorXd

  • example: m_vector_property["corr"]

Definition at line 218 of file MonteCarlo.hh.

◆ m_write_trajectory

bool CASM::Monte::MonteCarlo::m_write_trajectory = false
privateinherited

Save trajectory?

Definition at line 246 of file MonteCarlo.hh.


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