Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
MCGIDI_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 <map>
11
12#include "MCGIDI.hpp"
13
14namespace MCGIDI {
15
16/* *********************************************************************************************************//**
17 * For internal use only. Function to determine the GIDI::Styles::TemperatureInfos from a GIDI::ProtareSingle that contains TNSL data,
18 * protare given the parameters specified in the ransporting::MC *a_settings*.
19 *
20 * @param a_protare [in] A GIDI::ProtareSingle that contains TNSL data.
21 * @param a_settings [in] Used to pass user options to the *this* to instruct it which data are desired.
22 *
23 * @return
24 ***********************************************************************************************************/
25
26static LUPI_HOST GIDI::Styles::TemperatureInfos TNSL_temperatureInfos( GIDI::ProtareSingle const &a_protare, LUPI_maybeUnused Transporting::MC &a_settings ) {
27
28 return( a_protare.temperatures( ) );
29}
30
31/*! \class ProtareTNSL
32 * Class representing a **GNDS** <**reactionSuite**> node with only data needed for Monte Carlo transport. The
33 * data are also stored in a way that is better suited for Monte Carlo transport. For example, cross section data
34 * for each reaction are not stored with its reaction, but within the HeatedCrossSections member of the Protare.
35 */
36
37/* *********************************************************************************************************//**
38 * Default constructor used when broadcasting a Protare as needed by MPI or GPUs.
39 ***********************************************************************************************************/
40
43 m_numberOfTNSLReactions( 0 ),
44 m_TNSL_maximumEnergy( 0.0 ),
45 m_TNSL_maximumTemperature( 0.0 ),
46 m_protareWithElastic( nullptr ),
47 m_TNSL( nullptr ),
48 m_protareWithoutElastic( nullptr ) {
49
50}
51
52/* *********************************************************************************************************//**
53 * @param a_smr [Out] If errors are not to be thrown, then the error is reported via this instance.
54 * @param a_protare [in] The GIDI::Protare whose data is to be used to construct *this*.
55 * @param a_pops [in] A PoPs Database instance used to get particle intids and possibly other particle information.
56 * @param a_settings [in] Used to pass user options to the *this* to instruct it which data are desired.
57 * @param a_particles [in] List of transporting particles and their information (e.g., multi-group boundaries and fluxes).
58 * @param a_domainHash [in] The hash data used when looking up a cross section.
59 * @param a_temperatureInfos [in] The list of temperature data to extract from *a_protare*.
60 * @param a_reactionsToExclude [in] A list of reaction to not include in the MCGIDI::Protare. This currently does not work for ProtareTNSL.
61 * @param a_reactionsToExcludeOffset [in] The starting index for the reactions in this ProtareSingle.
62 * @param a_allowFixedGrid [in] For internal (i.e., MCGIDI) use only. Users must use the default value.
63 ***********************************************************************************************************/
64
66 GIDI::Transporting::Particles const &a_particles, DomainHash const &a_domainHash, GIDI::Styles::TemperatureInfos const &a_temperatureInfos,
67 GIDI::ExcludeReactionsSet const &a_reactionsToExclude, std::size_t a_reactionsToExcludeOffset, LUPI_maybeUnused bool a_allowFixedGrid ) :
68 Protare( ProtareType::TNSL, a_protare, a_settings, a_pops ),
69 m_protareWithElastic( static_cast<ProtareSingle *>( protareFromGIDIProtare( a_smr, *a_protare.protare( ), a_pops, a_settings, a_particles,
70 a_domainHash, a_temperatureInfos, a_reactionsToExclude, a_reactionsToExcludeOffset, false ) ) ),
71 m_TNSL( static_cast<ProtareSingle *>( protareFromGIDIProtare( a_smr, *a_protare.TNSL( ), a_pops, a_settings, a_particles, a_domainHash,
72 TNSL_temperatureInfos( *a_protare.TNSL( ), a_settings ), a_reactionsToExclude, a_reactionsToExcludeOffset + m_protareWithElastic->numberOfReactions( ), false ) ) ),
73 m_protareWithoutElastic( nullptr ) {
74
75 GIDI::ExcludeReactionsSet reactionsToExclude( a_reactionsToExclude );
76
77 reactionsToExclude.insert( 0 );
78 m_protareWithoutElastic = static_cast<ProtareSingle *>( protareFromGIDIProtare( a_smr, *a_protare.protare( ), a_pops, a_settings, a_particles, a_domainHash, a_temperatureInfos, reactionsToExclude ) );
79 m_protareWithoutElastic->setUpscatterModelASupported( false );
80
81 m_numberOfTNSLReactions = m_TNSL->numberOfReactions( );
82 m_TNSL_maximumEnergy = m_TNSL->maximumEnergy( );
83 m_TNSL_maximumTemperature = m_TNSL->temperatures( ).back( );
84
85 std::set<int> product_intids;
86 std::set<int> product_intids_transportable;
87 std::set<int> product_indices;
88 std::set<int> product_indices_transportable;
89
90 addVectorItemsToSet( m_TNSL->productIntids( false ), product_intids );
91 addVectorItemsToSet( m_protareWithElastic->productIntids( true ), product_intids_transportable );
92 addVectorItemsToSet( m_TNSL->productIndices( false ), product_indices );
93 addVectorItemsToSet( m_protareWithElastic->productIndices( true ), product_indices_transportable );
94 productIntidsAndIndices( product_intids, product_intids_transportable, product_indices, product_indices_transportable );
95}
96
97/* *********************************************************************************************************//**
98 ***********************************************************************************************************/
99
101
102 delete m_protareWithElastic;
103 delete m_TNSL;
104 delete m_protareWithoutElastic;
105}
106
107/* *********************************************************************************************************//**
108 * Updates the m_userParticleIndex to *a_userParticleIndex* for all particles with PoPs index *a_particleIndex*.
109 *
110 * @param a_particleIndex [in] The PoPs index of the particle whose user index is to be set.
111 * @param a_userParticleIndex [in] The particle index specified by the user.
112 ***********************************************************************************************************/
113
114LUPI_HOST void ProtareTNSL::setUserParticleIndex2( int a_particleIndex, int a_userParticleIndex ) {
115
116 m_protareWithElastic->setUserParticleIndex( a_particleIndex, a_userParticleIndex );
117 m_TNSL->setUserParticleIndex( a_particleIndex, a_userParticleIndex );
118 m_protareWithoutElastic->setUserParticleIndex( a_particleIndex, a_userParticleIndex );
119}
120
121/* *********************************************************************************************************//**
122 * Updates the m_userParticleIndex to *a_userParticleIndex* for all particles with PoPs intid *a_particleIntid*.
123 *
124 * @param a_particleIntid [in] The PoPs intid of the particle whose user index is to be set.
125 * @param a_userParticleIndex [in] The particle index specified by the user.
126 ***********************************************************************************************************/
127
128LUPI_HOST void ProtareTNSL::setUserParticleIndexViaIntid2( int a_particleIntid, int a_userParticleIndex ) {
129
130 m_protareWithElastic->setUserParticleIndexViaIntid( a_particleIntid, a_userParticleIndex );
131 m_TNSL->setUserParticleIndexViaIntid( a_particleIntid, a_userParticleIndex );
132 m_protareWithoutElastic->setUserParticleIndexViaIntid( a_particleIntid, a_userParticleIndex );
133}
134
135
136/* *********************************************************************************************************//**
137 * Returns the pointer representing the (a_index - 1)th **ProtareSingle**.
138 *
139 * @param a_index [in] Index of the **ProtareSingle** to return. Can only be 0 or 1.
140 *
141 * @return Pointer to the requested protare or nullptr if invalid *a_index*..
142 ***********************************************************************************************************/
143
144LUPI_HOST_DEVICE ProtareSingle const *ProtareTNSL::protare( std::size_t a_index ) const {
145
146 if( a_index == 0 ) return( m_protareWithElastic );
147 if( a_index == 1 ) return( m_TNSL );
148 return( nullptr );
149}
150
151/* *********************************************************************************************************//**
152 * Returns the pointer representing the (a_index - 1)th **ProtareSingle**.
153 *
154 * @param a_index [in] Index of the **ProtareSingle** to return. Can only be 0 or 1.
155 *
156 * @return Pointer to the requested protare or nullptr if invalid *a_index*..
157 ***********************************************************************************************************/
158
160
161 if( a_index == 0 ) return( m_protareWithElastic );
162 if( a_index == 1 ) return( m_TNSL );
163 return( nullptr );
164}
165
166/* *********************************************************************************************************//**
167 * Returns the pointer to the **ProtareSingle** that contains the (a_index - 1)th reaction.
168 *
169 * @param a_index [in] Index of the reaction.
170 *
171 * @return Pointer to the requested protare or nullptr if invalid *a_index*..
172 ***********************************************************************************************************/
173
175
176 if( a_index < m_numberOfTNSLReactions ) return( m_TNSL );
177 return( m_protareWithElastic->protareWithReaction( a_index - m_numberOfTNSLReactions ) );
178}
179
180/* *********************************************************************************************************//**
181 * Returns the list of temperatures for the requested ProtareSingle.
182 *
183 * @param a_index [in] Index of the reqested ProtareSingle.
184 *
185 * @return Vector of doubles.
186 ***********************************************************************************************************/
187
189
190 if( a_index == 0 ) return( m_protareWithElastic->temperatures( 0 ) );
191 if( a_index == 1 ) return( m_TNSL->temperatures( 0 ) );
192
193 LUPI_THROW( "ProtareSingle::temperatures: a_index not 0 or 1." );
194
195 Vector<double> temps; // Only to stop compilers from complaining.
196 return( temps );
197}
198
199/* *********************************************************************************************************//**
200 * Returns the reaction at index *a_index*. If *a_index* is negative, the reaction of the TNSL protare at index -*a_index* is
201 * returned; otherwise, the reaction from the regular protare at index *a_index* is returned.
202 *
203 * @param a_index [in] The index of the reaction to return.
204 *
205 * @return The reaction at index *a_index*.
206 ***********************************************************************************************************/
207
208LUPI_HOST_DEVICE Reaction const *ProtareTNSL::reaction( std::size_t a_index ) const {
209
210 if( a_index < m_numberOfTNSLReactions ) return( m_TNSL->reaction( a_index ) );
211 return( m_protareWithElastic->reaction( a_index - m_numberOfTNSLReactions ) );
212}
213
214/* *********************************************************************************************************//**
215 * Returns *true* if the reaction at index *a_index* has URR robability tables and false otherwise.
216 *
217 * @param a_index [in] The index of the reaction.
218 *
219 * @return *true* if the reaction has URR robability tables and false otherwise.
220 ***********************************************************************************************************/
221
223
224 if( a_index < m_numberOfTNSLReactions ) return( false );
225 return( m_protareWithElastic->reactionHasURR_probabilityTables( a_index - m_numberOfTNSLReactions ) );
226}
227
228/* *********************************************************************************************************//**
229 * Returns the threshold for the reaction at index *a_index*. If *a_index* is negative, it is set to 0 before the
230 * threshold in the regular protare is returned.
231 *
232 * @param a_index [in] The index of the reaction.
233 *
234 * @return The threshold for reaction at index *a_index*.
235 ***********************************************************************************************************/
236
237LUPI_HOST_DEVICE double ProtareTNSL::threshold( std::size_t a_index ) const {
238
239 if( a_index < m_numberOfTNSLReactions ) return( m_TNSL->threshold( a_index ) );
240 return( m_protareWithElastic->threshold( a_index - m_numberOfTNSLReactions ) );
241}
242
243/* *********************************************************************************************************//**
244 * Returns the total cross section.
245 *
246 * @param a_URR_protareInfos [in] URR information.
247 * @param a_hashIndex [in] The cross section hash index.
248 * @param a_temperature [in] The target temperature.
249 * @param a_energy [in] The projectile energy.
250 * @param a_sampling [in] Only used for multi-group cross sections. When sampling, the cross section in the group where threshold
251 * is present the cross section is augmented.
252 *
253 * @return The total cross section.
254 ***********************************************************************************************************/
255
256LUPI_HOST_DEVICE double ProtareTNSL::crossSection( URR_protareInfos const &a_URR_protareInfos, std::size_t a_hashIndex, double a_temperature, double a_energy, bool a_sampling ) const {
257
258 double crossSection1 = 0.0;
259
260 if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
261 crossSection1 = m_TNSL->crossSection( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_sampling ) +
262 m_protareWithoutElastic->crossSection( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_sampling ); }
263 else {
264 crossSection1 = m_protareWithElastic->crossSection( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_sampling );
265 }
266
267 return( crossSection1 );
268}
269
270/* *********************************************************************************************************//**
271 * Adds the energy dependent, total cross section corresponding to the temperature *a_temperature* multiplied by *a_userFactor* to *a_crossSectionVector*.
272 *
273 * @param a_temperature [in] Specifies the temperature of the material.
274 * @param a_userFactor [in] User factor which all cross sections are multiplied by.
275 * @param a_numberAllocated [in] The length of memory allocated for *a_crossSectionVector*.
276 * @param a_crossSectionVector [in/out] The energy dependent, total cross section to add cross section data to.
277 ***********************************************************************************************************/
278
279LUPI_HOST_DEVICE void ProtareTNSL::crossSectionVector( double a_temperature, double a_userFactor, std::size_t a_numberAllocated,
280 double *a_crossSectionVector ) const {
281
282 if( a_temperature <= m_TNSL_maximumTemperature ) {
283 m_TNSL->crossSectionVector( a_temperature, a_userFactor, a_numberAllocated, a_crossSectionVector );
284 m_protareWithoutElastic->crossSectionVector( a_temperature, a_userFactor, a_numberAllocated, a_crossSectionVector ); }
285 else {
286 m_protareWithElastic->crossSectionVector( a_temperature, a_userFactor, a_numberAllocated, a_crossSectionVector );
287 }
288}
289
290/* *********************************************************************************************************//**
291 * Returns the cross section for reaction at index *a_reactionIndex*, for target at temperature *a_temperature* and projectile of energy *a_energy*.
292 *
293 * @param a_URR_protareInfos [in] URR information.
294 * @param a_reactionIndex [in] The index of the reaction.
295 * @param a_hashIndex [in] The cross section hash index.
296 * @param a_temperature [in] The target temperature.
297 * @param a_energy [in] The projectile energy.
298 * @param a_sampling [in] Only used for multi-group cross sections. When sampling, the cross section in the group where threshold
299 * is present the cross section is augmented.
300 *
301 * @return The total cross section.
302 ***********************************************************************************************************/
303
304LUPI_HOST_DEVICE double ProtareTNSL::reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, std::size_t a_hashIndex, double a_temperature, double a_energy, bool a_sampling ) const {
305
306 std::size_t index = a_reactionIndex - m_numberOfTNSLReactions;
307 double crossSection1 = 0.0;
308
309 if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
310 if( a_reactionIndex < m_numberOfTNSLReactions ) {
311 crossSection1 = m_TNSL->reactionCrossSection( a_reactionIndex, a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_sampling ); }
312 else {
313 if( a_reactionIndex > m_numberOfTNSLReactions ) crossSection1 = m_protareWithElastic->reactionCrossSection( index, a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_sampling );
314 } }
315 else {
316 if( a_reactionIndex >= m_numberOfTNSLReactions ) crossSection1 = m_protareWithElastic->reactionCrossSection( index, a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_sampling );
317 }
318
319 return( crossSection1 );
320}
321
322/* *********************************************************************************************************//**
323 * Returns the cross section for reaction at index *a_reactionIndex*, for target at temperature *a_temperature* and projectile of energy *a_energy*.
324 *
325 * @param a_URR_protareInfos [in] URR information.
326 * @param a_reactionIndex [in] The index of the reaction.
327 * @param a_temperature [in] The target temperature.
328 * @param a_energy [in] The projectile energy.
329 *
330 * @return The total cross section.
331 ***********************************************************************************************************/
332
333LUPI_HOST_DEVICE double ProtareTNSL::reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, double a_temperature, double a_energy ) const {
334
335 std::size_t index = a_reactionIndex - m_numberOfTNSLReactions;
336 double crossSection1 = 0.0;
337
338 if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
339 if( a_reactionIndex < m_numberOfTNSLReactions ) {
340 crossSection1 = m_TNSL->reactionCrossSection( a_reactionIndex, a_URR_protareInfos, a_temperature, a_energy ); }
341 else {
342 if( a_reactionIndex > m_numberOfTNSLReactions ) crossSection1 = m_protareWithElastic->reactionCrossSection( index, a_URR_protareInfos, a_temperature, a_energy );
343 } }
344 else {
345 if( a_reactionIndex >= m_numberOfTNSLReactions ) crossSection1 = m_protareWithElastic->reactionCrossSection( index, a_URR_protareInfos, a_temperature, a_energy );
346 }
347
348 return( crossSection1 );
349}
350
351/* *********************************************************************************************************//**
352 * Returns the total deposition energy.
353 *
354 * @param a_hashIndex [in] The cross section hash index.
355 * @param a_temperature [in] The target temperature.
356 * @param a_energy [in] The projectile energy.
357 *
358 * @return The total deposition energy.
359 ***********************************************************************************************************/
360
361LUPI_HOST_DEVICE double ProtareTNSL::depositionEnergy( std::size_t a_hashIndex, double a_temperature, double a_energy ) const {
362
363 double deposition_energy = 0.0;
364
365 if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
366 deposition_energy = m_TNSL->depositionEnergy( a_hashIndex, a_temperature, a_energy ) +
367 m_protareWithoutElastic->depositionEnergy( a_hashIndex, a_temperature, a_energy ); }
368 else {
369 deposition_energy = m_protareWithElastic->depositionEnergy( a_hashIndex, a_temperature, a_energy );
370 }
371
372 return( deposition_energy );
373}
374
375/* *********************************************************************************************************//**
376 * Returns the total deposition momentum.
377 *
378 * @param a_hashIndex [in] The cross section hash index.
379 * @param a_temperature [in] The target temperature.
380 * @param a_energy [in] The projectile energy.
381 *
382 * @return The total deposition momentum.
383 ***********************************************************************************************************/
384
385LUPI_HOST_DEVICE double ProtareTNSL::depositionMomentum( std::size_t a_hashIndex, double a_temperature, double a_energy ) const {
386
387 double deposition_momentum = 0.0;
388
389 if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
390 deposition_momentum = m_TNSL->depositionMomentum( a_hashIndex, a_temperature, a_energy ) +
391 m_protareWithoutElastic->depositionMomentum( a_hashIndex, a_temperature, a_energy ); }
392 else {
393 deposition_momentum = m_protareWithElastic->depositionMomentum( a_hashIndex, a_temperature, a_energy );
394 }
395
396 return( deposition_momentum );
397}
398
399/* *********************************************************************************************************//**
400 * Returns the total production energy.
401 *
402 * @param a_hashIndex [in] The cross section hash index.
403 * @param a_temperature [in] The target temperature.
404 * @param a_energy [in] The projectile energy.
405 *
406 * @return The total production energy.
407 ***********************************************************************************************************/
408
409LUPI_HOST_DEVICE double ProtareTNSL::productionEnergy( std::size_t a_hashIndex, double a_temperature, double a_energy ) const {
410
411 double production_energy = 0.0;
412
413 if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
414 production_energy = m_TNSL->productionEnergy( a_hashIndex, a_temperature, a_energy ) +
415 m_protareWithoutElastic->productionEnergy( a_hashIndex, a_temperature, a_energy ); }
416 else {
417 production_energy = m_protareWithElastic->productionEnergy( a_hashIndex, a_temperature, a_energy );
418 }
419
420 return( production_energy );
421}
422
423/* *********************************************************************************************************//**
424 * Returns the gain for particle with index *a_particleIndex*.
425 *
426 * @param a_hashIndex [in] The cross section hash index.
427 * @param a_temperature [in] The temperature of the target.
428 * @param a_energy [in] The projectile energy.
429 * @param a_particleIndex [in] The index of the particle whose gain is to be returned.
430 *
431 * @return [in] A vector of the length of the number of multi-group groups.
432 ***********************************************************************************************************/
433
434LUPI_HOST_DEVICE double ProtareTNSL::gain( std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIndex ) const {
435
436 double gain1 = 0.0;
437
438 if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
439 gain1 = m_TNSL->gain( a_hashIndex, a_temperature, a_energy, a_particleIndex ) +
440 m_protareWithoutElastic->gain( a_hashIndex, a_temperature, a_energy, a_particleIndex ); }
441 else {
442 gain1 = m_protareWithElastic->gain( a_hashIndex, a_temperature, a_energy, a_particleIndex );
443 }
444
445 return( gain1 );
446}
447
448/* *********************************************************************************************************//**
449 * Returns the gain for particle with intid *a_particleIntid*.
450 *
451 * @param a_hashIndex [in] The cross section hash index.
452 * @param a_temperature [in] The temperature of the target.
453 * @param a_energy [in] The projectile energy.
454 * @param a_particleIntid [in] The intid of the particle whose gain is to be returned.
455 *
456 * @return [in] A vector of the length of the number of multi-group groups.
457 ***********************************************************************************************************/
458
459LUPI_HOST_DEVICE double ProtareTNSL::gainViaIntid( std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const {
460
461 double gain1 = 0.0;
462
463 if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
464 gain1 = m_TNSL->gainViaIntid( a_hashIndex, a_temperature, a_energy, a_particleIntid ) +
465 m_protareWithoutElastic->gainViaIntid( a_hashIndex, a_temperature, a_energy, a_particleIntid ); }
466 else {
467 gain1 = m_protareWithElastic->gainViaIntid( a_hashIndex, a_temperature, a_energy, a_particleIntid );
468 }
469
470 return( gain1 );
471}
472
473/* *********************************************************************************************************//**
474 * This method serializes *this* for broadcasting as needed for MPI and GPUs. The method can count the number of required
475 * bytes, pack *this* or unpack *this* depending on *a_mode*.
476 *
477 * @param a_buffer [in] The buffer to read or write data to depending on *a_mode*.
478 * @param a_mode [in] Specifies the action of this method.
479 ***********************************************************************************************************/
480
482
483 int numberOfTNSLReactions = static_cast<int>( m_numberOfTNSLReactions );
484 DATA_MEMBER_INT( numberOfTNSLReactions, a_buffer, a_mode );
485 m_numberOfTNSLReactions = static_cast<std::size_t>( numberOfTNSLReactions );
486
487 DATA_MEMBER_DOUBLE( m_TNSL_maximumEnergy, a_buffer, a_mode );
488 DATA_MEMBER_DOUBLE( m_TNSL_maximumTemperature, a_buffer, a_mode );
489
490 if( a_mode == LUPI::DataBuffer::Mode::Unpack ) {
491 if( a_buffer.m_placement != nullptr ) {
492 m_protareWithElastic = new(a_buffer.m_placement) ProtareSingle;
493 a_buffer.incrementPlacement( sizeof( ProtareSingle ) );
494 m_TNSL = new(a_buffer.m_placement) ProtareSingle;
495 a_buffer.incrementPlacement( sizeof( ProtareSingle ) );
496 m_protareWithoutElastic = new(a_buffer.m_placement) ProtareSingle;
497 a_buffer.incrementPlacement( sizeof( ProtareSingle ) ); }
498 else {
499 m_protareWithElastic = new ProtareSingle( );
500 m_TNSL = new ProtareSingle( );
501 m_protareWithoutElastic = new ProtareSingle( );
502 }
503 }
504 if( a_mode == LUPI::DataBuffer::Mode::Memory ) {
505 a_buffer.incrementPlacement( sizeof( ProtareSingle ) );
506 a_buffer.incrementPlacement( sizeof( ProtareSingle ) );
507 a_buffer.incrementPlacement( sizeof( ProtareSingle ) );
508 }
509 m_protareWithElastic->serializeCommon( a_buffer, a_mode );
510 m_protareWithElastic->serialize2( a_buffer, a_mode );
511 m_TNSL->serializeCommon( a_buffer, a_mode );
512 m_TNSL->serialize2( a_buffer, a_mode );
513 m_protareWithoutElastic->serializeCommon( a_buffer, a_mode );
514 m_protareWithoutElastic->serialize2( a_buffer, a_mode );
515}
516
517}
#define DATA_MEMBER_DOUBLE(member, buf, mode)
#define DATA_MEMBER_INT( member, buf, mode)
#define LUPI_HOST_DEVICE
#define LUPI_THROW(arg)
#define LUPI_HOST
#define LUPI_maybeUnused
Styles::TemperatureInfos temperatures() const
ProtareSingle * protare(std::size_t a_index=0)
LUPI_HOST_DEVICE void incrementPlacement(std::size_t a_delta)
LUPI_HOST_DEVICE Vector< double > temperatures(std::size_t a_index=0) const
LUPI_HOST_DEVICE double maximumEnergy() const
Definition MCGIDI.hpp:1684
LUPI_HOST_DEVICE std::size_t numberOfReactions() const
Definition MCGIDI.hpp:1694
LUPI_HOST_DEVICE Vector< double > temperatures(std::size_t a_index=0) const
LUPI_HOST_DEVICE double productionEnergy(std::size_t a_hashIndex, double a_temperature, double a_energy) const
LUPI_HOST_DEVICE double depositionMomentum(std::size_t a_hashIndex, double a_temperature, double a_energy) const
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables(std::size_t a_index) const
LUPI_HOST_DEVICE ProtareTNSL()
LUPI_HOST_DEVICE Reaction const * reaction(std::size_t a_index) const
LUPI_HOST_DEVICE ProtareSingle const * TNSL() const
Definition MCGIDI.hpp:1851
LUPI_HOST void setUserParticleIndex2(int a_particleIndex, int a_userParticleIndex)
LUPI_HOST_DEVICE void serialize2(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE double threshold(std::size_t a_index) const
LUPI_HOST_DEVICE double reactionCrossSection(std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, std::size_t a_hashIndex, double a_temperature, double a_energy, bool a_sampling=false) const
LUPI_HOST_DEVICE ~ProtareTNSL()
LUPI_HOST_DEVICE void crossSectionVector(double a_temperature, double a_userFactor, std::size_t a_numberAllocated, double *a_crossSectionVector) const
LUPI_HOST_DEVICE double crossSection(URR_protareInfos const &a_URR_protareInfos, std::size_t a_hashIndex, double a_temperature, double a_energy, bool a_sampling=false) const
LUPI_HOST_DEVICE double gainViaIntid(std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIntid) const
LUPI_HOST_DEVICE double gain(std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIndex) const
LUPI_HOST void setUserParticleIndexViaIntid2(int a_particleIntid, int a_userParticleIndex)
LUPI_HOST_DEVICE ProtareSingle const * protareWithReaction(std::size_t a_index) const
LUPI_HOST_DEVICE ProtareSingle const * protare(std::size_t a_index) const
LUPI_HOST_DEVICE double depositionEnergy(std::size_t a_hashIndex, double a_temperature, double a_energy) const
LUPI_HOST Vector< int > const & productIndices(bool a_transportablesOnly) const
friend ProtareSingle
Definition MCGIDI.hpp:1599
LUPI_HOST Vector< int > const & productIntids(bool a_transportablesOnly) const
LUPI_HOST_DEVICE Protare(ProtareType a_protareType)
LUPI_HOST_DEVICE T & back()
std::vector< Styles::TemperatureInfo > TemperatureInfos
Definition GIDI.hpp:3440
std::set< std::size_t > ExcludeReactionsSet
Definition GIDI.hpp:47
Simple C++ string class, useful as replacement for std::string if this cannot be used,...
Definition MCGIDI.hpp:43
LUPI_HOST void addVectorItemsToSet(Vector< int > const &a_from, std::set< int > &a_to)
LUPI_HOST Protare * protareFromGIDIProtare(LUPI::StatusMessageReporting &a_smr, GIDI::Protare const &a_protare, PoPI::Database const &a_pops, Transporting::MC &a_settings, GIDI::Transporting::Particles const &a_particles, DomainHash const &a_domainHash, GIDI::Styles::TemperatureInfos const &a_temperatureInfos, GIDI::ExcludeReactionsSet const &a_reactionsToExclude, std::size_t a_reactionsToExcludeOffset=0, bool a_allowFixedGrid=true)
ProtareType
Definition MCGIDI.hpp:79