|
| 1 | +// system includes |
| 2 | +#include <pybind11/pybind11.h> |
| 3 | +#include <pybind11/stl.h> |
| 4 | + |
| 5 | +// local includes |
| 6 | +#include "ACEtk/block/PhotoatomicElectronBremsstrahlungBlock.hpp" |
| 7 | +#include "views.hpp" |
| 8 | +#include "definitions.hpp" |
| 9 | + |
| 10 | +// namespace aliases |
| 11 | +namespace python = pybind11; |
| 12 | + |
| 13 | +namespace block { |
| 14 | + |
| 15 | +void wrapPhotoatomicElectronBremsstrahlungBlock( python::module& module, python::module& ) { |
| 16 | + |
| 17 | + // type aliases |
| 18 | + using Block = njoy::ACEtk::block::PhotoatomicElectronBremsstrahlungBlock; |
| 19 | + |
| 20 | + // wrap views created by this block |
| 21 | + |
| 22 | + // create the block |
| 23 | + python::class_< Block > block( |
| 24 | + |
| 25 | + module, |
| 26 | + "PhotoatomicElectronBremsstrahlungBlock", |
| 27 | + "The photoatomic BREML block with the average electron energy after Bremsstrahlung\n\n" |
| 28 | + "This block is part of the eprdata formats.\n\n" |
| 29 | + "The PhotoatomicElectronBremsstrahlungBlock class contains 2 arrays of the same\n" |
| 30 | + "length:\n" |
| 31 | + " - the energy points\n" |
| 32 | + " - the average energy remaining after Bremsstrahlung\n\n" |
| 33 | + "The size NBL of each (the total number of energy points) is stored in NXS(12)." |
| 34 | + ); |
| 35 | + |
| 36 | + // wrap the block |
| 37 | + block |
| 38 | + .def( |
| 39 | + |
| 40 | + python::init< std::vector< double >, std::vector< double > >(), |
| 41 | + python::arg( "energies" ), python::arg( "remaining" ), |
| 42 | + "Initialise the block\n\n" |
| 43 | + "Arguments:\n" |
| 44 | + " self the block\n" |
| 45 | + " energies the energy values\n" |
| 46 | + " remaining the average energy remaining after Bremsstrahlung" |
| 47 | + ) |
| 48 | + .def_property_readonly( |
| 49 | + |
| 50 | + "NBL", |
| 51 | + &Block::NBL, |
| 52 | + "The number of energy points" |
| 53 | + ) |
| 54 | + .def_property_readonly( |
| 55 | + |
| 56 | + "number_energy_points", |
| 57 | + &Block::numberEnergyPoints, |
| 58 | + "The number of energy points" |
| 59 | + ) |
| 60 | + .def_property_readonly( |
| 61 | + |
| 62 | + "energies", |
| 63 | + [] ( const Block& self ) -> DoubleRange |
| 64 | + { return self.energies(); }, |
| 65 | + "The energy values" |
| 66 | + ) |
| 67 | + .def_property_readonly( |
| 68 | + |
| 69 | + "energy_after_bremsstrahlung", |
| 70 | + [] ( const Block& self ) -> DoubleRange |
| 71 | + { return self.energyAfterBremsstrahlung(); }, |
| 72 | + "The average energy remaining after Bremsstrahlung" |
| 73 | + ); |
| 74 | + |
| 75 | + // add standard block definitions |
| 76 | + addStandardBlockDefinitions< Block >( block ); |
| 77 | +} |
| 78 | + |
| 79 | +} // block namespace |
0 commit comments