Skip to content

Commit d388664

Browse files
committed
Adding the angular distribution table for electrons
1 parent f63f98e commit d388664

4 files changed

Lines changed: 85 additions & 5 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ if(ACEtk.python)
167167
python/src/block/PhotoelectricCrossSectionBlock.python.cpp
168168
python/src/block/PhotoatomicSubshellTransitionData.python.cpp
169169
python/src/block/PhotoatomicSubshellTransitionDataBlock.python.cpp
170+
python/src/block/ElectronTabulatedAngularDistribution.python.cpp
170171
python/src/ContinuousEnergyTable.python.cpp
171172
python/src/DosimetryTable.python.cpp
172173
python/src/ThermalScatteringTable.python.cpp

‎python/src/ACEtk.python.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ namespace block {
6868
void wrapThermalScatteringDiscreteCosinesWithProbability( python::module&, python::module& );
6969
void wrapPhotoatomicComptonProfile( python::module&, python::module& );
7070
void wrapPhotoatomicSubshellTransitionData( python::module&, python::module& );
71+
void wrapElectronTabulatedAngularDistribution( python::module&, python::module& );
7172

7273
// declarations - ACE table blocks
7374
void wrapPrincipalCrossSectionBlock( python::module&, python::module& );
@@ -203,6 +204,7 @@ PYBIND11_MODULE( ACEtk, module ) {
203204
block::wrapThermalScatteringDiscreteCosinesWithProbability( module, viewmodule );
204205
block::wrapPhotoatomicComptonProfile( module, viewmodule );
205206
block::wrapPhotoatomicSubshellTransitionData( module, viewmodule );
207+
block::wrapElectronTabulatedAngularDistribution( module, viewmodule );
206208

207209
// wrap ACE table blocks
208210
block::wrapPrincipalCrossSectionBlock( module, viewmodule );
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// system includes
2+
#include <pybind11/pybind11.h>
3+
#include <pybind11/stl.h>
4+
5+
// local includes
6+
#include "ACEtk/block/ElectronTabulatedAngularDistribution.hpp"
7+
#include "views.hpp"
8+
#include "definitions.hpp"
9+
10+
// namespace aliases
11+
namespace python = pybind11;
12+
13+
namespace block {
14+
15+
void wrapElectronTabulatedAngularDistribution( python::module& module, python::module& ) {
16+
17+
// type aliases
18+
using Block = njoy::ACEtk::block::ElectronTabulatedAngularDistribution;
19+
20+
// wrap views created by this block
21+
22+
// create the block
23+
python::class_< Block > block(
24+
25+
module,
26+
"ElectronTabulatedAngularDistribution",
27+
"Tabulated electron angular distribution data for a single incident energy\n\n"
28+
"The ElectronTabulatedAngularDistribution class contains the cumulative\n"
29+
"density function (CDF) as a function of cosine for the given incident\n"
30+
"energy. It is used in the ELAS block."
31+
);
32+
33+
// wrap the block
34+
block
35+
.def(
36+
37+
python::init< double, std::vector< double >, std::vector< double > >(),
38+
python::arg( "energy" ), python::arg( "cosines" ), python::arg( "cdf" ),
39+
"Initialise the block\n\n"
40+
"Arguments:\n"
41+
" self the block\n"
42+
" energy the associated incident energy value\n"
43+
" cosines the cosine values\n"
44+
" cdf the cdf values"
45+
)
46+
.def_property_readonly(
47+
48+
"energy",
49+
&Block::energy,
50+
"The associated incident energy value"
51+
)
52+
.def_property_readonly(
53+
54+
"number_cosines",
55+
&Block::numberCosines,
56+
"The number of cosine values"
57+
)
58+
.def_property_readonly(
59+
60+
"cosines",
61+
[] ( const Block& self ) -> DoubleRange
62+
{ return self.cosines(); },
63+
"The cosine values"
64+
)
65+
.def_property_readonly(
66+
67+
"cdf",
68+
[] ( const Block& self ) -> DoubleRange
69+
{ return self.cdf(); },
70+
"The cdf values"
71+
);
72+
73+
// add standard block definitions
74+
addStandardBlockDefinitions< Block >( block );
75+
}
76+
77+
} // block namespace

‎src/ACEtk/block/ElectronTabulatedAngularDistribution.hpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ namespace block {
1212

1313
/**
1414
* @class
15-
* @brief Tabulated angular distribution data for a single incident or outgoing
15+
* @brief Tabulated electron angular distribution data for a single incident
1616
* energy
1717
*
18-
* The TabulatedAngularDistribution class contains the probability density
19-
* function (PDF) and cumulative density function (CDF) as a function of
20-
* cosine for the given energy. It is used in the AND block.
18+
* The ElectronTabulatedAngularDistribution class contains the cumulative
19+
* density function (CDF) as a function of cosine for the given incident
20+
* energy. It is used in the ELAS block.
2121
*/
2222
class ElectronTabulatedAngularDistribution : protected details::ArrayData {
2323

@@ -32,7 +32,7 @@ class ElectronTabulatedAngularDistribution : protected details::ArrayData {
3232
#include "ACEtk/block/ElectronTabulatedAngularDistribution/src/ctor.hpp"
3333

3434
/**
35-
* @brief Return the associated energy value
35+
* @brief Return the associated incident energy value
3636
*/
3737
double energy() const { return this->energy_; }
3838

0 commit comments

Comments
 (0)