38#define P3M_BRILLOUIN 0
45#define USE_ERFC_APPROXIMATION 1
72 auto constexpr epsilon = T(0.1);
73#if not defined(__CUDACC__)
77 auto const pix = std::numbers::pi_v<T> * x;
82 auto constexpr factorial = [](
int n)
consteval {
113#if not defined(__CUDACC__)
116 auto const theta =
static_cast<double>(n) *
mesh_i * std::numbers::pi;
119 if constexpr (cao == 1) {
122 if constexpr (cao == 2) {
123 return (1. + c * 2.) / 3.;
125 if constexpr (cao == 3) {
126 return (2. + c * (11. + c * 2.)) / 15.;
128 if constexpr (cao == 4) {
129 return (17. + c * (180. + c * (114. + c * 4.))) / 315.;
131 if constexpr (cao == 5) {
132 return (62. + c * (1072. + c * (1452. + c * (247. + c * 2.)))) / 2835.;
134 if constexpr (cao == 6) {
136 c * (35396. + c * (83021. + c * (34096. + c * (2026. + c * 4.))))) /
142 c * (2123860. + c * (349500. + c * (8166. + c * 4.)))))) /
150 }
else if (cao == 2) {
152 }
else if (cao == 3) {
154 }
else if (cao == 4) {
156 }
else if (cao == 5) {
158 }
else if (cao == 6) {
160 }
else if (cao == 7) {
163 if (ptr ==
nullptr) {
164 throw std::domain_error(
"Invalid value cao=" + std::to_string(cao));
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
constexpr int p3m_min_cao
Minimal charge assignment order.
constexpr int p3m_max_cao
Maximal charge assignment order.
DEVICE_QUALIFIER constexpr T sqr(T x)
Calculates the SQuaRe of x.
DEVICE_QUALIFIER auto abs(double x)
Return the absolute value of x.
DEVICE_QUALIFIER auto sinc(T x)
Calculate the function .
auto get_analytic_cotangent_sum_kernel(int cao)
DEVICE_QUALIFIER auto analytic_cotangent_sum(int n, double mesh_i)
One of the aliasing sums used to compute k-space errors.