Repository navigation
Expand file tree
/
Copy pathDelayedNeutronPrecursorBlock.python.cpp
More file actions
76 lines (60 loc) · 1.85 KB
/
Copy pathDelayedNeutronPrecursorBlock.python.cpp
File metadata and controls
76 lines (60 loc) · 1.85 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
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/DelayedNeutronPrecursorBlock.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapDelayedNeutronPrecursorBlock( python::module& module, python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::DelayedNeutronPrecursorBlock;
using DelayedNeutronPrecursorData = njoy::ACEtk::continuous::DelayedNeutronPrecursorData;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"DelayedNeutronPrecursorBlock",
"The continuous energy BDD block with the delayed neutron precursor data\n\n"
"The number of precursor groups is stored in NXS(8)."
);
// wrap the block
block
.def(
python::init< std::vector< DelayedNeutronPrecursorData > >(),
python::arg( "groups" ),
"Initialise the block\n\n"
"Arguments:\n"
" self the block\n"
" groups the cross section data"
)
.def_property_readonly(
"NPCR",
&Block::NPCR,
"The number of delayed neutron precursor groups"
)
.def_property_readonly(
"number_delayed_precursors",
&Block::numberDelayedPrecursors,
"The number of delayed neutron precursor groups"
)
.def_property_readonly(
"data",
&Block::data,
"The delayed neutron precursor data"
)
.def(
"precursor_group_data",
&Block::precursorGroupData,
python::arg( "index" ),
"Return the precursor data for a group index\n\n"
"When the index is out of range an out of range exception is thrown\n"
"(debug mode only).\n\n"
" self the block\n"
" index the index (one-based)"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace