Skip to content

Commit

Permalink
Merge pull request #18 from njoy/fix/review-part5
Browse files Browse the repository at this point in the history
Fix/review part5
  • Loading branch information
whaeck authored Oct 8, 2024
2 parents 526f0ce + 8d7545d commit 76fa384
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions python/test/Test_NDItk_MultigroupTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def verify_chunk( self, chunk ) :
self.assertEqual( 7, len( moment.matrix ) )
self.assertEqual( 7, len( moment.matrix[0] ) )
self.assertEqual( 0, moment.order )
self.assertAlmostEqual( 1, moment.matrix[0][0] )
self.assertAlmostEqual( 0, moment.matrix[0][1] )
self.assertAlmostEqual( 0.999999999999, moment.matrix[0][0] )
self.assertAlmostEqual( 1e-13, moment.matrix[0][1] )
self.assertAlmostEqual( 0, moment.matrix[0][2] )
self.assertAlmostEqual( 0, moment.matrix[0][3] )
self.assertAlmostEqual( 0, moment.matrix[0][4] )
Expand Down Expand Up @@ -476,7 +476,7 @@ def verify_chunk( self, chunk ) :
xs = [ CrossSection( 2, 0., [ 10., 20., 30., 40., 50., 60., 70. ] ),
CrossSection( 16, 1.1234567, [ 1., 2., 3., 4., 5., 6., 7. ] ) ] ),
scattering = ScatteringMatrix(
[ LegendreMoment( 0, [ 1, 0, 0, 0, 0, 0, 0,
[ LegendreMoment( 0, [ 0.999999999999, 1e-13, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0,
Expand Down
8 changes: 4 additions & 4 deletions src/NDItk/MultigroupTable/test/MultigroupTable.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SCENARIO( "MultigroupTable" ) {
multigroup::TotalCrossSection total( { 1.1, 1.2, 1.25, 1.05, 1.15, 1.04, 1.06 } );
multigroup::ReactionCrossSections xs( { { 2, 0.0, { 10., 20., 30., 40., 50., 60., 70. } },
{ 16, 1.1234567, { 1., 2., 3., 4., 5., 6., 7. } } } );
multigroup::ScatteringMatrix scattering( { { 0, { 1, 0, 0, 0, 0, 0, 0,
multigroup::ScatteringMatrix scattering( { { 0, { 0.999999999999, 0.0000000000001, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0,
Expand Down Expand Up @@ -322,7 +322,7 @@ std::string chunk() {
" 6 7\n"
"pn_full\n"
" 0\n"
" 1 0 0 0 0\n"
" 0.999999999999 1e-13 0 0 0\n"
" 0 0 0 1 0\n"
" 0 0 0 0 0\n"
" 0 1 0 0 0\n"
Expand Down Expand Up @@ -547,8 +547,8 @@ void verifyChunk( const MultigroupTable& chunk ) {
CHECK( 7 == moment.matrix().size() );
CHECK( 7 == moment.matrix()[0].size() );
CHECK( 0 == moment.order() );
CHECK_THAT( 1, WithinRel( moment.matrix()[0][0] ) );
CHECK_THAT( 0, WithinRel( moment.matrix()[0][1] ) );
CHECK_THAT( 0.999999999999, WithinRel( moment.matrix()[0][0] ) );
CHECK_THAT( 1e-13, WithinRel( moment.matrix()[0][1] ) );
CHECK_THAT( 0, WithinRel( moment.matrix()[0][2] ) );
CHECK_THAT( 0, WithinRel( moment.matrix()[0][3] ) );
CHECK_THAT( 0, WithinRel( moment.matrix()[0][4] ) );
Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/LegendreMoment/src/verify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @brief Verify the cross section data values
*
* The following verification tests are performed:
* - there are at least three values
* - there are at least two values
* - the reaction identifier looks to be an integer
*
* @param[in] data the data values in the Legendre moment subrecord
Expand Down
2 changes: 1 addition & 1 deletion src/NDItk/multigroup/LegendreMoment/src/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void write( OutputIterator& iter ) const {
++x;

auto full = ( this->size() - 1 ) / 5;
auto partial = ( this->size() - 1 ) - full * 5;
auto partial = ( this->size() - 1 ) % 5;

while ( full-- ) {

Expand Down
5 changes: 2 additions & 3 deletions src/NDItk/multigroup/ScatteringMatrix/src/read.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @brief Read the record data
* @brief Read the record data (secondary particle production matrix)
*
* @param[in,out] iter an iterator to the current position in the input
* @param[in,out] end an iterator to the end of the input
Expand All @@ -23,12 +23,11 @@ void read( Iterator& iter, const Iterator& end, unsigned int incident,
};

/**
* @brief Read the record data
* @brief Read the record data (scattering matrix)
*
* @param[in,out] iter an iterator to the current position in the input
* @param[in,out] end an iterator to the end of the input
* @param[in,out] incident the number of incident energy groups
* @param[in,out] outgoing the number of outgoing energy groups
* @param[in,out] number the number of moments
*/
template< typename Iterator >
Expand Down

0 comments on commit 76fa384

Please sign in to comment.