CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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 
6 namespace CASM {
7 
8  class MonteSettings;
9 
16  public:
17 
20 
28  GrandCanonicalConditions(const PrimClex &_primclex,
29  double _temperature,
30  const Eigen::VectorXd &_param_chem_pot,
31  double _tol);
32 
33  // ***************************************ACCESSORS********************************************** //
34 
35  const PrimClex &primclex() const;
36 
37  double temperature() const;
38 
39  double beta() const;
40 
43 
45  double exchange_chem_pot(Index index_new, Index index_curr) const;
46 
49 
51  double param_chem_pot(Index index) const;
52 
53 
54  double tolerance() const;
55 
56  // ***************************************MUTATORS*********************************************** //
57 
59  void set_temperature(double in_temp);
60 
62  void set_param_chem_pot(const Eigen::VectorXd &in_chem_pot);
63 
65  void set_param_chem_pot(Index ind, double in_chem_pot);
66 
67 
68  // ***************************************OPERATORS********************************************** //
69 
72 
75 
78 
81 
83  bool operator==(const GrandCanonicalConditions &RHS) const;
84 
86  bool operator!=(const GrandCanonicalConditions &RHS) const;
87 
89  int operator/(const GrandCanonicalConditions &RHS_inc) const;
90 
91 
92  protected:
93 
95 
97  double m_temperature;
98 
100  double m_beta;
101 
104 
107 
110 
112  double m_tolerance;
113 
114 
115  };
116 
117  std::ostream &operator<<(std::ostream &sout, const GrandCanonicalConditions &cond);
118 
119 }
120 
121 #endif
122 
Eigen::MatrixXd MatrixXd
bool operator!=(const GrandCanonicalConditions &RHS) const
Compare temperature and all chemical potentials to *this.
GrandCanonicalConditions & operator+=(const GrandCanonicalConditions &RHS)
Add temperature and all chemical potentials to *this.
Eigen::VectorXd param_chem_pot() const
parametric chemical potential: dg/dcomp_x
Main CASM namespace.
Definition: complete.cpp:8
Eigen::VectorXd m_param_chem_pot
Vector of the parametric chemical potentials conjugate to the parametric compositions.
Eigen::MatrixXd exchange_chem_pot() const
matrix of exchange chemical potential, M(new, curr) = chem_pot(new) - chem_pot(curr) ...
GrandCanonicalConditions operator-(const GrandCanonicalConditions &RHS) const
Subtract temperature and all chemical potentials together and return a new Condition.
double m_beta
Inverse temperature. Includes Boltzmann term.
Eigen::MatrixXd m_exchange_chem_pot
Matrix(i,j) of chem_pot(i) - chem_pot(j)
double m_tolerance
Tolerance for comparison operators == and !=.
std::ostream & operator<<(std::ostream &_stream, const FormattedPrintable &_formatted)
int operator/(const GrandCanonicalConditions &RHS_inc) const
Divide ALL parameters and return the greatest number in absolute value.
EigenIndex Index
For long integer indexing:
void set_param_chem_pot(const Eigen::VectorXd &in_chem_pot)
Set all the parametric chemical potentials of the current grand canonical condition.
Eigen::VectorXd VectorXd
PrimClex is the top-level data structure for a CASM project.
Definition: PrimClex.hh:52
GrandCanonicalConditions operator+(const GrandCanonicalConditions &RHS) const
Add temperature and all chemical potentials together and return a new Condition.
bool operator==(const GrandCanonicalConditions &RHS) const
Compare temperature and all chemical potentials to *this.
GrandCanonicalConditions()
Default constructor.
void set_temperature(double in_temp)
Set the temperature of the current grand canonical condition.
GrandCanonicalConditions & operator-=(const GrandCanonicalConditions &RHS)
Subtract temperature and all chemical potentials to *this.
Eigen::VectorXd m_chem_pot
Vector of the 'atomic' chemical potentials for each species. Ordered as primclex.get_param_comp().get_components()