|
| 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 |
0 commit comments