STORMM Source Documentation
Loading...
Searching...
No Matches
pme_util.h
1// -*-c++-*-
2#ifndef STORMM_PME_UTIL_H
3#define STORMM_PME_UTIL_H
4
5#include <cmath>
6#include "copyright.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"
12
13namespace stormm {
14namespace energy {
15
16using card::Hybrid;
17using data_types::isSignedIntegralScalarType;
18using stmath::FunctionLevel;
19using stmath::radialFirstDerivative;
20using stmath::radialSecondDerivative;
21using stmath::radialThirdDerivative;
22using stmath::radialPartialDerivative;
23
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;
32
36constexpr double minimum_ewald_coefficient = 0.0625;
37
40constexpr double maximum_ewald_coefficient = 1.0;
41
47double ewaldCoefficient(double cutoff, double direct_sum_tol);
48
53double pmeGaussianSpread(double cutoff, double direct_sum_tol);
54
62double recoverDirectSumTolerance(double cutoff, double ewald_coefficient);
63
91template <typename Tcalc>
92Tcalc elecPMEDirectSpace(double ew_coeff, Tcalc kcoul, Tcalc r, Tcalc r2, int order);
93
94template <typename Tcalc, typename T3>
95Tcalc elecPMEDirectSpace(const T3 pa, const T3 pb, double ew_coeff, Tcalc kcoul,
96 FunctionLevel order = FunctionLevel::VALUE);
97
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);
102
114double pmeGammaSum(int m, int mesh_length, int ordr);
115
121std::vector<double> pmeLoadBPrefactor(int ordr, int mesh_length);
122
127std::vector<double> pmeLoadMVec(int mesh_length);
128
132std::vector<double> pmeLoadMVecShift(int mesh_length);
133
134} // namespace energy
135} // namespace stormm
136
137#include "pme_util.tpp"
138
139#endif