Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI::Product Class Reference

#include <GIDI.hpp>

Inheritance diagram for GIDI::Product:

Public Member Functions

 Product (PoPI::Database const &a_pops, std::string const &a_productID, std::string const &a_label)
 Product (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Suite *a_parent, Styles::Suite const *a_styles)
 ~Product ()
ParticleInfo const & particle () const
void setParticle (ParticleInfo const &a_particle)
std::string pid () const
ParticleInfo const & GNDS_particle () const
ParticleInfoGNDS_particle ()
int depth () const
Componentmultiplicity ()
Component const & multiplicity () const
Componentdistribution ()
Component const & distribution () const
ComponentaverageEnergy ()
Component const & averageEnergy () const
ComponentaverageMomentum ()
Component const & averageMomentum () const
OutputChanneloutputChannel () const
void modifiedMultiGroupElasticForTNSL (std::map< std::string, std::size_t > const &a_maximumTNSL_MultiGroupIndex)
bool hasFission () const
bool isDelayedFissionNeutronComplete (bool a_isDelayedNeutron) const
bool areAllProductsTracked (Transporting::Particles const &a_particles) const
GUPI::AncestryfindInAncestry3 (std::string const &a_item)
GUPI::Ancestry const * findInAncestry3 (std::string const &a_item) const
void productIDs (std::set< std::string > &a_ids, Transporting::Particles const &a_particles, bool a_transportablesOnly) const
int productMultiplicity (std::string const &a_productID) const
int maximumLegendreOrder (LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID) const
Vector multiGroupQ (LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, bool a_final) const
Vector multiGroupMultiplicity (LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID) 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) const
Vector multiGroupAverageEnergy (LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID) const
Vector multiGroupAverageMomentum (LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_productID) const
void continuousEnergyProductData (Transporting::Settings const &a_settings, std::string const &a_particleID, double a_energy, double &a_productEnergy, double &a_productMomentum, double &a_productGain, bool a_ignoreIncompleteParticles) const
void mapContinuousEnergyProductData (Transporting::Settings const &a_settings, std::string const &a_particleID, std::vector< double > const &a_energies, std::size_t a_offset, std::vector< double > &a_productEnergies, std::vector< double > &a_productMomenta, std::vector< double > &a_productGains, bool a_ignoreIncompleteParticles) const
bool isCompleteParticle () const
void incompleteParticles (Transporting::Settings const &a_settings, std::set< std::string > &a_incompleteParticles) const
void calculateMultiGroupData (ProtareSingle const *a_protare, Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_heatedMultiGroupLabel, MultiGroupCalulationInformation const &a_multiGroupCalulationInformation, Functions::XYs1d const &a_crossSectionXYs1d)
void toXMLList (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
Public Member Functions inherited from GIDI::Form
 Form (FormType a_type)
 Form (std::string const &a_moniker, FormType a_type, std::string const &a_label)
 Form (HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, Suite *a_suite=nullptr)
 Form (Form const &a_form)
virtual ~Form ()
Formoperator= (Form const &a_rhs)
Suiteparent () const
std::string const & label () const
void setLabel (std::string const &a_label)
virtual std::string actualMoniker () const
std::string const & keyName () const
void setKeyName (std::string const &a_keyName)
std::string const & keyValue () const
virtual void setKeyValue (std::string const &a_keyName) const
FormType type () const
Form const * sibling (std::string a_label) const
GUPI::AncestryfindInAncestry3 (LUPI_maybeUnused std::string const &a_item)
GUPI::Ancestry const * findInAncestry3 (LUPI_maybeUnused std::string const &a_item) const
std::string xlinkItemKey () const
Public Member Functions inherited from GUPI::Ancestry
 Ancestry (std::string const &a_moniker, std::string const &a_attribute="")
virtual ~Ancestry ()
Ancestryoperator= (Ancestry const &a_ancestry)
std::string const & moniker () const
void setMoniker (std::string const &a_moniker)
Ancestryancestor ()
Ancestry const * ancestor () const
void setAncestor (Ancestry *a_ancestor)
std::string attribute () const
Ancestryroot ()
Ancestry const * root () const
bool isChild (Ancestry *a_instance)
bool isParent (Ancestry *a_parent)
bool isRoot () const
AncestryfindInAncestry (std::string const &a_href)
Ancestry const * findInAncestry (std::string const &a_href) const
virtual LUPI_HOST void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
std::string toXLink () const
void printXML () const

Additional Inherited Members

Static Public Member Functions inherited from GUPI::Ancestry
static std::string buildXLinkItemKey (std::string const &a_name, std::string const &a_key)

Detailed Description

Class to store a GNDS <product> node.

Definition at line 3871 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Product() [1/2]

GIDI::Product::Product ( PoPI::Database const & a_pops,
std::string const & a_productID,
std::string const & a_label )

Constructed

Definition at line 24 of file GIDI_product.cc.

24 :
26 m_particle( ParticleInfo( a_productID, a_pops, a_pops, true ) ),
27 m_GNDS_particle( ParticleInfo( a_productID, a_pops, a_pops, true ) ),
28 m_productMultiplicity( 0 ),
29 m_treatProductAsIfInfinityMass( false ),
30 m_multiplicity( GIDI_multiplicityChars, GIDI_labelChars ),
31 m_distribution( GIDI_distributionChars, GIDI_labelChars ),
32 m_averageEnergy( GIDI_averageEnergyChars, GIDI_labelChars ),
33 m_averageMomentum( GIDI_averageMomentumChars, GIDI_labelChars ),
34 m_outputChannel( nullptr ) {
35
37 setLabel( a_label );
38
39 m_multiplicity.setAncestor( this );
40 m_distribution.setAncestor( this );
41 m_averageEnergy.setAncestor( this );
42 m_averageMomentum.setAncestor( this );
43}
#define GIDI_productChars
Definition GIDI.hpp:221
#define GIDI_labelChars
Definition GIDI.hpp:438
#define GIDI_multiplicityChars
Definition GIDI.hpp:223
#define GIDI_averageEnergyChars
Definition GIDI.hpp:225
#define GIDI_averageMomentumChars
Definition GIDI.hpp:226
#define GIDI_distributionChars
Definition GIDI.hpp:224
Form(FormType a_type)
Definition GIDI_form.cc:25
void setLabel(std::string const &a_label)
Definition GIDI_form.cc:114
void setMoniker(std::string const &a_moniker)
Definition GUPI.hpp:103

◆ Product() [2/2]

GIDI::Product::Product ( Construction::Settings const & a_construction,
HAPI::Node const & a_node,
SetupInfo & a_setupInfo,
PoPI::Database const & a_pops,
PoPI::Database const & a_internalPoPs,
Suite * a_parent,
Styles::Suite const * a_styles )

Constructed from data in a <product> node.

Parameters
a_construction[in] Used to pass user options to the constructor.
a_node[in] The HAPI::Node to be parsed and used to construct the Product.
a_setupInfo[in] Information create my the Protare constructor to help in parsing.
a_pops[in] The external PoPI::Database instance used to get particle indices and possibly other particle information.
a_internalPoPs[in] The internal PoPI::Database instance used to get particle indices and possibly other particle information. This is the <PoPs> node under the <reactionSuite> node.
a_parent[in] The m_products member of GIDI::OutputChannel this product belongs to.
a_styles[in] The <styles> node under the <reactionSuite> node.

Definition at line 58 of file GIDI_product.cc.

59 :
60 Form( a_node, a_setupInfo, FormType::product, a_parent ),
61 m_particle( a_node.attribute_as_string( GIDI_pidChars ), a_pops, a_internalPoPs, false ),
62 m_GNDS_particle( a_node.attribute_as_string( GIDI_pidChars ), a_pops, a_internalPoPs, false ),
63 m_productMultiplicity( 0 ),
64 m_treatProductAsIfInfinityMass( false ),
65 m_multiplicity( a_construction, GIDI_multiplicityChars, GIDI_labelChars, a_node, a_setupInfo, a_pops, a_internalPoPs, parseMultiplicitySuite, a_styles ),
66 m_distribution( a_construction, GIDI_distributionChars, GIDI_labelChars, a_node, a_setupInfo, a_pops, a_internalPoPs, parseDistributionSuite, a_styles ),
67 m_averageEnergy( a_construction, GIDI_averageEnergyChars, GIDI_labelChars, a_node, a_setupInfo, a_pops, a_internalPoPs, parseAverageEnergySuite, a_styles ),
68 m_averageMomentum( a_construction, GIDI_averageMomentumChars, GIDI_labelChars, a_node, a_setupInfo, a_pops, a_internalPoPs, parseAverageMomentumSuite, a_styles ),
69 m_outputChannel( nullptr ) {
70
71 if( a_setupInfo.m_outputChannelLevel == 0 ) a_setupInfo.m_initialState = m_particle.ID( );
72 m_multiplicity.setAncestor( this );
73 m_distribution.setAncestor( this );
74 m_averageEnergy.setAncestor( this );
75 m_averageMomentum.setAncestor( this );
76
77 auto iter = a_setupInfo.m_particleSubstitution->find( m_GNDS_particle.ID( ) );
78 if( iter != a_setupInfo.m_particleSubstitution->end( ) ) m_particle = iter->second;
79
80 if( a_setupInfo.m_protare->projectile( ).ID( ) == PoPI::IDs::photon ) {
81 if( m_particle.ID( ) == a_setupInfo.m_protare->GNDS_target( ).ID( ) ) m_particle = a_setupInfo.m_protare->target( );
82 }
83
84 if( a_setupInfo.m_protare->isPhotoAtomic( ) || a_setupInfo.m_protare->isTNSL_ProtareSingle( ) ) {
85 m_treatProductAsIfInfinityMass = m_GNDS_particle.ID( ) == a_setupInfo.m_protare->GNDS_target( ).ID( );
86 }
87
88 HAPI::Node const _outputChannel = a_node.child( GIDI_outputChannelChars );
89 a_setupInfo.m_outputChannelLevel += 1;
90 if( ! _outputChannel.empty( ) )
91 m_outputChannel = new OutputChannel( a_construction, _outputChannel, a_setupInfo, a_pops, a_internalPoPs, a_styles, false, false );
92 a_setupInfo.m_outputChannelLevel -= 1;
93
94 if( m_outputChannel == nullptr ) {
95 if( m_multiplicity.size( ) > 0 ) {
96 GIDI::Functions::Function1dForm const *function1d = m_multiplicity.get<GIDI::Functions::Function1dForm>( 0 );
97
98 if( function1d->type( ) == FormType::constant1d ) {
99 m_productMultiplicity = static_cast<int>( function1d->evaluate( 0.0 ) ); }
100 else if( function1d->type( ) != FormType::unspecified1d ) {
101 m_productMultiplicity = -1;
102 }
103 } }
104 else {
105 m_outputChannel->setAncestor( this );
106 }
107}
#define GIDI_outputChannelChars
Definition GIDI.hpp:227
#define GIDI_pidChars
Definition GIDI.hpp:454
FormType type() const
Definition GIDI.hpp:667
virtual double evaluate(double a_x1) const =0
bool empty() const
Definition HAPI_Node.cc:150
Form * parseAverageEnergySuite(Construction::Settings const &a_construction, Suite *parent, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pop, PoPI::Database const &a_internalPoPs, std::string const &a_name, Styles::Suite const *a_styles)
Form * parseMultiplicitySuite(Construction::Settings const &a_construction, Suite *parent, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pop, PoPI::Database const &a_internalPoPs, std::string const &a_name, Styles::Suite const *a_styles)
Form * parseAverageMomentumSuite(Construction::Settings const &a_construction, Suite *parent, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pop, PoPI::Database const &a_internalPoPs, std::string const &a_name, Styles::Suite const *a_styles)
Form * parseDistributionSuite(Construction::Settings const &a_construction, Suite *parent, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pop, PoPI::Database const &a_internalPoPs, std::string const &a_name, Styles::Suite const *a_styles)
static std::string const photon
Definition PoPI.hpp:162

◆ ~Product()

GIDI::Product::~Product ( )

Definition at line 112 of file GIDI_product.cc.

112 {
113
114 if( m_outputChannel != nullptr ) delete m_outputChannel;
115}

Member Function Documentation

◆ areAllProductsTracked()

bool GIDI::Product::areAllProductsTracked ( Transporting::Particles const & a_particles) const

Returns true if all outgoing particles (i.e., products) are specifed in a_particles. That is, the user will be tracking all products of this reaction.

Parameters
a_particles[in] The list of particles to be transported.
Returns
bool.

Definition at line 185 of file GIDI_product.cc.

185 {
186
187 if( m_outputChannel != nullptr ) return( m_outputChannel->areAllProductsTracked( a_particles ) );
188
189 return( a_particles.hasParticle( m_particle.ID( ) ) );
190}

◆ averageEnergy() [1/2]

Component & GIDI::Product::averageEnergy ( )
inline

Returns a reference to the m_averageEnergy member.

Definition at line 3902 of file GIDI.hpp.

Referenced by continuousEnergyProductData(), and mapContinuousEnergyProductData().

◆ averageEnergy() [2/2]

Component const & GIDI::Product::averageEnergy ( ) const
inline

Returns a const reference to the m_averageEnergy member.

Definition at line 3903 of file GIDI.hpp.

◆ averageMomentum() [1/2]

Component & GIDI::Product::averageMomentum ( )
inline

Returns a reference to the m_averageMomentum member.

Definition at line 3904 of file GIDI.hpp.

Referenced by continuousEnergyProductData(), and mapContinuousEnergyProductData().

◆ averageMomentum() [2/2]

Component const & GIDI::Product::averageMomentum ( ) const
inline

Returns a const reference to the m_averageMomentum member.

Definition at line 3905 of file GIDI.hpp.

◆ calculateMultiGroupData()

void GIDI::Product::calculateMultiGroupData ( ProtareSingle const * a_protare,
Styles::TemperatureInfo const & a_temperatureInfo,
std::string const & a_heatedMultiGroupLabel,
MultiGroupCalulationInformation const & a_multiGroupCalulationInformation,
Functions::XYs1d const & a_crossSectionXYs1d )

This methods calculates multi-group data for all needed components and adds each component's multi-group with label a_heatedMultiGroupLabel.

Parameters
a_temperatureInfo[in] Specifies the temperature and labels use to lookup the requested data.
a_heatedMultiGroupLabel[in] The label of the style for the multi-group data being added.
a_multiGroupCalulationInformation[in] Store multi-group boundary and flux data used for multi-grouping.
a_crossSectionXYs1d[in[ The cross section weight.

Definition at line 552 of file GIDI_product.cc.

554 {
555
556// FIXME, need to calculateMultiGroupData for the distribution.
557
558 if( isCompleteParticle( ) ) {
559 if( m_multiplicity.find( a_heatedMultiGroupLabel ) != m_multiplicity.end( ) ) {
560 calculate1dMultiGroupDataInComponent( a_protare, a_heatedMultiGroupLabel, a_multiGroupCalulationInformation, m_multiplicity, a_crossSectionXYs1d );
561 calculate1dMultiGroupDataInComponent( a_protare, a_heatedMultiGroupLabel, a_multiGroupCalulationInformation, m_averageEnergy, a_crossSectionXYs1d );
562 calculate1dMultiGroupDataInComponent( a_protare, a_heatedMultiGroupLabel, a_multiGroupCalulationInformation, m_averageMomentum, a_crossSectionXYs1d );
563 }
564 }
565
566 if( m_outputChannel != nullptr )
567 m_outputChannel->calculateMultiGroupData( a_protare, a_temperatureInfo, a_heatedMultiGroupLabel, a_multiGroupCalulationInformation, a_crossSectionXYs1d );
568}
bool isCompleteParticle() const
void calculate1dMultiGroupDataInComponent(ProtareSingle const *a_protare, std::string const &a_heatedMultiGroupLabel, MultiGroupCalulationInformation const &a_multiGroupCalulationInformation, Component &a_component, Functions::XYs1d const &a_crossSection)

Referenced by GIDI::OutputChannel::calculateMultiGroupData().

◆ continuousEnergyProductData()

void GIDI::Product::continuousEnergyProductData ( Transporting::Settings const & a_settings,
std::string const & a_particleID,
double a_energy,
double & a_productEnergy,
double & a_productMomentum,
double & a_productGain,
bool a_ignoreIncompleteParticles ) const

Returns, via arguments, the average energy and momentum, and gain for product with particle id a_particleID.

Parameters
a_settings[in] Specifies the requested label.
a_particleID[in] The particle id of the product.
a_energy[in] The energy of the projectile.
a_productEnergy[in] The average energy of the product.
a_productMomentum[in] The average momentum of the product.
a_productGain[in] The gain of the product.
a_ignoreIncompleteParticles[in] If true, incomplete particles are ignore, otherwise a throw is executed.

Definition at line 458 of file GIDI_product.cc.

459 {
460
461 if( m_outputChannel == nullptr ) {
462 if( a_particleID == m_particle.ID( ) ) {
463 if( !isCompleteParticle( ) ) {
464 if( a_ignoreIncompleteParticles ) return;
465 throw Exception( "GIDI::Product::continuousEnergyProductData: particle is incomplete: " + toXLink( ) + "." );
466 }
467 a_productEnergy += averageEnergy( ).get<GIDI::Functions::Function1dForm>( 0 )->evaluate( a_energy );
468 a_productMomentum += averageMomentum( ).get<GIDI::Functions::Function1dForm>( 0 )->evaluate( a_energy );
469 a_productGain += multiplicity( ).get<GIDI::Functions::Function1dForm>( 0 )->evaluate( a_energy ); } }
470 else {
471 m_outputChannel->continuousEnergyProductData( a_settings, a_particleID, a_energy, a_productEnergy, a_productMomentum, a_productGain, a_ignoreIncompleteParticles );
472 }
473}
Component & averageMomentum()
Definition GIDI.hpp:3904
Component & averageEnergy()
Definition GIDI.hpp:3902
Component & multiplicity()
Definition GIDI.hpp:3898
T * get(std::size_t a_Index)
Definition GIDI.hpp:2642
std::string toXLink() const

Referenced by GIDI::OutputChannel::continuousEnergyProductData().

◆ depth()

int GIDI::Product::depth ( ) const

Returns the maximum product depth for this product.

Returns
The maximum product depth.

Definition at line 123 of file GIDI_product.cc.

123 {
124
125 if( m_outputChannel == nullptr ) return( 0 );
126 return( m_outputChannel->depth( ) );
127}

Referenced by GIDI::OutputChannel::depth().

◆ distribution() [1/2]

Component & GIDI::Product::distribution ( )
inline

Returns a reference to the m_distribution member.

Definition at line 3900 of file GIDI.hpp.

Referenced by MCGIDI::Product::Product().

◆ distribution() [2/2]

Component const & GIDI::Product::distribution ( ) const
inline

Returns a reference to the m_distribution member.

Definition at line 3901 of file GIDI.hpp.

◆ findInAncestry3() [1/2]

GUPI::Ancestry * GIDI::Product::findInAncestry3 ( std::string const & a_item)
virtual

Used by GUPI::Ancestry to tranverse GNDS nodes. This method returns a pointer to a derived class' a_item member or nullptr if none exists.

Parameters
a_item[in] The name of the class member whose pointer is to be return.
Returns
The pointer to the class member or nullptr if class does not have a member named a_item.

Implements GUPI::Ancestry.

Definition at line 199 of file GIDI_product.cc.

199 {
200
201 if( a_item == GIDI_multiplicityChars ) return( &m_multiplicity );
202 if( a_item == GIDI_distributionChars ) return( &m_distribution );
203 if( a_item == GIDI_averageEnergyChars ) return( &m_averageEnergy );
204 if( a_item == GIDI_averageMomentumChars ) return( &m_averageMomentum );
205 if( a_item == GIDI_outputChannelChars ) return( m_outputChannel );
206
207 return( nullptr );
208}

◆ findInAncestry3() [2/2]

GUPI::Ancestry const * GIDI::Product::findInAncestry3 ( std::string const & a_item) const
virtual

Used by GUPI::Ancestry to tranverse GNDS nodes. This method returns a pointer to a derived class' a_item member or nullptr if none exists.

Parameters
a_item[in] The name of the class member whose pointer is to be return.
Returns
The pointer to the class member or nullptr if class does not have a member named a_item.

Implements GUPI::Ancestry.

Definition at line 217 of file GIDI_product.cc.

217 {
218
219 if( a_item == GIDI_multiplicityChars ) return( &m_multiplicity );
220 if( a_item == GIDI_distributionChars ) return( &m_distribution );
221 if( a_item == GIDI_averageEnergyChars ) return( &m_averageEnergy );
222 if( a_item == GIDI_averageMomentumChars ) return( &m_averageMomentum );
223 if( a_item == GIDI_outputChannelChars ) return( m_outputChannel );
224
225 return( nullptr );
226}

◆ GNDS_particle() [1/2]

ParticleInfo & GIDI::Product::GNDS_particle ( )
inline

Returns the value of the m_GNDS_particle member.

Definition at line 3895 of file GIDI.hpp.

◆ GNDS_particle() [2/2]

ParticleInfo const & GIDI::Product::GNDS_particle ( ) const
inline

Returns a const reference to the m_GNDS_particle member.

Definition at line 3894 of file GIDI.hpp.

◆ hasFission()

bool GIDI::Product::hasFission ( ) const

Returns true if the product has an output channel and its output channel hasFission returns true, and false otherwise.

Returns
true if at least one output channel is a fission channel.

Definition at line 151 of file GIDI_product.cc.

151 {
152
153 if( m_outputChannel != nullptr ) return( m_outputChannel->hasFission( ) );
154 return( false );
155}

◆ incompleteParticles()

void GIDI::Product::incompleteParticles ( Transporting::Settings const & a_settings,
std::set< std::string > & a_incompleteParticles ) const

If the product has a distribution and its first distribution form is not unspecified, its PoPs id is added to a_incompleteParticles.

Returns
Returns true if the product has distribution data and false otherwise.

Definition at line 534 of file GIDI_product.cc.

534 {
535
536 if( m_outputChannel == nullptr ) {
537 if( !isCompleteParticle( ) ) a_incompleteParticles.insert( particle( ).ID( ) ); }
538 else {
539 m_outputChannel->incompleteParticles( a_settings, a_incompleteParticles );
540 }
541}
ParticleInfo const & particle() const
Definition GIDI.hpp:3891

Referenced by GIDI::OutputChannel::incompleteParticles().

◆ isCompleteParticle()

bool GIDI::Product::isCompleteParticle ( ) const

Returns true if the product is complete and false otherwise. A product is complete if its multiplicity and/or distribution are other than unspecified.

Returns
true if the product is complete and false otherwise.

Definition at line 518 of file GIDI_product.cc.

518 {
519
520 if( m_multiplicity.size( ) == 0 ) return( false );
521 if( m_multiplicity.get<Form>( 0 )->type( ) == FormType::unspecified ) return( false );
522 if( m_distribution.size( ) == 0 ) return( false );
523 if( m_distribution.get<Form>( 0 )->type( ) == FormType::unspecified ) return( false );
524
525 return( true );
526}

Referenced by calculateMultiGroupData(), continuousEnergyProductData(), incompleteParticles(), isDelayedFissionNeutronComplete(), and mapContinuousEnergyProductData().

◆ isDelayedFissionNeutronComplete()

bool GIDI::Product::isDelayedFissionNeutronComplete ( bool a_isDelayedNeutron) const

Returns false* if this has delayed fission neutrons and they are not complete; otherwise, returns **true.

Parameters
a_isDelayedNeutron[in] true is called from FissionFragmentData::isDelayedFissionNeutronComplete and false otherwise.
Returns
bool

Definition at line 165 of file GIDI_product.cc.

165 {
166
167 if( a_isDelayedNeutron ) {
168 return( isCompleteParticle( ) ); }
169 else {
170 if( m_outputChannel != nullptr ) return( m_outputChannel->isDelayedFissionNeutronComplete( ) );
171 }
172
173 return( true );
174}

◆ mapContinuousEnergyProductData()

void GIDI::Product::mapContinuousEnergyProductData ( Transporting::Settings const & a_settings,
std::string const & a_particleID,
std::vector< double > const & a_energies,
std::size_t a_offset,
std::vector< double > & a_productEnergies,
std::vector< double > & a_productMomenta,
std::vector< double > & a_productGains,
bool a_ignoreIncompleteParticles ) const

Modifies the average product energies, momenta and gains for product with particle id a_particleID.

Parameters
a_settings[in] Specifies user options.
a_particleID[in] The particle id of the product.
a_energies[in] The vector of energies to map the data to.
a_offset[in] The index of the first energy whose data are to be added to the vectors.
a_productEnergies[out] The vector of average energies of the product.
a_productMomenta[out] The vector of average momenta of the product.
a_productGains[out] The vector of gain of the product.
a_ignoreIncompleteParticles[in] If true, incomplete particles are ignore, otherwise a throw is executed.

Definition at line 488 of file GIDI_product.cc.

490 {
491
492 if( m_outputChannel == nullptr ) {
493 if( a_particleID == m_particle.ID( ) ) {
494 if( !isCompleteParticle( ) ) {
495 if( a_ignoreIncompleteParticles ) return;
496 throw Exception( "GIDI::Product::mapContinuousEnergyProductData: particle is incomplete: " + toXLink( ) + "." );
497 }
498 GIDI::Functions::Function1dForm const *multiplicity1 = multiplicity( ).get<GIDI::Functions::Function1dForm>( 0 );
499 if( multiplicity1->type( ) == FormType::branching1d ) return;
500
501 averageEnergy( ).get<GIDI::Functions::Function1dForm>( 0 )->mapToXsAndAdd( a_offset, a_energies, a_productEnergies, -1.0 );
502 averageMomentum( ).get<GIDI::Functions::Function1dForm>( 0 )->mapToXsAndAdd( a_offset, a_energies, a_productMomenta, -1.0 );
503 multiplicity1->mapToXsAndAdd( a_offset, a_energies, a_productGains, 1.0 );
504 } }
505 else {
506 m_outputChannel->mapContinuousEnergyProductData( a_settings, a_particleID, a_energies, a_offset, a_productEnergies, a_productMomenta,
507 a_productGains, a_ignoreIncompleteParticles );
508 }
509}
virtual void mapToXsAndAdd(std::size_t a_offset, std::vector< double > const &a_Xs, std::vector< double > &a_results, double a_scaleFactor) const
Definition GIDI_form.cc:424

Referenced by GIDI::OutputChannel::mapContinuousEnergyProductData().

◆ maximumLegendreOrder()

int GIDI::Product::maximumLegendreOrder ( LUPI::StatusMessageReporting & a_smr,
Transporting::MG const & a_settings,
Styles::TemperatureInfo const & a_temperatureInfo,
std::string const & a_productID ) const

Determines the maximum Legredre order present in the multi-group transfer matrix for a this product and any sub-products for a give label.

Parameters
a_smr[Out] If errors are not to be thrown, then the error is reported via this instance.
a_settings[in] Specifies the requested label.
a_temperatureInfo[in] Specifies the temperature and labels use to lookup the requested data.
a_productID[in] Particle id for the requested product.
Returns
The maximum Legredre order. If no transfer matrix data are present for the requested product, -1 is returned.

Definition at line 274 of file GIDI_product.cc.

275 {
276
277 int _maximumLegendreOrder = -1;
278
279 if( m_outputChannel == nullptr ) {
280 if( PoPI::compareSpecialParticleIDs( m_particle.ID( ), a_productID ) ) {
281 Distributions::MultiGroup3d const *form = dynamic_cast<Distributions::MultiGroup3d const*>( a_settings.form(
282 a_smr, m_distribution, a_temperatureInfo, "distribution for maximumLegendreOrder" ) );
283 if( form != nullptr ) {
284 Functions::Gridded3d const &gdata = form->data( );
285 Array3d const &data = gdata.data( );
286 _maximumLegendreOrder = static_cast<int>( data.size( ) ) - 1;
287 }
288 } }
289 else {
290 int __maximumLegendreOrder = m_outputChannel->maximumLegendreOrder( a_smr, a_settings, a_temperatureInfo, a_productID );
291 if( __maximumLegendreOrder > _maximumLegendreOrder ) _maximumLegendreOrder = __maximumLegendreOrder;
292 }
293
294 return( _maximumLegendreOrder );
295}
bool compareSpecialParticleIDs(std::string const &a_id1, std::string const &a_id2)
Definition PoPI_misc.cc:133

Referenced by GIDI::OutputChannel::maximumLegendreOrder().

◆ modifiedMultiGroupElasticForTNSL()

void GIDI::Product::modifiedMultiGroupElasticForTNSL ( std::map< std::string, std::size_t > const & a_maximumTNSL_MultiGroupIndex)

Only for internal use. Called by ProtareTNSL instance to zero the lower energy multi-group data covered by the ProtareSingle that contains the TNSL data covers the lower energy multi-group data.

Parameters
a_maximumTNSL_MultiGroupIndex[in] A map that contains labels for heated multi-group data and the last valid group boundary for the TNSL data for that boundary.

Definition at line 137 of file GIDI_product.cc.

137 {
138
139 m_multiplicity.modifiedMultiGroupElasticForTNSL( a_maximumTNSL_MultiGroupIndex );
140 m_distribution.modifiedMultiGroupElasticForTNSL( a_maximumTNSL_MultiGroupIndex );
141 m_averageEnergy.modifiedMultiGroupElasticForTNSL( a_maximumTNSL_MultiGroupIndex );
142 m_averageMomentum.modifiedMultiGroupElasticForTNSL( a_maximumTNSL_MultiGroupIndex );
143}

Referenced by GIDI::OutputChannel::modifiedMultiGroupElasticForTNSL().

◆ multiGroupAverageEnergy()

Vector GIDI::Product::multiGroupAverageEnergy ( LUPI::StatusMessageReporting & a_smr,
Transporting::MG const & a_settings,
Styles::TemperatureInfo const & a_temperatureInfo,
std::string const & a_productID ) const

Returns the sum of the multi-group, average energy for the requested label for the requested product. This is a cross section weighted average energy summed over this and all sub-products.

Parameters
a_smr[Out] If errors are not to be thrown, then the error is reported via this instance.
a_settings[in] Specifies the requested label.
a_temperatureInfo[in] Specifies the temperature and labels use to lookup the requested data.
a_productID[in] Particle id for the requested product.
Returns
The requested multi-group average energy as a GIDI::Vector.

Definition at line 399 of file GIDI_product.cc.

400 {
401
402 Vector vector( 0 );
403
404 if( m_outputChannel == nullptr ) {
405 if( ( PoPI::compareSpecialParticleIDs( m_particle.ID( ), a_productID ) ) && ( !m_treatProductAsIfInfinityMass ) ) {
406 Functions::Gridded1d const *form = dynamic_cast<Functions::Gridded1d const*>( a_settings.form(
407 a_smr, m_averageEnergy, a_temperatureInfo, "average product energy" ) );
408 if( form != nullptr ) vector += form->data( );
409 } }
410 else {
411 vector += m_outputChannel->multiGroupAverageEnergy( a_smr, a_settings, a_temperatureInfo, a_productID );
412 }
413
414 return( vector );
415}

◆ multiGroupAverageMomentum()

Vector GIDI::Product::multiGroupAverageMomentum ( LUPI::StatusMessageReporting & a_smr,
Transporting::MG const & a_settings,
Styles::TemperatureInfo const & a_temperatureInfo,
std::string const & a_productID ) const

Returns the sum of the multi-group, average momentum for the requested label for the requested product. This is a cross section weighted average momentum summed over this and all sub-products.

Parameters
a_smr[Out] If errors are not to be thrown, then the error is reported via this instance.
a_settings[in] Specifies the requested label.
a_temperatureInfo[in] Specifies the temperature and labels use to lookup the requested data.
a_productID[in] Particle id for the requested product.
Returns
The requested multi-group average momentum as a GIDI::Vector.

Definition at line 429 of file GIDI_product.cc.

430 {
431
432 Vector vector( 0 );
433
434 if( m_outputChannel == nullptr ) {
435 if( ( PoPI::compareSpecialParticleIDs( m_particle.ID( ), a_productID ) ) && ( !m_treatProductAsIfInfinityMass ) ) {
436 Functions::Gridded1d const *form = dynamic_cast<Functions::Gridded1d const*>( a_settings.form(
437 a_smr, m_averageMomentum, a_temperatureInfo, "average product momentum" ) );
438 if( form != nullptr ) vector += form->data( );
439 } }
440 else {
441 vector += m_outputChannel->multiGroupAverageMomentum( a_smr, a_settings, a_temperatureInfo, a_productID );
442 }
443 return( vector );
444}

◆ multiGroupMultiplicity()

Vector GIDI::Product::multiGroupMultiplicity ( LUPI::StatusMessageReporting & a_smr,
Transporting::MG const & a_settings,
Styles::TemperatureInfo const & a_temperatureInfo,
std::string const & a_productID ) const

Returns the sum of the multi-group, multiplicity for the requested label for the this product and any sub-product. This is a cross section weighted multiplicity.

Parameters
a_smr[Out] If errors are not to be thrown, then the error is reported via this instance.
a_settings[in] Specifies the requested label.
a_temperatureInfo[in] Specifies the temperature and labels use to lookup the requested data.
a_productID[in] Particle id for the requested product.
Returns
The requested multi-group multiplicity as a GIDI::Vector.

Definition at line 309 of file GIDI_product.cc.

310 {
311
312 Vector vector( 0 );
313
314 if( m_outputChannel == nullptr ) {
315 if( ( PoPI::compareSpecialParticleIDs( m_particle.ID( ), a_productID ) ) && ( !m_treatProductAsIfInfinityMass ) ) {
316 Functions::Gridded1d const *form = dynamic_cast<Functions::Gridded1d const*>( a_settings.form(
317 a_smr, m_multiplicity, a_temperatureInfo, "multiplicity" ) );
318 if( form != nullptr ) vector += form->data( );
319 } }
320 else {
321 vector += m_outputChannel->multiGroupMultiplicity( a_smr, a_settings, a_temperatureInfo, a_productID );
322 }
323
324 return( vector );
325}

◆ multiGroupProductMatrix()

Matrix GIDI::Product::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 ) const

Returns the multi-group, product matrix for the requested label for the requested product index for the requested Legendre order. If no data are found, an empty GIDI::Matrix is returned.

Parameters
a_smr[Out] If errors are not to be thrown, then the error is reported via this instance.
a_settings[in] Specifies the requested label and if delayed neutrons should be included.
a_temperatureInfo[in] Specifies the temperature and labels use to lookup the requested data.
a_particles[in] The list of particles to be transported.
a_productID[in] Particle id for the requested product.
a_order[in] Requested product matrix, Legendre order.
Returns
The requested multi-group product matrix as a GIDI::Matrix.

Definition at line 364 of file GIDI_product.cc.

366 {
367
368 Matrix matrix( 0, 0 );
369
370 if( m_outputChannel == nullptr ) {
371 if( ( PoPI::compareSpecialParticleIDs( m_particle.ID( ), a_productID ) ) && ( !m_treatProductAsIfInfinityMass ) ) {
372 Distributions::MultiGroup3d const *form = dynamic_cast<Distributions::MultiGroup3d const*>( a_settings.form(
373 a_smr, m_distribution, a_temperatureInfo, "distribution for product matrix" ) );
374 if( form != nullptr ) {
375 Functions::Gridded3d const &gdata = form->data( );
376 Array3d const &data = gdata.data( );
377 matrix = data.matrix( a_order );
378 }
379 } }
380 else {
381 matrix += m_outputChannel->multiGroupProductMatrix( a_smr, a_settings, a_temperatureInfo, a_particles, a_productID, a_order );
382 }
383
384 return( matrix );
385}

◆ multiGroupQ()

Vector GIDI::Product::multiGroupQ ( LUPI::StatusMessageReporting & a_smr,
Transporting::MG const & a_settings,
Styles::TemperatureInfo const & a_temperatureInfo,
bool a_final ) const

Returns the sum of the multi-group, Q for the requested label for the this product and any sub-product . This is a cross section weighted Q. If a_final is false, only the Q for the products output channel is returned, otherwise, the Q for all output channels summed, including output channels for each products.

Parameters
a_smr[Out] If errors are not to be thrown, then the error is reported via this instance.
a_settings[in] Specifies the requested label.
a_temperatureInfo[in] Specifies the temperature and labels use to lookup the requested data.
a_final[in] If true, the Q is calculated for all output channels, including those for products.
Returns
The requested multi-group Q as a GIDI::Vector.

Definition at line 340 of file GIDI_product.cc.

341 {
342
343 Vector _vector( 0 );
344
345 if( m_outputChannel != nullptr ) _vector += m_outputChannel->multiGroupQ( a_smr, a_settings, a_temperatureInfo, a_final );
346
347 return( _vector );
348}

Referenced by GIDI::OutputChannel::multiGroupQ().

◆ multiplicity() [1/2]

Component & GIDI::Product::multiplicity ( )
inline

Returns a reference to the m_multiplicity member.

Definition at line 3898 of file GIDI.hpp.

Referenced by continuousEnergyProductData(), and mapContinuousEnergyProductData().

◆ multiplicity() [2/2]

Component const & GIDI::Product::multiplicity ( ) const
inline

Returns a const reference to the m_multiplicity member.

Definition at line 3899 of file GIDI.hpp.

◆ outputChannel()

OutputChannel * GIDI::Product::outputChannel ( ) const
inline

Returns a reference to the m_outputChannel member.

Definition at line 3906 of file GIDI.hpp.

Referenced by MCGIDI::Product::Product().

◆ particle()

ParticleInfo const & GIDI::Product::particle ( ) const
inline

Returns the value of the m_particle member.

Definition at line 3891 of file GIDI.hpp.

Referenced by incompleteParticles().

◆ pid()

std::string GIDI::Product::pid ( ) const
inline

Definition at line 3893 of file GIDI.hpp.

3893{ return( m_particle.ID( ) ); }

◆ productIDs()

void GIDI::Product::productIDs ( std::set< std::string > & a_indices,
Transporting::Particles const & a_particles,
bool a_transportablesOnly ) const

Insert a std::set with the products index and any product in in its output channel. If a_transportablesOnly is true, only transportable product indices are return.

Parameters
a_indices[out] The unique list of product indices.
a_particles[in] The list of particles to be transported.
a_transportablesOnly[in] If true, only transportable product indices are added in the list.

Definition at line 237 of file GIDI_product.cc.

237 {
238
239 if( m_outputChannel == nullptr ) {
240 if( a_transportablesOnly && !a_particles.hasParticle( m_particle.ID( ) ) ) return;
241 if( m_particle.ID( ) != "" ) a_indices.insert( m_particle.ID( ) ); }
242 else {
243 m_outputChannel->productIDs( a_indices, a_particles, a_transportablesOnly );
244 }
245}

Referenced by GIDI::OutputChannel::productIDs().

◆ productMultiplicity()

int GIDI::Product::productMultiplicity ( std::string const & a_productID) const

Returns the product multiplicity (e.g., 0, 1, 2, ...) or -1 if energy dependent or not an integer for particle with id a_productID.

Parameters
a_productID;[in] The id of the requested particle.
Returns
The multiplicity for the requested particle.

Definition at line 255 of file GIDI_product.cc.

255 {
256
257 if( m_outputChannel != nullptr ) return( m_outputChannel->productMultiplicity( a_productID ) );
258
259 if( PoPI::compareSpecialParticleIDs( a_productID, m_particle.ID( ) ) ) return( m_productMultiplicity );
260 return( 0 );
261}

Referenced by GIDI::OutputChannel::productMultiplicity().

◆ setParticle()

void GIDI::Product::setParticle ( ParticleInfo const & a_particle)
inline

Sets m_particle to a_particle.

Definition at line 3892 of file GIDI.hpp.

◆ toXMLList()

void GIDI::Product::toXMLList ( GUPI::WriteInfo & a_writeInfo,
std::string const & a_indent = "" ) const
virtual

Fills the argument a_writeInfo with the XML lines that represent this. Recursively enters each sub-node.

Parameters
a_writeInfo[in/out] Instance containing incremental indentation and other information and stores the appended lines.
a_indent[in] The amount to indent this node.

Reimplemented from GUPI::Ancestry.

Definition at line 577 of file GIDI_product.cc.

577 {
578
579 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
580 std::string attributes;
581
582 attributes += a_writeInfo.addAttribute( GIDI_pidChars, m_GNDS_particle.ID( ) );
583 if( label( ) != "" ) attributes += a_writeInfo.addAttribute( GIDI_labelChars, label( ) );
584 a_writeInfo.addNodeStarter( a_indent, moniker( ), attributes );
585
586 m_multiplicity.toXMLList( a_writeInfo, indent2 );
587 m_distribution.toXMLList( a_writeInfo, indent2 );
588 m_averageEnergy.toXMLList( a_writeInfo, indent2 );
589 m_averageMomentum.toXMLList( a_writeInfo, indent2 );
590 if( m_outputChannel != nullptr ) m_outputChannel->toXMLList( a_writeInfo, indent2 );
591
592 a_writeInfo.addNodeEnder( moniker( ) );
593}
std::string const & label() const
Definition GIDI.hpp:658
std::string const & moniker() const
Definition GUPI.hpp:102
void addNodeEnder(std::string const &a_moniker)
Definition GUPI.hpp:59
std::string incrementalIndent(std::string const &indent)
Definition GUPI.hpp:52
void addNodeStarter(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:55
std::string addAttribute(std::string const &a_name, std::string const &a_value) const
Definition GUPI.hpp:60

The documentation for this class was generated from the following files: