Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GENDF -- 8 months later #119

Open
wants to merge 63 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c509240
Added the MF9 section, updated code for file 9
whaeck Feb 17, 2021
75b23d1
Added MF9 python bindings
whaeck Feb 17, 2021
1e2294a
Bound MF9 in darkness
whaeck Feb 18, 2021
ae6f914
Started Base for GENDF section and added GENDF DataRecord.
nathangibson14 Feb 18, 2021
dd08c56
Added MF10 coding
whaeck Feb 18, 2021
3364cf1
Small updates to MF9
whaeck Feb 18, 2021
35e6f9f
Added DataRecords to SectionBase.
nathangibson14 Feb 18, 2021
a240345
Added documentation.
nathangibson14 Feb 18, 2021
64a196a
MF10 has been bound in darkness
whaeck Feb 18, 2021
531d351
Renamed MF9 Multiplicity to ReactionProduct
whaeck Feb 18, 2021
4aaacc6
Added CrossSection as a GENDF section.
nathangibson14 Feb 18, 2021
9e851ed
Replaced the MF9 and MF10 subsection by ReactionProduct subsections, …
whaeck Feb 18, 2021
3032650
Added some missing documentation.
nathangibson14 Feb 19, 2021
88ddfa7
Updates after Wim's comments.
nathangibson14 Feb 19, 2021
932e8de
Trying to debug SegFault on ENDFtk.gendf.CrossSection.test.
nathangibson14 Feb 20, 2021
4c8873c
Fixed that SegFault.
nathangibson14 Feb 20, 2021
53a8f6e
Added FissionYielData and FissionProduct, main components of MF8 MT45…
whaeck Feb 23, 2021
d9350a5
Added python bindings for FissionYieldData
whaeck Feb 23, 2021
143c412
Some updates to the previous components
whaeck Feb 23, 2021
1966aed
More changes to the interface
whaeck Feb 23, 2021
5262e3e
Finished MF8 MT454
whaeck Feb 24, 2021
bca97e8
Bound MF8 MT454 in darkness
whaeck Feb 27, 2021
6d84121
MF8 MT459 has been bound in darkness
whaeck Feb 27, 2021
2ffff73
Added the LI flag for fully isotropic angular distributions to MF4 co…
whaeck Feb 27, 2021
6cd2452
Added Isotropic angular distributions
whaeck Mar 15, 2021
2ebe1e3
Added the isotropic angular distribution for a discrete photon
whaeck Mar 15, 2021
cccab26
Added Legendre and tabulated angular distribution components
whaeck Mar 15, 2021
6009ed3
Added Legendre angular distributions for a specific discrete photon
whaeck Mar 16, 2021
04c97b9
Saving work
whaeck Mar 17, 2021
4a59dd5
Finished coding MF14, on to testing
whaeck Mar 17, 2021
2686f29
Almost done ...
whaeck Mar 17, 2021
9f0b9e4
Forgot to update some tests following interface changes
whaeck Mar 17, 2021
ea44ab4
Updated MF14 coding, works now, still needs MF14 section test
whaeck Mar 18, 2021
0459e2d
Bound MF14 in darkness
whaeck Mar 22, 2021
54b2176
Update to latest develop
whaeck Mar 31, 2021
bd736a0
Update to latest develop
whaeck Mar 31, 2021
ecd8570
Update to latest develop
whaeck Mar 31, 2021
ba5aef7
Update to latest develop
whaeck Mar 31, 2021
96681dc
Started work on MF15
whaeck Mar 31, 2021
040714f
Added PartialDistribution to MF15
whaeck Apr 6, 2021
8478722
Finished C++ side of MF15
whaeck Apr 6, 2021
134a45b
Started binding MF15
whaeck Apr 6, 2021
8948bb2
Merged MF8 branch
whaeck Apr 6, 2021
4790ba3
Merged MF10 branch
whaeck Apr 6, 2021
915a054
Forgot to put MF14 object back in variant.
whaeck Apr 6, 2021
37118f4
Merged MF14 branch
whaeck Apr 6, 2021
1b604b4
MF15 was bound in darkness
whaeck Apr 6, 2021
4b0f6fc
Updated basic ENDF record interfaces to range-v3 0.11.0
whaeck Apr 7, 2021
3c44cd8
Updated MF1 sections
whaeck Apr 7, 2021
93cbe24
Updated MF1
whaeck Apr 7, 2021
66505a6
Updated MF2 sections
whaeck Apr 7, 2021
f6a6d09
Updated MF7 sections
whaeck Apr 7, 2021
7595d0d
Updated MF9 and MF10 sections
whaeck Apr 7, 2021
c4770a7
Updated MF3, MF4 and MF5 sections
whaeck Apr 7, 2021
2163335
Updated MF12, MF13, MF14 and MF15
whaeck Apr 7, 2021
4136d55
Updated MF8 sections
whaeck Apr 7, 2021
a9c43ff
Updated MF6 section, the ENDFtk tree and Material and Tape
whaeck Apr 7, 2021
fe04b4d
Updated python bindings
whaeck Apr 7, 2021
dbf04fd
Adding g++-9 to actions again
whaeck Apr 8, 2021
23b1847
Some more cpp20 namespace updates
whaeck Apr 15, 2021
b166bc4
Oops ...
whaeck Apr 15, 2021
f100c41
Updated build system files
whaeck Apr 15, 2021
4302afc
Moving range-v3 update to gendf work
whaeck Apr 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ContinuousIntegration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-18.04, macos-10.15 ]
cxx: [ clang++ ]
cxx: [ clang++, g++-9 ]
build_type: [ Debug, Release ]

