-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from njoy/feature/multigroup-part9
Feature/multigroup part9
- Loading branch information
Showing
46 changed files
with
1,828 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
// local includes | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
namespace depletion { | ||
|
||
// declarations - NDI enumerators | ||
void wrapReactionMultiplicityType( python::module&, python::module& ); | ||
|
||
// declarations - NDI records and subrecords | ||
void wrapMultiplicities( python::module&, python::module& ); | ||
void wrapReactionMultiplicities( python::module&, python::module& ); | ||
} | ||
|
||
void wrapDepletion( python::module& module, python::module& viewmodule ) { | ||
|
||
// create the submodule | ||
python::module submodule = module.def_submodule( | ||
|
||
"depletion", | ||
"Depeltion NDI records and subrecords" | ||
); | ||
|
||
depletion::wrapReactionMultiplicityType( submodule, viewmodule ); | ||
depletion::wrapMultiplicities( submodule, viewmodule ); | ||
depletion::wrapReactionMultiplicities( submodule, viewmodule ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
// local includes | ||
#include "NDItk/depletion/Multiplicities.hpp" | ||
#include "tools/views/views-python.hpp" | ||
#include "definitions.hpp" | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
namespace depletion { | ||
|
||
void wrapMultiplicities( python::module& module, python::module& ) { | ||
|
||
// type aliases | ||
using Record = njoy::NDItk::depletion::Multiplicities; | ||
|
||
// wrap views created by this record | ||
|
||
// create the record | ||
python::class_< Record > record( | ||
|
||
module, | ||
"Multiplicities", | ||
"A reaction product multiplicity subrecord for depletion data" | ||
); | ||
|
||
// wrap the record | ||
record | ||
.def( | ||
|
||
python::init< int, std::vector< int >, std::vector< int > >(), | ||
python::arg( "reaction" ), python::arg( "products" ), | ||
python::arg( "multiplicities" ), | ||
"Initialise the subrecord\n\n" | ||
"Arguments:\n" | ||
" self the record\n" | ||
" reaction the reaction number\n" | ||
" products the reaction product identifiers\n" | ||
" multiplicities the multiplicity values" | ||
) | ||
.def_property_readonly( | ||
|
||
"identifier", | ||
&Record::identifier, | ||
"The reaction identifier" | ||
) | ||
.def_property_readonly( | ||
|
||
"number_reaction_products", | ||
&Record::numberReactionProducts, | ||
"The number of reaction products" | ||
) | ||
.def_property_readonly( | ||
|
||
"reaction_products", | ||
[] ( const Record& self ) -> IntRange | ||
{ return self.reactionProducts(); }, | ||
"The reaction product identifiers" | ||
) | ||
.def_property_readonly( | ||
|
||
"multiplicities", | ||
[] ( const Record& self ) -> IntRange | ||
{ return self.multiplicities(); }, | ||
"The reaction product multiplicities" | ||
); | ||
|
||
// add standard record definitions | ||
addStandardSubrecordDefinitions< Record, IntRange >( record ); | ||
} | ||
|
||
} // depletion namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
// local includes | ||
#include "NDItk/depletion/ReactionMultiplicities.hpp" | ||
#include "tools/views/views-python.hpp" | ||
#include "definitions.hpp" | ||
#include "read.hpp" | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
namespace depletion { | ||
|
||
void wrapReactionMultiplicities( python::module& module, python::module& ) { | ||
|
||
// type aliases | ||
using Record = njoy::NDItk::depletion::ReactionMultiplicities; | ||
using Multiplicities = njoy::NDItk::depletion::Multiplicities; | ||
using ReactionMultiplicityType = njoy::NDItk::depletion::ReactionMultiplicityType; | ||
|
||
// wrap views created by this record | ||
|
||
// create the record | ||
python::class_< Record > record( | ||
|
||
module, | ||
"ReactionMultiplicities", | ||
"A reaction product multiplicity record for depletion data" | ||
); | ||
|
||
// wrap the record | ||
record | ||
.def( | ||
|
||
python::init< std::vector< Multiplicities > >(), | ||
python::arg( "multiplicities" ), | ||
"Initialise the record\n\n" | ||
"Arguments:\n" | ||
" self the record\n" | ||
" multiplicities the multiplicity data" | ||
) | ||
.def( | ||
|
||
python::init< const ReactionMultiplicityType&, | ||
std::vector< Multiplicities > >(), | ||
python::arg( "type" ),python::arg( "multiplicities" ), | ||
"Initialise the record\n\n" | ||
"Arguments:\n" | ||
" self the record\n" | ||
" type the multiplicity type (all, few or rmo)\n" | ||
" multiplicities the multiplicity data" | ||
) | ||
.def_property_readonly( | ||
|
||
"number_reactions", | ||
&Record::numberReactions, | ||
"The number of reactions defined by this record" | ||
) | ||
.def_property_readonly( | ||
|
||
"reactions", | ||
&Record::reactions, | ||
"The multiplicity data for all reactions" | ||
) | ||
.def( | ||
|
||
"has_reaction", | ||
&Record::hasReaction, | ||
python::arg( "reaction" ), | ||
"Return whether or not a given reaction is present\n\n" | ||
" self the record\n" | ||
" reaction the reaction to look for" | ||
) | ||
.def( | ||
|
||
"reaction", | ||
&Record::reaction, | ||
python::arg( "reaction" ), | ||
"Return the multiplicity data for a given reaction\n\n" | ||
" self the record\n" | ||
" reaction the reaction to look for" | ||
) | ||
.def_static( | ||
|
||
"from_string", | ||
[] ( const std::string& string, unsigned int reactions ) -> Record | ||
{ return readWithMultiplicitySubtype< Record >( string, reactions ); }, | ||
python::arg( "string" ), python::arg( "reactions" ), | ||
"Read the record from a string\n\n" | ||
"An exception is raised if something goes wrong while reading the\n" | ||
"record\n\n" | ||
"Arguments:\n" | ||
" string the string representing the record\n" | ||
" reactions the number of reactions to be read" | ||
); | ||
|
||
// add standard record definitions | ||
addStandardRecordDefinitions< Record, DoubleRange >( record ); | ||
} | ||
|
||
} // depletion namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
// local includes | ||
#include "NDItk/depletion/ReactionMultiplicityType.hpp" | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
namespace depletion { | ||
|
||
void wrapReactionMultiplicityType( python::module& module, python::module& ) { | ||
|
||
// type aliases | ||
using Component = njoy::NDItk::depletion::ReactionMultiplicityType; | ||
|
||
// wrap views created by this component | ||
|
||
// create the component | ||
python::enum_< Component > component( | ||
|
||
module, | ||
"ReactionMultiplicityType", | ||
"The reaction multiplicity types", | ||
python::arithmetic() | ||
); | ||
|
||
// wrap the component | ||
component | ||
.value( "All", Component::All ) | ||
.value( "Few", Component::Few ) | ||
.value( "RMO", Component::RMO ); | ||
} | ||
|
||
} // namespace depletion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// system includes | ||
#include <pybind11/pybind11.h> | ||
#include <pybind11/stl.h> | ||
|
||
// local includes | ||
#include "NDItk/multigroup/FissionType.hpp" | ||
|
||
// namespace aliases | ||
namespace python = pybind11; | ||
|
||
namespace multigroup { | ||
|
||
void wrapFissionType( python::module& module, python::module& ) { | ||
|
||
// type aliases | ||
using Component = njoy::NDItk::multigroup::FissionType; | ||
|
||
// wrap views created by this component | ||
|
||
// create the component | ||
python::enum_< Component > component( | ||
|
||
module, | ||
"FissionType", | ||
"The fission data types", | ||
python::arithmetic() | ||
); | ||
|
||
// wrap the component | ||
component | ||
.value( "Prompt", Component::Prompt ) | ||
.value( "Delayed", Component::Delayed ) | ||
.value( "Total", Component::Total ); | ||
} | ||
|
||
} // namespace multigroup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.