From be7da65b5ad8e0e39fafed289b9ed8456fafdd50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sat, 24 Nov 2018 23:10:32 +0000 Subject: [PATCH] Wrap function ewald3_sigma_long Former-commit-id: b36f1095d792b9bfd54d28fa9d0da5de0da0ba3f --- qpms/ewald.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/qpms/ewald.c b/qpms/ewald.c index 385b330..02b8ffd 100644 --- a/qpms/ewald.c +++ b/qpms/ewald.c @@ -619,6 +619,33 @@ int ewald3_1_z_sigma_long ( return 0; } +int ewald3_sigma_long ( + complex double *target, // must be c->nelem_sc long + double *err, + const qpms_ewald32_constants_t *c, + const double eta, const double k, + const double unitcell_volume /* with the corresponding lattice dimensionality */, + const LatticeDimensionality latdim, + PGenSph *pgen_K, const bool pgen_generates_shifted_points + /* If false, the behaviour corresponds to the old ewald32_sigma_long_points_and_shift, + * so the function assumes that the generated points correspond to the unshifted reciprocal Bravais lattice, + * and adds beta to the generated points before calculations. + * If true, it assumes that they are already shifted. + */, + const cart3_t beta, + const cart3_t particle_shift + ) +{ + assert(latdim & SPACE3D); + if (latdim & LAT_XYONLY) + return ewald3_21_xy_sigma_long(target, err, c, eta, k, unitcell_volume, + latdim, pgen_K, pgen_generates_shifted_points, beta, particle_shift); + else if (latdim & LAT_ZONLY) + return ewald3_1_z_sigma_long(target, err, c, eta, k, unitcell_volume, + latdim, pgen_K, pgen_generates_shifted_points, beta, particle_shift); + // TODO 3D case and general 2D case + else abort(); // NOT IMPLEMENTED +} struct sigma2_integrand_params { int n;