ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
FFTBackendLegacy.cpp
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#include "config/config.hpp"
23
24#if defined(P3M) or defined(DP3M)
25
26#include "FFTBackendLegacy.hpp"
27
28#include "communication.hpp"
29
30#include "fft/fft.hpp"
31
32#include <memory>
33
34template <typename FloatType>
36 : FFTBackend<FloatType>(local_mesh),
37 fft{std::make_unique<fft::fft_data_struct<FloatType>>(
38 ::Communication::mpiCallbacksHandle()->share_mpi_env())} {}
39
40template <typename FloatType>
42
43template <typename FloatType>
45 ca_mesh_size = fft->initialize_fft(
46 ::comm_cart, local_mesh.dim, local_mesh.margin, params.mesh,
47 params.mesh_off, ks_pnum, ::communicator.node_grid);
48}
49
50template <typename FloatType>
52 fft->forward_fft(::comm_cart, rs_mesh);
53}
54
55template <typename FloatType>
57 fft->backward_fft(::comm_cart, rs_mesh, check_complex_residuals);
58}
59
60template class FFTBackendLegacy<float>;
61template class FFTBackendLegacy<double>;
62
63#endif // defined(P3M) or defined(DP3M)
Historic FFT backend based on FFTW3.
void backward_fft(FloatType *rs_mesh) override
~FFTBackendLegacy() override
FFTBackendLegacy(P3MLocalMesh const &local_mesh)
void init(P3MParameters const &params) override
void forward_fft(FloatType *rs_mesh) override
API for the FFT backend of the P3M algorithm.
Communicator communicator
boost::mpi::communicator comm_cart
The communicator.
This file contains the defaults for ESPResSo.
Routines, row decomposition, data structures and communication for the 3D-FFT.
Definition fft.cpp:74
static SteepestDescentParameters params
Currently active steepest descent instance.
Utils::Vector3i node_grid
Properties of the local mesh.
Structure to hold P3M parameters and some dependent variables.