ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
script_interface/walberla/EKNone.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022-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
22#include "config/config.hpp"
23
24#ifdef WALBERLA
25
26#include "EKPoissonSolver.hpp"
27
30
33
34#include <memory>
35
37
38class EKNone : public EKPoissonSolver {
39 std::shared_ptr<::walberla::PoissonSolver> m_instance;
40 std::shared_ptr<LatticeWalberla> m_lattice;
41 bool m_single_precision;
42
43public:
44 void do_construct(VariantMap const &args) override {
45 m_single_precision = get_value_or<bool>(args, "single_precision", false);
46 m_lattice = get_value<std::shared_ptr<LatticeWalberla>>(args, "lattice");
47
48 m_instance = ::walberla::new_ek_poisson_none(m_lattice->lattice(),
49 m_single_precision);
50
52 {"single_precision", AutoParameter::read_only,
53 [this]() { return m_single_precision; }},
54 {"lattice", AutoParameter::read_only, [this]() { return m_lattice; }},
55 });
56 }
57
58 [[nodiscard]] std::shared_ptr<::walberla::PoissonSolver>
60 return m_instance;
61 }
62};
63
64} // namespace ScriptInterface::walberla
65
66#endif // WALBERLA
void add_parameters(std::vector< AutoParameter > &&params)
void do_construct(VariantMap const &args) override
std::shared_ptr<::walberla::PoissonSolver > get_instance() const noexcept override
This file contains the defaults for ESPResSo.
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
std::unordered_map< std::string, Variant > VariantMap
Definition Variant.hpp:69
std::shared_ptr< walberla::PoissonSolver > new_ek_poisson_none(std::shared_ptr< LatticeWalberla > const &lattice, bool single_precision)
static constexpr const ReadOnly read_only