Repository navigation
Expand file tree
/
Copy pathSecondaryParticleProductionBlock.python.cpp
More file actions
75 lines (59 loc) · 1.84 KB
/
Copy pathSecondaryParticleProductionBlock.python.cpp
File metadata and controls
75 lines (59 loc) · 1.84 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
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/SecondaryParticleProductionBlock.hpp"
#include "tools/views/views-python.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapSecondaryParticleProductionBlock( python::module& module,
python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::SecondaryParticleProductionBlock;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"SecondaryParticleProductionBlock",
"Total production cross section and heating numbers for a secondary particle"
);
// wrap the block
block
.def(
python::init< std::size_t, std::vector< double >, std::vector< double > >(),
python::arg( "index" ), python::arg( "production" ), python::arg( "heating" ),
"Initialise the block\n\n"
"Arguments:\n"
" self the block\n"
" index the energy index\n"
" production the total production cross section values"
" heating the heating numbers"
)
.def_property_readonly(
"energy_index",
&Block::energyIndex,
"The energy index"
)
.def_property_readonly(
"number_values",
&Block::numberValues,
"The number of cross section values"
)
.def_property_readonly(
"total_production",
[] ( const Block& self ) -> DoubleRange
{ return self.totalProduction(); },
"The total poduction cross section values"
)
.def_property_readonly(
"heating",
[] ( const Block& self ) -> DoubleRange
{ return self.heating(); },
"The heating numbers"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace