Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updates after Wim's comments.
  • Loading branch information
nathangibson14 committed Feb 19, 2021
commit 88ddfa749187f4213994e38bc112e669668170d6
30 changes: 7 additions & 23 deletions src/ENDFtk/gendf/CrossSection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,13 @@ namespace gendf {

class CrossSection : protected SectionBase {

/* constructor */
#include "ENDFtk/gendf/CrossSection/src/ctor.hpp"

protected:

/* convenience functions */

double getValue( unsigned int block, unsigned int group,
unsigned int order, unsigned int dilution ) {

// default value
if ( !this->hasRecord(group) )
return 0.0;

// from list
auto values = this->record( group ).data( block );
return values[ this->num_legendre_ * dilution + order ];
}

/* constructor */
#include "ENDFtk/gendf/CrossSection/src/ctor.hpp"

public:


/* convenience functions */

/**
Expand Down Expand Up @@ -153,14 +137,14 @@ namespace gendf {

// from gendf::SectionBase
using SectionBase::NL;
using SectionBase::numLegendre;
using SectionBase::numberLegendreMoments;
using SectionBase::legendreOrder;
using SectionBase::NZ;
using SectionBase::numDilutions;
using SectionBase::numSigmaZeros;
using SectionBase::numberDilutions;
using SectionBase::numberSigmaZeros;
using SectionBase::NGN;
using SectionBase::numGroups;
using SectionBase::LRFLAG;
using SectionBase::numberGroups;
using SectionBase::LR;
using SectionBase::complexBreakUp;

// from section::Base
Expand Down
8 changes: 6 additions & 2 deletions src/ENDFtk/gendf/CrossSection/src/ctor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
* @param[in] head the head record of the section
* @param[in] begin the iterator for begin
* @param[in] end the iterator for end
* @param[in] lineNumber the current line number
* @param[in] MAT the expected MAT number
*/
template< typename Iterator >
CrossSection( const HEAD& head,
Iterator& begin,
const Iterator& end ) :
SectionBase( head, begin, end ) {}
const Iterator& end,
long& lineNumber,
int MAT ) :
SectionBase( head, begin, end, lineNumber, MAT ) {}
115 changes: 55 additions & 60 deletions src/ENDFtk/gendf/CrossSection/test/CrossSection.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,32 @@ bool compareRanges( Range1 r1, Range2 r2 ) {
// tests
SCENARIO( "CrossSection tests") {

GIVEN( "a string representing the CrossSection" ) {
GIVEN( "valid data for the CrossSection" ) {

std::string line = chunk();
auto begin = line.begin();
auto end = line.end();
long lineNumber = 0;
auto head = StructureDivision( begin, end, lineNumber );
WHEN( "the data is given as a string" ) {}

THEN( "the section can be constructed" ) {
std::string line = chunk();
auto begin = line.begin();
auto end = line.end();
long lineNumber = 0;
auto head = StructureDivision( begin, end, lineNumber );

CrossSection section( asHead(head), begin, end );
THEN( "the section can be constructed" ) {

AND_THEN( "we can get the parameters from it" ) {
CrossSection section( asHead(head), begin, end, lineNumber, 9228 );
verifySection( section );
} // AND_THEN
} // THEN
} // GIVEN

WHEN( "the section is created from parameters" ) {

THEN( "the section can be constructed" ) {
} // THEN
} // WHEN

// TODO
WHEN( "the data is given explicitly" ) {

AND_THEN( "we can get the parameters from it" ) {
THEN( "the section can be constructed" ) {

// TODO
// verifySection( section );
} // AND_THEN
} // THEN
} // WHEN

} // THEN
} // WHEN
} // GIVEN
} // SCENARIO

std::string chunk(){
Expand All @@ -80,55 +75,55 @@ std::string chunk(){
void verifySection( CrossSection section ) {

// header information
REQUIRE( 1 == section.MT() );
REQUIRE( 1 == section.sectionNumber() );
REQUIRE( 92235 == section.ZA() );
REQUIRE( 0.0 == section.atomicWeightRatio() );
REQUIRE( 0.0 == section.AWR() );
REQUIRE( 2 == section.NL() );
REQUIRE( 2 == section.numLegendre() );
REQUIRE( 1 == section.legendreOrder() );
REQUIRE( 3 == section.NZ() );
REQUIRE( 3 == section.numDilutions() );
REQUIRE( 0 == section.LRFLAG() );
REQUIRE( 0 == section.complexBreakUp() );
REQUIRE( 3 == section.NGN() );
REQUIRE( 3 == section.numGroups() );
CHECK( 1 == section.MT() );
CHECK( 1 == section.sectionNumber() );
CHECK( 92235 == section.ZA() );
CHECK( 0.0 == section.atomicWeightRatio() );
CHECK( 0.0 == section.AWR() );
CHECK( 2 == section.NL() );
CHECK( 2 == section.numberLegendreMoments() );
CHECK( 1 == section.legendreOrder() );
CHECK( 3 == section.NZ() );
CHECK( 3 == section.numberDilutions() );
CHECK( 0 == section.LR() );
CHECK( 0 == section.complexBreakUp() );
CHECK( 3 == section.NGN() );
CHECK( 3 == section.numberGroups() );

// group not provided
REQUIRE( 0.0 == Approx( section.flux(1) ) );
REQUIRE( 0.0 == Approx( section.flux(1, 1, 1) ) );
REQUIRE( 0.0 == Approx( section.crossSection(1) ) );
REQUIRE( 0.0 == Approx( section.crossSection(1, 0, 0) ) );
CHECK( 0.0 == Approx( section.flux(1) ) );
CHECK( 0.0 == Approx( section.flux(1, 1, 1) ) );
CHECK( 0.0 == Approx( section.crossSection(1) ) );
CHECK( 0.0 == Approx( section.crossSection(1, 0, 0) ) );

// group provided -- flux
REQUIRE( 1.0 == Approx( section.flux(2) ) );
REQUIRE( 1.0 == Approx( section.flux(2, 0, 0) ) );
REQUIRE( 2.0 == Approx( section.flux(2, 1, 0) ) );
REQUIRE( 3.0 == Approx( section.flux(2, 0, 1) ) );
REQUIRE( 3.0 == Approx( section.flux(2, 1) ) );
REQUIRE( 4.0 == Approx( section.flux(2, 1, 1) ) );
REQUIRE( 5.0 == Approx( section.flux(2, 0, 2) ) );
REQUIRE( 6.0 == Approx( section.flux(2, 1, 2) ) );
CHECK( 1.0 == Approx( section.flux(2) ) );
CHECK( 1.0 == Approx( section.flux(2, 0, 0) ) );
CHECK( 2.0 == Approx( section.flux(2, 1, 0) ) );
CHECK( 3.0 == Approx( section.flux(2, 0, 1) ) );
CHECK( 3.0 == Approx( section.flux(2, 1) ) );
CHECK( 4.0 == Approx( section.flux(2, 1, 1) ) );
CHECK( 5.0 == Approx( section.flux(2, 0, 2) ) );
CHECK( 6.0 == Approx( section.flux(2, 1, 2) ) );

// group provided -- cross_section
REQUIRE( 7.1 == Approx( section.crossSection(3) ) );
REQUIRE( 7.1 == Approx( section.crossSection(3, 0, 0) ) );
REQUIRE( 8.1 == Approx( section.crossSection(3, 1, 0) ) );
REQUIRE( 9.1 == Approx( section.crossSection(3, 0, 1) ) );
REQUIRE( 10.1 == Approx( section.crossSection(3, 1, 1) ) );
REQUIRE( 11.1 == Approx( section.crossSection(3, 0, 2) ) );
REQUIRE( 11.1 == Approx( section.crossSection(3, 2) ) );
REQUIRE( 12.1 == Approx( section.crossSection(3, 1, 2) ) );
CHECK( 7.1 == Approx( section.crossSection(3) ) );
CHECK( 7.1 == Approx( section.crossSection(3, 0, 0) ) );
CHECK( 8.1 == Approx( section.crossSection(3, 1, 0) ) );
CHECK( 9.1 == Approx( section.crossSection(3, 0, 1) ) );
CHECK( 10.1 == Approx( section.crossSection(3, 1, 1) ) );
CHECK( 11.1 == Approx( section.crossSection(3, 0, 2) ) );
CHECK( 11.1 == Approx( section.crossSection(3, 2) ) );
CHECK( 12.1 == Approx( section.crossSection(3, 1, 2) ) );

// vectors
REQUIRE( compareRanges( std::vector( {0.0, 1.0, 1.1} ),
CHECK( compareRanges( std::vector( {0.0, 1.0, 1.1} ),
section.fluxes(0) ) );
REQUIRE( compareRanges( std::vector( {0.0, 2.0, 2.1} ),
CHECK( compareRanges( std::vector( {0.0, 2.0, 2.1} ),
section.fluxes(1, 0) ) );
REQUIRE( compareRanges( std::vector( {0.0, 7.0, 7.1} ),
CHECK( compareRanges( std::vector( {0.0, 7.0, 7.1} ),
section.crossSections(0) ) );
REQUIRE( compareRanges( std::vector( {0.0, 10.0, 10.1} ),
CHECK( compareRanges( std::vector( {0.0, 10.0, 10.1} ),
section.crossSections(1, 1) ) );

}
10 changes: 5 additions & 5 deletions src/ENDFtk/gendf/DataRecord.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace gendf {
/**
* @brief The number of secondary positions
*/
long numSecondaryPositions() const { return this->NG2(); }
long numberSecondaryPositions() const { return this->NG2(); }

/**
* @brief The index to the lowest position
Expand All @@ -88,7 +88,7 @@ namespace gendf {
/**
* @brief The number of words in the list
*/
long numWords() const { return this->NW(); }
long numberWords() const { return this->NW(); }

/**
* @brief The group index
Expand All @@ -108,9 +108,9 @@ namespace gendf {
auto data( unsigned int block ) const {

std::size_t size = this->NW() / this->NG2();
return this->list() |
ranges::view::drop_exactly( block * size ) |
ranges::view::take_exactly( size );
return this->list()
| ranges::view::drop_exactly( block * size )
| ranges::view::take_exactly( size );
}

using ListRecord::list;
Expand Down
64 changes: 31 additions & 33 deletions src/ENDFtk/gendf/DataRecord/test/DataRecord.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,35 @@ void verifyRecord( DataRecord );
// tests
SCENARIO( "DataRecord tests") {

GIVEN( "a string representing the DataRecord" ) {
GIVEN( "valid data for the DataRecord" ) {

std::string data = chunk();
auto begin = data.begin();
auto end = data.end();
long lineNumber = 10;
WHEN( "the data is given as a string" ) {

THEN( "the record can be constructed" ) {
std::string data = chunk();
auto begin = data.begin();
auto end = data.end();
long lineNumber = 10;

DataRecord record( begin, end, lineNumber, 9228, 3, 1 );
THEN( "the record can be constructed" ) {

AND_THEN( "we can get the data from it" ) {
DataRecord record( begin, end, lineNumber, 9228, 3, 1 );
verifyRecord( record );

} // AND_THEN
} // THEN
} // GIVEN
} // THEN
} // WHEN

WHEN( "the record is created from parameters" ) {
WHEN( "the data is given explicitly" ) {

THEN( "the record can be constructed" ) {
std::vector<double> data = { 1.0, 2.0, 3.0, 4.0 };

std::vector<double> data = {1.0, 2.0, 3.0, 4.0};
DataRecord record( 293.6, 2, 1, 5, std::move(data) );
THEN( "the record can be constructed" ) {

AND_THEN( "we can get the data from it" ) {
DataRecord record( 293.6, 2, 1, 5, std::move( data ) );
verifyRecord( record );

} // AND_THEN
} // THEN
} // WHEN
} // THEN
} // WHEN
} // GIVEN

} // SCENARIO

Expand All @@ -58,19 +56,19 @@ std::string chunk(){
}

void verifyRecord( DataRecord record ) {
REQUIRE( 293.6 == Approx( record.TEMP() ) );
REQUIRE( 293.6 == Approx( record.temperature() ) );
REQUIRE( 2 == record.NG2() );
REQUIRE( 2 == record.numSecondaryPositions() );
REQUIRE( 1 == record.IG2LO() );
REQUIRE( 1 == record.lowestPosition() );
REQUIRE( 4 == record.NW() );
REQUIRE( 4 == record.numWords() );
REQUIRE( 5 == record.IG() );
REQUIRE( 5 == record.groupIndex() );
REQUIRE( 1.0 == Approx( record.list()[0] ) );
REQUIRE( 2.0 == Approx( record.list()[1] ) );
REQUIRE( 2.0 == Approx( record.data(0)[1] ) );
REQUIRE( 4.0 == Approx( record.data(1)[1] ) );
CHECK( 293.6 == Approx( record.TEMP() ) );
CHECK( 293.6 == Approx( record.temperature() ) );
CHECK( 2 == record.NG2() );
CHECK( 2 == record.numberSecondaryPositions() );
CHECK( 1 == record.IG2LO() );
CHECK( 1 == record.lowestPosition() );
CHECK( 4 == record.NW() );
CHECK( 4 == record.numberWords() );
CHECK( 5 == record.IG() );
CHECK( 5 == record.groupIndex() );
CHECK( 1.0 == Approx( record.list()[0] ) );
CHECK( 2.0 == Approx( record.list()[1] ) );
CHECK( 2.0 == Approx( record.data(0)[1] ) );
CHECK( 4.0 == Approx( record.data(1)[1] ) );

}
Loading