24#if defined(P3M) or defined(DP3M)
28#include "communication.hpp"
33template <
typename FloatType>
36template <
typename FloatType>
40 for (
auto i = 0u; i < 3u; ++i) {
41 out.
rs_fields[i] = std::span(rs_mesh_fields[i]);
49template <
typename FloatType>
51 rs_mesh.resize(ca_mesh_size);
52 for (
auto &rs_mesh_field : rs_mesh_fields) {
53 rs_mesh_field.resize(ca_mesh_size);
57template <
typename FloatType>
59 std::array<FloatType *, 3u> meshes = {{rs_mesh_fields[0u].data(),
60 rs_mesh_fields[1u].data(),
61 rs_mesh_fields[2u].data()}};
62 mesh_comm.spread_grid(
::comm_cart, meshes, local_mesh.dim);
65template <
typename FloatType>
67 mesh_comm.gather_grid(
::comm_cart, rs_mesh.data(), local_mesh.dim);
70template <
typename FloatType>
72 std::array<FloatType *, 3u> meshes = {{rs_mesh_fields[0u].data(),
73 rs_mesh_fields[1u].data(),
74 rs_mesh_fields[2u].data()}};
75 mesh_comm.gather_grid(
::comm_cart, meshes, local_mesh.dim);
78template <
typename FloatType>
80 mesh_comm.spread_grid(
::comm_cart, rs_mesh.data(), local_mesh.dim);
83template <
typename FloatType>
85 return rs_mesh.data();
88template <
typename FloatType>
90 return {rs_mesh_fields[0u].data(), rs_mesh_fields[1u].data(),
91 rs_mesh_fields[2u].data()};
Buffers for FFTBackendLegacy.
void update_mesh_views(P3MFFTMesh< FloatType > &out) override
void perform_scalar_halo_spread() override
void perform_vector_halo_spread() override
void perform_vector_halo_gather() override
~FFTBuffersLegacy() override
void perform_scalar_halo_gather() override
void init_halo() override
void init_meshes(int ca_mesh_size) override
FloatType * get_scalar_mesh() override
std::array< FloatType *, 3u > get_vector_mesh() override
boost::mpi::communicator comm_cart
The communicator.
This file contains the defaults for ESPResSo.
std::array< std::span< FloatType >, 3 > rs_fields
real-space vector meshes for the electric or dipolar field.
std::span< FloatType > rs_scalar
real-space scalar mesh for charge assignment and FFT.