1 #ifndef CASM_Canonical_HH
2 #define CASM_Canonical_HH
57 std::pair<ConfigDoF, std::string>
set_state(
63 const std::string &msg =
"");
126 std::string colheader,
bool all_correlations)
const;
156 std::vector<OccSwap>::const_iterator end);
A sparse container of ECI values and their corresponding orbit indices.
Data structure for storing information regarding a proposed grand canonical Monte Carlo event.
const CondType & conditions() const
Return current conditions.
void _calc_delta_point_corr(size_type l, int new_occ, Eigen::VectorXd &dCorr_comp) const
CanonicalConditions m_condition
void accept(const EventType &event)
Accept proposed event. Change configuration accordingly and update energies etc.
ConfigDoF _default_motif() const
Generate supercell filling ConfigDoF from default configuration.
CanonicalEvent m_event
Event to propose, check, accept/reject:
Eigen::VectorXd & _comp_n()
Number of atoms of each type, normalized per primitive cell.
void write_results(size_type cond_index) const
Write results to files.
const Eigen::VectorXd & corr() const
Correlations, normalized per primitive cell.
const Eigen::VectorXd & comp_n() const
Number of atoms of each type, normalized per primitive cell.
void _update_properties()
Calculate properties given current conditions.
std::pair< ConfigDoF, std::string > set_state(const CanonicalConditions &new_conditions, const CanonicalSettings &settings)
Set configdof and conditions and clear previously collected data.
void _set_nlist(size_type l) const
ConfigDoF _configname_motif(const std::string &configname) const
Generate supercell filling ConfigDoF from configuration.
size_type steps_per_pass() const
Return number of steps per pass. Equals number of sites with variable occupation.
const double & formation_energy() const
Formation energy, normalized per primitive cell.
void reject(const EventType &event)
Nothing needs to be done to reject a CanonicalEvent.
void _make_possible_swaps(const CanonicalSettings &settings)
Construct m_candidate, m_cand_to_index, m_occ_loc, m_canonical_swaps, m_grand_canonical_swaps.
Eigen::VectorXd & _corr()
Correlations, normalized per primitive cell.
Conversions m_convert
Convert sublat/asym_unit and species/occ index.
ConfigDoF _enforce_conditions(const ConfigDoF &configdof)
Enforce composition by repeatedly applying grand canonical events.
void set_configdof(const ConfigDoF &configdof, const std::string &msg="")
Set configdof and clear previously collected data.
Eigen::VectorXd * m_corr
Correlations, normalized per primitive cell.
void set_conditions(const CondType &new_conditions)
Set conditions and clear previously collected data.
double * m_potential_energy
Potential energy, normalized per primitive cell.
std::pair< ConfigDoF, std::string > _restricted_auto_motif(const CanonicalConditions &cond) const
Generate minimum potential energy ConfigDoF for this supercell.
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 ...
Clex m_formation_energy_clex
Holds Clexulator and ECI references.
std::vector< OccSwap >::const_iterator _find_grand_canonical_swap(const Configuration &config, std::vector< OccSwap >::const_iterator begin, std::vector< OccSwap >::const_iterator end)
Find a OccSwap to help enforce composition.
void _update_deltas(CanonicalEvent &event) const
Calculate delta properties for an event and update the event with those properties.
static const ENSEMBLE ensemble
Canonical(const PrimClex &primclex, const SettingsType &settings, Log &_log)
Constructs a Canonical object and prepares it for running based on Settings.
const double & potential_energy() const
Potential energy, normalized per primitive cell.
const ECIContainer & _eci() const
double * m_formation_energy
Formation energy, normalized per primitive cell.
OccCandidateList m_cand
Convert sublat/asym_unit and species/occ index.
double & _formation_energy()
Formation energy, normalized per primitive cell.
double & _potential_energy()
Potential energy, normalized per primitive cell.
const EventType & propose()
Propose a new event, calculate delta properties, and return reference to it.
std::pair< ConfigDoF, std::string > _auto_motif(const CanonicalConditions &cond) const
Generate minimum potential energy ConfigDoF.
void _print_correlations(const Eigen::VectorXd &corr, std::string title, std::string colheader, bool all_correlations) const
Print correlations to _log()
OccLocation m_occ_loc
Keeps track of what sites have which occupants.
CanonicalConditions CondType
CanonicalSettings SettingsType
bool m_use_deltas
If the supercell is large enough, calculate delta correlations directly.
Eigen::VectorXd * m_comp_n
Number of atoms of each type, normalized per primitive cell.
Clexulator const & _clexulator() const
void _set_dCorr(CanonicalEvent &event) const
Calculate delta correlations for an event.
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
Stores data to enable efficient proposal and update of occupation mutation.
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.
Pair of Clexulator and ECIContainer.