46 #ifndef Xyce_N_DEV_FermiIntegrals_h
47 #define Xyce_N_DEV_FermiIntegrals_h
51 #include <N_UTL_Misc.h>
94 double a1,
a2,
a3,
a4,
a5,
a6,
a7,
a8,
x10,
y10,
yp10,
x20,
y20,
yp20,
c1,
c2;
100 double c_b2 = 4.0/3.0;
103 a1 = sqrt(2.0) / 4.0;
104 a2 = 0.1875 - sqrt(3.0) / 9.0;
105 a3 = sqrt(2.0) * 5.0 / 48.0 + 0.125 - sqrt(6.0) / 9.0;
106 a4 = sqrt(2.0) * 5.0 / 32.0 + 1585.0/6912.0 - sqrt(3.0) * 5.0/24.0 - sqrt(5.0) / 25.0;
107 d__1 = sqrt(pi) * 3.0/4.0;
108 a5 = pow(d__1, c_b2);
114 y10 = log(x10) + a1 * x10 + a2 * (x10*
x10) + a3*(x10*x10*x10) + a4*(d__3 *
d__3);
115 yp10 = 1.0/x10 + a1 + a2 * 2.0 * x10 + a3 * 3.0 * (x10 *
x10) + a4 * 4.0 * (x10 * x10 * x10);
117 y20 = sqrt(a5 * pow(x20, a6) - a7);
118 yp20 = 0.5 / sqrt(a5 * pow(x20, a6) - a7) * a6 * a5 * pow(x20, a8);
121 c1 = dely * 0.5 / (delx *
delx) - yp10 * 0.75 / delx - yp20 * 0.25 / delx;
122 c2 = dely * 0.5 / (delx *
delx) - yp20 * 0.75 / delx - yp10 * 0.25 / delx;
125 template <
typename ScalarT>
128 ScalarT ret_val = 0.0;
129 ScalarT tempVal = 0.0;
132 if (ratio > 0.0 && ratio <= 7.5)
134 tempVal = ratio*ratio;
135 ret_val = log(ratio) + a1 * ratio + a2*(ratio*ratio) + a3*(ratio*ratio*ratio) + a4*(tempVal*tempVal);
139 if (ratio > 7.5 && ratio <= 8.0)
141 ScalarT diff = ratio - 7.5;
142 ret_val = y10 + yp10*diff + c1*(diff*diff);
144 if (ratio > 8. && ratio < 8.5)
146 ScalarT diff = 8.5-ratio;
147 ret_val = y20 - yp20*diff - c2*(diff*diff);
151 ret_val = sqrt(a5 * pow(ratio, a6) - a7);
177 template <
typename ScalarT>
184 ScalarT nu_eta = pow(arg, 4.0) + 50.0 +
185 33.6*arg*(1.0 - 0.68*exp(-0.17*pow(arg+1.0,2)));
187 ScalarT xi = 3.0*sqrt(pi)/(4.0*pow(nu_eta,0.375));
189 ScalarT neta_uarg = 1.0/(exp(-arg)+xi);
253 template <
typename ScalarT>
257 ScalarT ret_val = 0.0;
263 for (
int i=0; i < 7; ++i)
266 ret_val += sign*n1[i]*std::exp((index+1.0)*arg);
272 ScalarT mult = std::sqrt(arg);
273 for (
int i=0; i < 7; ++i)
275 ret_val += a1[i] / std::pow(arg, 2.0*i);
277 ret_val = mult * ret_val;
281 for (
int i=0; i < 9; ++i)
283 ret_val += a2[i] * std::pow(arg, i);
288 for (
int i=0; i < 9; ++i)
290 ret_val += a3[i] * std::pow(arg, i);
305 #endif //Xyce_N_DEV_FermiIntegrals_h
Pure virtual class to augment a linear system.
inverse_fermi_one_half_N()
ScalarT operator()(const ScalarT &arg)
ScalarT operator()(const ScalarT &arg)
ScalarT operator()(const ScalarT &ratio)
Sacado::Fad::SFad< double, 10 > pdeFadType