Repository navigation
Expand file tree
/
Copy pathEnergyDependentWattSpectrum.python.cpp
More file actions
100 lines (80 loc) · 2.4 KB
/
Copy pathEnergyDependentWattSpectrum.python.cpp
File metadata and controls
100 lines (80 loc) · 2.4 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
// system includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
// local includes
#include "ACEtk/continuous/EnergyDependentWattSpectrum.hpp"
#include "definitions.hpp"
// namespace aliases
namespace python = pybind11;
namespace continuous {
void wrapEnergyDependentWattSpectrum( python::module& module, python::module& ) {
// type aliases
using Block = njoy::ACEtk::continuous::EnergyDependentWattSpectrum;
using ParameterData = njoy::ACEtk::continuous::ParameterData;
// wrap views created by this block
// create the block
python::class_< Block > block(
module,
"EnergyDependentWattSpectrum",
"An energy dependent Watt spectrum\n\n"
"The EnergyDependentWattSpectrum class contains the tabulated values for the\n"
"energy dependent a and b parameters as well as the restriction energy U used\n"
"to describe the Watt spectrum. It is used in the DLW block as ACE LAW 11."
);
// wrap the block
block
.def(
python::init( [] ( ParameterData a, ParameterData b, double energy )
{ return Block( std::move( a ), std::move( b ), energy ); } ),
python::arg( "a" ), python::arg( "b" ), python::arg( "energy" ),
"Initialise the block\n\n"
"Arguments:\n"
" self the block\n"
" a the data for parameter a\n"
" b the data for parameter b\n"
" energy the restriction energy"
)
.def_property_readonly(
"LAW",
[] ( const Block& self ) { return self.LAW(); },
"The distribution type"
)
.def_property_readonly(
"type",
[] ( const Block& self ) { return self.type(); },
"The distribution type"
)
.def_property_readonly(
"a",
&Block::a,
"The data for parameter a"
)
.def_property_readonly(
"b",
&Block::b,
"The data for parameter b"
)
.def_property_readonly(
"minimum_incident_energy",
&Block::minimumIncidentEnergy,
"The minimum incident energy for the distribution"
)
.def_property_readonly(
"maximum_incident_energy",
&Block::maximumIncidentEnergy,
"The maximum incident energy for the distribution"
)
.def_property_readonly(
"U",
&Block::U,
"The restriction energy"
)
.def_property_readonly(
"restriction_energy",
&Block::restrictionEnergy,
"The restriction energy"
);
// add standard block definitions
addStandardBlockDefinitions< Block >( block );
}
} // continuous namespace