2#ifndef STORMM_PME_UTIL_H
3#define STORMM_PME_UTIL_H
7#include "Accelerator/hybrid.h"
8#include "Constants/symbol_values.h"
9#include "DataTypes/common_types.h"
10#include "Math/math_enumerators.h"
11#include "Math/radial_derivatives.h"
17using data_types::isSignedIntegralScalarType;
18using stmath::FunctionLevel;
19using stmath::radialFirstDerivative;
20using stmath::radialSecondDerivative;
21using stmath::radialThirdDerivative;
22using stmath::radialPartialDerivative;
26constexpr int default_charge_mapping_order = 5;
27constexpr double default_dsum_tol = 1.0e-5;
28constexpr double max_dsum_tol = 1.0e-4;
29constexpr double default_pme_cutoff = 8.0;
30constexpr double default_pme_grid_spacing_target = 1.0;
36constexpr double minimum_ewald_coefficient = 0.0625;
40constexpr double maximum_ewald_coefficient = 1.0;
47double ewaldCoefficient(
double cutoff,
double direct_sum_tol);
53double pmeGaussianSpread(
double cutoff,
double direct_sum_tol);
62double recoverDirectSumTolerance(
double cutoff,
double ewald_coefficient);
91template <
typename Tcalc>
92Tcalc elecPMEDirectSpace(
double ew_coeff, Tcalc kcoul, Tcalc r, Tcalc r2,
int order);
94template <
typename Tcalc,
typename T3>
95Tcalc elecPMEDirectSpace(
const T3 pa,
const T3 pb,
double ew_coeff, Tcalc kcoul,
96 FunctionLevel order = FunctionLevel::VALUE);
98template <
typename Tcalc,
typename T3>
99std::vector<Tcalc> elecPMEDirectSpace(
const T3 pa,
const T3 pb,
double ew_coeff, Tcalc kcoul,
100 const std::vector<FunctionLevel> &orders);
114double pmeGammaSum(
int m,
int mesh_length,
int ordr);
121std::vector<double> pmeLoadBPrefactor(
int ordr,
int mesh_length);
127std::vector<double> pmeLoadMVec(
int mesh_length);
132std::vector<double> pmeLoadMVecShift(
int mesh_length);
137#include "pme_util.tpp"