Skip to content

Commit

Permalink
synch
Browse files Browse the repository at this point in the history
  • Loading branch information
JFL committed Oct 8, 2024
1 parent a19299f commit c94a4ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 5 additions & 2 deletions include/Species.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand Down Expand Up @@ -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);}
Expand Down Expand Up @@ -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);}

Expand Down
12 changes: 7 additions & 5 deletions src/FMT_Species_EOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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_);

Expand Down

0 comments on commit c94a4ee

Please sign in to comment.