ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Scafacos.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 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#ifndef ESPRESSO_SRC_SCAFACOS_SCAFACOS_HPP
21#define ESPRESSO_SRC_SCAFACOS_SCAFACOS_HPP
22
23#include <fcs.h>
24
25#include <mpi.h>
26
27#include <string>
28#include <type_traits>
29#include <vector>
30
31namespace Scafacos {
32
33/** @brief Abstraction of a method from the ScaFaCoS library. */
34struct Scafacos {
35 Scafacos(MPI_Comm comm, std::string method, std::string parameters);
36 ~Scafacos();
37 /** Get the parameters from the library */
38 std::string get_parameters() const { return m_parameters; }
39 /** Get active method name */
40 std::string get_method() const { return m_method_name; }
41
42 /** Set box geometry, number of particles and calculation type. */
43 void set_runtime_parameters(double const *box_l, int const *periodicity,
44 int total_particles, int near_field_flag);
45
46 /** Get a list of methods supported by the library */
47 static std::vector<std::string> available_methods();
48
49protected:
50 /** Handle from the library */
52
53private:
54 /** The method name */
55 std::string m_method_name;
56 /** The parameters set */
57 std::string m_parameters;
58};
59
60static_assert(std::is_same_v<fcs_int, int>,
61 "ScaFaCoS must be compiled with fcs_int = int");
62static_assert(std::is_same_v<fcs_float, double>,
63 "ScaFaCoS must be compiled with fcs_float = double");
64
65} // namespace Scafacos
66#endif
std::string get_method() const
Get active method name.
Definition Scafacos.hpp:40
FCS m_handle
Handle from the library.
Definition Scafacos.hpp:51
std::string get_parameters() const
Get the parameters from the library.
Definition Scafacos.hpp:38