ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
FFTBuffersLegacy.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2024 The ESPResSo project
3 * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
4 * Max-Planck-Institute for Polymer Research, Theory Group
5 *
6 * This file is part of ESPResSo.
7 *
8 * ESPResSo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * ESPResSo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "config/config.hpp"
25
26#if defined(P3M) or defined(DP3M)
27
28#include "common.hpp"
29#include "data_struct.hpp"
30#include "send_mesh.hpp"
31
32#include "fft/vector.hpp"
33
34#include <array>
35#include <type_traits>
36
37/** @brief Buffers for @ref FFTBackendLegacy. */
38template <typename FloatType>
39class FFTBuffersLegacy : public FFTBuffers<FloatType> {
40 static_assert(std::is_same_v<FloatType, float> or
41 std::is_same_v<FloatType, double>,
42 "FFTW only implements float and double");
43 using FFTBuffers<FloatType>::FFTBuffers;
44 using FFTBuffers<FloatType>::local_mesh;
46 /** @brief real-space mesh (local) for CA/FFT. */
48 /** @brief real-space mesh (local) for the electric or dipolar field. */
49 std::array<fft::vector<FloatType>, 3u> rs_mesh_fields;
50
51public:
53 void init_halo() override;
54 void init_meshes(int ca_mesh_size) override;
55 void perform_scalar_halo_gather() override;
56 void perform_vector_halo_gather() override;
57 void perform_scalar_halo_spread() override;
58 void perform_vector_halo_spread() override;
59 void update_mesh_views(P3MFFTMesh<FloatType> &out) override;
60 FloatType *get_scalar_mesh() override;
61 std::array<FloatType *, 3u> get_vector_mesh() override;
62};
63
64#endif // defined(P3M) or defined(DP3M)
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
API for the FFT mesh buffers.
P3MLocalMesh const & local_mesh
P3M halo communicator.
Definition send_mesh.hpp:38
This file contains the defaults for ESPResSo.
std::vector< T, allocator< T > > vector
Definition vector.hpp:52
Common functions for dipolar and charge P3M.
Local mesh FFT buffers.