Loading [MathJax]/extensions/TeX/AMSmath.js
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
p3m.cpp File Reference

The corresponding header file is p3m.hpp. More...

#include "config/config.hpp"
#include "electrostatics/p3m.hpp"
#include "electrostatics/coulomb.hpp"
#include "electrostatics/elc.hpp"
#include "electrostatics/p3m_gpu_cuda.cuh"
#include "electrostatics/p3m_gpu_error.hpp"
#include "electrostatics/p3m.impl.hpp"
#include "p3m/P3MFFT.hpp"
#include "p3m/TuningAlgorithm.hpp"
#include "p3m/TuningLogger.hpp"
#include "p3m/field_layout_helpers.hpp"
#include "p3m/for_each_3d.hpp"
#include "p3m/influence_function.hpp"
#include "p3m/math.hpp"
#include "BoxGeometry.hpp"
#include "LocalBox.hpp"
#include "Particle.hpp"
#include "ParticlePropertyIterator.hpp"
#include "ParticleRange.hpp"
#include "PropagationMode.hpp"
#include "actor/visitors.hpp"
#include "cell_system/CellStructure.hpp"
#include "cell_system/CellStructureType.hpp"
#include "communication.hpp"
#include "errorhandling.hpp"
#include "integrators/Propagation.hpp"
#include "npt.hpp"
#include "p3m/send_mesh.hpp"
#include "system/GpuParticleData.hpp"
#include "system/System.hpp"
#include "tuning.hpp"
#include <utils/Vector.hpp>
#include <utils/integral_parameter.hpp>
#include <utils/math/int_pow.hpp>
#include <utils/math/sqr.hpp>
#include <utils/serialization/array.hpp>
#include <boost/mpi/collectives/all_reduce.hpp>
#include <boost/mpi/collectives/broadcast.hpp>
#include <boost/mpi/collectives/reduce.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/range/combine.hpp>
#include <boost/range/numeric.hpp>
#include <algorithm>
#include <array>
#include <cassert>
#include <complex>
#include <cstddef>
#include <functional>
#include <initializer_list>
#include <numbers>
#include <optional>
#include <span>
#include <sstream>
#include <stdexcept>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
+ Include dependency graph for p3m.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{p3m.cpp}::AssignCharge< cao >
 
struct  AssignForces< cao >
 
class  CoulombTuningAlgorithm< FloatType, Architecture >
 

Namespaces

namespace  anonymous_namespace{p3m.cpp}
 

Functions

template<typename FloatType >
std::complex< FloatType > multiply_complex_by_imaginary (std::complex< FloatType > const &z, FloatType k)
 
template<typename FloatType >
std::complex< FloatType > multiply_complex_by_real (std::complex< FloatType > const &z, FloatType k)
 
template<typename FloatType >
FloatType complex_norm2 (std::complex< FloatType > const &z)
 
template<Utils::MemoryOrder order_in, Utils::MemoryOrder order_out, typename T >
auto transpose (std::span< T > const &flat_array, Utils::Vector3i const &shape)
 
static bool is_node_grid_compatible_with_mesh (Utils::Vector3i const &node_grid, Utils::Vector3i const &mesh)
 
static auto get_size_from_shape (Utils::Vector3i const &shape)
 
static auto p3m_tune_aliasing_sums (Utils::Vector3i const &shift, Utils::Vector3i const &mesh, Utils::Vector3d const &mesh_i, int cao, double alpha_L_i)
 Aliasing sum used by p3m_k_space_error.
 
static double p3m_real_space_error (double pref, double r_cut_iL, int n_c_part, double sum_q2, double alpha_L, Utils::Vector3d const &box_l)
 Calculate the real space contribution to the rms error in the force (as described by Kolafa and Perram).
 
static double p3m_k_space_error (double pref, Utils::Vector3i const &mesh, int cao, int n_c_part, double sum_q2, double alpha_L, Utils::Vector3d const &box_l)
 Calculate the analytic expression of the error estimate for the P3M method in [23] (eq.
 
template<typename combined_ranges >
static auto calc_dipole_moment (boost::mpi::communicator const &comm, combined_ranges const &p_q_unfolded_pos_range)
 

Detailed Description

The corresponding header file is p3m.hpp.

Definition in file p3m.cpp.

Function Documentation

◆ calc_dipole_moment()

template<typename combined_ranges >
static auto calc_dipole_moment ( boost::mpi::communicator const &  comm,
combined_ranges const &  p_q_unfolded_pos_range 
)
static

◆ complex_norm2()

template<typename FloatType >
FloatType complex_norm2 ( std::complex< FloatType > const &  z)

◆ get_size_from_shape()

static auto get_size_from_shape ( Utils::Vector3i const &  shape)
static

◆ is_node_grid_compatible_with_mesh()

static bool is_node_grid_compatible_with_mesh ( Utils::Vector3i const &  node_grid,
Utils::Vector3i const &  mesh 
)
static

Definition at line 130 of file p3m.cpp.

◆ multiply_complex_by_imaginary()

template<typename FloatType >
std::complex< FloatType > multiply_complex_by_imaginary ( std::complex< FloatType > const &  z,
FloatType  k 
)

Definition at line 100 of file p3m.cpp.

◆ multiply_complex_by_real()

template<typename FloatType >
std::complex< FloatType > multiply_complex_by_real ( std::complex< FloatType > const &  z,
FloatType  k 
)

Definition at line 107 of file p3m.cpp.

◆ p3m_k_space_error()

static double p3m_k_space_error ( double  pref,
Utils::Vector3i const &  mesh,
int  cao,
int  n_c_part,
double  sum_q2,
double  alpha_L,
Utils::Vector3d const &  box_l 
)
static

Calculate the analytic expression of the error estimate for the P3M method in [23] (eq.

8-23 p. 275) in order to obtain the rms error in the force for a system of N randomly distributed particles in a cubic box (k-space part).

Parameters
prefPrefactor of Coulomb interaction.
meshnumber of mesh points in one direction.
caocharge assignment order.
n_c_partnumber of charged particles in the system.
sum_q2sum of square of charges in the system
alpha_Lrescaled Ewald splitting parameter.
box_lbox dimensions.
Returns
reciprocal (k) space error

Definition at line 255 of file p3m.cpp.

References for_each_3d(), math::get_analytic_cotangent_sum_kernel(), p3m_tune_aliasing_sums(), Utils::product(), ROUND_ERROR_PREC, and Utils::sqr().

Referenced by CoulombTuningAlgorithm< FloatType, Architecture >::calculate_accuracy().

◆ p3m_real_space_error()

static double p3m_real_space_error ( double  pref,
double  r_cut_iL,
int  n_c_part,
double  sum_q2,
double  alpha_L,
Utils::Vector3d const &  box_l 
)
static

Calculate the real space contribution to the rms error in the force (as described by Kolafa and Perram).

Parameters
prefPrefactor of Coulomb interaction.
r_cut_iLrescaled real space cutoff for p3m method.
n_c_partnumber of charged particles in the system.
sum_q2sum of square of charges in the system
alpha_Lrescaled Ewald splitting parameter.
box_lbox dimensions.
Returns
real space error

Definition at line 234 of file p3m.cpp.

References Utils::product(), and Utils::sqr().

Referenced by CoulombTuningAlgorithm< FloatType, Architecture >::calculate_accuracy().

◆ p3m_tune_aliasing_sums()

static auto p3m_tune_aliasing_sums ( Utils::Vector3i const &  shift,
Utils::Vector3i const &  mesh,
Utils::Vector3d const &  mesh_i,
int  cao,
double  alpha_L_i 
)
static

◆ transpose()

template<Utils::MemoryOrder order_in, Utils::MemoryOrder order_out, typename T >
auto transpose ( std::span< T > const &  flat_array,
Utils::Vector3i const &  shape 
)