ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
PoissonSolver.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
23
24#include <cstddef>
25#include <memory>
26#include <utility>
27
28namespace walberla {
29
31private:
32 std::shared_ptr<LatticeWalberla> m_lattice;
33 double m_permittivity;
34
35public:
36 PoissonSolver(std::shared_ptr<LatticeWalberla> lattice, double permittivity)
37 : m_lattice(std::move(lattice)), m_permittivity(permittivity) {}
38 virtual ~PoissonSolver() = default;
39
40 virtual void reset_charge_field() = 0;
41
42 virtual void add_charge_to_field(std::size_t id, double valency,
43 bool is_double_precision) = 0;
44
45 [[nodiscard]] virtual std::size_t get_potential_field_id() const noexcept = 0;
46
47 void set_permittivity(double permittivity) noexcept {
48 m_permittivity = permittivity;
49 }
50
51 [[nodiscard]] double get_permittivity() const noexcept {
52 return m_permittivity;
53 }
54
55 [[nodiscard]] auto const &get_lattice() const noexcept { return *m_lattice; }
56
57 virtual void solve() = 0;
58};
59
60} // namespace walberla
void set_permittivity(double permittivity) noexcept
virtual std::size_t get_potential_field_id() const noexcept=0
virtual ~PoissonSolver()=default
PoissonSolver(std::shared_ptr< LatticeWalberla > lattice, double permittivity)
double get_permittivity() const noexcept
virtual void solve()=0
auto const & get_lattice() const noexcept
virtual void add_charge_to_field(std::size_t id, double valency, bool is_double_precision)=0
virtual void reset_charge_field()=0