ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
common.hpp File Reference

Common functions for dipolar and charge P3M. More...

#include <config/config.hpp>
#include <utils/Vector.hpp>
#include <utils/index.hpp>
#include <algorithm>
#include <array>
#include <vector>
#include "LocalBox.hpp"
#include <cstddef>
#include <optional>
#include <span>
#include <stdexcept>
+ Include dependency graph for p3m/common.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  P3MParameters
 Structure to hold P3M parameters and some dependent variables. More...
 
struct  P3MLocalMesh
 Properties of the local mesh. More...
 
struct  P3MFFTMesh< FloatType >
 Local mesh FFT buffers. More...
 
struct  TuningParameters
 
struct  P3MFFTConfig< RSpaceOrder, KSpaceOrder, UseR2C, R2CDir >
 

Enumerations

enum class  Arch { CPU , CUDA }
 P3M kernel architecture. More...
 

Functions

template<unsigned int r2c_dir>
void influence_function_r2c (auto &g_function, auto const &global_size, auto const &local_size, auto const &local_origin)
 Adapt an influence function grid for real-to-complex FFTs.
 
std::array< std::vector< int >, 3 > calc_p3m_mesh_shift (Utils::Vector3i const &mesh_size, bool zero_out_midpoint=false)
 Calculate indices that shift P3MParameters::mesh by mesh/2.
 

Variables

auto constexpr P3M_EPSILON_METALLIC = 0.0
 This value indicates metallic boundary conditions.
 

Detailed Description

Common functions for dipolar and charge P3M.

We use here a P3M (Particle-Particle Particle-Mesh) method based on the Ewald summation. Details of the used method can be found in [23] and [11] [12]. The file p3m contains only the Particle-Mesh part.

Further reading: [19], [23], [11], [12], [13], [14], [10]

Definition in file p3m/common.hpp.

Enumeration Type Documentation

◆ Arch

enum class Arch
strong

P3M kernel architecture.

Enumerator
CPU 
CUDA 

Definition at line 59 of file p3m/common.hpp.

Function Documentation

◆ calc_p3m_mesh_shift()

std::array< std::vector< int >, 3 > calc_p3m_mesh_shift ( Utils::Vector3i const &  mesh_size,
bool  zero_out_midpoint = false 
)
inline

Calculate indices that shift P3MParameters::mesh by mesh/2.

For each mesh size \( n \) in mesh_size, create a sequence of integer values \( \left( 0, \ldots, \lfloor n/2 \rfloor, -\lfloor n/2 \rfloor, \ldots, -1\right) \) if zero_out_midpoint is false, otherwise \( \left( 0, \ldots, \lfloor n/2 - 1 \rfloor, 0, -\lfloor n/2 \rfloor, \ldots, -1\right) \).

Definition at line 297 of file p3m/common.hpp.

Referenced by P3MStateCommon< FloatType >::calc_differential_operator(), grid_influence_function(), grid_influence_function_dipolar(), and grid_influence_function_self_energy().

◆ influence_function_r2c()

template<unsigned int r2c_dir>
void influence_function_r2c ( auto &  g_function,
auto const &  global_size,
auto const &  local_size,
auto const &  local_origin 
)

Adapt an influence function grid for real-to-complex FFTs.

Parameters
[in]global_sizesize of the global mesh grid
[in]local_sizesize of the local mesh grid
[in]local_originoffset of the local mesh grid
[in,out]g_functioninfluence function grid to modify in-place
Template Parameters
r2c_dirdirection of the reduced dimension

Definition at line 264 of file p3m/common.hpp.

References Utils::Vector< T, N >::broadcast().

Variable Documentation

◆ P3M_EPSILON_METALLIC