ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
dp3m_heffte.impl.hpp File Reference
#include <config/config.hpp>
#include "magnetostatics/dp3m.hpp"
#include "magnetostatics/dipoles.hpp"
#include "short_range_cabana.hpp"
#include "magnetostatics/dp3m_heffte.hpp"
#include "fft/fft.hpp"
#include "p3m/P3MFFT.hpp"
#include "p3m/TuningAlgorithm.hpp"
#include "p3m/TuningLogger.hpp"
#include "p3m/common.hpp"
#include "p3m/field_layout_helpers.hpp"
#include "p3m/influence_function_dipolar.hpp"
#include "p3m/interpolation.hpp"
#include "p3m/math.hpp"
#include "BoxGeometry.hpp"
#include "LocalBox.hpp"
#include "Particle.hpp"
#include "ParticleRange.hpp"
#include "PropagationMode.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/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/reduce.hpp>
#include <Kokkos_Core.hpp>
#include <omp.h>
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdio>
#include <functional>
#include <iterator>
#include <numbers>
#include <optional>
#include <span>
#include <sstream>
#include <stdexcept>
#include <tuple>
#include <utility>
#include <vector>
+ Include dependency graph for dp3m_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{dp3m_heffte.impl.hpp}::AssignDipole< cao >
 
struct  anonymous_namespace{dp3m_heffte.impl.hpp}::AssignTorques< cao >
 
struct  anonymous_namespace{dp3m_heffte.impl.hpp}::AssignForcesDip< cao >
 
class  DipolarTuningAlgorithm< FloatType, Architecture, FFTConfig >
 

Namespaces

namespace  anonymous_namespace{dp3m_heffte.impl.hpp}
 

Functions

double dp3m_k_space_error (double box_size, int mesh, int cao, std::size_t n_c_part, double sum_q2, double alpha_L)
 Calculate the k-space error of dipolar-P3M.
 
double dp3m_real_space_error (double box_size, double r_cut_iL, std::size_t n_c_part, double sum_q2, double alpha_L)
 Calculate the value of the errors for the REAL part of the force in terms of the splitting parameter alpha of Ewald.
 
double dp3m_rtbisection (double box_size, double r_cut_iL, std::size_t n_c_part, double sum_q2, double x1, double x2, double xacc, double tuned_accuracy)
 Compute the value of alpha through a bisection method.
 
auto dp3m_tune_aliasing_sums (Utils::Vector3i const &shift, int mesh, double mesh_i, int cao, double alpha_L_i)
 Tuning dipolar-P3M.
 

Function Documentation

◆ dp3m_k_space_error()

double dp3m_k_space_error ( double  box_size,
int  mesh,
int  cao,
std::size_t  n_c_part,
double  sum_q2,
double  alpha_L 
)
inline

◆ dp3m_real_space_error()

double dp3m_real_space_error ( double  box_size,
double  r_cut_iL,
std::size_t  n_c_part,
double  sum_q2,
double  alpha_L 
)
inline

Calculate the value of the errors for the REAL part of the force in terms of the splitting parameter alpha of Ewald.

Based on eq. (33) [48].

Please note that in this more refined approach we don't use eq. (37), but eq. (33) which maintains all the powers in alpha.

Definition at line 1277 of file dp3m_heffte.impl.hpp.

References Utils::sqr(), and stream.

Referenced by DipolarTuningAlgorithm< FloatType, Architecture, FFTConfig >::calculate_accuracy(), and dp3m_rtbisection().

◆ dp3m_rtbisection()

double dp3m_rtbisection ( double  box_size,
double  r_cut_iL,
std::size_t  n_c_part,
double  sum_q2,
double  x1,
double  x2,
double  xacc,
double  tuned_accuracy 
)

Compute the value of alpha through a bisection method.

Using bisection, find the root of a function "func-tuned_accuracy/sqrt(2.)" known to lie between x1 and x2.

Based on eq. (33) [48].

The root, returned as rtbis, will be refined until its accuracy is \(\pm\) xacc.

Definition at line 1311 of file dp3m_heffte.impl.hpp.

References dp3m_real_space_error(), and stream.

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

◆ dp3m_tune_aliasing_sums()

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