Repository navigation
Expand file tree
/
Copy pathFrameAndMultiplicityBlock.python.cpp
More file actions
106 lines (88 loc) · 2.75 KB
/
Copy pathFrameAndMultiplicityBlock.python.cpp
File metadata and controls
106 lines (88 loc) · 2.75 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
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/FrameAndMultiplicityBlock.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapFrameAndMultiplicityBlock( python::module& module,
python::module& viewmodule ) {
// type aliases
using Block = njoy::ACEtk::continuous::FrameAndMultiplicityBlock;
using ReferenceFrame = njoy::ACEtk::ReferenceFrame;
using ReferenceFrameRange = BasicRandomAccessAnyView< ReferenceFrame >;
// create the block
python::class_< Block > block(
module,
"FrameAndMultiplicityBlock",
"The continuous energy TYR block with the outgoing projectile multiplicities\n"
"and reference frames\n\n"
"The FrameAndMultiplicityBlock class contains the reference frame and\n"
"outgoing projectile multiplicity. The order of this data is the same as\n"
"the order of the reaction numbers in the MTR block.\n\n"
"The number of available reactions (excluding elastic) is stored in NXS(4).\n"
);
// wrap the block
block
.def(
python::init< std::vector< ReferenceFrame >,
std::vector< unsigned int > >(),
python::arg( "frames" ), python::arg( "multiplicities" ),
"Initialise the TYR block\n\n"
"Arguments:\n"
" self the block\n"
" frames the reference frames\n"
" multiplicities the multiplicities"
)
.def(
python::init< std::vector< ReferenceFrame > >(),
python::arg( "frames" ),
"Initialise the TYRH block\n\n"
"Arguments:\n"
" self the block\n"
" frames the reference frames"
)
.def_property_readonly(
"NTR",
&Block::NTR,
"The number of available reactions (excluding elastic)"
)
.def_property_readonly(
"number_reactions",
&Block::numberReactions,
"The number of available reactions (excluding elastic)"
)
.def(
"reference_frame",
&Block::referenceFrame,
python::arg( "index" ),
"The reference frame for a reaction index\n\n"
"Arguments:\n"
" self the block\n"
" index the index (one-based)"
)
.def(
"multiplicity",
&Block::multiplicity,
python::arg( "index" ),
"The multiplicity for a reaction index\n\n"
"Arguments:\n"
" self the block\n"
" index the index (one-based)"
)
.def_property_readonly(
"reference_frames",
&Block::referenceFrames,
"The reference frames"
)
.def_property_readonly(
"multiplicities",
&Block::multiplicities,
"The reference frames"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace