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

#include <MCGIDI.hpp>

Public Member Functions

LUPI_HOST_DEVICE HeatedReactionCrossSectionContinuousEnergy ()
LUPI_HOST HeatedReactionCrossSectionContinuousEnergy (std::size_t a_offset, double a_threshold, Vector< double > &a_crossSection)
LUPI_HOST HeatedReactionCrossSectionContinuousEnergy (double a_threshold, GIDI::Functions::Ys1d const &a_crossSection, Probabilities::ProbabilityBase2d *a_URR_probabilityTables, ACE_URR_probabilityTables *a_ACE_URR_probabilityTables)
LUPI_HOST_DEVICE ~HeatedReactionCrossSectionContinuousEnergy ()
LUPI_HOST_DEVICE double threshold () const
LUPI_HOST_DEVICE std::size_t offset () const
LUPI_HOST Vector< MCGIDI_FLOAT > const & crossSections () const
LUPI_HOST_DEVICE bool hasURR_probabilityTables () const
LUPI_HOST_DEVICE Transporting::URR_mode URR_mode () const
LUPI_HOST_DEVICE double URR_domainMin () const
LUPI_HOST_DEVICE double URR_domainMax () const
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2dURR_probabilityTables () const
LUPI_HOST_DEVICE ACE_URR_probabilityTables_ACE_URR_probabilityTables () const
LUPI_HOST_DEVICE double crossSection (std::size_t a_index) const
LUPI_HOST GIDI::Functions::XYs1d crossSectionAsGIDI_XYs1d (double a_temperature, Vector< double > const &a_energies) const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST void print (ProtareSingle const *a_protareSingle, std::string const &a_indent, std::string const &a_iFormat, std::string const &a_energyFormat, std::string const &a_dFormat) const

Detailed Description

Class to store a reaction's cross section.

Definition at line 529 of file MCGIDI.hpp.

Constructor & Destructor Documentation

◆ HeatedReactionCrossSectionContinuousEnergy() [1/3]

LUPI_HOST_DEVICE MCGIDI::HeatedReactionCrossSectionContinuousEnergy::HeatedReactionCrossSectionContinuousEnergy ( )

Simple constructor needed for broadcasting.

Definition at line 27 of file MCGIDI_heatedCrossSections.cc.

27 :
28 m_offset( 0 ),
29 m_threshold( 0.0 ),
30 m_crossSections( ),
31 m_URR_mode( Transporting::URR_mode::none ),
32 m_URR_probabilityTables( nullptr ),
33 m_ACE_URR_probabilityTables( nullptr ) {
34
35}

◆ HeatedReactionCrossSectionContinuousEnergy() [2/3]

LUPI_HOST MCGIDI::HeatedReactionCrossSectionContinuousEnergy::HeatedReactionCrossSectionContinuousEnergy ( std::size_t a_offset,
double a_threshold,
Vector< double > & a_crossSection )
Parameters
a_offset[in] The offset of the first cross section point in the energy grid.
a_threshold[in] The threshold for the reaction.
a_crossSection[in] The cross section for the reaction.

Definition at line 43 of file MCGIDI_heatedCrossSections.cc.

44 :
45 m_offset( a_offset ),
46 m_threshold( a_threshold ),
47 m_crossSections( a_crossSection.size( ) ),
48 m_URR_mode( Transporting::URR_mode::none ),
49 m_URR_probabilityTables( nullptr ),
50 m_ACE_URR_probabilityTables( nullptr ) {
51
52 std::size_t index = 0; // This and next line needed as m_crossSections may be an instance of Vector<float>.
53 for( auto iter = a_crossSection.begin( ); iter != a_crossSection.end( ); ++iter, ++index ) m_crossSections[index] = *iter;
54
55}

◆ HeatedReactionCrossSectionContinuousEnergy() [3/3]

LUPI_HOST MCGIDI::HeatedReactionCrossSectionContinuousEnergy::HeatedReactionCrossSectionContinuousEnergy ( double a_threshold,
GIDI::Functions::Ys1d const & a_crossSection,
Probabilities::ProbabilityBase2d * a_URR_probabilityTables,
ACE_URR_probabilityTables * a_ACE_URR_probabilityTables )
Parameters
a_threshold[in] The threshold for the reaction.
a_crossSection[in] The cross section for the reaction.
a_URR_probabilityTables[in] The pdf style URR probability tables.
a_ACE_URR_probabilityTables[in] The ACE style URR probability tables.

Definition at line 64 of file MCGIDI_heatedCrossSections.cc.

