24#if defined(P3M) || defined(DP3M)
46 return (1.0 + c * 2.0) / 3.0;
49 return (2.0 + c * (11.0 + c * 2.0)) / 15.0;
52 return (17.0 + c * (180.0 + c * (114.0 + c * 4.0))) / 315.0;
55 return (62.0 + c * (1072.0 + c * (1452.0 + c * (247.0 + c * 2.0)))) /
61 c * (83021.0 + c * (34096.0 + c * (2026.0 + c * 4.0))))) /
69 c * (349500.0 + c * (8166.0 + c * 4.0)))))) /
73 throw std::logic_error(
"Invalid value cao=" + std::to_string(cao));
79 LocalBox const &local_geo,
double skin,
88 auto const &inner_ld_pos = local_geo.
my_left();
90 auto const &inner_ur_pos = local_geo.
my_right();
92 auto const outer_ur_pos = inner_ur_pos + full_skin;
94 auto const outer_ld_pos = inner_ld_pos - full_skin;
96 auto const inner_ld_grid_pos =
params.calc_grid_pos(inner_ld_pos);
97 auto const inner_ur_grid_pos =
params.calc_grid_pos(inner_ur_pos);
98 auto const outer_ld_grid_pos =
params.calc_grid_pos(outer_ld_pos);
99 auto const outer_ur_grid_pos =
params.calc_grid_pos(outer_ur_pos);
102 for (i = 0; i < 3; i++)
103 in_ld[i] =
static_cast<int>(std::ceil(inner_ld_grid_pos[i]));
105 for (i = 0; i < 3; i++)
106 in_ur[i] =
static_cast<int>(std::floor(inner_ur_grid_pos[i]));
109 for (i = 0; i < 3; i++) {
116 for (i = 0; i < 3; i++)
119 for (i = 0; i < 3; i++)
120 ld_ind[i] =
static_cast<int>(std::ceil(outer_ld_grid_pos[i]));
122 for (i = 0; i < 3; i++)
125 for (i = 0; i < 3; i++)
126 ind[i] =
static_cast<int>(std::floor(outer_ur_grid_pos[i]));
128 for (i = 0; i < 3; i++)
129 if (outer_ur_grid_pos[i] - ind[i] == 0.)
132 for (i = 0; i < 3; i++)
137 for (i = 0; i < 3; i++) {
143 for (i = 0; i < 3; i++)
145 for (i = 0; i < 3; i++)
Vector implementation and trait types for boost qvm interoperability.
auto const & my_right() const
Right (top, back) corner of this nodes local box.
auto const & my_left() const
Left (bottom, front) corner of this nodes local box.
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.
Common functions for dipolar and charge P3M.
This file contains the defaults for ESPResSo.
#define ROUND_ERROR_PREC
Precision for capture of round off errors.
DEVICE_QUALIFIER constexpr T pi()
Ratio of diameter and circumference of a circle.
DEVICE_QUALIFIER constexpr T sqr(T x)
Calculates the SQuaRe of x.
static SteepestDescentParameters params
Currently active steepest descent instance.
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 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 margin[6]
number of margin mesh points.
int q_2_off
offset between mesh lines of the last dimension
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.