Thermal-FIST  1.3
Package for hadron resonance gas model applications
ThermalModelEVDiagonal.h
Go to the documentation of this file.
1 /*
2  * Thermal-FIST package
3  *
4  * Copyright (c) 2014-2019 Volodymyr Vovchenko
5  *
6  * GNU General Public License (GPLv3 or later)
7  */
8 #ifndef THERMALMODELEVDIAGONAL_H
9 #define THERMALMODELEVDIAGONAL_H
10 
12 
13 namespace thermalfist {
14 
15  struct EVSolution {
16  double T, mu;
17  double n, P, en, s;
18  double mutil;
19  double nid, eid, sid, pid;
20  double fav, f2av, f3av, wav, wfav, w2fav, w2av;
21  double scv, scvid;
24  double dndmu, dndT, dendmu, dendT;
25  double skew, kurtosis;
26  double Cs;
27  double PT4, eT4, sT3;
28  double deltaEN, sigmaEN;
29  };
30 
46  {
47  public:
55 
60  virtual ~ThermalModelEVDiagonal(void);
61 
70  void FillVirialEV(const std::vector<double> & vi = std::vector<double>(0));
71 
79  double ExcludedVolume(int i) const;
80 
88  double CommonSuppressionFactor();
89 
90 
92  virtual void DisableMesonMesonVirial() {}
96  virtual void DisableMesonMesonAttraction() {}
97  virtual void DisableMesonBaryonVirial() {}
98  virtual void DisableMesonBaryonAttraction() {}
99  virtual void DisableBaryonBaryonVirial() {}
104 
105  // Override functions begin
106 
107  void SetRadius(double rad);
108 
109  void SetRadius(int i, double rad);
110 
117  void FillVirial(const std::vector<double> & ri = std::vector<double>(0));
118 
125  virtual void ReadInteractionParameters(const std::string &filename);
126 
135  virtual void WriteInteractionParameters(const std::string &filename);
136 
137  virtual double CalculateEigenvolumeFraction();
138 
147  double VirialCoefficient(int i, int j) const;
148 
157  void SetVirial(int i, int j, double b);
158 
159  virtual void ChangeTPS(ThermalParticleSystem *TPS);
160 
161  virtual void CalculatePrimordialDensities();
162 
163  virtual void CalculateFluctuations();
164 
165  virtual void CalculateTwoParticleCorrelations();
166 
167  virtual std::vector<double> CalculateChargeFluctuations(const std::vector<double> &chgs, int order = 4);
168 
169  virtual double CalculatePressure();
170 
171  virtual double CalculateEnergyDensity();
172 
173  virtual double CalculateEntropyDensity();
174 
175  // Dummy
176  virtual double CalculateBaryonMatterEntropyDensity() { return 0.; }
177 
178  virtual double CalculateMesonMatterEntropyDensity() { return 0.; }
179 
180  // TODO properly with excluded volume
181  virtual double ParticleScaledVariance(int /*part*/) { return 1.; }
182 
183  // TODO properly with excluded volume
184  virtual double ParticleSkewness(int /*part*/) { return 1.; }
185 
186  // TODO properly with excluded volume
187  virtual double ParticleKurtosis(int /*part*/) { return 1.; }
188 
189  virtual double ParticleScalarDensity(int part);
190 
191  // Override functions end
192 
193  protected:
200  virtual void SolvePressure();
201 
208  double Pressure(double P);
209 
218  double DensityId(int i, double Pressure);
219 
228  double PressureId(int i, double Pressure);
229 
239  double ScaledVarianceId(int i, double Pressure);
240 
251  virtual double MuShift(int i) const;
252 
253  std::vector<double> m_densitiesid;
254  std::vector<double> m_densitiesidnoshift;
255  std::vector<double> m_v;
256  double m_Suppression;
257  double m_Pressure;
258  double m_Densityid;
262  private:
263  class BroydenEquationsDEV : public BroydenEquations
264  {
265  public:
266  BroydenEquationsDEV(ThermalModelEVDiagonal *model) : BroydenEquations(), m_THM(model) { m_N = 1; m_mnc = 1.; }
267  std::vector<double> Equations(const std::vector<double> &x);
268  void SetMnc(double mnc) { m_mnc = mnc; }
269  private:
270  ThermalModelEVDiagonal *m_THM;
271  double m_mnc;
272  };
273 
274  class BroydenJacobianDEV : public BroydenJacobian
275  {
276  public:
277  BroydenJacobianDEV(ThermalModelEVDiagonal *model) : BroydenJacobian(), m_THM(model) { m_mnc = 1.; }
278  std::vector<double> Jacobian(const std::vector<double> &x);
279  void SetMnc(double mnc) { m_mnc = mnc; }
280  private:
281  ThermalModelEVDiagonal *m_THM;
282  double m_mnc;
283  };
284 
285  class BroydenSolutionCriteriumDEV : public Broyden::BroydenSolutionCriterium
286  {
287  public:
288  BroydenSolutionCriteriumDEV(ThermalModelEVDiagonal *model, double relative_error = Broyden::TOL) : Broyden::BroydenSolutionCriterium(relative_error), m_THM(model) { }
289  virtual bool IsSolved(const std::vector<double>& x, const std::vector<double>& f, const std::vector<double>& xdelta = std::vector<double>()) const;
290  protected:
291  ThermalModelEVDiagonal *m_THM;
292  };
293 
294  class BroydenEquationsDEVOrig : public BroydenEquations
295  {
296  public:
297  BroydenEquationsDEVOrig(ThermalModelEVDiagonal *model) : BroydenEquations(), m_THM(model) { m_N = 1; }
298  std::vector<double> Equations(const std::vector<double> &x);
299  private:
300  ThermalModelEVDiagonal *m_THM;
301  };
302 
303  class BroydenJacobianDEVOrig : public BroydenJacobian
304  {
305  public:
306  BroydenJacobianDEVOrig(ThermalModelEVDiagonal *model) : BroydenJacobian(), m_THM(model) {}
307  std::vector<double> Jacobian(const std::vector<double> &x);
308  private:
309  ThermalModelEVDiagonal *m_THM;
310  };
311  };
312 
313 } // namespace thermalfist
314 
315 #endif
316 
virtual double CalculateMesonMatterEntropyDensity()
The fraction of entropy carried by mesons (Ideal GCE only)
virtual double ParticleScaledVariance(int)
Scaled variance of primordial particle number fluctuations for species i.
Abstract base class for an HRG model implementation.
static const double TOL
Default desired solution accuracy.
Definition: Broyden.h:183
Class implementing the diagonal excluded-volume model.
Class containing the particle list.
Structure containing all thermal parameters of the model.
Abstract class which defines the system of non-linear equations to be solved by the Broyden&#39;s method...
Definition: Broyden.h:31
virtual double CalculateBaryonMatterEntropyDensity()
The fraction of entropy carried by baryons (Ideal GCE only)
Sub-class where it is determined whether the required accuracy is achieved in the Broyden&#39;s method...
Definition: Broyden.h:144
virtual double ParticleKurtosis(int)
Kurtosis of primordial particle number fluctuations for species i.
Class which implements calculation of the Jacobian needed for the Broyden&#39;s method.
Definition: Broyden.h:76
The main namespace where all classes and functions of the Thermal-FIST library reside.
virtual double ParticleSkewness(int)
Skewness of primordial particle number fluctuations for species i.