Skip to content

Commit 1112d30

Browse files
authored
Merge pull request #213 from njoy/feature/atomicrelax
More updates for atomic relaxation
2 parents 49d1ac8 + b077cf2 commit 1112d30

File tree

6 files changed

+31
-20
lines changed

6 files changed

+31
-20
lines changed

ReleaseNotes.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ In addition, the following issues were corrected:
1212
- In MF8 MT457 DiscreteSpectrum, NT=8 (which can occur for electrons, i.e. STYP=8), was explicitly disallowed by ENDFtk. This was corrected and a new constructor reflecting this usage was added as well.
1313
- The STA variable in MF1 MT451 was interpreted incorrectly and this has now been fixed. An additional isUnstable() function has been added to the interface.
1414
- The NJSX value (the number of spin groups) is now read from the CONT record before the particle pairs in MF32 R-matrix limited uncertainties since SAMMY does not print the NJSX value on the particle pairs (the ENDF format basically has the NJSX value appear in two places and ENDFtk used the second one while SAMMY only prints out the first one). This "breaks" some interface functions (the R-matrix limited uncertainties from_string() function now requires the number of spin groups while previously it did not).
15+
- In MF28 MT533, the electron population was being returned as an integer value while this can be a floating point value. This has been corrected.
16+
- All electron subshell identifiers in MF26 MT533 are returned as an integers.
1517

1618
A few changes were also made to remove some range-v3 code in MF1 MT451. These changes have no impact on functionality.
1719

