ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
script_interface/reaction_methods/ReactionEnsemble.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2021-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 SCRIPT_INTERFACE_REACTION_METHODS_REACTION_ENSEMBLE_HPP
21
#define SCRIPT_INTERFACE_REACTION_METHODS_REACTION_ENSEMBLE_HPP
22
23
#include "
ReactionAlgorithm.hpp
"
24
25
#include "
script_interface/ScriptInterface.hpp
"
26
27
#include "
core/reaction_methods/ReactionAlgorithm.hpp
"
28
#include "
core/reaction_methods/ReactionEnsemble.hpp
"
29
30
#include <memory>
31
#include <unordered_map>
32
33
namespace
ScriptInterface
{
34
namespace
ReactionMethods
{
35
36
class
ReactionEnsemble
:
public
ReactionAlgorithm
{
37
public
:
38
std::shared_ptr<::ReactionMethods::ReactionAlgorithm>
RE
()
override
{
39
return
m_re;
40
}
41
std::shared_ptr<::ReactionMethods::ReactionAlgorithm>
const
42
RE
()
const override
{
43
return
m_re;
44
}
45
46
void
do_construct
(
VariantMap
const
&
params
)
override
{
47
context
()->
parallel_try_catch
([&]() {
48
m_re = std::make_shared<::ReactionMethods::ReactionEnsemble>(
49
context
()->get_comm(),
get_value<int>
(
params
,
"seed"
),
50
get_value<double>
(
params
,
"kT"
),
51
get_value<double>
(
params
,
"exclusion_range"
),
52
get_value_or
<std::unordered_map<int, double>>(
53
params
,
"exclusion_radius_per_type"
, {}));
54
});
55
do_set_parameter
(
"search_algorithm"
,
56
Variant
{
get_value_or<std::string>
(
57
params
,
"search_algorithm"
,
"order_n"
)});
58
}
59
60
private
:
61
std::shared_ptr<::ReactionMethods::ReactionEnsemble> m_re;
62
};
63
}
/* namespace ReactionMethods */
64
}
/* namespace ScriptInterface */
65
66
#endif
ScriptInterface.hpp
ScriptInterface::AutoParameters< ReactionAlgorithm >::do_set_parameter
void do_set_parameter(const std::string &name, const Variant &value) final
Definition
AutoParameters.hpp:154
ScriptInterface::Context::parallel_try_catch
virtual void parallel_try_catch(std::function< void()> const &cb) const =0
ScriptInterface::ObjectHandle::context
Context * context() const
Responsible context.
Definition
ObjectHandle.hpp:57
ScriptInterface::ReactionMethods::ReactionAlgorithm
Definition
script_interface/reaction_methods/ReactionAlgorithm.hpp:40
ScriptInterface::ReactionMethods::ReactionEnsemble
Definition
script_interface/reaction_methods/ReactionEnsemble.hpp:36
ScriptInterface::ReactionMethods::ReactionEnsemble::do_construct
void do_construct(VariantMap const ¶ms) override
Definition
script_interface/reaction_methods/ReactionEnsemble.hpp:46
ScriptInterface::ReactionMethods::ReactionEnsemble::RE
std::shared_ptr<::ReactionMethods::ReactionAlgorithm > RE() override
Definition
script_interface/reaction_methods/ReactionEnsemble.hpp:38
ScriptInterface::ReactionMethods::ReactionEnsemble::RE
std::shared_ptr<::ReactionMethods::ReactionAlgorithm > const RE() const override
Definition
script_interface/reaction_methods/ReactionEnsemble.hpp:42
stream
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Definition
common_cuda.cu:34
ReactionAlgorithm.hpp
ReactionEnsemble.hpp
ReactionMethods
Definition
core/reaction_methods/ConstantpHEnsemble.hpp:26
ScriptInterface
Definition
script_interface/accumulators/AccumulatorBase.hpp:33
ScriptInterface::VariantMap
std::unordered_map< std::string, Variant > VariantMap
Definition
Variant.hpp:133
ScriptInterface::get_value_or
T get_value_or(VariantMap const &vals, std::string const &name, T const &default_)
Get a value from a VariantMap by name, or return a default value if it does not exist.
Definition
get_value.hpp:420
ReactionAlgorithm.hpp
params
static SteepestDescentParameters params
Currently active steepest descent instance.
Definition
steepest_descent.cpp:44
ScriptInterface::impl::recursive_variant
Recursive variant implementation.
Definition
Variant.hpp:84
src
script_interface
reaction_methods
ReactionEnsemble.hpp
Generated on Mon Dec 8 2025 02:32:30 for ESPResSo by
1.9.8