34 std::vector<double> &series) {
37 auto const deriv =
static_cast<double>(2 * n);
42 series[0] = 2. * (1. - std::numbers::egamma);
43 for (
int order = 1;; order += 1) {
44 auto const x_order =
static_cast<double>(2 * order);
45 auto const coeff = -2 *
hzeta(x_order + 1, 2);
48 series.push_back(coeff);
57 for (
int order = 0;; order++) {
59 auto const x_order =
static_cast<double>(2 * order);
60 auto const coeff = pref *
hzeta(1 + deriv + x_order, 2);
64 series.push_back(-binom * coeff);
67 pref *= (1.0 + deriv / (x_order + 1));
68 pref *= (1.0 + deriv / (x_order + 2));
74 std::vector<double> &series) {
75 auto const deriv =
static_cast<double>(2 * n + 1);
78 auto pref = 2 * deriv * (1 + deriv);
80 for (
int order = 0;; order++) {
82 auto const x_order =
static_cast<double>(2 * order + 1);
83 auto const coeff = pref *
hzeta(1 + deriv + x_order, 2);
88 series.push_back(-binom * coeff);
90 pref *= (1.0 + deriv / (x_order + 1));
91 pref *= (1.0 + deriv / (x_order + 2));
95void CoulombMMM1D::create_mod_psi_up_to(
int new_n) {
96 auto const old_n =
static_cast<int>(modPsi.size() >> 1);
98 modPsi.resize(2 * new_n);
101 for (
int n = 0; n < old_n; n++)
102 binom *= (-0.5 - n) /
static_cast<double>(n + 1);
104 for (
int n = old_n; n < new_n; n++) {
107 binom *= (-0.5 - n) /
static_cast<double>(n + 1);
This file contains the defaults for ESPResSo.
#define ROUND_ERROR_PREC
Precision for capture of round off errors.
static void preparePolygammaOdd(int n, double binom, std::vector< double > &series)
static void preparePolygammaEven(int n, double binom, std::vector< double > &series)
MMM1D algorithm for long-range Coulomb interactions on the CPU.
double hzeta(double s, double q)
Hurwitz zeta function.
This file contains implementations for some special functions which are needed by the MMM family of a...