Skip to content

Commit 97e6408

Browse files
committed
Adding unresolved resonance probability table block
1 parent d975a0f commit 97e6408

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

‎python/src/ContinuousEnergyTable.python.cpp‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ void wrapContinuousEnergyTable( python::module& module, python::module& ) {
3030
using ANDP = njoy::ACEtk::block::ANDP;
3131
using DLWP = njoy::ACEtk::block::DLWP;
3232
using YP = njoy::ACEtk::block::YP;
33+
using UNR = njoy::ACEtk::block::UNR;
3334

3435
// wrap views created by this table
3536

@@ -52,14 +53,15 @@ void wrapContinuousEnergyTable( python::module& module, python::module& ) {
5253
SIG, AND, DLW, std::optional< GPD >,
5354
std::optional< MTRP >, std::optional< SIGP >,
5455
std::optional< ANDP >, std::optional< DLWP >,
55-
std::optional< YP > >(),
56+
std::optional< YP >, std::optional< UNR > >(),
5657
python::arg( "z" ), python::arg( "a" ),
5758
python::arg( "header" ), python::arg( "esz" ),
5859
python::arg( "nu" ) = std::nullopt,
5960
python::arg( "mtr" ), python::arg( "lqr" ), python::arg( "tyr" ),
6061
python::arg( "sig" ), python::arg( "ang" ), python::arg( "dlw" ),
6162
python::arg( "gpd" ), python::arg( "mtrp" ), python::arg( "sigp" ),
6263
python::arg( "andp" ), python::arg( "dlwp" ), python::arg( "yp" ),
64+
python::arg( "unr" ),
6365
"Initialise the table\n\n"
6466
"Arguments:\n"
6567
" self the table\n"
@@ -79,7 +81,8 @@ void wrapContinuousEnergyTable( python::module& module, python::module& ) {
7981
" sigp the photon production cross section data block\n"
8082
" angp the photon production angular distribution data block\n"
8183
" dlwp the photon production energy distribution data block\n"
82-
" yp the photon multiplicity reaction number block"
84+
" yp the photon multiplicity reaction number block\n"
85+
" unr the unresolved resonance probability table block"
8386
)
8487
.def_property_readonly(
8588

‎src/ACEtk/ContinuousEnergyTable/src/ctor.hpp‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ ContinuousEnergyTable& operator=( ContinuousEnergyTable&& base ) {
5252
* @param[in] angp the photon production angular distribution data block
5353
* @param[in] dlwp the photon production energy distribution data block
5454
* @param[in] yp the photon multiplicity reaction number block
55+
* @param[in] unr the unresolved resonance probability table block
5556
*/
5657
ContinuousEnergyTable( unsigned int z, unsigned int a, Header header,
5758
block::ESZ esz, std::optional< block::NU > nu,
@@ -62,7 +63,8 @@ ContinuousEnergyTable( unsigned int z, unsigned int a, Header header,
6263
std::optional< block::SIGP > sigp,
6364
std::optional< block::ANDP > andp,
6465
std::optional< block::DLWP > dlwp,
65-
std::optional< block::YP > yp ) :
66+
std::optional< block::YP > yp,
67+
std::optional< block::UNR > unr ) :
6668
ContinuousEnergyTable(
6769
Table( std::move( header ),
6870
generateData( z, a, std::move( esz ), std::move( nu ),
@@ -71,4 +73,5 @@ ContinuousEnergyTable( unsigned int z, unsigned int a, Header header,
7173
std::move( ang ), std::move( dlw ),
7274
std::move( gpd ), std::move( mtrp ),
7375
std::move( sigp ), std::move( andp ),
74-
std::move( dlwp ), std::move( yp ) ) ) ) {}
76+
std::move( dlwp ), std::move( yp ),
77+
std::move( unr ) ) ) ) {}

‎src/ACEtk/ContinuousEnergyTable/src/generateData.hpp‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Data generateData( unsigned int z, unsigned int a,
77
std::optional< block::SIGP >&& sigp,
88
std::optional< block::ANDP >&& andp,
99
std::optional< block::DLWP >&& dlwp,
10-
std::optional< block::YP >&& yp ) {
10+
std::optional< block::YP >&& yp,
11+
std::optional< block::UNR >&& unr ) {
1112

1213
std::array< int32_t, 16 > iz;
1314
std::array< double, 16 > aw;
@@ -69,7 +70,7 @@ Data generateData( unsigned int z, unsigned int a,
6970
if ( nu ) {
7071

7172
jxs[1] = xss.size() + 1;
72-
xss.insert( xss.end(), nu.value().begin(), nu.value().end() );
73+
xss.insert( xss.end(), nu->begin(), nu->end() );
7374
}
7475
jxs[2] = xss.size() + 1;
7576
xss.insert( xss.end(), mtr.begin(), mtr.end() );
@@ -101,12 +102,19 @@ Data generateData( unsigned int z, unsigned int a,
101102
jxs[17] = xss.size() + 1;
102103
jxs[18] = xss.size() + ntrp + 1;
103104
xss.insert( xss.end(), dlwp->begin(), dlwp->end() );
105+
jxs[19] = xss.size() + 1;
106+
xss.insert( xss.end(), yp->begin(), yp->end() );
104107
}
105108
if ( mtr.hasReactionNumber( 18 ) ) {
106109

107110
jxs[20] = jxs[8] + sig.crossSectionLocator( mtr.index( 18 ) ) - 1;
108111
}
109112
jxs[21] = xss.size() + 1;
113+
if ( unr ) {
114+
115+
jxs[22] = xss.size() + 1;
116+
xss.insert( xss.end(), unr->begin(), unr->end() );
117+
}
110118

111119
// set the nxs values for the continuous energy table
112120
// NXS(1) = length

0 commit comments

Comments
 (0)