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

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

#include "config/config.hpp"
#include "electrostatics/p3m.hpp"
#include "electrostatics/p3m.impl.hpp"
#include "electrostatics/coulomb.hpp"
#include "electrostatics/elc.hpp"
#include "electrostatics/p3m_gpu_cuda.cuh"
#include "electrostatics/p3m_gpu_error.hpp"
#include "fft/fft.hpp"
#include "p3m/TuningAlgorithm.hpp"
#include "p3m/TuningLogger.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 "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 <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 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

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 [22] (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

◆ 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 [22] (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 208 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 187 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