30 m_protare( a_protare ),
32 m_elasticReaction( nullptr ) {
34 if( a_protare->projectile( ).ID( ) !=
PoPI::IDs::neutron )
throw Exception(
"ProtareTNSL::ProtareTNSL: a_protare neutron as target." );
35 if( a_TNSL->projectile( ).ID( ) !=
PoPI::IDs::neutron )
throw Exception(
"ProtareTNSL::ProtareTNSL: a_TNSL not thermal neutron scattering protare." );
37 setProjectile( a_protare->projectile( ) );
38 setTarget( a_protare->target( ) );
40 for( std::size_t i1 = 0; i1 < m_protare->numberOfReactions( ); ++i1 ) {
41 Reaction *
reaction = m_protare->reaction( i1 );
49 if( m_elasticReaction ==
nullptr )
throw Exception(
"ProtareTNSL::ProtareTNSL: could not find elastic reaction in a_protare." );
51 m_maximumTNSL_MultiGroupIndex[
""] = 0;
52 Styles::TemperatureInfos temperatures = m_TNSL->temperatures( );
53 Transporting::MG settings( m_TNSL->projectile( ).ID( ), Transporting::Mode::multiGroup, Transporting::DelayedNeutrons::off );
55 for(
auto iter = temperatures.begin( ); iter != temperatures.end( ); ++iter ) {
56 std::string label = iter->heatedMultiGroup( );
60 std::size_t maximumMultiGroupIndex = 0;
62 Vector crossSection = m_TNSL->multiGroupCrossSection( smr1, settings, *iter );
64 for( ; i1 < crossSection.size( ); ++i1 ) {
65 if( crossSection[i1] == 0 )
break;
67 maximumMultiGroupIndex = i1;
71 Vector multiplicity = m_TNSL->multiGroupMultiplicity( smr1, settings, *iter,
PoPI::IDs::neutron );
73 for( i1 = 0; i1 < multiplicity.size( ); ++i1 ) {
74 if( multiplicity[i1] == 0 )
break;
76 if( i1 < maximumMultiGroupIndex ) maximumMultiGroupIndex = i1;
78 m_maximumTNSL_MultiGroupIndex[label] = maximumMultiGroupIndex;
82 m_elasticReaction->modifiedMultiGroupElasticForTNSL( m_maximumTNSL_MultiGroupIndex );
106 return( m_maximumTNSL_MultiGroupIndex.at( a_temperatureInfo.
heatedMultiGroup( ) ) );
121 if( a_vectorTNSL.
size( ) == 0 )
return;
123 std::size_t maximumMultiGroupIndex = m_maximumTNSL_MultiGroupIndex.at( a_temperatureInfo.
heatedMultiGroup( ) );
125 for( std::size_t i1 = 0; i1 < maximumMultiGroupIndex; ++i1 ) a_vector[i1] += a_vectorTNSL[i1] - a_vectorElastic[i1];
140 if( a_matrixTNSL.
size( ) == 0 )
return;
142 std::size_t maximumMultiGroupIndex = m_maximumTNSL_MultiGroupIndex.at( a_temperatureInfo.
heatedMultiGroup( ) );
144 for( std::size_t i1 = 0; i1 < maximumMultiGroupIndex; ++i1 ) {
145 Vector const &rowTNSL = a_matrixTNSL[i1];
146 Vector const &rowElastic = a_matrixElastic[i1];
147 Vector &row = a_matrix[i1];
149 for( std::size_t i2 = 0; i2 < a_matrixTNSL.
size( ); ++i2 ) row[i2] += rowTNSL[i2] - rowElastic[i2];
163 if( a_index == 0 )
return( m_protare->formatVersion( ) );
164 if( a_index == 1 )
return( m_TNSL->formatVersion( ) );
165 throw Exception(
"ProtareTNSL::formatVersion: index can only be 0 or 1." );
178 if( a_index == 0 )
return( m_protare->fileName( ) );
179 if( a_index == 1 )
return( m_TNSL->fileName( ) );
180 throw Exception(
"ProtareTNSL::fileName: index can only be 0 or 1." );
193 if( a_index == 0 )
return( m_protare->realFileName( ) );
194 if( a_index == 1 )
return( m_TNSL->realFileName( ) );
195 throw Exception(
"ProtareTNSL::realFileName: index can only be 0 or 1." );
208 if( a_index == 0 )
return( m_protare->libraries( ) );
209 if( a_index == 1 )
return( m_TNSL->libraries( ) );
210 throw Exception(
"ProtareTNSL::libraries: index can only be 0 or 1." );
223 if( a_index == 0 )
return( m_protare->evaluation( ) );
224 if( a_index == 1 )
return( m_TNSL->evaluation( ) );
225 throw Exception(
"ProtareTNSL::evaluation: index can only be 0 or 1." );
238 if( a_index == 0 )
return( m_protare->projectileFrame( ) );
239 if( a_index == 1 )
return( m_TNSL->projectileFrame( ) );
240 throw Exception(
"ProtareTNSL::projectileFrame: index can only be 0 or 1." );
253 if( a_index == 0 )
return( m_protare );
254 if( a_index == 1 )
return( m_TNSL );
268 if( a_index == 0 )
return( m_protare );
269 if( a_index == 1 )
return( m_TNSL );
281 return( m_protare->numberOfLazyParsingHelperForms( ) + m_TNSL->numberOfLazyParsingHelperForms( ) );
292 return( m_protare->numberOfLazyParsingHelperFormsReplaced( ) + m_TNSL->numberOfLazyParsingHelperFormsReplaced( ) );
303 return( m_protare->thresholdFactor( ) );
314 return( m_protare->documentations( ) );
326 return( m_protare->style( a_label ) );
337 return( m_protare->styles( ) );
348 return( m_protare->styles( ) );
361 return( m_protare->intid( a_id ) );
374 m_protare->productIDs( a_ids, a_particles, a_transportablesOnly );
375 m_TNSL->productIDs( a_ids, a_particles, a_transportablesOnly );
393 int maximumLegendreOrder1 = m_protare->maximumLegendreOrder( a_smr, a_settings, a_temperatureInfo, a_productID );
394 int maximumLegendreOrder2 = m_TNSL->maximumLegendreOrder( a_smr, a_settings, a_temperatureInfo, a_productID );
396 if( maximumLegendreOrder1 > maximumLegendreOrder2 )
return( maximumLegendreOrder1 );
397 return( maximumLegendreOrder2 );
416 return( m_protare->temperatures( ) );
427 return( m_TNSL->numberOfReactions( ) + m_protare->numberOfReactions( ) );
439 if( a_index < m_TNSL->
numberOfReactions( ) )
return( m_TNSL->reaction( a_index ) );
441 return( m_protare->reaction( a_index - m_TNSL->numberOfReactions( ) ) );
453 if( a_index < m_TNSL->
numberOfReactions( ) )
return( m_TNSL->reaction( a_index ) );
455 return( m_protare->reaction( a_index - m_TNSL->numberOfReactions( ) ) );
472 if( a_index < m_TNSL->
numberOfReactions( ) )
return( m_TNSL->reaction( a_index, a_settings, a_reactionsToExclude ) );
474 return( m_protare->reaction( a_index - m_TNSL->numberOfReactions( ), a_settings, a_reactionsToExclude ) );
485 return( m_protare->numberOfOrphanProducts( ) );
497 return( m_protare->orphanProduct( a_index ) );
509 return( m_protare->orphanProduct( a_index ) );
519 m_TNSL->updateReactionIndices( 0 );
520 m_protare->updateReactionIndices( m_TNSL->numberOfReactions( ) );
531 return( m_protare->hasFission( ) );
542 return( m_protare->isDelayedFissionNeutronComplete( ) );
557 return( m_protare->groupBoundaries( a_settings, a_temperatureInfo, a_productID ) );
573 return( m_protare->multiGroupInverseSpeed( a_smr, a_settings, a_temperatureInfo ) );
590 std::string
const &a_label )
const {
593 Vector vector = m_protare->multiGroupCrossSection( a_smr, a_settings, a_temperatureInfo, excludeReactionsSet, a_label );
596 if( !m_elasticReaction->active( ) )
return( vector );
598 Vector vectorElastic = m_elasticReaction->multiGroupCrossSection( a_smr, a_settings, a_temperatureInfo, a_label );
600 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic,
601 m_TNSL->multiGroupCrossSection( a_smr, a_settings, a_temperatureInfo, excludeReactionsSet, a_label ) );
623 Vector vector = m_protare->multiGroupQ( a_smr, a_settings, a_temperatureInfo, a_final, a_effectivePhotoAtomic );
626 if( !m_elasticReaction->active( ) )
return( vector );
628 Vector vectorElastic = m_elasticReaction->multiGroupQ( a_smr, a_settings, a_temperatureInfo, a_final );
630 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupQ( a_smr, a_settings, a_temperatureInfo, a_final, a_effectivePhotoAtomic ) );
651 Vector vector = m_protare->multiGroupMultiplicity( a_smr, a_settings, a_temperatureInfo, a_productID );
654 if( !m_elasticReaction->active( ) )
return( vector );
656 Vector vectorElastic = m_elasticReaction->multiGroupMultiplicity( a_smr, a_settings, a_temperatureInfo, a_productID );
658 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupMultiplicity( a_smr, a_settings, a_temperatureInfo, a_productID ) );
676 return( m_protare->multiGroupFissionNeutronMultiplicity( a_smr, a_settings, a_temperatureInfo, a_reactionsToExclude ) );
693 return( m_protare->multiGroupFissionGammaMultiplicity( a_smr, a_settings, a_temperatureInfo, a_reactionsToExclude ) );
713 std::string
const &a_productID, std::size_t a_order,
ExcludeReactionsSet const &a_reactionsToExclude )
const {
716 Matrix matrix = m_protare->multiGroupProductMatrix( a_smr, a_settings, a_temperatureInfo, a_particles, a_productID, a_order, excludeReactionsSet );
719 if( !m_elasticReaction->active( ) )
return( matrix );
721 Matrix matrixElastic = m_elasticReaction->multiGroupProductMatrix( a_smr, a_settings, a_temperatureInfo, a_particles, a_productID, a_order );
722 Matrix matrixTNSL = m_TNSL->multiGroupProductMatrix( a_smr, a_settings, a_temperatureInfo, a_particles, a_productID, a_order );
724 combineMatrices( a_settings, a_temperatureInfo, matrix, matrixElastic, matrixTNSL );
745 return( m_protare->multiGroupFissionMatrix( a_smr, a_settings, a_temperatureInfo, a_particles, a_order, a_reactionsToExclude ) );
771 a_reactionsToExclude ) );
773 std::size_t size = matrixCollapsed.
size( );
774 std::vector<double> transportCorrection1( size, 0 );
779 for( std::size_t index = 0; index < size; ++index ) transportCorrection1[index] = matrixCollapsed[index][index]; }
781 throw Exception(
"Unsupported transport correction: only None and Pendlebury (i.e., Pendlebury/Underhill) are currently supported." );
783 return(
Vector( transportCorrection1 ) );
802 Vector vector = m_protare->multiGroupAvailableEnergy( a_smr, a_settings, a_temperatureInfo, excludeReactionsSet );
805 if( !m_elasticReaction->active( ) )
return( vector );
807 Vector vectorElastic = m_elasticReaction->multiGroupAvailableEnergy( a_smr, a_settings, a_temperatureInfo );
809 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupAvailableEnergy( a_smr, a_settings, a_temperatureInfo ) );
831 Vector vector = m_protare->multiGroupAverageEnergy( a_smr, a_settings, a_temperatureInfo, a_productID, excludeReactionsSet );
834 if( !m_elasticReaction->active( ) )
return( vector );
836 Vector vectorElastic = m_elasticReaction->multiGroupAverageEnergy( a_smr, a_settings, a_temperatureInfo, a_productID );
838 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupAverageEnergy( a_smr, a_settings, a_temperatureInfo, a_productID ) );
861 Vector vector = m_protare->multiGroupDepositionEnergy( a_smr, a_settings, a_temperatureInfo, a_particles, excludeReactionsSet );
864 if( !m_elasticReaction->active( ) )
return( vector );
866 Vector vectorElastic = m_elasticReaction->multiGroupDepositionEnergy( a_smr, a_settings, a_temperatureInfo, a_particles );
868 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupDepositionEnergy( a_smr, a_settings, a_temperatureInfo, a_particles ) );
888 Vector vector = m_protare->multiGroupAvailableMomentum( a_smr, a_settings, a_temperatureInfo, excludeReactionsSet );
891 if( !m_elasticReaction->active( ) )
return( vector );
893 Vector vectorElastic = m_elasticReaction->multiGroupAvailableMomentum( a_smr, a_settings, a_temperatureInfo );
895 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupAvailableMomentum( a_smr, a_settings, a_temperatureInfo ) );
917 Vector vector = m_protare->multiGroupAverageMomentum( a_smr, a_settings, a_temperatureInfo, a_productID, excludeReactionsSet );
920 if( !m_elasticReaction->active( ) )
return( vector );
922 Vector vectorElastic = m_elasticReaction->multiGroupAverageMomentum( a_smr, a_settings, a_temperatureInfo, a_productID );
924 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupAverageMomentum( a_smr, a_settings, a_temperatureInfo, a_productID ) );
947 Vector vector = m_protare->multiGroupDepositionMomentum( a_smr, a_settings, a_temperatureInfo, a_particles, excludeReactionsSet );
950 if( !m_elasticReaction->active( ) )
return( vector );
952 Vector vectorElastic = m_elasticReaction->multiGroupDepositionMomentum( a_smr, a_settings, a_temperatureInfo, a_particles );
954 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupDepositionMomentum( a_smr, a_settings, a_temperatureInfo, a_particles ) );
974 std::string
const projectile_id = m_protare->projectile( ).ID( );
976 Vector vector = m_protare->multiGroupGain( a_smr, a_settings, a_temperatureInfo, a_productID, excludeReactionsSet );
979 if( !m_elasticReaction->active( ) )
return( vector );
981 Vector vectorElastic = m_elasticReaction->multiGroupGain( a_smr, a_settings, a_temperatureInfo, a_productID, projectile_id );
983 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupGain( a_smr, a_settings, a_temperatureInfo, a_productID ) );
999 double projectileEnergyMax = m_TNSL->projectileEnergyMax( );
1006 a_crossSectionSum -= slicedXYs1d;
1020 double projectileEnergyMax = m_TNSL->projectileEnergyMax( );
1022 nf_Buffer<double>
const energies = griddedCrossSection->
grid( ).
values( );
1025 std::size_t start = ys1d->
start( );
1026 std::vector<double>
const &Ys = ys1d->
Ys( );
1027 std::vector<double> &crossSectionYs = a_crossSectionSum.
Ys( );
1028 for( std::size_t index = 0; index < Ys.size( ); ++index ) {
1029 if( energies[index] > projectileEnergyMax )
break;
1030 crossSectionYs[index+start] -= Ys[index];
1044 return( stringAndDoublePairs1 );
1056 m_protare->incompleteParticles( a_settings, a_incompleteParticles );
1057 m_TNSL->incompleteParticles( a_settings, a_incompleteParticles );
ptwXYPoints const * ptwXY() const
std::vector< double > const & Ys() const
std::size_t start() const
nf_Buffer< double > const & values() const
Vector multiGroupTransportCorrection(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order, TransportCorrectionType a_transportCorrectionType, double a_temperature, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
Vector multiGroupDepositionEnergy(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
Vector multiGroupFissionNeutronMultiplicity(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
int numberOfLazyParsingHelperFormsReplaced() const
std::size_t numberOfReactions() const
Vector multiGroupQ(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, bool a_final, bool a_effectivePhotoAtomic=true, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
Vector multiGroupFissionGammaMultiplicity(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
LUPI::FormatVersion const & formatVersion(std::size_t a_index=0) const
ProtareTNSL(Construction::Settings const &a_construction, ProtareSingle *a_protare, ProtareSingle *a_TNSL)
void productIDs(std::set< std::string > &a_ids, Transporting::Particles const &a_particles, bool a_transportablesOnly) const
std::vector< double > groupBoundaries(Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID) const
std::size_t maximumTNSL_MultiGroupIndex(Styles::TemperatureInfo const &a_temperatureInfo) const
Styles::Base & style(std::string const &a_label)
Vector multiGroupGain(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
Reaction * orphanProduct(std::size_t a_index)
Frame projectileFrame(std::size_t a_index=0) const
Vector multiGroupCrossSection(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}, std::string const &a_label="") const
std::size_t numberOfOrphanProducts() const
Vector multiGroupDepositionMomentum(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
void combineVectors(Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Vector &a_vector, Vector const &a_vectorElastic, Vector const &a_vectorTNSL) const
int numberOfLazyParsingHelperForms() const
Vector multiGroupAverageEnergy(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
double thresholdFactor() const
bool isDelayedFissionNeutronComplete() const
ProtareSingle * protare(std::size_t a_index=0)
int intid(std::string const &a_id) const
std::string const & fileName(std::size_t a_index=0) const
Vector multiGroupInverseSpeed(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo) const
int maximumLegendreOrder(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID) const
stringAndDoublePairs muCutoffForCoulombPlusNuclearElastic() const
Vector multiGroupAverageMomentum(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
std::vector< std::string > libraries(std::size_t a_index=0) const
std::string const & realFileName(std::size_t a_index=0) const
void incompleteParticles(Transporting::Settings const &a_settings, std::set< std::string > &a_incompleteParticles) const
Reaction * reaction(std::size_t a_index)
void combineMatrices(Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Matrix &a_matrix, Matrix const &a_matrixElastic, Matrix const &a_matrixTNSL) const
std::string const & evaluation(std::size_t a_index=0) const
Styles::TemperatureInfos temperatures() const
Vector multiGroupMultiplicity(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
void TNSL_crossSectionSumCorrection(std::string const &a_label, Functions::XYs1d &a_crossSectionSum)
void updateReactionIndices(std::size_t a_offset) const
Vector multiGroupAvailableEnergy(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
Matrix multiGroupFissionMatrix(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
Vector multiGroupAvailableMomentum(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
Matrix multiGroupProductMatrix(LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::string const &a_productID, std::size_t a_order, ExcludeReactionsSet const &a_reactionsToExclude=ExcludeReactionsSet {}) const
Documentation_1_10::Suite & documentations()
ParticleInfo const & projectile() const
Grid const & grid() const
std::string const & heatedMultiGroup() const
std::vector< Styles::TemperatureInfo > TemperatureInfos
void excludeReactionsSetAdjust(ExcludeReactionsSet &a_excludeReactionsSet, Protare const &a_protare)
std::vector< stringAndDoublePair > stringAndDoublePairs
Vector collapse(Vector const &a_vector, Transporting::Settings const &a_settings, Transporting::Particles const &a_particles, double a_temperature)
std::set< std::size_t > ExcludeReactionsSet
struct ptwXYPoints_s ptwXYPoints
ptwXYPoints * ptwXY_domainMaxSlice(statusMessageReporting *smr, ptwXYPoints *ptwXY, double domainMax, int64_t secondarySize, int fill)
int64_t ptwXY_length(statusMessageReporting *smr, ptwXYPoints *ptwXY)
static std::string const neutron