ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
EKPoissonSolverNode.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 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 ESPRESSO_WALBERLA
25
26#include "EKPoissonSolver.hpp"
27#include "LatticeIndices.hpp"
28
31
33
34#include <utils/Vector.hpp>
35
36#include <cassert>
37#include <memory>
38#include <string>
39
41
43 : public AutoParameters<EKPoissonSolverNode, LatticeIndices> {
44 std::shared_ptr<::walberla::PoissonSolver> m_ek_poisson_solver;
45 Utils::Vector3i m_index;
46 Utils::Vector3i m_grid_size;
47
48public:
51 {{"_index", AutoParameter::read_only, [this]() { return m_index; }}});
52 }
53
54 void do_construct(VariantMap const &params) override {
55 auto const ek_sip =
57 m_ek_poisson_solver = ek_sip->get_instance();
58 assert(m_ek_poisson_solver);
59 m_grid_size = m_ek_poisson_solver->get_lattice().get_grid_dimensions();
61 m_grid_size);
62 }
63
64 Variant do_call_method(std::string const &name,
65 VariantMap const &params) override;
66};
67} // namespace ScriptInterface::walberla
68
69#endif // ESPRESSO_WALBERLA
Vector implementation and trait types for boost qvm interoperability.
Bind parameters in the script interface.
Utils::Vector3i get_mapped_index(Utils::Vector3i const &index, Utils::Vector3i const &shape) const
std::string_view name() const
Variant do_call_method(std::string const &name, VariantMap const &params) override
void do_construct(VariantMap const &params) override
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:133
static SteepestDescentParameters params
Currently active steepest descent instance.
static constexpr const ReadOnly read_only
Recursive variant implementation.
Definition Variant.hpp:84