ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
dp3m_heffte.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2010-2025 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
#ifdef ESPRESSO_DP3M
25
26
#include "
magnetostatics/dp3m_heffte.impl.hpp
"
27
28
#include "
p3m/FFTBackendLegacy.hpp
"
29
#include "
p3m/FFTBuffersLegacy.hpp
"
30
31
#include <memory>
32
#include <utility>
33
34
template
<
typename
FloatType, Arch Architecture>
35
std::shared_ptr<DipolarP3M>
36
new_dipolar_p3m_impl
(
P3MParameters
&&p3m,
TuningParameters
const
&
tuning_params
,
37
double
prefactor) {
38
using
DefaultFFTConfig
=
39
P3MFFTConfig
<
Utils::MemoryOrder::ROW_MAJOR
,
Utils::MemoryOrder::ROW_MAJOR
,
40
false
, 2>;
41
auto
obj
= std::make_shared<
42
DipolarP3MHeffte<FloatType, Architecture, DefaultFFTConfig>
>(
43
std::make_unique<DipolarP3MState<FloatType, DefaultFFTConfig>>(
44
std::move(p3m)),
45
tuning_params
, prefactor);
46
obj
->dp3m.template
make_mesh_instance<FFTBuffersLegacy<FloatType>
>();
47
obj
->dp3m.template
make_fft_instance<FFTBackendLegacy<FloatType>
>();
48
return
obj
;
49
}
50
51
std::shared_ptr<DipolarP3M>
52
new_dipolar_p3m_heffte
(
P3MParameters
&&p3m_params,
53
TuningParameters
const
&
tuning_params
,
double
prefactor,
54
bool
single_precision
,
Arch
arch
) {
55
auto
fptr
= &
new_dipolar_p3m_impl<float, Arch::CPU>
;
56
if
(
single_precision
) {
57
fptr
=
new_dipolar_p3m_impl<float, Arch::CPU>
;
58
}
else
{
59
fptr
=
new_dipolar_p3m_impl<double, Arch::CPU>
;
60
}
61
return
fptr
(std::move(p3m_params),
tuning_params
, prefactor);
62
}
63
64
#endif
// ESPRESSO_DP3M
FFTBackendLegacy.hpp
FFTBuffersLegacy.hpp
stream
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Definition
common_cuda.cu:34
config.hpp
new_dipolar_p3m_heffte
std::shared_ptr< DipolarP3M > new_dipolar_p3m_heffte(P3MParameters &&p3m_params, TuningParameters const &tuning_params, double prefactor, bool single_precision, Arch arch)
Definition
dp3m_heffte.cpp:52
new_dipolar_p3m_impl
std::shared_ptr< DipolarP3M > new_dipolar_p3m_impl(P3MParameters &&p3m, TuningParameters const &tuning_params, double prefactor)
Definition
dp3m_heffte.cpp:36
dp3m_heffte.impl.hpp
Utils::MemoryOrder::ROW_MAJOR
@ ROW_MAJOR
Arch
Arch
P3M kernel architecture.
Definition
p3m/common.hpp:59
DipolarP3MHeffte
Definition
dp3m_heffte.hpp:158
P3MFFTConfig
Definition
p3m/common.hpp:318
P3MParameters
Structure to hold P3M parameters and some dependent variables.
Definition
p3m/common.hpp:62
TuningParameters
Definition
p3m/common.hpp:249
src
core
magnetostatics
dp3m_heffte.cpp
Generated on Tue Dec 9 2025 02:28:52 for ESPResSo by
1.9.8