![]() |
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>
Include dependency graph for influence_function_dipolar.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_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, Utils::MemoryOrder memory_order = Utils::MemoryOrder::ROW_MAJOR> | |
| std::vector< FloatType > | grid_influence_function_dipolar (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 [23] 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::hadamard_division(), Utils::Vector< T, N >::norm2(), params, Utils::product(), math::sinc(), Utils::sqr(), and stream.
|
inline |
Definition at line 180 of file influence_function_dipolar.hpp.
References Utils::Vector< T, N >::broadcast(), for_each_3d(), Utils::hadamard_division(), params, Utils::product(), math::sinc(), and stream.
| std::vector< FloatType > grid_influence_function_dipolar | ( | 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 134 of file influence_function_dipolar.hpp.
References calc_p3m_mesh_shift(), for_each_3d(), params, Utils::product(), and stream.
Referenced by DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::calc_influence_function_energy(), and DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::calc_influence_function_force().
|
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 215 of file influence_function_dipolar.hpp.
References calc_p3m_mesh_shift(), for_each_3d(), params, and stream.