24#if defined(P3M) or defined(DP3M)
35 LocalBox const &local_geo,
double skin,
44 auto const &inner_ld_pos = local_geo.
my_left();
46 auto const &inner_ur_pos = local_geo.
my_right();
48 auto const outer_ur_pos = inner_ur_pos + full_skin;
50 auto const outer_ld_pos = inner_ld_pos - full_skin;
52 auto const inner_ld_grid_pos =
params.calc_grid_pos(inner_ld_pos);
53 auto const inner_ur_grid_pos =
params.calc_grid_pos(inner_ur_pos);
54 auto const outer_ld_grid_pos =
params.calc_grid_pos(outer_ld_pos);
55 auto const outer_ur_grid_pos =
params.calc_grid_pos(outer_ur_pos);
58 for (i = 0; i < 3; i++)
59 in_ld[i] =
static_cast<int>(std::ceil(inner_ld_grid_pos[i]));
61 for (i = 0; i < 3; i++)
62 in_ur[i] =
static_cast<int>(std::floor(inner_ur_grid_pos[i]));
65 for (i = 0; i < 3; i++) {
72 for (i = 0; i < 3; i++)
75 for (i = 0; i < 3; i++)
76 ld_ind[i] =
static_cast<int>(std::ceil(outer_ld_grid_pos[i]));
78 for (i = 0; i < 3; i++)
81 for (i = 0; i < 3; i++)
82 ind[i] =
static_cast<int>(std::floor(outer_ur_grid_pos[i]));
84 for (i = 0; i < 3; i++)
85 if (outer_ur_grid_pos[i] - ind[i] == 0.)
88 for (i = 0; i < 3; i++)
93 for (i = 0; i < 3; i++) {
99 for (i = 0; i < 3; i++)
101 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 DEVICE_QUALIFIER constexpr Vector< T, N > broadcast(typename Base::value_type const &value)
Create a vector that has all entries set to the same value.
This file contains the defaults for ESPResSo.
#define ROUND_ERROR_PREC
Precision for capture of round off errors.
Common functions for dipolar and charge P3M.
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.