ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include "p3m/common.hpp"
#include "p3m/for_each_3d.hpp"
#include "p3m/math.hpp"
#include <utils/Vector.hpp>
#include <utils/index.hpp>
#include <utils/math/int_pow.hpp>
#include <utils/math/sqr.hpp>
#include <cmath>
#include <cstddef>
#include <functional>
#include <numbers>
#include <utility>
#include <vector>
Go to the source code of this file.
Functions | |
template<std::size_t S, std::size_t m> | |
double | G_opt (int cao, double alpha, Utils::Vector3d const &k, Utils::Vector3d const &h) |
Hockney/Eastwood/Ballenegger optimal influence function. | |
template<typename FloatType , std::size_t S, std::size_t m = 0> | |
std::vector< FloatType > | grid_influence_function (P3MParameters const ¶ms, Utils::Vector3i const &n_start, Utils::Vector3i const &n_stop, int const KX, int const KY, int const KZ, Utils::Vector3d const &inv_box_l) |
Map influence function over a grid. | |
double G_opt | ( | int | cao, |
double | alpha, | ||
Utils::Vector3d const & | k, | ||
Utils::Vector3d const & | h | ||
) |
Hockney/Eastwood/Ballenegger optimal influence function.
This implements Eq. 30 of [9], which can be used for monopole and dipole P3M by choosing the appropriate S factor.
S | Order of the differential operator, e.g. 0 for potential, 1 for electric field, ... |
m | Number of aliasing terms to take into account. |
cao | Charge assignment order. |
alpha | Ewald splitting parameter. |
k | k-vector to evaluate the function for. |
h | Grid spacing. |
Definition at line 54 of file influence_function.hpp.
References Utils::Vector< T, N >::broadcast(), for_each_3d(), Utils::Vector< T, N >::norm2(), Utils::product(), math::sinc(), and Utils::sqr().
std::vector< FloatType > grid_influence_function | ( | P3MParameters const & | params, |
Utils::Vector3i const & | n_start, | ||
Utils::Vector3i const & | n_stop, | ||
int const | KX, | ||
int const | KY, | ||
int const | KZ, | ||
Utils::Vector3d const & | inv_box_l | ||
) |
Map influence function over a grid.
This evaluates the optimal influence function G_opt over a regular grid of k vectors, and returns the values as a vector.
S | Order of the differential operator, e.g. 0 for potential, 1 for electric field... |
m | Number of aliasing terms to take into account. |
params | P3M parameters. |
n_start | Lower left corner of the grid. |
n_stop | Upper right corner of the grid. |
KX | k-space x-axis index. |
KY | k-space y-axis index. |
KZ | k-space z-axis index. |
inv_box_l | Inverse box length. |
Definition at line 114 of file influence_function.hpp.
References for_each_3d(), params, and Utils::product().