47#if defined(P3M) || defined(DP3M)
60namespace FFT_indexing {
61enum FFT_REAL_VECTOR :
int { RX = 0, RY = 1, RZ = 2 };
62enum FFT_WAVE_VECTOR :
int { KY = 0, KZ = 1, KX = 2 };
111 auto constexpr value_to_tune = -1.;
114 throw std::domain_error(
"Parameter 'epsilon' must be >= 0");
118 throw std::domain_error(
"Parameter 'accuracy' must be > 0");
125 throw std::domain_error(
"Parameter 'r_cut' must be > 0");
133 throw std::domain_error(
"Parameter 'alpha' must be > 0");
140 throw std::domain_error(
"Parameter 'mesh' must be > 0");
148 throw std::domain_error(
"Parameter 'mesh_off' must be >= 0 and <= 1");
152 if ((cao < 1 or cao > 7) and (not
tuning or
cao != -1)) {
153 throw std::domain_error(
"Parameter 'cao' must be >= 1 and <= 7");
157 throw std::domain_error(
"Parameter 'cao' cannot be larger than 'mesh'");
215 for (
unsigned int i = 0; i < 3; i++) {
225 LocalBox const &local_geo,
double skin,
249std::array<std::vector<int>, 3>
inline calc_meshift(
251 std::array<std::vector<int>, 3> ret{};
253 for (
unsigned int i = 0; i < 3; i++) {
254 ret[i] = std::vector<int>(mesh_size[i]);
256 for (
int j = 1; j <= mesh_size[i] / 2; j++) {
258 ret[i][mesh_size[i] - j] = -j;
260 if (zero_out_midpoint)
261 ret[i][mesh_size[i] / 2] = 0;
Vector implementation and trait types for boost qvm interoperability.
__shared__ int pos[MAXDEPTH *THREADS5/WARPSIZE]
static Vector< T, N > broadcast(T const &s)
Create a vector that has all entries set to one value.
double p3m_analytic_cotangent_sum(int n, double mesh_i, int cao)
One of the aliasing sums used to compute k-space errors.
auto constexpr P3M_EPSILON_METALLIC
This value indicates metallic boundary conditions.
This file contains the defaults for ESPResSo.
#define P3M_MESHOFF
P3M: Default for offset of first mesh point from the origin (left down corner of the simulation box).
auto hadamard_division(Vector< T, N > const &a, Vector< U, N > const &b)
auto hadamard_product(Vector< T, N > const &a, Vector< U, N > const &b)
static SteepestDescentParameters params
Currently active steepest descent instance.
Structure for local mesh parameters.
Utils::Vector3i dim
dimension (size) of local mesh.
int in_ur[3]
inner up right grid point + (1,1,1)
int size
number of local mesh points.
void recalc_ld_pos(P3MParameters const ¶ms)
Recalculate quantities derived from the mesh and box length: ld_pos (position of the left down mesh).
void calc_local_ca_mesh(P3MParameters const ¶ms, LocalBox const &local_geo, double skin, double space_layer)
Calculate properties of the local FFT mesh for the charge assignment process.
int in_ld[3]
inner left down grid point
int r_margin[6]
number of margin mesh points from neighbour nodes
int margin[6]
number of margin mesh points.
int q_2_off
offset between mesh lines of the last dimension
double ld_pos[3]
position of the first local mesh point.
int inner[3]
dimension of mesh inside node domain.
int ld_ind[3]
index of lower left corner of the local mesh in the global mesh.
int q_21_off
offset between mesh lines of the two last dimensions
Structure to hold P3M parameters and some dependent variables.
auto calc_grid_pos(Utils::Vector3d const &pos) const
Convert spatial position to grid position.
Utils::Vector3d cao_cut
cutoff for charge assignment.
double alpha
unscaled alpha_L for use with fast inline functions only
P3MParameters(bool tuning, double epsilon, double r_cut, Utils::Vector3i const &mesh, Utils::Vector3d const &mesh_off, int cao, double alpha, double accuracy)
double r_cut_iL
cutoff radius for real space electrostatics (>0), rescaled to r_cut_iL = r_cut * box_l_i.
int cao
charge assignment order ([0,7]).
double accuracy
accuracy of the actual parameter set.
double alpha_L
Ewald splitting parameter (0.
int cao3
number of points unto which a single charge is interpolated, i.e.
Utils::Vector3d mesh_off
offset of the first mesh point (lower left corner) from the coordinate origin ([0,...
Utils::Vector3d ai
inverse mesh constant.
double r_cut
unscaled r_cut_iL for use with fast inline functions only
void recalc_a_ai_cao_cut(Utils::Vector3d const &box_l)
Recalculate quantities derived from the mesh and box length: a, ai and cao_cut.
bool tuning
tuning or production?
Utils::Vector3i mesh
number of mesh points per coordinate direction (>0).
double epsilon
epsilon of the "surrounding dielectric".
Utils::Vector3d a
mesh constant.