diff --git a/include/Species.h b/include/Species.h index 8768441..ee4a60e 100644 --- a/include/Species.h +++ b/include/Species.h @@ -127,7 +127,9 @@ class Species double evaluate_external_field(const External_Field &f); // Placeholders for FMT-specific functionality: non-FMT classes do nothing - virtual double getHSD() const { return 0.0;} + virtual double getHSD() const { return 0.0;} + virtual double get_hsd() const { return getHSD();} + // virtual void set_fundamental_measure_derivatives(FundamentalMeasures &fm, long pos, bool needsTensor) {} virtual void set_fundamental_measure_derivatives(long pos, FundamentalMeasures &fm, void* param = NULL) {} @@ -239,6 +241,7 @@ class FMT_Species : public Species ~FMT_Species(){} virtual double getHSD() const { return hsd_;} + double getEta(long pos) const { return fmt_weighted_densities[EI()].real(pos);} double getS(long pos) const { return fmt_weighted_densities[SI()].real(pos);} double getV(int j, long pos) const { return fmt_weighted_densities[VI(j)].real(pos);} @@ -646,7 +649,7 @@ class FMT_Species_EOS : public FMT_Species void convolute_eos_eta_weight_with(const DFT_FFT &v, DFT_FFT &result, bool bConjugate = false) const { convolute_weight_with(eos_weighted_density_[0].wk(), v, result, bConjugate );} - + double get_eos_weight(long l) const { return eos_weighted_density_[0].getWeight(l);} // double get_eos_measure(long pos) const { return eos_weighted_density_[0].real(pos);} diff --git a/src/FMT_Species_EOS.cpp b/src/FMT_Species_EOS.cpp index 644132c..3cc86a1 100644 --- a/src/FMT_Species_EOS.cpp +++ b/src/FMT_Species_EOS.cpp @@ -53,6 +53,7 @@ double FMT_Species_EOS::effDensity(long I) return x; } +// this is F/V: note that fmt.get_fex gives F/N double FMT_Species_EOS::get_bulk_dfex(double x, const void *param) const { if(eos_.isNull()) return 0; @@ -67,10 +68,11 @@ double FMT_Species_EOS::get_bulk_ddfex_deta(double x, const void *param) const { if(eos_.isNull()) return 0; - double HSeta = M_PI*x*hsd_*hsd_*hsd_/6; + double eta = M_PI*x*hsd_*hsd_*hsd_/6; FMT &fmt = *((FMT*) param); - double dfdft_dx = fmt.get_fex(HSeta) + HSeta*fmt.get_dfex_deta(HSeta) + 2*avdw_*x; + double dfdft_dx = fmt.get_fex(eta) + eta*fmt.get_dfex_deta(eta) + 2*avdw_*x; + double dx_deta = 6/(M_PI*hsd_*hsd_*hsd_*D_EOS_*D_EOS_*D_EOS_); return dx_deta*(eos_.f1ex(x) - dfdft_dx); @@ -80,12 +82,12 @@ double FMT_Species_EOS::get_bulk_d2dfex_deta2(double x, const void *param) const { if(eos_.isNull()) return 0; - double HSeta = M_PI*x*hsd_*hsd_*hsd_/6; + double eta = M_PI*x*hsd_*hsd_*hsd_/6; FMT &fmt = *((FMT*) param); - double dHSeta_dx = M_PI*hsd_*hsd_*hsd_/6; + double deta_dx = M_PI*hsd_*hsd_*hsd_/6; - double d2fdft_dx2 = dHSeta_dx*(2*fmt.get_dfex_deta(HSeta) + HSeta*fmt.get_d2fex_deta2(HSeta)) + 2*avdw_; + double d2fdft_dx2 = deta_dx*(2*fmt.get_dfex_deta(eta) + eta*fmt.get_d2fex_deta2(eta)) + 2*avdw_; double dx_deta = 6/(M_PI*hsd_*hsd_*hsd_*D_EOS_*D_EOS_*D_EOS_);