67 std::array<fft_vector<double>, 3>
E_mesh;
113 sanity_checks_cell_structure();
117 sanity_checks_boxl();
118 sanity_checks_node_grid();
119 sanity_checks_periodicity();
120 sanity_checks_cell_structure();
187 auto const exp_adist_sq = exp(-adist * adist);
188 auto const dist_sq = dist * dist;
190#if USE_ERFC_APPROXIMATION
192 auto const fac = exp_adist_sq * (erfc_part_ri + two_a_sqrt_pi_i) / dist_sq;
194 auto const erfc_part_ri = erfc(adist) / dist;
195 auto const fac = (erfc_part_ri + two_a_sqrt_pi_i * exp_adist_sq) / dist_sq;
207#if USE_ERFC_APPROXIMATION
209 return prefactor * q1q2 * erfc_part_ri * exp(-adist * adist);
211 auto const erfc_part_ri = erfc(adist) / dist;
234 void calc_influence_function_force();
235 void calc_influence_function_energy();
238 void sanity_checks_boxl()
const;
239 void sanity_checks_node_grid()
const;
240 void sanity_checks_periodicity()
const;
241 void sanity_checks_cell_structure()
const;
243 void scaleby_box_l();
Vector implementation and trait types for boost qvm interoperability.
double prefactor
Electrostatics prefactor.
void sanity_checks_charge_neutrality() const
Cache for interpolation weights.
Structure for send/recv meshes.
Common functions for dipolar and charge P3M.
This file contains the defaults for ESPResSo.
Routines, row decomposition, data structures and communication for the 3D-FFT.
std::vector< T, fft_allocator< T > > fft_vector
constexpr T AS_erfc_part(T d)
Approximate by applying a formula from chapter 7.
DEVICE_QUALIFIER constexpr T sqrt_pi_i()
One over square root of pi.
void charge_assign(ParticleRange const &particles)
Assign the physical charges using the tabulated charge assignment function.
void add_long_range_forces(ParticleRange const &particles)
Compute the k-space part of forces.
void on_cell_structure_change()
bool check_complex_residuals
void assign_charge(double q, Utils::Vector3d const &real_pos, p3m_interpolation_cache &inter_weights)
Assign a single charge into the current charge grid.
double long_range_kernel(bool force_flag, bool energy_flag, ParticleRange const &particles)
Compute the k-space part of forces and energies.
Utils::Vector3d pair_force(double q1q2, Utils::Vector3d const &d, double dist) const
Calculate real-space contribution of p3m Coulomb pair forces.
void on_boxl_change()
Recalculate all box-length-dependent parameters.
double pair_energy(double q1q2, double dist) const
Calculate real-space contribution of Coulomb pair energy.
Utils::Vector9d long_range_pressure(ParticleRange const &particles)
Compute the k-space part of the pressure tensor.
void init()
Recalculate all derived parameters.
void sanity_checks() const
void count_charged_particles()
Count the number of charged particles and calculate the sum of the squared charges.
void on_periodicity_change() const
p3m_data_struct p3m
P3M parameters.
void on_node_grid_change() const
double long_range_energy(ParticleRange const &particles)
Compute the k-space part of energies.
void tune()
Tune P3M parameters to desired accuracy.
Structure for local mesh parameters.
Structure to hold P3M parameters and some dependent variables.
double alpha
unscaled alpha_L for use with fast inline functions only
double r_cut
unscaled r_cut_iL for use with fast inline functions only
Information about the three one dimensional FFTs and how the nodes have to communicate inbetween.
P3MLocalMesh local_mesh
local mesh.
p3m_data_struct(P3MParameters &¶meters)
p3m_send_mesh sm
send/recv mesh sizes
double sum_q2
Sum of square of charges (only on head node).
fft_vector< double > rs_mesh
real space mesh (local) for CA/FFT.
double square_sum_q
square of sum of charges (only on head node).
int sum_qpart
number of charged particles (only on head node).
p3m_interpolation_cache inter_weights
std::array< fft_vector< double >, 3 > E_mesh
mesh (local) for the electric field.