66 :
67 m_offset( a_crossSection.start( ) ),
68 m_threshold( a_threshold ),
69 m_crossSections( a_crossSection.Ys( ).size( ) ),
70 m_URR_mode( Transporting::URR_mode::none ),
71 m_URR_probabilityTables( a_URR_probabilityTables ),
72 m_ACE_URR_probabilityTables( a_ACE_URR_probabilityTables ) {
73
74 std::size_t index = 0; // Next lines needed as m_crossSections may be an instance of Vector<float>.
75 std::vector<double> const &Ys = a_crossSection.Ys( );
76 for( auto iter = Ys.begin( ); iter != Ys.end( ); ++iter, ++index ) m_crossSections[index] = *iter;
77
78 if( m_URR_probabilityTables != nullptr ) {
79 m_URR_mode = Transporting::URR_mode::pdfs; }
80 else if( m_ACE_URR_probabilityTables != nullptr ) {
82 }
83}

◆ ~HeatedReactionCrossSectionContinuousEnergy()

LUPI_HOST_DEVICE MCGIDI::HeatedReactionCrossSectionContinuousEnergy::~HeatedReactionCrossSectionContinuousEnergy ( )

Definition at line 88 of file MCGIDI_heatedCrossSections.cc.

88 {
89
90 delete m_URR_probabilityTables;
91 delete m_ACE_URR_probabilityTables;
92}

Member Function Documentation

◆ _ACE_URR_probabilityTables()

LUPI_HOST_DEVICE ACE_URR_probabilityTables * MCGIDI::HeatedReactionCrossSectionContinuousEnergy::_ACE_URR_probabilityTables ( ) const
inline

Returns the value of the m_ACE_URR_probabilityTables.

Definition at line 556 of file MCGIDI.hpp.

◆ crossSection()

LUPI_HOST_DEVICE double MCGIDI::HeatedReactionCrossSectionContinuousEnergy::crossSection ( std::size_t a_index) const
inline

Definition at line 557 of file MCGIDI.hpp.

557 {
558 if( a_index < m_offset ) return( 0.0 );
559 a_index -= m_offset;
560 if( a_index >= m_crossSections.size( ) ) return( 0.0 );
561
562 return( m_crossSections[a_index] );
563 }

Referenced by crossSectionAsGIDI_XYs1d(), and MCGIDI::HeatedCrossSectionContinuousEnergy::HeatedCrossSectionContinuousEnergy().

◆ crossSectionAsGIDI_XYs1d()

LUPI_HOST GIDI::Functions::XYs1d MCGIDI::HeatedReactionCrossSectionContinuousEnergy::crossSectionAsGIDI_XYs1d ( double a_temperature,
Vector< double > const & a_energies ) const

Returns the reactions cross section as a GIDI::Functions::XYs1d instance.

Returns
A GIDI::Functions::XYs1d instance.

Definition at line 128 of file MCGIDI_heatedCrossSections.cc.

129 {
130
131 std::vector<double> energies = vectorToSTD_vector( a_energies );
132 std::vector<double> crossSection( energies.size( ), 0.0 );
133 for( std::size_t index = 0; index < m_crossSections.size( ); ++index ) crossSection[m_offset+index] = m_crossSections[index];
134
135 return( GIDI::Functions::XYs1d( GIDI::Axes( ), ptwXY_interpolationLinLin, energies, crossSection, 0, a_temperature ) );
136}
LUPI_HOST_DEVICE double crossSection(std::size_t a_index) const
Definition MCGIDI.hpp:557
LUPI_HOST std::vector< double > vectorToSTD_vector(Vector< double > a_input)
@ ptwXY_interpolationLinLin
Definition ptwXY.h:37

◆ crossSections()

LUPI_HOST Vector< MCGIDI_FLOAT > const & MCGIDI::HeatedReactionCrossSectionContinuousEnergy::crossSections ( ) const
inline

Returns a reference to the member m_crossSections.

Definition at line 548 of file MCGIDI.hpp.

◆ hasURR_probabilityTables()

LUPI_HOST_DEVICE bool MCGIDI::HeatedReactionCrossSectionContinuousEnergy::hasURR_probabilityTables ( ) const
inline

Returns true if URR probability tables data present and false otherwise.

Definition at line 549 of file MCGIDI.hpp.

◆ offset()

LUPI_HOST_DEVICE std::size_t MCGIDI::HeatedReactionCrossSectionContinuousEnergy::offset ( ) const
inline

Returns the value of the m_offset.

Definition at line 547 of file MCGIDI.hpp.

◆ print()

LUPI_HOST void MCGIDI::HeatedReactionCrossSectionContinuousEnergy::print ( ProtareSingle const * a_protareSingle,
std::string const & a_indent,
std::string const & a_iFormat,
std::string const & a_energyFormat,
std::string const & a_dFormat ) const

Print to std::cout the content of this. This is mainly meant for debugging.

Parameters
a_protareSingle[in] The ProtareSingle instance this resides in.
a_indent[in] The buffer to read or write data to depending on a_mode.
a_iFormat[in] C printf format specifier for any interger that is printed (e.g., "%3d").
a_energyFormat[in] C printf format specifier for any interger that is printed (e.g., "%20.12e").
a_dFormat[in] C printf format specifier for any interger that is printed (e.g., "%14.7e").