src/ENDFtk/section/28/SubshellData.hpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ class ENDFTK_PYTHON_EXPORT SubshellData : protected ListRecord {
2828
/**
2929
* @brief Return the subshell designator
3030
*/
31-
unsigned int SUBI() const { return ListRecord::C1(); }
31+
unsigned int SUBI() const {
32+
33+
return static_cast< unsigned int >( std::round( ListRecord::C1() ) );
34+
}
3235

3336
/**
3437
* @brief Return the subshell designator
@@ -58,12 +61,12 @@ class ENDFTK_PYTHON_EXPORT SubshellData : protected ListRecord {
5861
/**
5962
* @brief Return the number of electrons in the subshell
6063
*/
61-
unsigned int ELN() const { return ListRecord::list()[1]; }
64+
double ELN() const { return ListRecord::list()[1]; }
6265

6366
/**
6467
* @brief Return the number of electrons in the subshell
6568
*/
66-
unsigned int numberSubshellElectrons() const { return this->ELN(); }
69+
double numberSubshellElectrons() const { return this->ELN(); }
6770

6871
/**
6972
* @brief Return the secondary subshell designators (one for each transition)

src/ENDFtk/section/28/SubshellData/Transition.hpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ class ENDFTK_PYTHON_EXPORT Transition {
1818
/**
1919
* @brief Return the secondary subshell designator
2020
*/
21-
auto SUBJ() const { return this->chunk[0]; }
21+
unsigned int SUBJ() const {
22+
23+
return static_cast< unsigned int >( std::round( this->chunk[0] ) );
24+
}
2225

2326
/**
2427
* @brief Return the secondary subshell designator
@@ -28,7 +31,10 @@ class ENDFTK_PYTHON_EXPORT Transition {
2831
/**
2932
* @brief Return the tertiary subshell designator
3033
*/
31-
auto SUBK() const { return this->chunk[1]; }
34+
unsigned int SUBK() const {
35+
36+
return static_cast< unsigned int >( std::round( this->chunk[1] ) );
37+
}
3238

3339
/**
3440
* @brief Return the tertiary subshell designator
@@ -38,7 +44,7 @@ class ENDFTK_PYTHON_EXPORT Transition {
3844
/**
3945
* @brief Return whether or not the transition is radiative
4046
*/
41-
bool isRadiative() const { return this->SUBK() == 0.; }
47+
bool isRadiative() const { return this->SUBK() == 0; }
4248

4349
/**
4450
* @brief Return whether or not the transition is non-radiative

src/ENDFtk/section/28/SubshellData/Transition/test/Transition.test.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ SCENARIO( "Transition" ) {
4343

4444
void verifyRadiativeChunk( const Transition& chunk ) {
4545

46-
CHECK_THAT( 1, WithinRel( chunk.SUBJ() ) );
47-
CHECK_THAT( 1, WithinRel( chunk.secondarySubshellDesignator() ) );
48-
CHECK_THAT( 0, WithinRel( chunk.SUBK() ) );
49-
CHECK_THAT( 0, WithinRel( chunk.tertiarySubshellDesignator() ) );
46+
CHECK( 1 == chunk.SUBJ() );
47+
CHECK( 1 == chunk.secondarySubshellDesignator() );
48+
CHECK( 0 == chunk.SUBK() );
49+
CHECK( 0 == chunk.tertiarySubshellDesignator() );
5050
CHECK( true == chunk.isRadiative() );
5151
CHECK( false == chunk.isNonRadiative() );
5252
CHECK_THAT( 3., WithinRel( chunk.ETR() ) );
@@ -57,10 +57,10 @@ void verifyRadiativeChunk( const Transition& chunk ) {
5757

5858
void verifyNonRadiativeChunk( const Transition& chunk ) {
5959

60-
CHECK_THAT( 1, WithinRel( chunk.SUBJ() ) );
61-
CHECK_THAT( 1, WithinRel( chunk.secondarySubshellDesignator() ) );
62-
CHECK_THAT( 2, WithinRel( chunk.SUBK() ) );
63-
CHECK_THAT( 2, WithinRel( chunk.tertiarySubshellDesignator() ) );
60+
CHECK( 1 == chunk.SUBJ() );
61+
CHECK( 1 == chunk.secondarySubshellDesignator() );
62+
CHECK( 2 == chunk.SUBK() );
63+
CHECK( 2 == chunk.tertiarySubshellDesignator() );
6464
CHECK( false == chunk.isRadiative() );
6565
CHECK( true == chunk.isNonRadiative() );
6666
CHECK_THAT( 3., WithinRel( chunk.ETR() ) );

src/ENDFtk/section/28/SubshellData/test/SubshellData.test.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ void verifyChunk( const SubshellData& chunk ) {
111111

112112
CHECK_THAT( 1.156100e+4, WithinRel( chunk.EBI() ) );
113113
CHECK_THAT( 1.156100e+4, WithinRel( chunk.subshellBindingEnergy() ) );
114-
CHECK( 2 == chunk.ELN() );
115-
CHECK( 2 == chunk.numberSubshellElectrons() );
114+
CHECK_THAT( 2, WithinRel( chunk.ELN() ) );
115+
CHECK_THAT( 2, WithinRel( chunk.numberSubshellElectrons() ) );
116116

117117
CHECK( 2 == chunk.transitions().size() );
118118
CHECK( 3 == chunk.transitions()[0].SUBJ() );

src/ENDFtk/section/28/test/28.test.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ void verifyChunk( const section::Type< 28 >& chunk ) {
153153
CHECK( 2 == shell.numberTransitions() );
154154
CHECK_THAT( 1.156100e+4, WithinRel( shell.EBI() ) );
155155
CHECK_THAT( 1.156100e+4, WithinRel( shell.subshellBindingEnergy() ) );
156-
CHECK( 2 == shell.ELN() );
157-
CHECK( 2 == shell.numberSubshellElectrons() );
156+
CHECK_THAT( 2, WithinRel( shell.ELN() ) );
157+
CHECK_THAT( 2, WithinRel( shell.numberSubshellElectrons() ) );
158158
CHECK( 2 == shell.transitions().size() );
159159
CHECK( 3 == shell.transitions()[0].SUBJ() );
160160
CHECK( 4 == shell.transitions()[1].SUBJ() );
@@ -176,8 +176,8 @@ void verifyChunk( const section::Type< 28 >& chunk ) {
176176
CHECK( 1 == shell.numberTransitions() );
177177
CHECK_THAT( 2000., WithinRel( shell.EBI() ) );
178178
CHECK_THAT( 2000., WithinRel( shell.subshellBindingEnergy() ) );
179-
CHECK( 1 == shell.ELN() );
180-
CHECK( 1 == shell.numberSubshellElectrons() );
179+
CHECK_THAT( 1, WithinRel( shell.ELN() ) );
180+
CHECK_THAT( 1, WithinRel( shell.numberSubshellElectrons() ) );
181181
CHECK( 1 == shell.transitions().size() );
182182
CHECK( 1 == shell.transitions()[0].SUBJ() );
183183
CHECK( 0 == shell.transitions()[0].SUBK() );

0 commit comments

Comments
 (0)