ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
p3m_heffte.impl.hpp File Reference
#include <config/config.hpp>
#include "electrostatics/p3m.hpp"
#include "electrostatics/p3m_heffte.hpp"
#include "electrostatics/coulomb.hpp"
#include "electrostatics/elc.hpp"
#include "electrostatics/p3m_gpu_cuda.cuh"
#include "electrostatics/p3m_gpu_error.hpp"
#include "short_range_cabana.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 "aosoa_pack.hpp"
#include "cell_system/CellStructure.hpp"
#include "cell_system/CellStructureType.hpp"
#include "cell_system/particle_enumeration.hpp"
#include "communication.hpp"
#include "errorhandling.hpp"
#include "integrators/Propagation.hpp"
#include "npt.hpp"
#include "p3m/send_mesh.hpp"
#include "particle_reduction.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 <Kokkos_Core.hpp>
#include <omp.h>
#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_heffte.impl.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  anonymous_namespace{p3m_heffte.impl.hpp}::AssignCharge< cao >
 
struct  anonymous_namespace{p3m_heffte.impl.hpp}::AssignForces< cao >
 
class  CoulombTuningAlgorithm< FloatType, Architecture, FFTConfig >
 

Namespaces

namespace  anonymous_namespace{p3m_heffte.impl.hpp}
 

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)
 
bool is_node_grid_compatible_with_mesh (Utils::Vector3i const &node_grid, Utils::Vector3i const &mesh)
 
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.
 
double p3m_real_space_error (double pref, double r_cut_iL, std::size_t 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).
 
double p3m_k_space_error (double pref, Utils::Vector3i const &mesh, int cao, std::size_t 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.
 
auto calc_dipole_moment (boost::mpi::communicator const &comm, auto const &cs, auto const &box_geo)
 

Function Documentation

◆ calc_dipole_moment()

auto calc_dipole_moment ( boost::mpi::communicator const comm,
auto const cs,
auto const box_geo 
)
inline

◆ is_node_grid_compatible_with_mesh()

bool is_node_grid_compatible_with_mesh ( Utils::Vector3i const node_grid,
Utils::Vector3i const mesh 
)
inline

Definition at line 117 of file p3m_heffte.impl.hpp.

References stream.

◆ multiply_complex_by_imaginary()

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

Definition at line 105 of file p3m_heffte.impl.hpp.

◆ multiply_complex_by_real()

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

Definition at line 112 of file p3m_heffte.impl.hpp.

◆ p3m_k_space_error()

double p3m_k_space_error ( double  pref,
Utils::Vector3i const mesh,
int  cao,
std::size_t  n_c_part,
double  sum_q2,
double  alpha_L,
Utils::Vector3d const box_l 
)
inline

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 261 of file p3m_heffte.impl.hpp.

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

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

◆ p3m_real_space_error()

double p3m_real_space_error ( double  pref,
double  r_cut_iL,
std::size_t  n_c_part,
double  sum_q2,
double  alpha_L,
Utils::Vector3d const box_l 
)
inline

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 239 of file p3m_heffte.impl.hpp.

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

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

◆ p3m_tune_aliasing_sums()

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