Loading [MathJax]/extensions/TeX/AMSmath.js
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
EKReactionBase.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 "EKReactant.hpp"
24
25#include <memory>
26#include <utility>
27#include <vector>
28
29namespace walberla {
30
32public:
33 using reactants_type = std::vector<std::shared_ptr<EKReactant>>;
34
35private:
36 std::shared_ptr<LatticeWalberla> m_lattice;
37 reactants_type m_reactants;
38 double m_coefficient;
39
40public:
41 EKReactionBase(std::shared_ptr<LatticeWalberla> lattice,
42 reactants_type reactants, double coefficient)
43 : m_lattice(std::move(lattice)), m_reactants(std::move(reactants)),
44 m_coefficient(coefficient) {}
45
46 virtual ~EKReactionBase() = default;
47
48 void set_coefficient(double coefficient) noexcept {
49 m_coefficient = coefficient;
50 }
51 [[nodiscard]] double get_coefficient() const noexcept {
52 return m_coefficient;
53 }
54 [[nodiscard]] auto get_lattice() const noexcept { return m_lattice; }
55 [[nodiscard]] auto const &get_reactants() const noexcept {
56 return m_reactants;
57 }
58
59 virtual void perform_reaction() = 0;
60};
61
62} // namespace walberla
void set_coefficient(double coefficient) noexcept
std::vector< std::shared_ptr< EKReactant > > reactants_type
auto get_lattice() const noexcept
double get_coefficient() const noexcept
EKReactionBase(std::shared_ptr< LatticeWalberla > lattice, reactants_type reactants, double coefficient)
virtual ~EKReactionBase()=default
virtual void perform_reaction()=0
auto const & get_reactants() const noexcept
\file PackInfoPdfDoublePrecision.cpp \author pystencils