ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
EKPoissonSolver.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022-2026 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 "LatticeModel.hpp"
27#include "LatticeWalberla.hpp"
28#include "VTKHandle.hpp"
29
32
34
36
37#include <memory>
38#include <unordered_map>
39
41
42class EKPoissonVTKHandle : public VTKHandleBase<::walberla::PoissonSolver> {
43 static std::unordered_map<std::string, int> const obs_map;
44
45 std::unordered_map<std::string, int> const &get_obs_map() const override {
46 return obs_map;
47 }
48};
49
51 : public LatticeModel<::walberla::PoissonSolver, EKPoissonVTKHandle> {
52protected:
53 double m_tau;
55
56 void set_potential_conversion(double agrid, double tau) {
57 m_conv_potential = Utils::int_pow<2>(tau) / Utils::int_pow<2>(agrid);
58 }
59
60public:
61 virtual std::shared_ptr<::walberla::PoissonSolver>
63
67
70 return {
71 {"potential", 1. / m_conv_potential},
72 };
73 }
74};
75
76} // namespace ScriptInterface::walberla
77
78#endif // ESPRESSO_WALBERLA
std::unordered_map< std::string, double > units_map
void set_potential_conversion(double agrid, double tau)
virtual std::shared_ptr<::walberla::PoissonSolver > get_instance() const noexcept=0
::LatticeModel::units_map get_lattice_to_md_units_conversion() const override
std::unordered_map< std::string, int > const & get_obs_map() const override
T get_value(Variant const &v)
Extract value of specific type T from a Variant.