Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI_protareTNSL.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#include <stdlib.h>
11#include <algorithm>
12
13#include "GIDI.hpp"
14
15namespace GIDI {
16
17/*! \class ProtareTNSL
18 * Class to store <**reactionSuite**> nodes required for thermal neutron scattering law.
19 */
20
21/* *********************************************************************************************************//**
22 * ProtareTNSL constructor.
23 *
24 * @param a_construction [in] Used to pass user options to the constructor.
25 * @param a_protare [in] The non-TNSL **ProtareSingle**.
26 * @param a_TNSL [in] The TNSL **ProtareSingle**.
27 ***********************************************************************************************************/
28
30 m_protare( a_protare ),
31 m_TNSL( a_TNSL ),
32 m_elasticReaction( nullptr ) {
33
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." );
36
37 setProjectile( a_protare->projectile( ) );
38 setTarget( a_protare->target( ) );
39
40 for( std::size_t i1 = 0; i1 < m_protare->numberOfReactions( ); ++i1 ) {
41 Reaction *reaction = m_protare->reaction( i1 );
42
43 if( reaction->ENDF_MT( ) == 2 ) {
44 m_elasticReaction = reaction;
45 break;
46 }
47 }
48
49 if( m_elasticReaction == nullptr ) throw Exception( "ProtareTNSL::ProtareTNSL: could not find elastic reaction in a_protare." );
50
51 m_maximumTNSL_MultiGroupIndex[""] = 0; // In case temperatureInfo.heatedMultiGroup( ) is an empty string. Is this needed?
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( );
57
58 if( label != "" ) {
59 std::size_t i1 = 0;
60 std::size_t maximumMultiGroupIndex = 0;
61
62 Vector crossSection = m_TNSL->multiGroupCrossSection( smr1, settings, *iter );
63 smr1.clear( );
64 for( ; i1 < crossSection.size( ); ++i1 ) {
65 if( crossSection[i1] == 0 ) break;
66 }
67 maximumMultiGroupIndex = i1;
68 // The check of multiplicity is needed because FUDGE has a inconsistency in what maximum energy
69 // to use for TNSL calculations. The following lines can be remove when this issue is resolved in FUDGE.
70 // This should not be needed for data produced after 15/Jan/2021 or probably earlier as FUDGE was fixed.
71 Vector multiplicity = m_TNSL->multiGroupMultiplicity( smr1, settings, *iter, PoPI::IDs::neutron );
72 smr1.clear( );
73 for( i1 = 0; i1 < multiplicity.size( ); ++i1 ) {
74 if( multiplicity[i1] == 0 ) break;
75 }
76 if( i1 < maximumMultiGroupIndex ) maximumMultiGroupIndex = i1;
77
78 m_maximumTNSL_MultiGroupIndex[label] = maximumMultiGroupIndex;
79 }
80 }
81
82 m_elasticReaction->modifiedMultiGroupElasticForTNSL( m_maximumTNSL_MultiGroupIndex );
83
84// FIXME do I need to check that data are consistence.
85}
86
87/* *********************************************************************************************************//**
88 ******************************************************************/
89
91
92 delete m_protare;
93 delete m_TNSL;
94}
95
96/* *********************************************************************************************************//**
97 * Returns the maximum number of usable multi-groups for the thermal neutron scattering law protare for the request multi-group label in *a_temperatureInfo*.
98 *
99 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
100 *
101 * @return The last multigroup index for which the TNSL protare has cross section data. Above this index, the cross section, et al. data must come from the standard protare.
102 ******************************************************************/
103
104std::size_t ProtareTNSL::maximumTNSL_MultiGroupIndex( Styles::TemperatureInfo const &a_temperatureInfo ) const {
105
106 return( m_maximumTNSL_MultiGroupIndex.at( a_temperatureInfo.heatedMultiGroup( ) ) );
107}
108
109/* *********************************************************************************************************//**
110 * Removes the elastic component from *a_vector* and adds in the TNSL component.
111 *
112 * @param a_settings [in] Specifies the requested label.
113 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
114 * @param a_vector [in/out] The vector from the non TNSL protare.
115 * @param a_vectorElastic [in] The vector from the elastic reactino from the non TNSL protare.
116 * @param a_vectorTNSL [in] The vector from the TNSL protare.
117 ******************************************************************/
118
119void ProtareTNSL::combineVectors( LUPI_maybeUnused Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Vector &a_vector, Vector const &a_vectorElastic, Vector const &a_vectorTNSL ) const {
120
121 if( a_vectorTNSL.size( ) == 0 ) return;
122
123 std::size_t maximumMultiGroupIndex = m_maximumTNSL_MultiGroupIndex.at( a_temperatureInfo.heatedMultiGroup( ) );
124
125 for( std::size_t i1 = 0; i1 < maximumMultiGroupIndex; ++i1 ) a_vector[i1] += a_vectorTNSL[i1] - a_vectorElastic[i1];
126}
127
128/* *********************************************************************************************************//**
129 * Removes the elastic component from *a_matrix* and adds in the TNSL component.
130 *
131 * @param a_settings [in] Specifies the requested label.
132 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
133 * @param a_matrix [in/out] The matrix from the non TNSL protare.
134 * @param a_matrixElastic [in] The matrix from the elastic reactino from the non TNSL protare.
135 * @param a_matrixTNSL [in] The matrix from the TNSL protare.
136 ******************************************************************/
137
138void ProtareTNSL::combineMatrices( LUPI_maybeUnused Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, Matrix &a_matrix, Matrix const &a_matrixElastic, Matrix const &a_matrixTNSL ) const {
139
140 if( a_matrixTNSL.size( ) == 0 ) return;
141
142 std::size_t maximumMultiGroupIndex = m_maximumTNSL_MultiGroupIndex.at( a_temperatureInfo.heatedMultiGroup( ) );
143
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];
148
149 for( std::size_t i2 = 0; i2 < a_matrixTNSL.size( ); ++i2 ) row[i2] += rowTNSL[i2] - rowElastic[i2];
150 }
151}
152
153/* *********************************************************************************************************//**
154 * Returns the GNDS format version for the (a_index+1)^th Protare. The index **a_index** can only be 0 (normal protare) or 1 (TNSL protare).
155 *
156 * @param a_index [in] The index of the Protare whose format version is returned.
157 *
158 * @return The format version.
159 ******************************************************************/
160
161LUPI::FormatVersion const &ProtareTNSL::formatVersion( std::size_t a_index ) const {
162
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." );
166}
167
168/* *********************************************************************************************************//**
169 * Returns the file name for the (a_index+1)^th Protare. The index **a_index** can only be 0 (normal protare) or 1 (TNSL protare).
170 *
171 * @param a_index [in] The index of the Protare whose file name is returned.
172 *
173 * @return The file name.
174 ******************************************************************/
175
176std::string const &ProtareTNSL::fileName( std::size_t a_index ) const {
177
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." );
181}
182
183/* *********************************************************************************************************//**
184 * Returns the real file name for the (a_index+1)^th Protare. The index **a_index** can only be 0 (normal protare) or 1 (TNSL protare).
185 *
186 * @param a_index [in] The index of the Protare whose real file name is returned.
187 *
188 * @return The real file name.
189 ******************************************************************/
190
191std::string const &ProtareTNSL::realFileName( std::size_t a_index ) const {
192
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." );
196}
197
198/* *********************************************************************************************************//**
199 * Returns the list of libraries for the (a_index+1)^th contained Protare. The index **a_index** can only be 0 (normal protare) or 1 (TNSL protare).
200 *
201 * @param a_index [in] The index of the Protare whose libraries are to be returned.
202 *
203 * @return The list of libraries.
204 ******************************************************************/
205
206std::vector<std::string> ProtareTNSL::libraries( std::size_t a_index ) const {
207
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." );
211}
212
213/* *********************************************************************************************************//**
214 * Returns the evaluation for the (a_index+1)^th Protare. The index **a_index** can only be 0 (normal protare) or 1 (TNSL protare).
215 *
216 * @param a_index [in] The index of the Protare whose evaluation is returned.
217 *
218 * @return The evaluation.
219 ******************************************************************/
220
221std::string const &ProtareTNSL::evaluation( std::size_t a_index ) const {
222
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." );
226}
227
228/* *********************************************************************************************************//**
229 * Returns the projectile frame for the (a_index+1)^th Protare. The index **a_index** can only be 0 (normal protare) or 1 (TNSL protare).
230 *
231 * @param a_index [in] The index of the Protare whose projectile frame is returned.
232 *
233 * @return The projectile frame.
234 ******************************************************************/
235
236Frame ProtareTNSL::projectileFrame( std::size_t a_index ) const {
237
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." );
241}
242
243/* *********************************************************************************************************//**
244 * Returns the pointer representing the (a_index - 1)th **ProtareSingle**.
245 *
246 * @param a_index [in] Index of the **ProtareSingle** to return. Can only be 0 or 1.
247 *
248 * @return Pointer to the requested protare or nullptr if invalid *a_index*..
249 ***********************************************************************************************************/
250
251ProtareSingle *ProtareTNSL::protare( std::size_t a_index ) {
252
253 if( a_index == 0 ) return( m_protare );
254 if( a_index == 1 ) return( m_TNSL );
255 return( nullptr );
256}
257
258/* *********************************************************************************************************//**
259 * Returns the pointer representing the (a_index - 1)th **ProtareSingle**.
260 *
261 * @param a_index [in] Index of the **ProtareSingle** to return. Can only be 0 or 1.
262 *
263 * @return Pointer to the requested protare or nullptr if invalid *a_index*..
264 ***********************************************************************************************************/
265
266ProtareSingle const *ProtareTNSL::protare( std::size_t a_index ) const {
267
268 if( a_index == 0 ) return( m_protare );
269 if( a_index == 1 ) return( m_TNSL );
270 return( nullptr );
271}
272
273/* *********************************************************************************************************//**
274 * Returns the number of LazyParsingHelperForms instantiated.
275 *
276 * @return The number of LazyParsingHelperForms instantiated.
277 ******************************************************************/
278
280
281 return( m_protare->numberOfLazyParsingHelperForms( ) + m_TNSL->numberOfLazyParsingHelperForms( ) );
282}
283
284/* *********************************************************************************************************//**
285 * Returns the number of instantiated LazyParsingHelperForms replaced with the appropriate form.
286 *
287 * @return The number of LazyParsingHelperForms replaced.
288 ******************************************************************/
289
291
292 return( m_protare->numberOfLazyParsingHelperFormsReplaced( ) + m_TNSL->numberOfLazyParsingHelperFormsReplaced( ) );
293}
294
295/* *********************************************************************************************************//**
296 * Returns the threshold factor for the projectile hitting the target.
297 *
298 * @return The threshold factor.
299 ******************************************************************/
300
302
303 return( m_protare->thresholdFactor( ) );
304}
305
306/* *********************************************************************************************************//**
307 * Returns the Documentation_1_10::Suite from the non TNSL protare.
308 *
309 * @return The Documentation_1_10::Suite.
310 ******************************************************************/
311
313
314 return( m_protare->documentations( ) );
315}
316
317/* *********************************************************************************************************//**
318 * Returns the style with label *a_label* from the non TNSL protare.
319 *
320 * @param a_label [in] The label of the requested style.
321 * @return The style with label *a_label*.
322 ******************************************************************/
323
324Styles::Base &ProtareTNSL::style( std::string const &a_label ) {
325
326 return( m_protare->style( a_label ) );
327}
328
329/* *********************************************************************************************************//**
330 * Returns the Styles::Suite from the non TNSL protare.
331 *
332 * @return The Styles::Suite.
333 ******************************************************************/
334
336
337 return( m_protare->styles( ) );
338}
339
340/* *********************************************************************************************************//**
341 * Returns the Styles::Suite from the non TNSL protare.
342 *
343 * @return The Styles::Suite.
344 ******************************************************************/
345
347
348 return( m_protare->styles( ) );
349}
350
351/* *********************************************************************************************************//**
352 * Returns the intid for the requested particle or -1 if the particle is not in *m_protare* PoPs database.
353 *
354 * @param a_id [in] The GNDS PoPs id for particle whose intd is requested.
355 *
356 * @return C++ int for the requested particle or -1 if particle is not in PoPs.
357 ******************************************************************/
358
359int ProtareTNSL::intid( std::string const &a_id ) const {
360
361 return( m_protare->intid( a_id ) );
362}
363
364/* *********************************************************************************************************//**
365 * Calls productIDs for each Protare contained in *this*.
366 *
367 * @param a_ids [in] Contains the list of particle ids.
368 * @param a_particles [in] The list of particles to be transported.
369 * @param a_transportablesOnly [in] If *true* only transportable particle ids are added to *a_ids*.
370 ******************************************************************/
371
372void ProtareTNSL::productIDs( std::set<std::string> &a_ids, Transporting::Particles const &a_particles, bool a_transportablesOnly ) const {
373
374 m_protare->productIDs( a_ids, a_particles, a_transportablesOnly );
375 m_TNSL->productIDs( a_ids, a_particles, a_transportablesOnly );
376}
377
378/* *********************************************************************************************************//**
379 * Determines the maximum Legredre order present in the multi-group transfer matrix for a give product for a give label.
380 * Loops over all contained Protares to determine the maximum Legredre order.
381 *
382 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
383 * @param a_settings [in] Specifies the requested label.
384 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
385 * @param a_productID [in] The id of the requested product.
386 *
387 * @return The maximum Legredre order. If no transfer matrix data are present for the requested product, -1 is returned.
388 ***********************************************************************************************************/
389
391 Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID ) const {
392
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 );
395
396 if( maximumLegendreOrder1 > maximumLegendreOrder2 ) return( maximumLegendreOrder1 );
397 return( maximumLegendreOrder2 );
398}
399
400/* *********************************************************************************************************//**
401 * Returns a list of all process temperature data from the non TNSL protare. For each temeprature, the labels for its
402 *
403 * + heated cross section data,
404 * + gridded cross section data,
405 * + multi-group data, and
406 * + multi-group upscatter data.
407 *
408 * are returned. If no data are present for a give data type (e.g., gridded cross section, multi-group upscatter), its label is an empty std::string.
409 *
410 * @return The list of temperatures and their labels via an Styles::TemperatureInfos instance. The Styles::TemperatureInfos class
411 * has many (if not all) the method of a std::vector.
412 ***********************************************************************************************************/
413
415
416 return( m_protare->temperatures( ) );
417}
418
419/* *********************************************************************************************************//**
420 * Returns the number of reactions from the non TNSL protare.
421 *
422 * @return The total number of reactions.
423 ******************************************************************/
424
425std::size_t ProtareTNSL::numberOfReactions( ) const {
426
427 return( m_TNSL->numberOfReactions( ) + m_protare->numberOfReactions( ) );
428}
429
430/* *********************************************************************************************************//**
431 * Returns the (*a_index*+1)th reaction from the non TNSL protare.
432 *
433 * @param a_index [in] The index of the requested reaction.
434 * @return The (*a_index*+1)th reaction.
435 ***********************************************************************************************************/
436
437Reaction *ProtareTNSL::reaction( std::size_t a_index ) {
438
439 if( a_index < m_TNSL->numberOfReactions( ) ) return( m_TNSL->reaction( a_index ) );
440
441 return( m_protare->reaction( a_index - m_TNSL->numberOfReactions( ) ) );
442}
443
444/* *********************************************************************************************************//**
445 * Returns the (*a_index*+1)th reaction from the non TNSL protare.
446 *
447 * @param a_index [in] The index of the requested reaction.
448 * @return The (*a_index*+1)th reaction.
449 ***********************************************************************************************************/
450
451Reaction const *ProtareTNSL::reaction( std::size_t a_index ) const {
452
453 if( a_index < m_TNSL->numberOfReactions( ) ) return( m_TNSL->reaction( a_index ) );
454
455 return( m_protare->reaction( a_index - m_TNSL->numberOfReactions( ) ) );
456}
457
458/* *********************************************************************************************************//**
459 * Returns the (*a_index*+1)th reaction from the non TNSL protare or **nullptr**. If the indexed reaction is
460 * deactivated or exlucded, a **nullptr** is returned.
461 *
462 * @param a_index [in] The index of the requested reaction.
463 * @param a_settings [in] Specifies the requested label.
464 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the cross section.
465 *
466 * @return The (*a_index*+1)th reaction or a **nullptr**.
467 ***********************************************************************************************************/
468
469Reaction const *ProtareTNSL::reaction( std::size_t a_index, Transporting::MG const &a_settings,
470 ExcludeReactionsSet const &a_reactionsToExclude ) const {
471
472 if( a_index < m_TNSL->numberOfReactions( ) ) return( m_TNSL->reaction( a_index, a_settings, a_reactionsToExclude ) );
473
474 return( m_protare->reaction( a_index - m_TNSL->numberOfReactions( ), a_settings, a_reactionsToExclude ) );
475}
476
477/* *********************************************************************************************************//**
478 * Returns the number of orphanProduct's from the non TNSL protare.
479 *
480 * @return The total number of orphanProducts.
481 ******************************************************************/
482
484
485 return( m_protare->numberOfOrphanProducts( ) );
486}
487
488/* *********************************************************************************************************//**
489 * Returns the (*a_index*+1)th orphanProduct from the non TNSL protare.
490 *
491 * @param a_index [in] The index of the requested orphanProduct.
492 * @return The (*a_index*+1)th orphanProduct.
493 ***********************************************************************************************************/
494
495Reaction *ProtareTNSL::orphanProduct( std::size_t a_index ) {
496
497 return( m_protare->orphanProduct( a_index ) );
498}
499
500/* *********************************************************************************************************//**
501 * Returns the (*a_index*+1)th orphanProduct from the non TNSL protare.
502 *
503 * @param a_index [in] The index of the requested orphanProduct.
504 * @return The (*a_index*+1)th orphanProduct.
505 ***********************************************************************************************************/
506
507Reaction const *ProtareTNSL::orphanProduct( std::size_t a_index ) const {
508
509 return( m_protare->orphanProduct( a_index ) );
510}
511
512/* *********************************************************************************************************//**
513 * Re-indexs the reactions in the reactions, orphanProducts and fissionComponents suites.
514 *
515 ***********************************************************************************************************/
516
517void ProtareTNSL::updateReactionIndices( LUPI_maybeUnused std::size_t a_offset ) const {
518
519 m_TNSL->updateReactionIndices( 0 );
520 m_protare->updateReactionIndices( m_TNSL->numberOfReactions( ) );
521}
522
523/* *********************************************************************************************************//**
524 * Returns true if at least one reaction contains a fission channel.
525 *
526 * @return true if at least one reaction contains a fission channel and false otherwise.
527 ***********************************************************************************************************/
528
530
531 return( m_protare->hasFission( ) );
532}
533
534/* *********************************************************************************************************//**
535 * Returns **false* if protare has delayed fission neutrons for an active reaction and they are not complete; otherwise, returns **true**.
536 *
537 * @return bool
538 ***********************************************************************************************************/
539
541
542 return( m_protare->isDelayedFissionNeutronComplete( ) );
543}
544
545/* *********************************************************************************************************//**
546 * Returns the multi-group boundaries for the requested label and product.
547 *
548 * @param a_settings [in] Specifies the requested label.
549 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
550 * @param a_productID [in] ID for the requested product.
551 *
552 * @return List of multi-group boundaries.
553 ***********************************************************************************************************/
554
555std::vector<double> ProtareTNSL::groupBoundaries( Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID ) const {
556
557 return( m_protare->groupBoundaries( a_settings, a_temperatureInfo, a_productID ) );
558}
559
560/* *********************************************************************************************************//**
561 * Returns the inverse speeds for the requested label from the non TNSL protare. The label must be for a heated multi-group style.
562 *
563 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
564 * @param a_settings [in] Specifies the requested label.
565 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
566 *
567 * @return List of inverse speeds.
568 ***********************************************************************************************************/
569
571 Styles::TemperatureInfo const &a_temperatureInfo ) const {
572
573 return( m_protare->multiGroupInverseSpeed( a_smr, a_settings, a_temperatureInfo ) );
574}
575
576/* *********************************************************************************************************//**
577 * Returns the multi-group, total cross section for the requested label. This is summed over all reactions.
578 *
579 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
580 * @param a_settings [in] Specifies the requested label.
581 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
582 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the cross section.
583 * @param a_label [in] If not an empty string, this is used as the label for the form to return and the *a_temperatureInfo* labels are ignored.
584 *
585 * @return The requested multi-group cross section as a GIDI::Vector.
586 ***********************************************************************************************************/
587
589 Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude,
590 std::string const &a_label ) const {
591
592 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
593 Vector vector = m_protare->multiGroupCrossSection( a_smr, a_settings, a_temperatureInfo, excludeReactionsSet, a_label );
594 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
595
596 if( !m_elasticReaction->active( ) ) return( vector );
597
598 Vector vectorElastic = m_elasticReaction->multiGroupCrossSection( a_smr, a_settings, a_temperatureInfo, a_label );
599
600 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic,
601 m_TNSL->multiGroupCrossSection( a_smr, a_settings, a_temperatureInfo, excludeReactionsSet, a_label ) );
602 return( vector );
603}
604
605/* *********************************************************************************************************//**
606 * Returns the multi-group, total Q for the requested label. This is a cross section weighted multiplicity
607 * summed over all reactions
608 *
609 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
610 * @param a_settings [in] Specifies the requested label.
611 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
612 * @param a_final [in] If false, only the Q for the primary reactions are return, otherwise, the Q for the final reactions.
613 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the Q.
614 *
615 * @return The requested multi-group Q as a GIDI::Vector.
616 ***********************************************************************************************************/
617
619 Styles::TemperatureInfo const &a_temperatureInfo, bool a_final, bool a_effectivePhotoAtomic,
620 ExcludeReactionsSet const &a_reactionsToExclude ) const {
621
622 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
623 Vector vector = m_protare->multiGroupQ( a_smr, a_settings, a_temperatureInfo, a_final, a_effectivePhotoAtomic );
624 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
625
626 if( !m_elasticReaction->active( ) ) return( vector );
627
628 Vector vectorElastic = m_elasticReaction->multiGroupQ( a_smr, a_settings, a_temperatureInfo, a_final );
629
630 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupQ( a_smr, a_settings, a_temperatureInfo, a_final, a_effectivePhotoAtomic ) );
631 return( vector );
632}
633
634/* *********************************************************************************************************//**
635 * Returns the multi-group, total multiplicity for the requested label for the requested product. This is a cross section weighted multiplicity.
636 *
637 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
638 * @param a_settings [in] Specifies the requested label.
639 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
640 * @param a_productID [in] Id for the requested product.
641 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the multiplicity.
642 *
643 * @return The requested multi-group multiplicity as a GIDI::Vector.
644 ***********************************************************************************************************/
645
647 Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID,
648 ExcludeReactionsSet const &a_reactionsToExclude ) const {
649
650 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
651 Vector vector = m_protare->multiGroupMultiplicity( a_smr, a_settings, a_temperatureInfo, a_productID );
652 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
653
654 if( !m_elasticReaction->active( ) ) return( vector );
655
656 Vector vectorElastic = m_elasticReaction->multiGroupMultiplicity( a_smr, a_settings, a_temperatureInfo, a_productID );
657
658 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupMultiplicity( a_smr, a_settings, a_temperatureInfo, a_productID ) );
659 return( vector );
660}
661
662/* *********************************************************************************************************//**
663 * Returns the multi-group, total fission neutron multiplicity for the requested label. This is a cross section weighted multiplicity.
664 *
665 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
666 * @param a_settings [in] Specifies the requested label.
667 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
668 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the multiplicity.
669 *
670 * @return The requested multi-group fission neutron multiplicity as a GIDI::Vector.
671 ***********************************************************************************************************/
672
674 Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude ) const {
675
676 return( m_protare->multiGroupFissionNeutronMultiplicity( a_smr, a_settings, a_temperatureInfo, a_reactionsToExclude ) );
677}
678
679/* *********************************************************************************************************//**
680 * Returns the multi-group, total fission gamma multiplicity for the requested label. This is a cross section weighted multiplicity.
681 *
682 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
683 * @param a_settings [in] Specifies the requested label.
684 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
685 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the multiplicity.
686 *
687 * @return The requested multi-group fission neutron multiplicity as a GIDI::Vector.
688 ***********************************************************************************************************/
689
691 Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude ) const {
692
693 return( m_protare->multiGroupFissionGammaMultiplicity( a_smr, a_settings, a_temperatureInfo, a_reactionsToExclude ) );
694}
695
696/* *********************************************************************************************************//**
697 * Returns the multi-group, total product matrix for the requested label for the requested product id for the requested Legendre order.
698 * If no data are found, an empty GIDI::Matrix is returned.
699 *
700 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
701 * @param a_settings [in] Specifies the requested label and if delayed neutrons should be included.
702 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
703 * @param a_particles [in] The list of particles to be transported.
704 * @param a_productID [in] PoPs id for the requested product.
705 * @param a_order [in] Requested product matrix, Legendre order.
706 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the product matrix.
707 *
708 * @return The requested multi-group product matrix as a GIDI::Matrix.
709 ***********************************************************************************************************/
710
712 Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles,
713 std::string const &a_productID, std::size_t a_order, ExcludeReactionsSet const &a_reactionsToExclude ) const {
714
715 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
716 Matrix matrix = m_protare->multiGroupProductMatrix( a_smr, a_settings, a_temperatureInfo, a_particles, a_productID, a_order, excludeReactionsSet );
717 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
718
719 if( !m_elasticReaction->active( ) ) return( matrix );
720
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 );
723
724 combineMatrices( a_settings, a_temperatureInfo, matrix, matrixElastic, matrixTNSL );
725 return( matrix );
726}
727
728/* *********************************************************************************************************//**
729 * Like ProtareTNSL::multiGroupProductMatrix, but only returns the fission neutron, transfer matrix.
730 *
731 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
732 * @param a_settings [in] Specifies the requested label and if delayed neutrons should be included.
733 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
734 * @param a_particles [in] The list of particles to be transported.
735 * @param a_order [in] Requested product matrix, Legendre order.
736 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the fission matrix.
737 *
738 * @return The requested multi-group neutron fission matrix as a GIDI::Matrix.
739 ***********************************************************************************************************/
740
742 Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
743 ExcludeReactionsSet const &a_reactionsToExclude ) const {
744
745 return( m_protare->multiGroupFissionMatrix( a_smr, a_settings, a_temperatureInfo, a_particles, a_order, a_reactionsToExclude ) );
746}
747
748/* *********************************************************************************************************//**
749 * Returns the multi-group transport correction for the requested label. The transport correction is calculated from the transfer matrix
750 * for the projectile id for the Legendre order of *a_order + 1*.
751 *
752 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
753 * @param a_settings [in] Specifies the requested label.
754 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
755 * @param a_particles [in] The list of particles to be transported.
756 * @param a_order [in] Maximum Legendre order for transport. The returned transport correction is for the next higher Legender order.
757 * @param a_transportCorrectionType [in] Requested transport correction type.
758 * @param a_temperature [in] The temperature of the flux to use when collapsing. Pass to the GIDI::collapse method.
759 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the transport correction.
760 *
761 * @return The requested multi-group transport correction as a GIDI::Vector.
762 ***********************************************************************************************************/
763
765 Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
766 TransportCorrectionType a_transportCorrectionType, double a_temperature, ExcludeReactionsSet const &a_reactionsToExclude ) const {
767
768 if( a_transportCorrectionType == TransportCorrectionType::None ) return( Vector( 0 ) );
769
770 Matrix matrix( multiGroupProductMatrix( a_smr, a_settings, a_temperatureInfo, a_particles, projectile( ).ID( ), a_order + 1,
771 a_reactionsToExclude ) );
772 Matrix matrixCollapsed = collapse( matrix, a_settings, a_particles, a_temperature, projectile( ).ID( ) );
773 std::size_t size = matrixCollapsed.size( );
774 std::vector<double> transportCorrection1( size, 0 );
775
776 if( a_transportCorrectionType == TransportCorrectionType::None ) {
777 }
778 else if( a_transportCorrectionType == TransportCorrectionType::Pendlebury ) {
779 for( std::size_t index = 0; index < size; ++index ) transportCorrection1[index] = matrixCollapsed[index][index]; }
780 else {
781 throw Exception( "Unsupported transport correction: only None and Pendlebury (i.e., Pendlebury/Underhill) are currently supported." );
782 }
783 return( Vector( transportCorrection1 ) );
784}
785
786/* *********************************************************************************************************//**
787 * Returns the multi-group, total available energy for the requested label. This is a cross section weighted available energy
788 * summed over all reactions.
789 *
790 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
791 * @param a_settings [in] Specifies the requested label.
792 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
793 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the available energy.
794 *
795 * @return The requested multi-group available energy as a GIDI::Vector.
796 ***********************************************************************************************************/
797
799 Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude ) const {
800
801 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
802 Vector vector = m_protare->multiGroupAvailableEnergy( a_smr, a_settings, a_temperatureInfo, excludeReactionsSet );
803 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
804
805 if( !m_elasticReaction->active( ) ) return( vector );
806
807 Vector vectorElastic = m_elasticReaction->multiGroupAvailableEnergy( a_smr, a_settings, a_temperatureInfo );
808
809 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupAvailableEnergy( a_smr, a_settings, a_temperatureInfo ) );
810 return( vector );
811}
812
813/* *********************************************************************************************************//**
814 * Returns the multi-group, total average energy for the requested label for the requested product. This is a cross section weighted average energy
815 * summed over all reactions.
816 *
817 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
818 * @param a_settings [in] Specifies the requested label.
819 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
820 * @param a_productID [in] Particle id for the requested product.
821 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the average energy.
822 *
823 * @return The requested multi-group average energy as a GIDI::Vector.
824 ***********************************************************************************************************/
825
827 Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID,
828 ExcludeReactionsSet const &a_reactionsToExclude ) const {
829
830 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
831 Vector vector = m_protare->multiGroupAverageEnergy( a_smr, a_settings, a_temperatureInfo, a_productID, excludeReactionsSet );
832 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
833
834 if( !m_elasticReaction->active( ) ) return( vector );
835
836 Vector vectorElastic = m_elasticReaction->multiGroupAverageEnergy( a_smr, a_settings, a_temperatureInfo, a_productID );
837
838 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupAverageEnergy( a_smr, a_settings, a_temperatureInfo, a_productID ) );
839 return( vector );
840}
841
842/* *********************************************************************************************************//**
843 * Returns the multi-group, total deposition energy for the requested label. This is a cross section weighted deposition energy
844 * summed over all reactions. The deposition energy is calculated by subtracting the average energy from each transportable particle
845 * from the available energy. The list of transportable particles is specified via the list of particle specified in the *a_settings* argument.
846 *
847 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
848 * @param a_settings [in] Specifies the requested label and the products that are transported.
849 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
850 * @param a_particles [in] The list of particles to be transported.
851 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the deposition energy.
852 *
853 * @return The requested multi-group deposition energy as a GIDI::Vector.
854 ***********************************************************************************************************/
855
857 Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles,
858 ExcludeReactionsSet const &a_reactionsToExclude ) const {
859
860 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
861 Vector vector = m_protare->multiGroupDepositionEnergy( a_smr, a_settings, a_temperatureInfo, a_particles, excludeReactionsSet );
862 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
863
864 if( !m_elasticReaction->active( ) ) return( vector );
865
866 Vector vectorElastic = m_elasticReaction->multiGroupDepositionEnergy( a_smr, a_settings, a_temperatureInfo, a_particles );
867
868 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupDepositionEnergy( a_smr, a_settings, a_temperatureInfo, a_particles ) );
869 return( vector );
870}
871
872/* *********************************************************************************************************//**
873 * Returns the multi-group, total available momentum for the requested label. This is a cross section weighted available momentum
874 * summed over all reactions.
875 *
876 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
877 * @param a_settings [in] Specifies the requested label.
878 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
879 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the available momentum.
880 *
881 * @return The requested multi-group available momentum as a GIDI::Vector.
882 ***********************************************************************************************************/
883
885 Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude ) const {
886
887 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
888 Vector vector = m_protare->multiGroupAvailableMomentum( a_smr, a_settings, a_temperatureInfo, excludeReactionsSet );
889 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
890
891 if( !m_elasticReaction->active( ) ) return( vector );
892
893 Vector vectorElastic = m_elasticReaction->multiGroupAvailableMomentum( a_smr, a_settings, a_temperatureInfo );
894
895 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupAvailableMomentum( a_smr, a_settings, a_temperatureInfo ) );
896 return( vector );
897}
898
899/* *********************************************************************************************************//**
900 * Returns the multi-group, total average momentum for the requested label for the requested product. This is a cross section weighted average momentum
901 * summed over all reactions.
902 *
903 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
904 * @param a_settings [in] Specifies the requested label.
905 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
906 * @param a_productID [in] Particle id for the requested product.
907 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the average momentum.
908 *
909 * @return The requested multi-group average momentum as a GIDI::Vector.
910 ***********************************************************************************************************/
911
913 Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID,
914 ExcludeReactionsSet const &a_reactionsToExclude ) const {
915
916 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
917 Vector vector = m_protare->multiGroupAverageMomentum( a_smr, a_settings, a_temperatureInfo, a_productID, excludeReactionsSet );
918 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
919
920 if( !m_elasticReaction->active( ) ) return( vector );
921
922 Vector vectorElastic = m_elasticReaction->multiGroupAverageMomentum( a_smr, a_settings, a_temperatureInfo, a_productID );
923
924 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupAverageMomentum( a_smr, a_settings, a_temperatureInfo, a_productID ) );
925 return( vector );
926}
927
928/* *********************************************************************************************************//**
929 * Returns the multi-group, total deposition momentum for the requested label. This is a cross section weighted deposition momentum
930 * summed over all reactions. The deposition momentum is calculated by subtracting the average momentum from each transportable particle
931 * from the available momentum. The list of transportable particles is specified via the list of particle specified in the *a_settings* argument.
932 *
933 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
934 * @param a_settings [in] Specifies the requested label.
935 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
936 * @param a_particles [in] The list of particles to be transported.
937 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the deposition momentum.
938 *
939 * @return The requested multi-group deposition momentum as a GIDI::Vector.
940 ***********************************************************************************************************/
941
943 Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles,
944 ExcludeReactionsSet const &a_reactionsToExclude ) const {
945
946 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
947 Vector vector = m_protare->multiGroupDepositionMomentum( a_smr, a_settings, a_temperatureInfo, a_particles, excludeReactionsSet );
948 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
949
950 if( !m_elasticReaction->active( ) ) return( vector );
951
952 Vector vectorElastic = m_elasticReaction->multiGroupDepositionMomentum( a_smr, a_settings, a_temperatureInfo, a_particles );
953
954 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupDepositionMomentum( a_smr, a_settings, a_temperatureInfo, a_particles ) );
955 return( vector );
956}
957
958/* *********************************************************************************************************//**
959 * Returns the multi-group, gain for the requested particle and label. This is a cross section weighted gain summed over all reactions.
960 *
961 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
962 * @param a_settings [in] Specifies the requested label.
963 * @param a_temperatureInfo [in] Specifies the temperature and labels use to lookup the requested data.
964 * @param a_productID [in] The PoPs' id for the particle whose gain is to be calculated.
965 * @param a_reactionsToExclude [in] A list of reaction indices that are to be ignored when calculating the gain.
966 *
967 * @return The requested multi-group gain as a **GIDI::Vector**.
968 ***********************************************************************************************************/
969
971 Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID,
972 ExcludeReactionsSet const &a_reactionsToExclude ) const {
973
974 std::string const projectile_id = m_protare->projectile( ).ID( );
975 ExcludeReactionsSet excludeReactionsSet( a_reactionsToExclude );
976 Vector vector = m_protare->multiGroupGain( a_smr, a_settings, a_temperatureInfo, a_productID, excludeReactionsSet );
977 excludeReactionsSetAdjust( excludeReactionsSet, *m_protare );
978
979 if( !m_elasticReaction->active( ) ) return( vector );
980
981 Vector vectorElastic = m_elasticReaction->multiGroupGain( a_smr, a_settings, a_temperatureInfo, a_productID, projectile_id );
982
983 combineVectors( a_settings, a_temperatureInfo, vector, vectorElastic, m_TNSL->multiGroupGain( a_smr, a_settings, a_temperatureInfo, a_productID ) );
984
985 return( vector );
986}
987
988/* *********************************************************************************************************//**
989 * If the protare is a ProtareTNSL then summing over all reactions will include the standard protare's elastic cross section
990 * in the domain of the TNSL data. The standard elastic cross section should not be added in this domain.
991 * If needed, this function corrects the cross section for this over counting of the elastic cross section.
992 *
993 * @param a_label [in] The label of the elastic cross section data to use if over counting needs to be corrected.
994 * @param a_crossSectionSum [in] The cross section to correct.
995 ***********************************************************************************************************/
996
997void ProtareTNSL::TNSL_crossSectionSumCorrection( std::string const &a_label, Functions::XYs1d &a_crossSectionSum ) {
998
999 double projectileEnergyMax = m_TNSL->projectileEnergyMax( );
1000 Functions::XYs1d *xys1d = m_elasticReaction->crossSection( ).get<Functions::XYs1d>( a_label );
1001
1002 ptwXYPoints *ptwXY = const_cast<ptwXYPoints *>( xys1d->ptwXY( ) );
1003 ptwXYPoints *sliced = ptwXY_domainMaxSlice( NULL, ptwXY, projectileEnergyMax, ptwXY_length( NULL, ptwXY ), 1 );
1004 Functions::XYs1d slicedXYs1d( a_crossSectionSum.axes( ), sliced );
1005
1006 a_crossSectionSum -= slicedXYs1d;
1007}
1008
1009/* *********************************************************************************************************//**
1010 * If the protare is a ProtareTNSL then summing over all reactions will include the standard protare's elastic cross section
1011 * in the domain of the TNSL data. The standard elastic cross section should not be added in this domain.
1012 * If needed, this function corrects the cross section for this over counting of the elastic cross section.
1013 *
1014 * @param a_label [in] The label of the elastic cross section data to use if over counting needs to be corrected.
1015 * @param a_crossSectionSum [in] The cross section to correct.
1016 ***********************************************************************************************************/
1017
1018void ProtareTNSL::TNSL_crossSectionSumCorrection( std::string const &a_label, Functions::Ys1d &a_crossSectionSum ) {
1019
1020 double projectileEnergyMax = m_TNSL->projectileEnergyMax( );
1021 Styles::GriddedCrossSection const *griddedCrossSection = m_protare->styles( ).get<Styles::GriddedCrossSection>( a_label );
1022 nf_Buffer<double> const energies = griddedCrossSection->grid( ).values( );
1023 Functions::Ys1d const *ys1d = m_elasticReaction->crossSection( ).get<Functions::Ys1d const>( a_label );
1024
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];
1031 }
1032}
1033
1034/* *********************************************************************************************************//**
1035 * This method always returns 1 since the projectile is always a neutron.
1036 *
1037 * @return Always returns 1.
1038 ***********************************************************************************************************/
1039
1041
1042 stringAndDoublePairs stringAndDoublePairs1;
1043
1044 return( stringAndDoublePairs1 );
1045}
1046
1047/* *********************************************************************************************************//**
1048 * Calls the **incompleteParticles** method for each **ProtareSingle** in *this*.
1049 *
1050 * @param a_settings [in] Specifies the requested label.
1051 * @param a_incompleteParticles [out] The list of particles whose **completeParticle** method returns *false*.
1052 ***********************************************************************************************************/
1053
1054void ProtareTNSL::incompleteParticles( Transporting::Settings const &a_settings, std::set<std::string> &a_incompleteParticles ) const {
1055
1056 m_protare->incompleteParticles( a_settings, a_incompleteParticles );
1057 m_TNSL->incompleteParticles( a_settings, a_incompleteParticles );
1058}
1059
1060}
#define LUPI_maybeUnused
Axes const & axes() const
Definition GIDI.hpp:1012
ptwXYPoints const * ptwXY() const
Definition GIDI.hpp:1101
std::vector< double > const & Ys() const
Definition GIDI.hpp:1166
std::size_t start() const
Definition GIDI.hpp:1163
nf_Buffer< double > const & values() const
Definition GIDI.hpp:849
std::size_t size() 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
Styles::Suite & styles()
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
Definition GIDI.hpp:4541
Grid const & grid() const
Definition GIDI.hpp:3368
std::string const & heatedMultiGroup() const
Definition GIDI.hpp:3434
std::size_t size() const
Definition GIDI_data.hpp:79
std::vector< Styles::TemperatureInfo > TemperatureInfos
Definition GIDI.hpp:3440
Definition GIDI.hpp:32
Frame
Definition GIDI.hpp:146
void excludeReactionsSetAdjust(ExcludeReactionsSet &a_excludeReactionsSet, Protare const &a_protare)
Definition GIDI_misc.cc:461
std::vector< stringAndDoublePair > stringAndDoublePairs
Definition GIDI.hpp:486
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
Definition GIDI.hpp:47
TransportCorrectionType
Definition GIDI.hpp:147
struct ptwXYPoints_s ptwXYPoints
ptwXYPoints * ptwXY_domainMaxSlice(statusMessageReporting *smr, ptwXYPoints *ptwXY, double domainMax, int64_t secondarySize, int fill)
Definition ptwXY_core.c:499
int64_t ptwXY_length(statusMessageReporting *smr, ptwXYPoints *ptwXY)
Definition ptwXY_core.c:793
static std::string const neutron
Definition PoPI.hpp:164