Repository navigation
Expand file tree
/
Copy pathReactionQValueBlock.python.cpp
More file actions
79 lines (63 loc) · 1.91 KB
/
Copy pathReactionQValueBlock.python.cpp
File metadata and controls
79 lines (63 loc) · 1.91 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
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/ReactionQValueBlock.hpp"
#include "tools/views/views-python.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapReactionQValueBlock( python::module& module, python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::ReactionQValueBlock;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"ReactionQValueBlock",
"The continuous energy LQR block with the reaction Q values\n\n"
"The ReactionQValueBlock class contains the reaction Q values for all\n"
"available reactions (excluding elastic). The order of these Q values\n"
"is the same as the order of the reaction numbers in the MTR block.\n\n"
"The number of available reactions (excluding elastic) is stored in NXS(4)."
);
// wrap the block
block
.def(
python::init< std::vector< double > >(),
python::arg( "qvalues" ),
"Initialise the block\n\n"
"Arguments:\n"
" self the block\n"
" qvalues the Q values"
)
.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(
"q_value",
&Block::QValue,
python::arg( "index" ),
"The reaction Q value for a reaction index\n\n"
"Arguments:\n"
" self the block\n"
" index the index (one-based)"
)
.def_property_readonly(
"q_values",
[] ( const Block& self ) -> DoubleRange
{ return self.QValues(); },
"The reaction Q values"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace