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 WALBERLA
25
27
30
31#include "EKReaction.hpp"
32
35
36#include <memory>
37
39
40class EKReactions : public ObjectList<EKReaction> {
42 using value_type = typename 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
56protected:
57 void do_construct(VariantMap const &params) override {
58 m_ek_reactions = std::make_shared<::EK::EKWalberla::ek_reactions_type>();
59 }
60
61public:
62 auto &get_handle() { return m_ek_reactions; }
63
64 ~EKReactions() override { do_destruct(); }
65};
66
67} // namespace ScriptInterface::walberla
68
69#endif // WALBERLA
Owning list of object handles.
std::shared_ptr< EKReaction > value_type
bool has_in_core(value_type const &obj_ptr) const 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
static SteepestDescentParameters params
Currently active steepest descent instance.