Definition at line 166 of file MCGIDI_heatedCrossSections.cc.

167 {
168
169 std::cout << a_indent << "# Offset = " << m_offset << std::endl;
170 std::cout << a_indent << "# Threshold = " << m_threshold << std::endl;
171
172 std::cout << a_indent << "# Number of cross section points = " << m_crossSections.size( ) << std::endl;
173 for( auto iter = m_crossSections.begin( ); iter != m_crossSections.end( ); ++iter )
174 std::cout << a_indent << LUPI::Misc::argumentsToString( a_dFormat.c_str( ), *iter ) << std::endl;
175}
std::string argumentsToString(char const *a_format,...)
Definition LUPI_misc.cc:305

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::HeatedReactionCrossSectionContinuousEnergy::serialize ( LUPI::DataBuffer & a_buffer,
LUPI::DataBuffer::Mode a_mode )

This method serializes this for broadcasting as needed for MPI and GPUs. The method can count the number of required bytes, pack this or unpack this depending on a_mode.

Parameters
a_buffer[in] The buffer to read or write data to depending on a_mode.
a_mode[in] Specifies the action of this method.

Definition at line 146 of file MCGIDI_heatedCrossSections.cc.

146 {
147
148 DATA_MEMBER_SIZE_T( m_offset, a_buffer, a_mode );
149 DATA_MEMBER_DOUBLE( m_threshold, a_buffer, a_mode );
150 DATA_MEMBER_VECTOR_FLOAT_OR_DOUBLE( m_crossSections, a_buffer, a_mode );
151 m_URR_mode = serializeURR_mode( m_URR_mode, a_buffer, a_mode );
152 m_URR_probabilityTables = serializeProbability2d( a_buffer, a_mode, m_URR_probabilityTables );
153 m_ACE_URR_probabilityTables = serializeACE_URR_probabilityTables( m_ACE_URR_probabilityTables, a_buffer, a_mode );
154}
#define DATA_MEMBER_SIZE_T(member, buf, mode)
#define DATA_MEMBER_DOUBLE(member, buf, mode)
#define DATA_MEMBER_VECTOR_FLOAT_OR_DOUBLE
Definition MCGIDI.hpp:19
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d * serializeProbability2d(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Probabilities::ProbabilityBase2d *a_probability2d)
LUPI_HOST_DEVICE ACE_URR_probabilityTables * serializeACE_URR_probabilityTables(ACE_URR_probabilityTables *a_ACE_URR_probabilityTables, LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE Transporting::URR_mode serializeURR_mode(Transporting::URR_mode a_URR_mode, LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

◆ threshold()

LUPI_HOST_DEVICE double MCGIDI::HeatedReactionCrossSectionContinuousEnergy::threshold ( ) const
inline

Returns the value of the m_threshold.

Definition at line 546 of file MCGIDI.hpp.

◆ URR_domainMax()

LUPI_HOST_DEVICE double MCGIDI::HeatedReactionCrossSectionContinuousEnergy::URR_domainMax ( ) const

Returns the maximum energy for the unresolved resonance region (URR) domain. If no URR data present, returns -1.

Returns
true is if this has a URR data.

Definition at line 114 of file MCGIDI_heatedCrossSections.cc.

114 {
115
116 if( m_URR_probabilityTables != nullptr ) return( m_URR_probabilityTables->domainMax( ) );
117 if( m_ACE_URR_probabilityTables != nullptr ) return( m_ACE_URR_probabilityTables->domainMax( ) );
118
119 return( -1.0 );
120}

◆ URR_domainMin()

LUPI_HOST_DEVICE double MCGIDI::HeatedReactionCrossSectionContinuousEnergy::URR_domainMin ( ) const

Returns the minimum energy for the unresolved resonance region (URR) domain. If no URR data present, returns -1.

Returns
true is if this has a URR data.

Definition at line 100 of file MCGIDI_heatedCrossSections.cc.

100 {
101
102 if( m_URR_probabilityTables != nullptr ) return( m_URR_probabilityTables->domainMin( ) );
103 if( m_ACE_URR_probabilityTables != nullptr ) return( m_ACE_URR_probabilityTables->domainMin( ) );
104
105 return( -1.0 );
106}

◆ URR_mode()

LUPI_HOST_DEVICE Transporting::URR_mode MCGIDI::HeatedReactionCrossSectionContinuousEnergy::URR_mode ( ) const
inline

◆ URR_probabilityTables()

LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d * MCGIDI::HeatedReactionCrossSectionContinuousEnergy::URR_probabilityTables ( ) const
inline

Returns the value of the m_URR_probabilityTables.

Definition at line 555 of file MCGIDI.hpp.


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