CASM  1.1.0
A Clusters Approach to Statistical Mechanics
GrandCanonicalEvent.hh
Go to the documentation of this file.
1 #ifndef CASM_GrandCanonicalEvent_HH
2 #define CASM_GrandCanonicalEvent_HH
3 
4 #include <vector>
5 
6 #include "casm/external/Eigen/Dense"
9 
10 namespace CASM {
11 namespace Monte {
12 
16  public:
17  typedef Index size_type;
18 
21 
29  GrandCanonicalEvent(size_type Nspecies, size_type Ncorr);
30 
33  void set_dEf(double dE);
34 
37  double dEf() const;
38 
42 
45  const Eigen::VectorXl &dN() const;
46 
49  void set_dN(size_type species_type_index, long int dn);
50 
53  long int dN(size_type species_type_index) const;
54 
57  void set_dEpot(double dpot_nrg);
58 
61  double dEpot() const;
62 
66 
69  const Eigen::VectorXd &dCorr() const;
70 
73 
75  const OccMod &occupational_change() const;
76 
77  private:
80 
82  double m_dEf;
83 
86  double m_dEpot;
87 
92 
95 };
96 
105  size_type Ncorr)
106  : m_dCorr(Eigen::VectorXd(Ncorr)), m_dN(Eigen::VectorXl(Nspecies)) {}
107 
109 inline void GrandCanonicalEvent::set_dEf(double dEf) { m_dEf = dEf; }
110 
112 inline double GrandCanonicalEvent::dEf() const { return m_dEf; }
113 
117 
120 inline const Eigen::VectorXl &GrandCanonicalEvent::dN() const { return m_dN; }
121 
124 inline void GrandCanonicalEvent::set_dN(size_type species_type_index,
125  long int dNi) {
126  m_dN(species_type_index) = dNi;
127 }
128 
131 inline long int GrandCanonicalEvent::dN(size_type species_type_index) const {
132  return m_dN(species_type_index);
133 }
134 
137 inline void GrandCanonicalEvent::set_dEpot(double dEpot) { m_dEpot = dEpot; }
138 
141 inline double GrandCanonicalEvent::dEpot() const { return m_dEpot; }
142 
145 
148  return m_dCorr;
149 }
150 
153 
156  return m_occ_mod;
157 }
158 
159 } // namespace Monte
160 } // namespace CASM
161 
162 #endif
Data structure for storing information regarding a proposed grand canonical Monte Carlo event.
Eigen::VectorXd & dCorr()
Access the changes in (extensive) correlations associated with this event.
double dEf() const
Return change in (extensive) formation energy associated with this event.
void set_dEpot(double dpot_nrg)
Set change in (extensive) potential energy, dEpot = dEf - sum_i(Nunit * param_chem_pot_i * dcomp_x_i)
void set_dN(size_type species_type_index, long int dn)
Set the change in number of species in supercell. Order as in CompositionConverter::components().
void set_dEf(double dE)
Set the change in (extensive) formation energy associated with this event.
double m_dEpot
Change in (extensive) potential energy, dEpot = dEf - sum_i(Nunit * param_chem_pot_i * dcomp_x_i)
Eigen::VectorXl & dN()
Access change in number of species per supercell. Order as in CompositionConverter::components().
OccMod & occupational_change()
Access the occupational modification for this event.
Eigen::VectorXl m_dN
Change in number of each species in supercell due to this event. The order is determined by primclex....
Eigen::VectorXd m_dCorr
Change in (extensive) correlations due to this event.
OccMod m_occ_mod
The ConfigDoF modification performed by this event.
double dEpot() const
Return change in (extensive) potential energy, dEpot = dEf - sum_i(Nunit * param_chem_pot_i * dcomp_x...
double m_dEf
Change in (extensive) formation energy due to this event.
GrandCanonicalEvent()
Default constructor.
Main CASM namespace.
Definition: APICommand.hh:8
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Eigen::VectorXd VectorXd
Matrix< long int, Dynamic, 1 > VectorXl
Definition: eigen.hh:15