20 #ifndef JDFTX_FLUID_ERFFMTWEIGHT_H 21 #define JDFTX_FLUID_ERFFMTWEIGHT_H 23 #include <electronic/SphericalHarmonics.h> 32 r0 =
sqrt(
pow(0.5*R,2) -
pow(sigma,2)) + 0.5*R;
33 c0 = 1 -
pow(sigma/r0,2);
37 void operator()(
double G,
double& w0,
double& w1,
double& w2,
double& w3,
double& w1v,
double& w2m)
const 39 double prefac =
exp(-0.5*
pow(G*sigma,2));
40 double j0 = bessel_jl(0, G*R);
41 double j2 = bessel_jl(2, G*R);
42 double softness =
pow(sigma/R,2);
45 w2 = 4*M_PI*
pow(R,2) * prefac * (j0 + softness*cos(G*R));
46 w3 = (4*M_PI*
pow(R,3)/3) * prefac * (j0*(1+3*softness) + j2);
49 prefac =
exp(-0.5*
pow(sigma ? (r0-R)/sigma : 0.0, 2))/
sqrt(c0) *
exp(-(0.5/c0)*
pow(G*sigma,2));
50 j0 = bessel_jl(0, G*r0);
51 j2 = bessel_jl(2, G*r0);
52 double j4 = bessel_jl(4, G*r0);
53 softness =
pow(sigma/r0,2)/c0;
56 w1v = -
pow(r0,2)/3 * prefac * (j0*(1+3*softness) + j2);
57 w2m = (4*M_PI*
pow(r0,4)/15) * prefac * (j0*(1+softness*(10+softness*15)) + 10*j2*(1.0/7+softness) + (3.0/7)*j4);
61 double R, sigma, r0, c0;
64 #endif // JDFTX_FLUID_ERFFMTWEIGHT_H ScalarField pow(const ScalarField &, double alpha)
Elementwise power (preserve input)
ScalarField sqrt(const ScalarField &)
Elementwise square root (preserve input)
void operator()(double G, double &w0, double &w1, double &w2, double &w3, double &w1v, double &w2m) const
set the weights at a given G
Definition: ErfFMTweight.h:37
Utility for creating soft FMT weight functions.
Definition: ErfFMTweight.h:27
ScalarField exp(const ScalarField &)
Elementwise exponential (preserve input)