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

Feature/multigroup part9 #17

Merged
merged 18 commits into from
Oct 8, 2024
Merged

Feature/multigroup part9 #17

merged 18 commits into from
Oct 8, 2024

Conversation

whaeck
Copy link
Member

@whaeck whaeck commented May 28, 2024

This adds the reaction product multiplicity records.

@whaeck whaeck requested a review from tgsaller May 28, 2024 18:25
Base automatically changed from fix/review-part4 to develop June 4, 2024 18:48
python::module submodule = module.def_submodule(

"depletion",
"Depeltion NDI records and subrecords"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depletion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in fix/review-part6

chunk = Multiplicities( reaction = 16, products = [ 1, 92234 ],
multiplicities = [ 2, 1 ] )

verify_chunk( self, chunk )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should chunk_string also be used here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used inside the verify_chunk function, but since it is not a keyword record (it is a subrecord) we cannot create this subrecord from a string on the Python side.

self.assertEqual( self.chunk_typed_string, chunk.to_string() )

# verify the record
self.assertEqual( 'rprod_all', chunk.keyword )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the type (all) stored somewhere? Should we check that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. the type is stored, and I forgot to test it. That has been changed in fix/review-part6

@@ -5,6 +5,9 @@ MultigroupTable() :
metadata_(), primary_structure_(),
velocities_(), weights_(), total_(), xs_(), scattering_(),
release_(), primary_heating_(), primary_kerma_(),
product_multiplicities_all_( depletion::ReactionMultiplicityType::All ),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my understanding: all the others are empty parenthesis (default constructor), why do these have something in them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these records, we need to know the subtype to construct the full keyword name. This is the same for the nubar records that are introduced in part10.


if ( this->metadata_.numberReactions().has_value() ) {

readRecord( this->product_multiplicities_all_, iter, end,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be fine is the number of reactions is 0? Or would that never happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the number of reactions actually be zero?

ReactionMultiplicities() : ReactionMultiplicities( "" ) {}

/**
* @brief Default constructor
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in fix/review-part6

@@ -0,0 +1,8 @@
static std::string getPostFix( const ReactionMultiplicityType& type ) {

return type == ReactionMultiplicityType::All
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if there isn't a postfix or if it isn't all, few, or rmo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been removed in part10

std::vector< int > data;
while ( reactions-- ) {

data.push_back( njoy::tools::disco::FreeFormatInteger::read< int >( iter, end ) );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a comment as to what data this should be reading? Like, the first is the... MT? Second the number of products?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in fix/review-part6

*
* The following verification tests are performed:
* - there is at least one reaction
* - the number of groups for each reaction is the same
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applicable

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in fix/review-part6

CHECK( 2 == chunk.reactions()[1].multiplicities()[0] );
CHECK( 1 == chunk.reactions()[1].multiplicities()[1] );

auto multiplicities = chunk.reaction( 2 );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to use multiplicities rather than chunk.reaction( 2 ) below this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the line in fix/review-part6

@whaeck whaeck merged commit 526f0ce into develop Oct 8, 2024
8 checks passed
@whaeck whaeck deleted the feature/multigroup-part9 branch October 8, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants