ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
influence_function_dipolar.hpp File Reference
#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 &params, 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 &params, 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 &params, Utils::Vector3i const &shift)
 
template<typename FloatType , std::size_t m>
double grid_influence_function_self_energy (P3MParameters const &params, Utils::Vector3i const &n_start, Utils::Vector3i const &n_stop, std::vector< FloatType > const &g)
 Calculate self-energy of the influence function.
 

Function Documentation

◆ G_opt_dipolar()

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

Template Parameters
SOrder of the differential operator (2 for energy, 3 for forces)
mNumber of Brillouin zones that contribute to the aliasing sums
Parameters
paramsDP3M parameters
shiftshifting integer vector for a specific k-vector
d_opdifferential operator for a specific k-vector
Returns
The optimal influence function 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().

◆ G_opt_dipolar_self_energy()

template<std::size_t m>
double G_opt_dipolar_self_energy ( P3MParameters const &  params,
Utils::Vector3i const &  shift 
)
inline

◆ grid_influence_function()

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

Template Parameters
SOrder of the differential operator, e.g. 2 for energy, 3 for force
mNumber of Brillouin zones that contribute to the aliasing sums
Parameters
paramsDP3M parameters
n_startLower left corner of the grid in k-space.
n_stopUpper right corner of the grid in k-space.
inv_box_lInverse box length
Returns
Values of the influence function at regular grid points.

Definition at line 133 of file influence_function_dipolar.hpp.

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

◆ grid_influence_function_self_energy()

template<typename FloatType , std::size_t m>
double grid_influence_function_self_energy ( P3MParameters const &  params,
Utils::Vector3i const &  n_start,
Utils::Vector3i const &  n_stop,
std::vector< FloatType > const &  g 
)
inline

Calculate self-energy of the influence function.

Template Parameters
mNumber of Brillouin zones that contribute to the aliasing sums
Parameters
paramsDP3M parameters
n_startLower left corner of the grid in k-space.
n_stopUpper right corner of the grid in k-space.
gEnergies on the grid.
Returns
Total self-energy.

Definition at line 213 of file influence_function_dipolar.hpp.

References calc_p3m_mesh_shift(), for_each_3d(), and params.