Repository navigation
Expand file tree
/
Copy pathNBodyPhaseSpaceDistribution.python.cpp
More file actions
141 lines (116 loc) · 3.53 KB
/
Copy pathNBodyPhaseSpaceDistribution.python.cpp
File metadata and controls
141 lines (116 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/NBodyPhaseSpaceDistribution.hpp"
#include "tools/views/views-python.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapNBodyPhaseSpaceDistribution( python::module& module, python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::NBodyPhaseSpaceDistribution;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"NBodyPhaseSpaceDistribution",
"The energy distribution uses the N-body phase space formalism\n\n"
"The NBodyPhaseSpaceDistribution class contains two parameter values that\n"
"determine the distribution: the number of particles in the system and the\n"
"total mass ratio. It is used in the DLW block as ACE LAW 66."
);
// wrap the block
block
.def(
python::init< double, double, unsigned int, double, unsigned int,
std::vector< double >, std::vector< double >,
std::vector< double > >(),
python::arg( "emin" ), python::arg( "emax" ),
python::arg( "npsx" ), python::arg( "ap" ), python::arg( "interpolation" ),
python::arg( "values" ), python::arg( "pdf" ), python::arg( "cdf" ),
"Initialise the block\n\n"
"Arguments:\n"
" self the block\n"
" emin the minimum energy for the distribution\n"
" emax the maximum energy for the distribution\n"
" npsx the number of particles in the system\n"
" ap the total mass ratio\n"
" interpolation the interpolation flag\n"
" values the xi values\n"
" pdf the pdf values\n"
" cdf the cdf values"
)
.def_property_readonly(
"LAW",
[] ( const Block& self ) { return self.LAW(); },
"The distribution type"
)
.def_property_readonly(
"type",
[] ( const Block& self ) { return self.type(); },
"The distribution type"
)
.def_property_readonly(
"minimum_incident_energy",
&Block::minimumIncidentEnergy,
"The minimum incident energy for the distribution"
)
.def_property_readonly(
"maximum_incident_energy",
&Block::maximumIncidentEnergy,
"The maximum incident energy for the distribution"
)
.def_property_readonly(
"NPSX",
&Block::NPSX,
"The number of particles in the system"
)
.def_property_readonly(
"number_particles",
&Block::numberParticles,
"The number of particles in the system"
)
.def_property_readonly(
"AP",
&Block::AP,
"The total mass ratio"
)
.def_property_readonly(
"total_mass_ratio",
&Block::totalMassRatio,
"The total mass ratio"
)
.def_property_readonly(
"interpolation",
&Block::interpolation,
"The interpolation flag"
)
.def_property_readonly(
"number_values",
&Block::numberValues,
"The number of values"
)
.def_property_readonly(
"values",
[] ( const Block& self ) -> DoubleRange
{ return self.values(); },
"The normalised energy values"
)
.def_property_readonly(
"pdf",
[] ( const Block& self ) -> DoubleRange
{ return self.pdf(); },
"The pdf values"
)
.def_property_readonly(
"cdf",
[] ( const Block& self ) -> DoubleRange
{ return self.cdf(); },
"The cdf values"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace