8#ifndef MEANFIELDMODELS_H
9#define MEANFIELDMODELS_H
50 virtual double v(
double n)
const {
return 0.; }
59 virtual double dv(
int order,
double n)
const {
return 0.; }
67 virtual double dvdT(
double n)
const {
return 0.; }
100 virtual double v(
double n)
const {
return -m_a * n * n; }
109 virtual double dv(
int order,
double n)
const {
113 return -2. * m_a * n;
125 virtual double dvdT(
double n)
const {
return -m_dadT * n * n; }
150 m_a(a), m_c(c), m_dadT(dadT), m_dcdT(dcdT)
165 virtual double v(
double n)
const {
return -m_a * n * n / (1. + m_c * n); }
174 virtual double dv(
int order,
double n)
const {
178 return - m_a * n * (2. + m_c * n) / pow(1. + m_c * n, 2);
180 double ret = -2. * m_a / pow(1. + m_c * n, 3);
185 for(
int i = 3; i <= order; ++i) {
187 ret *= 1. / (1. + m_c * n);
199 virtual double dvdT(
double n)
const {
200 return -m_dadT * n * n / (1. + m_c * n)
201 + m_a * n * n / (1. + m_c * n) / (1. + m_c * n) * m_dcdT * n;
205 double m_dadT, m_dcdT;
232 double dalphadT = 0.,
234 ) : m_alpha(alpha), m_beta(beta), m_gam(gam), m_n0(n0), m_dalphadT(dalphadT), m_dbetadT(dbetadT)
249 virtual double v(
double n)
const {
250 return m_alpha * n * n / m_n0
251 + m_beta * n * pow(n/m_n0, m_gam);
261 virtual double dv(
int order,
double n)
const {
265 return 2. * m_alpha * n / m_n0 + (1. + m_gam) * m_beta * pow(n/m_n0, m_gam);
267 return 2. * m_alpha / m_n0 + (1. + m_gam) * m_gam * m_beta * pow(n, m_gam - 1.) / pow(m_n0, m_gam);
270 double gam_mult = 1.0;
271 for(
int i = 0; i < order; ++i) {
272 gam_mult *= (1. + m_gam - i);
274 return gam_mult * m_beta * pow(n, m_gam + 1 - order) / pow(m_n0, m_gam);
288 virtual double dvdT(
double n)
const {
289 return m_dalphadT * n * n / m_n0
290 + m_dbetadT * n * pow(n/m_n0, m_gam);
295 double m_alpha, m_beta, m_gam, m_n0;
296 double m_dalphadT, m_dbetadT;
321 std::vector<double> Ck,
322 std::vector<double> bk,
324 std::vector<double> dCkdT = std::vector<double>(),
325 std::vector<double> dbkdT = std::vector<double>()
326 ) : m_N(N), m_Ck(Ck), m_bk(bk), m_dCkdT(dCkdT), m_dbkdT(dbkdT), m_n0(n0)
328 if (dCkdT.size() == 0)
329 dCkdT = std::vector<double>(Ck.size(), 0.);
330 if (dbkdT.size() == 0)
331 dbkdT = std::vector<double>(bk.size(), 0.);
345 virtual double v(
double n)
const;
354 virtual double dv(
int order,
double n)
const;
362 virtual double dvdT(
double n)
const;
365 std::vector<double> m_Ck, m_bk;
366 std::vector<double> m_dCkdT, m_dbkdT;
virtual ~MeanFieldModelBase()
Destructor for the MeanFieldModelBase class.
MeanFieldModelBase()
Constructor for the MeanFieldModelBase class.
virtual double v(double n) const
Calculates the mean field value at a given density.
virtual double dv(int order, double n) const
Calculates the density derivatives of the mean field.
virtual double dvdT(double n) const
Calculates the temperature derivative of the mean field.
virtual double v(double n) const
Calculates the mean field value at a given density.
MeanFieldModelClausius(double a, double c, double dadT=0., double dcdT=0.)
Constructor for the MeanFieldModelClausius class.
virtual double dv(int order, double n) const
Calculates the density derivatives of the mean field.
virtual ~MeanFieldModelClausius()
Destructor for the MeanFieldModelClausius class.
virtual double dvdT(double n) const
Calculates the temperature derivative of the mean field.
virtual double dv(int order, double n) const
Calculates the density derivatives of the mean field.
MeanFieldModelSkyrme(double alpha, double beta, double gam=2.0, double n0=0.16, double dalphadT=0., double dbetadT=0.)
Constructor for the MeanFieldModelSkyrme class.
virtual double v(double n) const
Calculates the mean field value at a given density.
virtual ~MeanFieldModelSkyrme()
Destructor for the MeanFieldModelSkyrme class.
virtual double dvdT(double n) const
Calculates the temperature derivative of the mean field.
virtual ~MeanFieldModelVDF()
Destructor for the MeanFieldModelVDF class.
virtual double dv(int order, double n) const
Calculates the density derivatives of the mean field.
virtual double v(double n) const
Calculates the mean field value at a given density.
MeanFieldModelVDF(int N, std::vector< double > Ck, std::vector< double > bk, double n0=0., std::vector< double > dCkdT=std::vector< double >(), std::vector< double > dbkdT=std::vector< double >())
Constructor for the MeanFieldModelVDF class.
virtual double dvdT(double n) const
Calculates the temperature derivative of the mean field.
virtual double dvdT(double n) const
Calculates the temperature derivative of the mean field.
MeanFieldModelVDW(double a, double dadT=0.)
Constructor for the MeanFieldModelVDW class.
virtual double dv(int order, double n) const
Calculates the density derivatives of the mean field.
virtual ~MeanFieldModelVDW()
Destructor for the MeanFieldModelVDW class.
virtual double v(double n) const
Calculates the mean field value at a given density.
The main namespace where all classes and functions of the Thermal-FIST library reside.