ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
influence_function.hpp File Reference
#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>
+ Include dependency graph for influence_function.hpp:
+ This graph shows which files directly or indirectly include this file:

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 &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.
 

Function Documentation

◆ G_opt()

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.

This implements Eq. 30 of [9], which can be used for monopole and dipole P3M by choosing the appropriate S factor.

Template Parameters
SOrder of the differential operator, e.g. 0 for potential, 1 for electric field, ...
mNumber of aliasing terms to take into account.
Parameters
caoCharge assignment order.
alphaEwald splitting parameter.
kk-vector to evaluate the function for.
hGrid 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().

◆ grid_influence_function()

template<typename FloatType , std::size_t S, std::size_t m = 0>
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.

Template Parameters
SOrder of the differential operator, e.g. 0 for potential, 1 for electric field...
mNumber of aliasing terms to take into account.
Parameters
paramsP3M parameters.
n_startLower left corner of the grid.
n_stopUpper right corner of the grid.
KXk-space x-axis index.
KYk-space y-axis index.
KZk-space z-axis index.
inv_box_lInverse box length.
Returns
Values of G_opt at regular grid points.

Definition at line 114 of file influence_function.hpp.

References for_each_3d(), params, and Utils::product().