ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include "config/config.hpp"
#include "p3m/common.hpp"
#include "p3m/for_each_3d.hpp"
#include "p3m/math.hpp"
#include <utils/Vector.hpp>
#include <utils/math/int_pow.hpp>
#include <utils/math/sqr.hpp>
#include <cmath>
#include <cstddef>
#include <functional>
#include <numbers>
#include <vector>
Go to the source code of this file.
Functions | |
template<std::size_t S, std::size_t m> | |
double | G_opt_dipolar (P3MParameters const ¶ms, Utils::Vector3i const &shift, Utils::Vector3i const &d_op) |
Calculate the aliasing sums for the optimal influence function. | |
template<typename FloatType , std::size_t S, std::size_t m> | |
std::vector< FloatType > | grid_influence_function (P3MParameters const ¶ms, Utils::Vector3i const &n_start, Utils::Vector3i const &n_stop, Utils::Vector3d const &inv_box_l) |
Map influence function over a grid. | |
template<std::size_t m> | |
double | G_opt_dipolar_self_energy (P3MParameters const ¶ms, Utils::Vector3i const &shift) |
template<typename FloatType , std::size_t m> | |
double | grid_influence_function_self_energy (P3MParameters const ¶ms, Utils::Vector3i const &n_start, Utils::Vector3i const &n_stop, std::vector< FloatType > const &g) |
Calculate self-energy of the influence function. | |
double G_opt_dipolar | ( | P3MParameters const & | params, |
Utils::Vector3i const & | shift, | ||
Utils::Vector3i const & | d_op | ||
) |
Calculate the aliasing sums for the optimal influence function.
Evaluate the aliasing sums in the numerator and denominator of the expression for the optimal influence function, see [22] eq (8-22), p. 275.
The full equation is:
\begin{align*} G_{\text{opt}}(\vec{n}, S, \text{cao}) &= \displaystyle\frac{1}{\sum_\vec{m} U^2} \sum_\vec{m}U^2 \displaystyle\frac{\left(\vec{d}_{\text{op}}[\vec{n}](\vec{s}[\vec{n}] + \vec{m}\odot\vec{N})\right)^S} {\left(\vec{s}[\vec{n}] + \vec{m}\odot\vec{N}\right)^2} e^{-\pi^2\left(\alpha\vec{N}\odot\vec{a}\right)^{-2}\left(\vec{s}[\vec{n}] +\vec{m}\odot\vec{N}\right)^2} \\ U &= \operatorname{det}\left[I_3\cdot\operatorname{sinc}\left( \vec{s}[\vec{n}]\oslash{\vec{N}}+\vec{m}\odot\vec{N}\right) \right]^{\text{cao}} \end{align*}
with \( I_3 \) the 3x3 identity matrix, \( \vec{N} \) the global mesh size in k-space coordinates, \( \vec{a} \) the mesh size, \( \vec{m} \) the Brillouin zone coordinates, \( \odot \) the Hadamard product, \( \oslash \) the Hadamard division.
S | Order of the differential operator (2 for energy, 3 for forces) |
m | Number of Brillouin zones that contribute to the aliasing sums |
params | DP3M parameters |
shift | shifting integer vector for a specific k-vector |
d_op | differential operator for a specific k-vector |
Definition at line 79 of file influence_function_dipolar.hpp.
References Utils::Vector< T, N >::broadcast(), for_each_3d(), Utils::Vector< T, N >::norm2(), params, Utils::product(), math::sinc(), and Utils::sqr().
|
inline |
Definition at line 178 of file influence_function_dipolar.hpp.
References Utils::Vector< T, N >::broadcast(), for_each_3d(), params, Utils::product(), and math::sinc().
std::vector< FloatType > grid_influence_function | ( | P3MParameters const & | params, |
Utils::Vector3i const & | n_start, | ||
Utils::Vector3i const & | n_stop, | ||
Utils::Vector3d const & | inv_box_l | ||
) |
Map influence function over a grid.
This evaluates the optimal influence function G_opt_dipolar over a regular grid of k vectors, and returns the values as a vector.
S | Order of the differential operator, e.g. 2 for energy, 3 for force |
m | Number of Brillouin zones that contribute to the aliasing sums |
params | DP3M parameters |
n_start | Lower left corner of the grid in k-space. |
n_stop | Upper right corner of the grid in k-space. |
inv_box_l | Inverse box length |
Definition at line 133 of file influence_function_dipolar.hpp.
References calc_p3m_mesh_shift(), for_each_3d(), params, and Utils::product().
|
inline |
Calculate self-energy of the influence function.
m | Number of Brillouin zones that contribute to the aliasing sums |
params | DP3M parameters |
n_start | Lower left corner of the grid in k-space. |
n_stop | Upper right corner of the grid in k-space. |
g | Energies on the grid. |
Definition at line 213 of file influence_function_dipolar.hpp.
References calc_p3m_mesh_shift(), for_each_3d(), and params.