ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
script_interface/walberla/EKReactions.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 ESPRESSO_WALBERLA
25
26
#include <
walberla_bridge/electrokinetics/reactions/EKReactionBase.hpp
>
27
28
#include "
core/ek/EKReactions.hpp
"
29
#include "
core/ek/EKWalberla.hpp
"
30
31
#include "
EKReaction.hpp
"
32
33
#include <
script_interface/ObjectList.hpp
>
34
#include <
script_interface/ScriptInterface.hpp
>
35
36
#include <memory>
37
38
namespace
ScriptInterface::walberla
{
39
40
class
EKReactions
:
public
ObjectList
<EKReaction> {
41
using
Base
=
ObjectList<EKReaction>
;
42
using
Base::value_type
;
43
44
std::shared_ptr<::EK::EKWalberla::ek_reactions_type> m_ek_reactions;
45
46
bool
has_in_core
(
value_type
const
&
obj_ptr
)
const override
{
47
return
m_ek_reactions->contains(
obj_ptr
->get_instance());
48
}
49
void
add_in_core
(
value_type
const
&
obj_ptr
)
override
{
50
m_ek_reactions->add(
obj_ptr
->get_instance());
51
}
52
void
remove_in_core
(
value_type
const
&
obj_ptr
)
final
{
53
m_ek_reactions->remove(
obj_ptr
->get_instance());
54
}
55
56
protected
:
57
void
do_construct
(
VariantMap
const
&)
override
{
58
m_ek_reactions = std::make_shared<::EK::EKWalberla::ek_reactions_type>();
59
}
60
61
public
:
62
auto
&
get_handle
() {
return
m_ek_reactions; }
63
64
~EKReactions
()
override
{
do_destruct
(); }
65
};
66
67
}
// namespace ScriptInterface::walberla
68
69
#endif
// ESPRESSO_WALBERLA
EKReactionBase.hpp
EKReaction.hpp
EKWalberla.hpp
ObjectList.hpp
ScriptInterface.hpp
ScriptInterface::ObjectList
Owning list of object handles.
Definition
ObjectList.hpp:53
ScriptInterface::ObjectList< EKReaction >::value_type
std::shared_ptr< EKReaction > value_type
Definition
ObjectList.hpp:58
ScriptInterface::ObjectList< EKReaction >::do_destruct
void do_destruct()
Definition
ObjectList.hpp:69
ScriptInterface::walberla::EKReactions
Definition
script_interface/walberla/EKReactions.hpp:40
ScriptInterface::walberla::EKReactions::remove_in_core
void remove_in_core(value_type const &obj_ptr) final
Definition
script_interface/walberla/EKReactions.hpp:52
ScriptInterface::walberla::EKReactions::~EKReactions
~EKReactions() override
Definition
script_interface/walberla/EKReactions.hpp:64
ScriptInterface::walberla::EKReactions::get_handle
auto & get_handle()
Definition
script_interface/walberla/EKReactions.hpp:62
ScriptInterface::walberla::EKReactions::add_in_core
void add_in_core(value_type const &obj_ptr) override
Definition
script_interface/walberla/EKReactions.hpp:49
ScriptInterface::walberla::EKReactions::do_construct
void do_construct(VariantMap const &) override
Definition
script_interface/walberla/EKReactions.hpp:57
ScriptInterface::walberla::EKReactions::has_in_core
bool has_in_core(value_type const &obj_ptr) const override
Definition
script_interface/walberla/EKReactions.hpp:46
stream
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Definition
common_cuda.cu:34
config.hpp
EKReactions.hpp
ScriptInterface::walberla
Definition
script_interface/walberla/EKContainer.hpp:49
ScriptInterface::VariantMap
std::unordered_map< std::string, Variant > VariantMap
Definition
Variant.hpp:133
src
script_interface
walberla
EKReactions.hpp
Generated on Tue Dec 9 2025 02:28:56 for ESPResSo by
1.9.8