CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
GrandCanonicalEvent.hh
Go to the documentation of this file.
1 #ifndef CASM_GrandCanonicalEvent_HH
2 #define CASM_GrandCanonicalEvent_HH
3 
4 #include <vector>
5 #include "casm/external/Eigen/Dense"
8 
9 namespace CASM {
10 
11 
14 
15  public:
16 
17  typedef Index size_type;
18 
21 
27  GrandCanonicalEvent(size_type Nspecies, size_type Ncorr);
28 
29 
31  void set_dEf(double dE);
32 
34  double dEf() const;
35 
36 
39 
41  const Eigen::VectorXl &dN() const;
42 
44  void set_dN(size_type species_type_index, long int dn);
45 
47  long int dN(size_type species_type_index) const;
48 
49 
51  void set_dEpot(double dpot_nrg);
52 
54  double dEpot() const;
55 
58 
60  const Eigen::VectorXd &dCorr() const;
61 
62 
65 
67  const OccMod &occupational_change() const;
68 
69 
70  private:
71 
74 
76  double m_dEf;
77 
79  double m_dEpot;
80 
84 
87 
88  };
89 
90 
97  m_dCorr(Eigen::VectorXd(Ncorr)),
98  m_dN(Eigen::VectorXl(Nspecies)) { }
99 
100 
102  inline void GrandCanonicalEvent::set_dEf(double dEf) {
103  m_dEf = dEf;
104  }
105 
107  inline double GrandCanonicalEvent::dEf() const {
108  return m_dEf;
109  }
110 
111 
114  return m_dN;
115  }
116 
118  inline const Eigen::VectorXl &GrandCanonicalEvent::dN() const {
119  return m_dN;
120  }
121 
123  inline void GrandCanonicalEvent::set_dN(size_type species_type_index, long int dNi) {
124  m_dN(species_type_index) = dNi;
125  }
126 
128  inline long int GrandCanonicalEvent::dN(size_type species_type_index) const {
129  return m_dN(species_type_index);
130  }
131 
132 
134  inline void GrandCanonicalEvent::set_dEpot(double dEpot) {
135  m_dEpot = dEpot;
136  }
137 
139  inline double GrandCanonicalEvent::dEpot() const {
140  return m_dEpot;
141  }
142 
145  return m_dCorr;
146  }
147 
150  return m_dCorr;
151  }
152 
153 
156  return m_occ_mod;
157  }
158 
161  return m_occ_mod;
162  }
163 
164 }
165 
166 #endif
Eigen::VectorXd m_dCorr
Change in (extensive) correlations due to this event.
OccMod & occupational_change()
Access the occupational modification for this event.
double dEf() const
Return change in (extensive) formation energy associated with this event.
Data structure for storing information regarding a proposed grand canonical Monte Carlo event...
GrandCanonicalEvent()
Default constructor.
void set_dEpot(double dpot_nrg)
Set change in (extensive) potential energy, dEpot = dEf - sum_i(Nunit * param_chem_pot_i * dcomp_x_i)...
Main CASM namespace.
Definition: complete.cpp:8
Eigen::VectorXd & dCorr()
Access the changes in (extensive) correlations associated with this event.
void set_dEf(double dE)
Set the change in (extensive) formation energy associated with this event.
Eigen::VectorXl m_dN
Change in number of each species in supercell due to this event. The order is determined by primclex...
EigenIndex Index
For long integer indexing:
OccMod m_occ_mod
The ConfigDoF modification performed by this event.
Matrix< long int, Dynamic, 1 > VectorXl
Eigen::VectorXd VectorXd
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().
double dEpot() const
Return change in (extensive) potential energy, dEpot = dEf - sum_i(Nunit * param_chem_pot_i * dcomp_x...
double m_dEpot
Change in (extensive) potential energy, dEpot = dEf - sum_i(Nunit * param_chem_pot_i * dcomp_x_i) ...
double m_dEf
Change in (extensive) formation energy due to this event.
Eigen::VectorXl & dN()
Access change in number of species per supercell. Order as in CompositionConverter::components().