steps:
Expand Down
26 changes: 25 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ set( REPOSITORIES "release"
"Options for where to fetch repositories: develop, release, local"
)

message( STATUS "Using ${REPOSITORIES} repositories" )

if( REPOSITORIES STREQUAL "develop" )
include( cmake/develop_dependencies.cmake )

Expand Down Expand Up @@ -67,7 +69,7 @@ target_link_libraries( ENDFtk
INTERFACE disco
INTERFACE hana-adapter
INTERFACE header-utilities
INTERFACE range-v3-adapter
INTERFACE range-v3
)

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -182,13 +184,20 @@ pybind11_add_module( ENDFtk.python
python/src/section/7/4/AnalyticalFunctions.python.cpp
python/src/section/7/4/TabulatedFunctions.python.cpp
python/src/section/7/4/ScatteringFunction.python.cpp
python/src/section/8/FissionYieldData.python.cpp
python/src/section/8/454.python.cpp
python/src/section/8/457.python.cpp
python/src/section/8/457/AverageDecayEnergies.python.cpp
python/src/section/8/457/DecayMode.python.cpp
python/src/section/8/457/DecayModes.python.cpp
python/src/section/8/457/DiscreteSpectrum.python.cpp
python/src/section/8/457/ContinuousSpectrum.python.cpp
python/src/section/8/457/DecaySpectrum.python.cpp
python/src/section/8/459.python.cpp
python/src/section/9.python.cpp
python/src/section/9/ReactionProduct.python.cpp
python/src/section/10.python.cpp
python/src/section/10/ReactionProduct.python.cpp
python/src/section/12.python.cpp
python/src/section/12/TotalMultiplicity.python.cpp
python/src/section/12/PartialMultiplicity.python.cpp
Expand All @@ -197,6 +206,17 @@ pybind11_add_module( ENDFtk.python
python/src/section/13.python.cpp
python/src/section/13/TotalCrossSection.python.cpp
python/src/section/13/PartialCrossSection.python.cpp
python/src/section/14.python.cpp
python/src/section/14/IsotropicDiscretePhoton.python.cpp
python/src/section/14/LegendreCoefficients.python.cpp
python/src/section/14/TabulatedDistribution.python.cpp
python/src/section/14/LegendreDistributions.python.cpp
python/src/section/14/TabulatedDistributions.python.cpp
python/src/section/15.python.cpp
python/src/section/15/OutgoingEnergyDistribution.python.cpp
python/src/section/15/TabulatedSpectrum.python.cpp
python/src/section/15/Probability.python.cpp
python/src/section/15/PartialDistribution.python.cpp
python/src/file/1.python.cpp
python/src/file/2.python.cpp
python/src/file/3.python.cpp
Expand All @@ -205,8 +225,12 @@ pybind11_add_module( ENDFtk.python
python/src/file/6.python.cpp
python/src/file/7.python.cpp
python/src/file/8.python.cpp
python/src/file/9.python.cpp
python/src/file/10.python.cpp
python/src/file/12.python.cpp
python/src/file/13.python.cpp
python/src/file/14.python.cpp
python/src/file/15.python.cpp
python/src/Material.python.cpp
python/src/tree/Section.python.cpp
python/src/tree/File.python.cpp
Expand Down
10 changes: 4 additions & 6 deletions cmake/develop_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,14 @@ FetchContent_Declare( header-utilities
GIT_SHALLOW TRUE
)

FetchContent_Declare( range-v3-adapter
GIT_REPOSITORY https://github.com/njoy/range-v3-adapter
GIT_TAG origin/master
GIT_SHALLOW TRUE
FetchContent_Declare( range-v3
GIT_REPOSITORY https://github.com/ericniebler/range-v3
GIT_TAG 0.11.0
)

FetchContent_Declare( pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.6.1
GIT_SHALLOW TRUE
)

#######################################################################
Expand All @@ -57,6 +55,6 @@ FetchContent_MakeAvailable(
disco
hana-adapter
header-utilities
range-v3-adapter
range-v3
pybind11
)
8 changes: 4 additions & 4 deletions cmake/release_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ FetchContent_Declare( pybind11
GIT_TAG f1abf5d9159b805674197f6bc443592e631c9130 # tag: v2.6.1
)

FetchContent_Declare( range-v3-adapter
GIT_REPOSITORY https://github.com/njoy/range-v3-adapter
GIT_TAG 252679d4737c8f755d87c0e1eed6c37394a2ec59
FetchContent_Declare( range-v3
GIT_REPOSITORY https://github.com/ericniebler/range-v3
GIT_TAG 4989f3e9ff2efee1852942bb9328ef121369ba02 # tag: 0.11.0
)

FetchContent_Declare( spdlog
Expand All @@ -57,6 +57,6 @@ FetchContent_MakeAvailable(
header-utilities
Log
pybind11
range-v3-adapter
range-v3
spdlog
)
48 changes: 35 additions & 13 deletions cmake/unit_testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ add_subdirectory( src/ENDFtk/HeadRecord/test )
add_subdirectory( src/ENDFtk/InterpolationRecord/test )
add_subdirectory( src/ENDFtk/InterpolationSequenceRecord/test )
add_subdirectory( src/ENDFtk/ListRecord/test )
add_subdirectory( src/ENDFtk/Material/test )
add_subdirectory( src/ENDFtk/StructureDivision/test )
add_subdirectory( src/ENDFtk/TabulationRecord/test )
add_subdirectory( src/ENDFtk/Tape/test )
add_subdirectory( src/ENDFtk/TapeIdentification/test )
add_subdirectory( src/ENDFtk/TextRecord/test )
add_subdirectory( src/ENDFtk/Material/test )
add_subdirectory( src/ENDFtk/Tape/test )
add_subdirectory( src/ENDFtk/file/1/test )
add_subdirectory( src/ENDFtk/file/2/test )
add_subdirectory( src/ENDFtk/file/7/test )
Expand All @@ -33,24 +33,26 @@ add_subdirectory( src/ENDFtk/record/Sequence/test )
add_subdirectory( src/ENDFtk/record/Tail/test )
add_subdirectory( src/ENDFtk/record/Zipper/test )
add_subdirectory( src/ENDFtk/record/test )
add_subdirectory( src/ENDFtk/section/1/PolynomialMultiplicity/test )
add_subdirectory( src/ENDFtk/section/1/TabulatedMultiplicity/test )
add_subdirectory( src/ENDFtk/section/1/451/test )
add_subdirectory( src/ENDFtk/section/1/452/test )
add_subdirectory( src/ENDFtk/section/1/455/test )
add_subdirectory( src/ENDFtk/section/1/455/DecayConstants/test )
add_subdirectory( src/ENDFtk/section/1/455/EnergyDependentConstants/test )
add_subdirectory( src/ENDFtk/section/1/455/EnergyIndependentConstants/test )
add_subdirectory( src/ENDFtk/section/1/455/test )
add_subdirectory( src/ENDFtk/section/1/456/test )
add_subdirectory( src/ENDFtk/section/1/458/test )
add_subdirectory( src/ENDFtk/section/1/458/EnergyReleaseComponent/test )
add_subdirectory( src/ENDFtk/section/1/458/PolynomialComponents/test )
add_subdirectory( src/ENDFtk/section/1/458/TabulatedComponents/test )
add_subdirectory( src/ENDFtk/section/1/458/ThermalPointComponents/test )
add_subdirectory( src/ENDFtk/section/1/460/test )
add_subdirectory( src/ENDFtk/section/1/458/test )
add_subdirectory( src/ENDFtk/section/1/460/ContinuousPhotons/test )
add_subdirectory( src/ENDFtk/section/1/460/DiscretePhotons/test )
add_subdirectory( src/ENDFtk/section/1/460/DiscretePhotonMultiplicity/test )
add_subdirectory( src/ENDFtk/section/1/460/DiscretePhotons/test )
add_subdirectory( src/ENDFtk/section/1/460/test )
add_subdirectory( src/ENDFtk/section/1/PolynomialMultiplicity/test )
add_subdirectory( src/ENDFtk/section/1/TabulatedMultiplicity/test )
add_subdirectory( src/ENDFtk/section/10/ReactionProduct/test )
add_subdirectory( src/ENDFtk/section/10/test )
add_subdirectory( src/ENDFtk/section/12/Multiplicities/test )
add_subdirectory( src/ENDFtk/section/12/PartialMultiplicity/test )
add_subdirectory( src/ENDFtk/section/12/TotalMultiplicity/test )
Expand All @@ -60,19 +62,30 @@ add_subdirectory( src/ENDFtk/section/12/test )
add_subdirectory( src/ENDFtk/section/13/PartialCrossSection/test )
add_subdirectory( src/ENDFtk/section/13/TotalCrossSection/test )
add_subdirectory( src/ENDFtk/section/13/test )
add_subdirectory( src/ENDFtk/section/14/IsotropicDiscretePhoton/test )
add_subdirectory( src/ENDFtk/section/14/LegendreCoefficients/test )
add_subdirectory( src/ENDFtk/section/14/LegendreDistributions/test )
add_subdirectory( src/ENDFtk/section/14/TabulatedDistribution/test )
add_subdirectory( src/ENDFtk/section/14/TabulatedDistributions/test )
add_subdirectory( src/ENDFtk/section/14/test )
add_subdirectory( src/ENDFtk/section/15/PartialDistribution/test )
add_subdirectory( src/ENDFtk/section/15/Probability/test )
add_subdirectory( src/ENDFtk/section/15/TabulatedSpectrum/OutgoingEnergyDistribution/test )
add_subdirectory( src/ENDFtk/section/15/TabulatedSpectrum/test )
add_subdirectory( src/ENDFtk/section/15/test )
add_subdirectory( src/ENDFtk/section/2/151/BreitWignerLValue/Resonance/test )
add_subdirectory( src/ENDFtk/section/2/151/BreitWignerLValue/test )
add_subdirectory( src/ENDFtk/section/2/151/Isotope/test )
add_subdirectory( src/ENDFtk/section/2/151/MultiLevelBreitWigner/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/BackgroundChannels/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/FrohnerBackgroundRMatrix/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/NoBackgroundRMatrix/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/ParticlePairs/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/ResonanceChannels/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/ResonanceParameters/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/NoBackgroundRMatrix/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/TabulatedBackgroundRMatrix/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/SammyBackgroundRMatrix/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/FrohnerBackgroundRMatrix/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/BackgroundChannels/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/SpinGroup/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/TabulatedBackgroundRMatrix/test )
add_subdirectory( src/ENDFtk/section/2/151/RMatrixLimited/test )
add_subdirectory( src/ENDFtk/section/2/151/ReichMoore/test )
add_subdirectory( src/ENDFtk/section/2/151/ReichMooreLValue/Resonance/test )
Expand Down Expand Up @@ -106,8 +119,8 @@ add_subdirectory( src/ENDFtk/section/5/GeneralEvaporationSpectrum/test )
add_subdirectory( src/ENDFtk/section/5/MadlandNixSpectrum/test )
add_subdirectory( src/ENDFtk/section/5/MaxwellianFissionSpectrum/test )
add_subdirectory( src/ENDFtk/section/5/Parameter/test )
add_subdirectory( src/ENDFtk/section/5/Probability/test )
add_subdirectory( src/ENDFtk/section/5/PartialDistribution/test )
add_subdirectory( src/ENDFtk/section/5/Probability/test )
add_subdirectory( src/ENDFtk/section/5/TabulatedSpectrum/OutgoingEnergyDistribution/test )
add_subdirectory( src/ENDFtk/section/5/TabulatedSpectrum/test )
add_subdirectory( src/ENDFtk/section/5/WattSpectrum/test )
Expand Down Expand Up @@ -147,17 +160,26 @@ add_subdirectory( src/ENDFtk/section/7/4/ScatteringLawConstants/test )
add_subdirectory( src/ENDFtk/section/7/4/TabulatedFunctions/ScatteringFunction/test )
add_subdirectory( src/ENDFtk/section/7/4/TabulatedFunctions/test )
add_subdirectory( src/ENDFtk/section/7/4/test )
add_subdirectory( src/ENDFtk/section/8/454/test )
add_subdirectory( src/ENDFtk/section/8/457/AverageDecayEnergies/test )
add_subdirectory( src/ENDFtk/section/8/457/ContinuousSpectrum/test )
add_subdirectory( src/ENDFtk/section/8/457/DecayMode/test )
add_subdirectory( src/ENDFtk/section/8/457/DecayModes/test )
add_subdirectory( src/ENDFtk/section/8/457/DecaySpectrum/test )
add_subdirectory( src/ENDFtk/section/8/457/DiscreteSpectrum/test )
add_subdirectory( src/ENDFtk/section/8/457/test )
add_subdirectory( src/ENDFtk/section/8/459/test )
add_subdirectory( src/ENDFtk/section/8/FissionYieldData/FissionProduct/test )
add_subdirectory( src/ENDFtk/section/8/FissionYieldData/test )
add_subdirectory( src/ENDFtk/section/9/ReactionProduct/test )
add_subdirectory( src/ENDFtk/section/9/test )
add_subdirectory( src/ENDFtk/section/Base/test )
add_subdirectory( src/ENDFtk/section/BaseWithoutMT/test )
add_subdirectory( src/ENDFtk/test )
add_subdirectory( src/ENDFtk/tree/File/test )
add_subdirectory( src/ENDFtk/tree/Material/test )
add_subdirectory( src/ENDFtk/tree/Section/test )
add_subdirectory( src/ENDFtk/tree/Tape/test )
add_subdirectory( src/ENDFtk/gendf/SectionBase/test )
add_subdirectory( src/ENDFtk/gendf/DataRecord/test )
add_subdirectory( src/ENDFtk/gendf/CrossSection/test )
8 changes: 8 additions & 0 deletions python/src/ENDFtk.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ void wrapFile_5( python::module&, python::module& );
void wrapFile_6( python::module&, python::module& );
void wrapFile_7( python::module&, python::module& );
void wrapFile_8( python::module&, python::module& );
void wrapFile_9( python::module&, python::module& );
void wrapFile_10( python::module&, python::module& );
void wrapFile_12( python::module&, python::module& );
void wrapFile_13( python::module&, python::module& );
void wrapFile_14( python::module&, python::module& );
void wrapFile_15( python::module&, python::module& );

// material and tape
void wrapMaterial( python::module&, python::module& );
Expand Down Expand Up @@ -83,8 +87,12 @@ PYBIND11_MODULE( ENDFtk, module ) {
wrapFile_6( module, viewmodule );
wrapFile_7( module, viewmodule );
wrapFile_8( module, viewmodule );
wrapFile_9( module, viewmodule );
wrapFile_10( module, viewmodule );
wrapFile_12( module, viewmodule );
wrapFile_13( module, viewmodule );
wrapFile_14( module, viewmodule );
wrapFile_15( module, viewmodule );

// wrap material and tape
wrapMaterial( module, viewmodule );
Expand Down
73 changes: 33 additions & 40 deletions python/src/Material.python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ void wrapMaterial( python::module& module, python::module& ) {
using MF6 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 6 > >;
using MF7 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 7 > >;
using MF8 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 8 > >;
using MF9 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 9 > >;
using MF10 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 10 > >;
using MF12 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 12 > >;
using MF13 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 13 > >;
using MF14 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 14 > >;
using MF15 = std::reference_wrapper< const njoy::ENDFtk::file::Type< 15 > >;

// wrap views created by this section

Expand All @@ -38,6 +42,33 @@ void wrapMaterial( python::module& module, python::module& ) {
"Material - nuclear data for a single material"
);

// predefined lambda
auto getFile = [] ( const Material& self, int mf )
-> std::variant< MF1, MF2, MF3, MF4, MF5, MF6, MF7, MF8, MF9, MF10,
MF12, MF13, MF14, MF15 > {

switch ( mf ) {

case 1 : return self.file( 1_c );
case 2 : return self.file( 2_c );
case 3 : return self.file( 3_c );
case 4 : return self.file( 4_c );
case 5 : return self.file( 5_c );
case 6 : return self.file( 6_c );
case 7 : return self.file( 7_c );
case 8 : return self.file( 8_c );
case 9 : return self.file( 9_c );
case 10 : return self.file( 10_c );
case 12 : return self.file( 12_c );
case 13 : return self.file( 13_c );
case 14 : return self.file( 14_c );
case 15 : return self.file( 15_c );
default: throw std::runtime_error(
"Requested file number (" + std::to_string( mf ) +
") does not correspond to a stored file" );
}
};

// wrap the section
material
.def_property_readonly(
Expand Down Expand Up @@ -75,26 +106,7 @@ void wrapMaterial( python::module& module, python::module& ) {
.def(

"MF",
[] ( const Material& self, int mf )
-> std::variant< MF1, MF2, MF3, MF4, MF5, MF6, MF7, MF8, MF12, MF13 > {

switch ( mf ) {

case 1 : return self.file( 1_c );
case 2 : return self.file( 2_c );
case 3 : return self.file( 3_c );
case 4 : return self.file( 4_c );
case 5 : return self.file( 5_c );
case 6 : return self.file( 6_c );
case 7 : return self.file( 7_c );
case 8 : return self.file( 8_c );
case 12 : return self.file( 12_c );
case 13 : return self.file( 13_c );
default: throw std::runtime_error(
"Requested file number (" + std::to_string( mf ) +
") does not correspond to a stored file" );
}
},
getFile,
python::arg( "mf" ),
"Return the file with the requested MF number\n\n"
"Arguments:\n"
Expand All @@ -105,26 +117,7 @@ void wrapMaterial( python::module& module, python::module& ) {
.def(

"file",
[] ( const Material& self, int mf )
-> std::variant< MF1, MF2, MF3, MF4, MF5, MF6, MF7, MF8, MF12, MF13 > {

switch ( mf ) {

case 1 : return self.file( 1_c );
case 2 : return self.file( 2_c );
case 3 : return self.file( 3_c );
case 4 : return self.file( 4_c );
case 5 : return self.file( 5_c );
case 6 : return self.file( 6_c );
case 7 : return self.file( 7_c );
case 8 : return self.file( 8_c );
case 12 : return self.file( 12_c );
case 13 : return self.file( 13_c );
default: throw std::runtime_error(
"Requested file number (" + std::to_string( mf ) +
") does not correspond to a stored file" );
}
},
getFile,
python::arg( "mf" ),
"Return the file with the requested MF number\n\n"
"Arguments:\n"
Expand Down
Loading