ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
lb_kernels.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-2023 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
23
32
33#ifdef __AVX2__
38#else
43#endif
44
45namespace walberla {
46namespace detail {
47
48using lbmpy::Arch;
49
50template <typename FT = double, Arch AT = Arch::CPU> struct KernelTrait {
51#ifdef __AVX2__
52 using CollisionModelThermalized =
53 pystencils::CollideSweepDoublePrecisionThermalizedAVX;
54 using CollisionModelLeesEdwards =
55 pystencils::CollideSweepDoublePrecisionLeesEdwardsAVX;
56#else
57 using CollisionModelThermalized =
58 pystencils::CollideSweepDoublePrecisionThermalized;
59 using CollisionModelLeesEdwards =
60 pystencils::CollideSweepDoublePrecisionLeesEdwards;
61#endif
62 using StreamSweep = pystencils::StreamSweepDoublePrecision;
63 using InitialPDFsSetter = pystencils::InitialPDFsSetterDoublePrecision;
64};
65
66template <> struct KernelTrait<float, Arch::CPU> {
67#ifdef __AVX2__
68 using CollisionModelThermalized =
69 pystencils::CollideSweepSinglePrecisionThermalizedAVX;
70 using CollisionModelLeesEdwards =
71 pystencils::CollideSweepSinglePrecisionLeesEdwardsAVX;
72#else
73 using CollisionModelThermalized =
74 pystencils::CollideSweepSinglePrecisionThermalized;
75 using CollisionModelLeesEdwards =
76 pystencils::CollideSweepSinglePrecisionLeesEdwards;
77#endif
78 using StreamSweep = pystencils::StreamSweepSinglePrecision;
79 using InitialPDFsSetter = pystencils::InitialPDFsSetterSinglePrecision;
80};
81
82template <typename FT = double, Arch AT = Arch::CPU>
83struct BoundaryHandlingTrait {
84 using Dynamic_UBB = lbm::Dynamic_UBB_double_precision;
85};
86
87template <> struct BoundaryHandlingTrait<float, Arch::CPU> {
88 using Dynamic_UBB = lbm::Dynamic_UBB_single_precision;
89};
90
91} // namespace detail
92} // namespace walberla
Arch