Repository navigation
Expand file tree
/
Copy pathTabulatedAngularDistributionWithProbability.python.cpp
More file actions
111 lines (91 loc) · 3.13 KB
/
Copy pathTabulatedAngularDistributionWithProbability.python.cpp
File metadata and controls
111 lines (91 loc) · 3.13 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
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/TabulatedAngularDistributionWithProbability.hpp"
#include "tools/views/views-python.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapTabulatedAngularDistributionWithProbability( python::module& module,
python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::TabulatedAngularDistributionWithProbability;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"TabulatedAngularDistributionWithProbability",
"Tabulated angular distribution data for a single incident or outgoing energy\n"
"The TabulatedAngularDistributionWithProbability class contains the probability\n"
"density function (PDF) and cumulative density function (CDF) as a function of\n"
"cosine for the given energy and associated probability and cumulative probability.\n"
"It is used in the OutgoingEnergyAngleDistributionData (ACE LAW 61) in the DLW block."
);
// wrap the block
block
.def(
python::init< double, double, double, int,
std::vector< double >, std::vector< double >,
std::vector< double > >(),
python::arg( "energy" ), python::arg( "probability" ),
python::arg( "cumulative" ), python::arg( "interpolation" ),
python::arg( "cosines" ), python::arg( "pdf" ), python::arg( "cdf" ),
"Initialise the block\n\n"
"Arguments:\n"
" self the block\n"
" energy the associated energy value\n"
" probability the associated probability value\n"
" cumulative the associated cumulative probability value\n"
" cosines the cosine values\n"
" pdf the pdf values\n"
" cdf the cdf values"
)
.def_property_readonly(
"energy",
[] ( const Block& self ) { return self.energy(); },
"The associated energy value"
)
.def_property_readonly(
"probability",
&Block::probability,
"The associated probability value"
)
.def_property_readonly(
"cumulative_probability",
&Block::cumulativeProbability,
"The associated cumulative probability value"
)
.def_property_readonly(
"interpolation",
[] ( const Block& self ) { return self.interpolation(); },
"The interpolation flag"
)
.def_property_readonly(
"number_cosines",
[] ( const Block& self ) { return self.numberCosines(); },
"The number of cosine values"
)
.def_property_readonly(
"cosines",
[] ( const Block& self ) -> DoubleRange
{ return self.cosines(); },
"The cosine 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