ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
script_interface/observables/RDF.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
#ifndef SCRIPT_INTERFACE_RDF_HPP
23
#define SCRIPT_INTERFACE_RDF_HPP
24
25
#include "
script_interface/auto_parameters/AutoParameters.hpp
"
26
#include "
script_interface/observables/Observable.hpp
"
27
28
#include "
core/observables/RDF.hpp
"
29
30
#include <memory>
31
#include <vector>
32
33
namespace
ScriptInterface
{
34
namespace
Observables
{
35
36
class
RDF
:
public
AutoParameters
<RDF, Observable> {
37
38
public
:
39
RDF
() {
40
this->
add_parameters
(
41
{{
"ids1"
,
AutoParameter::read_only
,
42
[
this
]() {
return
rdf_observable
()->ids1(); }},
43
{
"ids2"
,
AutoParameter::read_only
,
44
[
this
]() {
return
rdf_observable
()->ids2(); }},
45
{
"n_r_bins"
,
AutoParameter::read_only
,
46
[
this
]() {
return
static_cast<
int
>
(
rdf_observable
()->n_r_bins); }},
47
{
"min_r"
,
AutoParameter::read_only
,
48
[
this
]() {
return
rdf_observable
()->min_r; }},
49
{
"max_r"
,
AutoParameter::read_only
,
50
[
this
]() {
return
rdf_observable
()->max_r; }}});
51
}
52
53
void
do_construct
(
VariantMap
const
&
params
)
override
{
54
context()->parallel_try_catch([&]() {
55
m_observable =
56
make_shared_from_args<::Observables::RDF, std::vector<int>,
57
std::vector<int>, int, double,
double
>(
58
params
,
"ids1"
,
"ids2"
,
"n_r_bins"
,
"min_r"
,
"max_r"
);
59
});
60
}
61
62
std::shared_ptr<::Observables::RDF>
rdf_observable
()
const
{
63
return
m_observable;
64
}
65
66
std::shared_ptr<::Observables::Observable>
observable
()
const override
{
67
return
m_observable;
68
}
69
70
private
:
71
std::shared_ptr<::Observables::RDF> m_observable;
72
};
73
74
}
/* namespace Observables */
75
}
/* namespace ScriptInterface */
76
77
#endif
AutoParameters.hpp
ScriptInterface::AutoParameters
Bind parameters in the script interface.
Definition
AutoParameters.hpp:93
ScriptInterface::AutoParameters< RDF, Observable >::add_parameters
void add_parameters(std::vector< AutoParameter > &¶ms)
Definition
AutoParameters.hpp:115
ScriptInterface::Observables::RDF
Definition
script_interface/observables/RDF.hpp:36
ScriptInterface::Observables::RDF::rdf_observable
std::shared_ptr<::Observables::RDF > rdf_observable() const
Definition
script_interface/observables/RDF.hpp:62
ScriptInterface::Observables::RDF::observable
std::shared_ptr<::Observables::Observable > observable() const override
Definition
script_interface/observables/RDF.hpp:66
ScriptInterface::Observables::RDF::RDF
RDF()
Definition
script_interface/observables/RDF.hpp:39
ScriptInterface::Observables::RDF::do_construct
void do_construct(VariantMap const ¶ms) override
Definition
script_interface/observables/RDF.hpp:53
RDF.hpp
Observables
Definition
BondAngles.hpp:36
ScriptInterface
Definition
script_interface/accumulators/AccumulatorBase.hpp:33
ScriptInterface::VariantMap
std::unordered_map< std::string, Variant > VariantMap
Definition
Variant.hpp:69
Observable.hpp
params
static SteepestDescentParameters params
Currently active steepest descent instance.
Definition
steepest_descent.cpp:44
ScriptInterface::AutoParameter::read_only
static constexpr const ReadOnly read_only
Definition
AutoParameter.hpp:42
src
script_interface
observables
RDF.hpp
Generated on Thu Dec 19 2024 02:13:16 for ESPResSo by
1.9.8