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
30
#include <
script_interface/ScriptInterface.hpp
>
31
#include <
script_interface/auto_parameters/AutoParameters.hpp
>
32
33
#include <
walberla_bridge/electrokinetics/PoissonSolver.hpp
>
34
35
#include <
utils/math/int_pow.hpp
>
36
37
#include <memory>
38
#include <unordered_map>
39
40
namespace
ScriptInterface::walberla
{
41
42
class
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
50
class
EKPoissonSolver
51
:
public
LatticeModel
<::walberla::PoissonSolver, EKPoissonVTKHandle> {
52
protected
:
53
double
m_tau
;
54
double
m_conv_potential
;
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
60
public
:
61
virtual
std::shared_ptr<::walberla::PoissonSolver>
62
get_instance
()
const
noexcept
= 0;
63
64
[[
nodiscard
]]
auto
get_conversion_factor_potential
()
const
noexcept
{
65
return
m_conv_potential
;
66
}
67
68
::LatticeModel::units_map
69
get_lattice_to_md_units_conversion
()
const override
{
70
return
{
71
{
"potential"
, 1. /
m_conv_potential
},
72
};
73
}
74
};
75
76
}
// namespace ScriptInterface::walberla
77
78
#endif
// ESPRESSO_WALBERLA
AutoParameters.hpp
PoissonSolver.hpp
ScriptInterface.hpp
LatticeModel::units_map
std::unordered_map< std::string, double > units_map
Definition
walberla_bridge/include/walberla_bridge/LatticeModel.hpp:33
ScriptInterface::walberla::EKPoissonSolver
Definition
EKPoissonSolver.hpp:51
ScriptInterface::walberla::EKPoissonSolver::set_potential_conversion
void set_potential_conversion(double agrid, double tau)
Definition
EKPoissonSolver.hpp:56
ScriptInterface::walberla::EKPoissonSolver::m_conv_potential
double m_conv_potential
Definition
EKPoissonSolver.hpp:54
ScriptInterface::walberla::EKPoissonSolver::m_tau
double m_tau
Definition
EKPoissonSolver.hpp:53
ScriptInterface::walberla::EKPoissonSolver::get_instance
virtual std::shared_ptr<::walberla::PoissonSolver > get_instance() const noexcept=0
ScriptInterface::walberla::EKPoissonSolver::get_conversion_factor_potential
auto get_conversion_factor_potential() const noexcept
Definition
EKPoissonSolver.hpp:64
ScriptInterface::walberla::EKPoissonSolver::get_lattice_to_md_units_conversion
::LatticeModel::units_map get_lattice_to_md_units_conversion() const override
Definition
EKPoissonSolver.hpp:69
ScriptInterface::walberla::EKPoissonVTKHandle
Definition
EKPoissonSolver.hpp:42
ScriptInterface::walberla::EKPoissonVTKHandle::get_obs_map
std::unordered_map< std::string, int > const & get_obs_map() const override
Definition
EKPoissonSolver.hpp:45
ScriptInterface::walberla::LatticeModel
Definition
script_interface/walberla/LatticeModel.hpp:40
ScriptInterface::walberla::VTKHandleBase
Definition
script_interface/walberla/VTKHandle.hpp:46
config.hpp
int_pow.hpp
ScriptInterface::walberla
Definition
script_interface/walberla/EKContainer.hpp:49
ScriptInterface::get_value
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
Definition
get_value.hpp:398
LatticeModel.hpp
LatticeWalberla.hpp
VTKHandle.hpp
src
script_interface
walberla
EKPoissonSolver.hpp
Generated on Mon May 25 2026 01:34:53 for ESPResSo by
1.9.8