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>
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::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.
 
double G_opt_dipolar_self_energy (P3MParameters const &params, Utils::Vector3i const &shift)
 
template<typename FloatType >
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>
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.

Calculates the aliasing sums in the numerator and denominator of the expression for the optimal influence function (see [22] : 8-22, p. 275).

Template Parameters
Sorder (2 for energy, 3 for forces)
Parameters
paramsDP3M parameters
shiftshift for a given n-vector
d_opdifferential operator for a given n-vector
Returns
The result of the fraction.

Definition at line 55 of file influence_function_dipolar.hpp.

References Utils::Vector< T, N >::broadcast(), for_each_3d(), Utils::Vector< T, N >::norm2(), P3M_BRILLOUIN, params, Utils::product(), math::sinc(), and Utils::sqr().

◆ G_opt_dipolar_self_energy()

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::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
Parameters
paramsDP3M parameters
n_startLower left corner of the grid
n_stopUpper right corner of the grid.
inv_box_lInverse box length
Returns
Values of the influence function at regular grid points.

Definition at line 109 of file influence_function_dipolar.hpp.

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

◆ grid_influence_function_self_energy()

template<typename FloatType >
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.

Parameters
paramsDP3M parameters
n_startLower left corner of the grid
n_stopUpper right corner of the grid.
gEnergies on the grid.
Returns
Total self-energy.

Definition at line 187 of file influence_function_dipolar.hpp.

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

Referenced by DipolarP3MImpl< FloatType, Architecture >::calc_average_self_energy_k_space().