1 #ifndef CASM_GrandCanonical_HH
2 #define CASM_GrandCanonical_HH
57 std::pair<ConfigDoF, std::string>
set_state(
63 const std::string &msg =
"");
123 int current_occupant,
int new_occupant,
bool use_deltas,
124 bool all_correlations)
const;
128 std::string colheader,
bool all_correlations)
const;
133 int sublat,
int current_occupant,
int new_occupant)
const;
A sparse container of ECI values and their corresponding orbit indices.
Data structure for storing information regarding a proposed grand canonical Monte Carlo event.
GrandCanonicalConditions CondType
Clexulator const & _clexulator() const
void _update_properties()
Calculate properties given current conditions.
Eigen::VectorXd * m_comp_n
Number of atoms of each type, normalized per primitive cell.
const ECIContainer & _eci() const
GrandCanonicalEvent EventType
const Eigen::VectorXd & corr() const
Correlations, normalized per primitive cell.
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.
void accept(const EventType &event)
Accept proposed event. Change configuration accordingly and update energies etc.
std::pair< ConfigDoF, std::string > set_state(const GrandCanonicalConditions &new_conditions, const GrandCanonicalSettings &settings)
Set configdof and conditions and clear previously collected data.
const EventType & propose()
Propose a new event, calculate delta properties, and return reference to it.
double * m_potential_energy
Potential energy, normalized per primitive cell.
void reject(const EventType &event)
Nothing needs to be done to reject a GrandCanonicalEvent.
Eigen::VectorXd & _corr()
Correlations, normalized per primitive cell.
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.
double lte_grand_canonical_free_energy() const
Calculate the single spin flip low temperature expansion of the grand canonical potential.
size_type steps_per_pass() const
Return number of steps per pass. Equals number of sites with variable occupation.
void _print_correlations(const Eigen::VectorXd &corr, std::string title, std::string colheader, bool all_correlations) const
Print correlations to _log()
GrandCanonical(const PrimClex &primclex, const SettingsType &settings, Log &_log)
Constructs a GrandCanonical object and prepares it for running based on Settings.
const double & formation_energy() const
Formation energy, normalized per primitive cell.
Eigen::VectorXd * m_corr
Correlations, normalized per primitive cell.
const double & potential_energy() const
Potential energy, normalized per primitive cell.
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 ...
double & _formation_energy()
Formation energy, normalized per primitive cell.
void write_results(size_type cond_index) const
Write results to files.
Clex m_formation_energy_clex
Holds Clexulator and ECI references.
ConfigDoF _configname_motif(const std::string &configname) const
Generate supercell filling ConfigDoF from configuration.
const CondType & conditions() const
Return current conditions.
void set_conditions(const CondType &new_conditions)
Set conditions and clear previously collected data.
ConfigDoF _default_motif() const
Generate supercell filling ConfigDoF from default configuration.
Eigen::VectorXd & _comp_n()
Number of atoms of each type, normalized per primitive cell.
GrandCanonicalSettings SettingsType
std::pair< ConfigDoF, std::string > _auto_motif(const GrandCanonicalConditions &cond) const
Generate minimum potential energy ConfigDoF.
static const ENSEMBLE ensemble
const Eigen::VectorXd & comp_n() const
Number of atoms of each type, normalized per primitive cell.
std::pair< ConfigDoF, std::string > _restricted_auto_motif(const GrandCanonicalConditions &cond) const
Generate minimum potential energy ConfigDoF for this supercell.
double * m_formation_energy
Formation energy, normalized per primitive cell.
double & _potential_energy()
Potential energy, normalized per primitive cell.
GrandCanonicalConditions m_condition
EventType m_event
Event to propose, check, accept/reject:
void set_configdof(const ConfigDoF &configdof, const std::string &msg="")
Set configdof and clear previously collected data.
bool m_use_deltas
If the supercell is large enough, calculate delta correlations directly.
const SiteExchanger m_site_swaps
Keeps track of what sites can change to what.
Interface base class for all types of Monte Carlo simulations (not meant to be used polymorphically)
const MonteSettings & settings() const
const Access settings used for construction
const Configuration & config() const
const Access current microstate
const PrimClex & primclex() const
const Access the PrimClex that *this is based on
Monte::size_type size_type
const ConfigDoF & configdof() const
const Access current microstate
PrimClex is the top-level data structure for a CASM project.
ConfigIO::GenericConfigFormatter< std::string > configname()
Constructs DataFormmaterDictionary containing all Configuration DatumFormatters.
ENSEMBLE
Monte Carlo ensemble type.
INDEX_TYPE Index
For long integer indexing:
Pair of Clexulator and ECIContainer.