CASM  1.1.0
A Clusters Approach to Statistical Mechanics
GrandCanonicalConditions.hh
Go to the documentation of this file.
1 #ifndef CASM_GrandCanonicalConditions_HH
2 #define CASM_GrandCanonicalConditions_HH
3 
4 #include "casm/clex/PrimClex.hh"
5 #include "casm/global/eigen.hh"
6 
7 namespace CASM {
8 namespace Monte {
9 
10 class Settings;
11 
18  public:
21 
29  GrandCanonicalConditions(const PrimClex &_primclex, double _temperature,
30  const Eigen::VectorXd &_param_chem_pot, double _tol);
31 
32  // ***************************************ACCESSORS**********************************************
33  // //
34 
35  const PrimClex &primclex() const;
36 
37  double temperature() const;
38 
39  double beta() const;
40 
44 
46  double exchange_chem_pot(Index index_new, Index index_curr) const;
47 
50 
52  double param_chem_pot(Index index) const;
53 
54  double tolerance() const;
55 
56  // ***************************************MUTATORS***********************************************
57  // //
58 
60  void set_temperature(double in_temp);
61 
64  void set_param_chem_pot(const Eigen::VectorXd &in_chem_pot);
65 
68  void set_param_chem_pot(Index ind, double in_chem_pot);
69 
70  // ***************************************OPERATORS**********************************************
71  // //
72 
75 
79 
82 
86 
88  bool operator==(const GrandCanonicalConditions &RHS) const;
89 
91  bool operator!=(const GrandCanonicalConditions &RHS) const;
92 
94  int operator/(const GrandCanonicalConditions &RHS_inc) const;
95 
96  protected:
98 
101 
103  double m_beta;
104 
108 
112 
115 
117  double m_tolerance;
118 };
119 
120 std::ostream &operator<<(std::ostream &sout,
121  const GrandCanonicalConditions &cond);
122 
123 } // namespace Monte
124 } // namespace CASM
125 
126 #endif
void set_param_chem_pot(const Eigen::VectorXd &in_chem_pot)
GrandCanonicalConditions operator-(const GrandCanonicalConditions &RHS) const
int operator/(const GrandCanonicalConditions &RHS_inc) const
Divide ALL parameters and return the greatest number in absolute value.
Eigen::MatrixXd m_exchange_chem_pot
Matrix(i,j) of chem_pot(i) - chem_pot(j)
GrandCanonicalConditions & operator+=(const GrandCanonicalConditions &RHS)
Add temperature and all chemical potentials to *this.
double m_tolerance
Tolerance for comparison operators == and !=.
Eigen::MatrixXd exchange_chem_pot() const
matrix of exchange chemical potential, M(new, curr) = chem_pot(new)
GrandCanonicalConditions operator+(const GrandCanonicalConditions &RHS) const
GrandCanonicalConditions & operator-=(const GrandCanonicalConditions &RHS)
Subtract temperature and all chemical potentials to *this.
double m_beta
Inverse temperature. Includes Boltzmann term.
bool operator!=(const GrandCanonicalConditions &RHS) const
Compare temperature and all chemical potentials to *this.
Eigen::VectorXd param_chem_pot() const
parametric chemical potential: dg/dcomp_x
bool operator==(const GrandCanonicalConditions &RHS) const
Compare temperature and all chemical potentials to *this.
void set_temperature(double in_temp)
Set the temperature of the current grand canonical condition.
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:55
std::ostream & operator<<(std::ostream &sout, const CanonicalConditions &cond)
Main CASM namespace.
Definition: APICommand.hh:8
Eigen::MatrixXd MatrixXd
INDEX_TYPE Index
For long integer indexing:
Definition: definitions.hh:39
Eigen::VectorXd VectorXd