1 #ifndef CASM_GrandCanonical_HH
2 #define CASM_GrandCanonical_HH
59 std::pair<ConfigDoF, std::string>
set_state(
64 void set_state(
const CondType &new_conditions,
66 const std::string &msg =
"");
72 bool check(
const EventType &event);
75 void accept(
const EventType &event);
78 void reject(
const EventType &event);
81 std::cout <<
"corr:" << std::endl;
83 std::cout <<
"OK corr" << std::endl;
151 int current_occupant,
154 bool all_correlations)
const;
159 std::string colheader,
160 bool all_correlations)
const;
166 int current_occupant,
167 int new_occupant)
const;
void set_conditions(const CondType &new_conditions)
Set conditions and clear previously collected data.
Eigen::VectorXd & _corr()
Correlations, normalized per primitive cell.
ConfigDoF & _configdof() const
Access current microstate.
Data structure for storing information regarding a proposed grand canonical Monte Carlo event...
const SiteExchanger m_site_swaps
Keeps track of what sites can change to what.
GrandCanonicalConditions CondType
Clexulator & clexulator(Log &status_log=null_log()) const
const Configuration & config() const
const Access current microstate
const Eigen::VectorXd & comp_n() const
Number of atoms of each type, normalized per primitive cell.
const ECIContainer & _eci() const
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 ...
ENSEMBLE
Monte Carlo ensemble type.
const ConfigDoF & configdof() const
const Access current microstate
double * m_formation_energy
Formation energy, normalized per primitive cell.
EventType m_event
Event to propose, check, accept/reject:
void _print_correlations(const Eigen::VectorXd &corr, std::string title, std::string colheader, bool all_correlations) const
Print correlations to _log()
void reject(const EventType &event)
Nothing needs to be done to reject a GrandCanonicalEvent.
bool m_all_correlations
If true, calculate all correlations; if false, calculate correlations with non-zero eci...
Eigen::VectorXd & _comp_n()
Number of atoms of each type, normalized per primitive cell.
void write_results(Index cond_index) const
Write results to files.
Eigen::VectorXd * m_corr
Correlations, normalized per primitive cell.
void _update_properties()
Calculate properties given current conditions.
void set_configdof(const ConfigDoF &configdof, const std::string &msg="")
Set configdof and clear previously collected data.
double lte_grand_canonical_free_energy() const
Calculate the single spin flip low temperature expansion of the grand canonical potential.
double & _formation_energy()
Formation energy, normalized per primitive cell.
const double & potential_energy() const
Potential energy, normalized per primitive cell.
double & _potential_energy()
Potential energy, normalized per primitive cell.
GrandCanonicalEvent EventType
const Supercell & supercell() const
const Access the Supercell that *this is based on
const EventType & propose()
Propose a new event, calculate delta properties, and return reference to it.
EigenIndex Index
For long integer indexing:
A container class for the different degrees of freedom a Configuration might have.
const Eigen::VectorXd & corr() const
Correlations, normalized per primitive cell.
const PrimClex & primclex() const
const Access the PrimClex that *this is based on
std::pair< ConfigDoF, std::string > _restricted_auto_motif(const GrandCanonicalConditions &cond) const
Generate minimum potential energy ConfigDoF for this supercell.
PrimClex is the top-level data structure for a CASM project.
bool m_use_deltas
If the supercell is large enough, calculate delta correlations directly.
Clexulator & _clexulator() const
ConfigIO::GenericConfigFormatter< std::string > configname()
Constructs DataFormmaterDictionary containing all Configuration DatumFormatters.
Eigen::VectorXd * m_comp_n
Number of atoms of each type, normalized per primitive cell.
Interface base class for all types of Monte Carlo simulations (not meant to be used polymorphically) ...
std::pair< ConfigDoF, std::string > _auto_motif(const GrandCanonicalConditions &cond) const
Generate minimum potential energy ConfigDoF.
std::pair< ConfigDoF, std::string > set_state(const GrandCanonicalConditions &new_conditions, const GrandCanonicalSettings &settings)
Set configdof and conditions and clear previously collected data.
void accept(const EventType &event)
Accept proposed event. Change configuration accordingly and update energies etc.
const double & formation_energy() const
Formation energy, normalized per primitive cell.
ConfigDoF _default_motif() const
Generate supercell filling ConfigDoF from default configuration.
const CondType & conditions() const
Return current conditions.
static const Monte::ENSEMBLE ensemble
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.
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.
const ECIContainer & eci() const
GrandCanonicalSettings SettingsType
Index steps_per_pass() const
Return number of steps per pass. Equals number of sites with variable occupation. ...
double * m_potential_energy
Potential energy, normalized per primitive cell.
ConfigDoF _configname_motif(const std::string &configname) const
Generate supercell filling ConfigDoF from configuration.
Clex m_formation_energy_clex
Holds Clexulator and ECI references.
Data structure used for cluster expansions.
Eigen::VectorXd correlations_vec(const ConfigDoF &configdof, const Supercell &scel, Clexulator &clexulator)
Returns correlations using 'clexulator'. Supercell needs a correctly populated neighbor list...
const MonteSettings & settings() const
const Access settings used for construction
GrandCanonical(PrimClex &primclex, const SettingsType &settings, Log &_log)
Constructs a GrandCanonical object and prepares it for running based on MonteSettings.
GrandCanonicalConditions m_condition
Conditions (T, mu). Initially determined by m_settings, but can be changed halfway through the run...
A Configuration represents the values of all degrees of freedom in a Supercell.
A sparse container of ECI values and their corresponding orbit indices.