28 m_numberOfReactions( 0 ),
29 m_numberOfOrphanProducts( 0 ),
30 m_minimumEnergy( 0.0 ),
31 m_maximumEnergy( 0.0 ) {
51 std::size_t a_reactionsToExcludeOffset,
LUPI_maybeUnused bool a_allowFixedGrid ) :
53 m_numberOfReactions( 0 ),
54 m_numberOfOrphanProducts( 0 ) {
57 std::size_t length =
static_cast<std::size_t
>(
protares.size( ) );
59 std::set<int> product_intids;
60 std::set<int> product_intids_transportable;
61 std::set<int> product_indices;
62 std::set<int> product_indices_transportable;
64 m_protares.resize( length );
65 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
68 m_protares[i1] =
static_cast<ProtareSingle *
>(
protareFromGIDIProtare( a_smr, *
protare, a_pops, a_settings, a_particles, a_domainHash, a_temperatureInfos, a_reactionsToExclude, a_reactionsToExcludeOffset,
false ) );
70 m_numberOfReactions += m_protares[i1]->numberOfReactions( );
71 m_numberOfOrphanProducts += m_protares[i1]->numberOfOrphanProducts( );
74 m_minimumEnergy = m_protares[0]->minimumEnergy( );
75 m_maximumEnergy = m_protares[0]->maximumEnergy( );
77 if( m_protares[i1]->
minimumEnergy( ) < m_minimumEnergy ) m_minimumEnergy = m_protares[i1]->minimumEnergy( );
78 if( m_protares[i1]->
maximumEnergy( ) > m_maximumEnergy ) m_maximumEnergy = m_protares[i1]->maximumEnergy( );
88 productIntidsAndIndices( product_intids, product_intids_transportable, product_indices, product_indices_transportable );
96 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
98 for( std::size_t i1 = 0; i1 < length; ++i1 )
delete m_protares[i1];
110 for(
auto iter = m_protares.begin( ); iter != m_protares.end( ); ++iter ) (*iter)->setUserParticleIndex( a_particleIndex, a_userParticleIndex );
122 for(
auto iter = m_protares.begin( ); iter != m_protares.end( ); ++iter ) (*iter)->setUserParticleIndexViaIntid( a_particleIntid, a_userParticleIndex );
135 for( std::size_t i1 = 0; i1 < m_protares.size( ); ++i1 ) {
136 std::size_t number = m_protares[i1]->numberOfProtares( );
138 if( number > a_index )
return( m_protares[i1]->
protare( a_index ) );
155 for( std::size_t i1 = 0; i1 < m_protares.size( ); ++i1 ) {
156 std::size_t number = m_protares[i1]->numberOfProtares( );
158 if( number > a_index )
return( m_protares[i1]->
protare( a_index ) );
175 for( std::size_t i1 = 0; i1 < m_protares.size( ); ++i1 ) {
195 for( std::size_t i1 = 0; i1 < m_protares.size( ); ++i1 ) {
196 std::size_t number = m_protares[i1]->numberOfProtares( );
198 if( number > a_index )
return( m_protares[i1]->
temperatures( a_index ) );
202 LUPI_THROW(
"ProtareSingle::temperatures: a_index not in range." );
219 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
221 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
242 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
244 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
262 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
264 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
265 if( m_protares[i1]->
hasFission( ) )
return(
true );
279 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
281 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
296 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
298 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
313 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
314 double URR_domain_min = 1e32;
316 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
318 if( URR_domain_min > m_protares[i1]->
URR_domainMin( ) ) URR_domain_min = m_protares[i1]->URR_domainMin( );
322 if( URR_domain_min == 1e32 ) URR_domain_min = -1.0;
324 return( URR_domain_min );
335 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
336 double URR_domain_max = -1.0;
338 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
340 if( URR_domain_max < m_protares[i1]->
URR_domainMax( ) ) URR_domain_max = m_protares[i1]->URR_domainMax( );
345 return( URR_domain_max );
358 std::size_t length = m_protares.size( );
360 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
381 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
383 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
408 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
409 double cross_section = 0.0;
411 for( std::size_t i1 = 0; i1 < length; ++i1 ) cross_section += m_protares[i1]->
crossSection( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_sampling );
413 return( cross_section );
427 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
429 for( std::size_t i1 = 0; i1 < length; ++i1 ) m_protares[i1]->
crossSectionVector( a_temperature, a_userFactor, a_numberAllocated, a_crossSectionVector );
448 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
449 double cross_section = 0.0;
451 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
455 cross_section = m_protares[i1]->reactionCrossSection( a_reactionIndex, a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_sampling );
461 return( cross_section );
477 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
478 double cross_section = 0.0;
480 for( std::size_t i1 = 0; i1 < length; ++i1 ) {
484 cross_section = m_protares[i1]->reactionCrossSection( a_reactionIndex, a_URR_protareInfos, a_temperature, a_energy );
490 return( cross_section );
505 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
506 double deposition_energy = 0.0;
508 for( std::size_t i1 = 0; i1 < length; ++i1 ) deposition_energy += m_protares[i1]->
depositionEnergy( a_hashIndex, a_temperature, a_energy );
510 return( deposition_energy );
525 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
526 double deposition_momentum = 0.0;
528 for( std::size_t i1 = 0; i1 < length; ++i1 ) deposition_momentum += m_protares[i1]->
depositionMomentum( a_hashIndex, a_temperature, a_energy );
530 return( deposition_momentum );
545 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
546 double production_energy = 0.0;
548 for( std::size_t i1 = 0; i1 < length; ++i1 ) production_energy += m_protares[i1]->
productionEnergy( a_hashIndex, a_temperature, a_energy );
550 return( production_energy );
566 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
567 double gain1 = m_protares[0]->gain( a_hashIndex, a_temperature, a_energy, a_particleIndex );
569 for( std::size_t i1 = 1; i1 < length; ++i1 ) gain1 += m_protares[i1]->
gain( a_hashIndex, a_temperature, a_energy, a_particleIndex );
587 std::size_t length =
static_cast<std::size_t
>( m_protares.size( ) );
588 double gain1 = m_protares[0]->gainViaIntid( a_hashIndex, a_temperature, a_energy, a_particleIntid );
590 for( std::size_t i1 = 1; i1 < length; ++i1 ) gain1 += m_protares[i1]->
gainViaIntid( a_hashIndex, a_temperature, a_energy, a_particleIntid );
605 std::size_t vectorSize = m_protares.size( );
606 int vectorSizeInt =
static_cast<int>( vectorSize );
615 vectorSize =
static_cast<std::size_t
>( vectorSizeInt );
618 m_protares.resize( vectorSize, &(workingBuffer->
m_placement) );
619 for( std::size_t vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) {
633 for( std::size_t i1 = 0; i1 < vectorSize; ++i1 ) {
634 m_protares[i1]->serializeCommon( a_buffer, a_mode );
635 m_protares[i1]->serialize2( a_buffer, a_mode );
#define DATA_MEMBER_SIZE_T(member, buf, mode)
#define DATA_MEMBER_DOUBLE(member, buf, mode)
#define DATA_MEMBER_INT( member, buf, mode)
std::vector< Protare * > & protares()
LUPI_HOST_DEVICE void incrementPlacement(std::size_t a_delta)
LUPI_HOST_DEVICE Reaction const * reaction(std::size_t a_index) const
LUPI_HOST_DEVICE ProtareSingle const * protareWithReaction(std::size_t a_index) const
LUPI_HOST_DEVICE Vector< double > temperatures(std::size_t a_index=0) const
LUPI_HOST_DEVICE Reaction const * orphanProduct(std::size_t a_index) const
LUPI_HOST void setUserParticleIndexViaIntid2(int a_particleIntid, int a_userParticleIndex)
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 double depositionEnergy(std::size_t a_hashIndex, double a_temperature, double a_energy) const
LUPI_HOST_DEVICE double gain(std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIndex) const
LUPI_HOST_DEVICE ProtareSingle const * protare(std::size_t a_index) const
LUPI_HOST_DEVICE double maximumEnergy() const
LUPI_HOST_DEVICE double URR_domainMin() const
LUPI_HOST_DEVICE void serialize2(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
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 bool hasFission() const
LUPI_HOST_DEVICE bool hasURR_probabilityTables() const
LUPI_HOST_DEVICE double threshold(std::size_t a_index) 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 productionEnergy(std::size_t a_hashIndex, double a_temperature, double a_energy) const
LUPI_HOST_DEVICE double URR_domainMax() const
LUPI_HOST_DEVICE ProtareComposite()
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables(std::size_t a_index) const
LUPI_HOST_DEVICE void crossSectionVector(double a_temperature, double a_userFactor, std::size_t a_numberAllocated, double *a_crossSectionVector) const
LUPI_HOST_DEVICE double depositionMomentum(std::size_t a_hashIndex, double a_temperature, double a_energy) const
Vector< ProtareSingle * > protares() const
LUPI_HOST void setUserParticleIndex2(int a_particleIndex, int a_userParticleIndex)
LUPI_HOST_DEVICE std::size_t numberOfReactions() const
LUPI_HOST_DEVICE bool hasIncoherentDoppler() const
LUPI_HOST_DEVICE double minimumEnergy() const
LUPI_HOST_DEVICE ~ProtareComposite()
LUPI_HOST_DEVICE std::size_t numberOfReactions() const
LUPI_HOST Vector< int > const & productIndices(bool a_transportablesOnly) const
LUPI_HOST Vector< int > const & productIntids(bool a_transportablesOnly) const
LUPI_HOST_DEVICE Protare(ProtareType a_protareType)
std::vector< Styles::TemperatureInfo > TemperatureInfos
std::set< std::size_t > ExcludeReactionsSet
Simple C++ string class, useful as replacement for std::string if this cannot be used,...
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)