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
ScafacosContextBase.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010-2022 The ESPResSo project
3 * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
4 * Max-Planck-Institute for Polymer Research, Theory Group
5 *
6 * This file is part of ESPResSo.
7 *
8 * ESPResSo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * ESPResSo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22/**
23 * @file
24 * @ref ScafacosContextBase provides the public interface
25 * of the ScaFaCoS bridge. It relies on type erasure to hide the
26 * ScaFaCoS implementation details from the ESPResSo core. It is
27 * implemented by @ref ScafacosContext.
28 */
29
30#pragma once
31
32#include "config/config.hpp"
33
34#if defined(SCAFACOS) or defined(SCAFACOS_DIPOLAR)
35
36#include <utils/Vector.hpp>
37
38#include <string>
39#include <vector>
40
41/**
42 * @brief Public interface to the ScaFaCoS context.
43 * Implementations of this class will store particle positions and
44 * charges/dipoles in flat arrays, as required by ScaFaCoS, as well
45 * as the output arrays.
46 */
49 virtual ~ScafacosContextBase() = default;
50 /** @brief Collect particle data in continuous arrays. */
51 virtual void update_particle_data() = 0;
52 /** @brief Write forces back to particles. */
53 virtual void update_particle_forces() const = 0;
54 /** @brief Calculate long-range part of the energy. */
55 virtual double long_range_energy() = 0;
56 /** @brief Add long-range part of the forces to particles. */
57 virtual void add_long_range_forces() = 0;
58 /** @brief Reinitialize number of particles, box shape and periodicity. */
59 virtual void update_system_params() = 0;
60 virtual std::string get_method() const = 0;
61 virtual std::string get_parameters() const = 0;
62 virtual void sanity_checks() const = 0;
63
64 static std::vector<std::string> available_methods();
65 static void sanity_check_method(std::string const &method_name);
66};
67
68#endif // SCAFACOS or SCAFACOS_DIPOLAR
Vector implementation and trait types for boost qvm interoperability.
This file contains the defaults for ESPResSo.
Public interface to the ScaFaCoS context.
ScafacosContextBase()=default
static std::vector< std::string > available_methods()
virtual void add_long_range_forces()=0
Add long-range part of the forces to particles.
virtual ~ScafacosContextBase()=default
static void sanity_check_method(std::string const &method_name)
virtual double long_range_energy()=0
Calculate long-range part of the energy.
virtual void update_system_params()=0
Reinitialize number of particles, box shape and periodicity.
virtual void sanity_checks() const =0
virtual void update_particle_forces() const =0
Write forces back to particles.
virtual std::string get_parameters() const =0
virtual void update_particle_data()=0
Collect particle data in continuous arrays.
virtual std::string get_method() const =0