Import Geant4 11.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2025-12-05 08:54:02 +01:00
parent a499fb82e9
commit b4a16de652
6484 changed files with 232674 additions and 221097 deletions
@@ -51,6 +51,7 @@ class G4GIDI_target {
MCGIDI::Protare *m_MCGIDI_protare;
std::string m_target;
std::string m_fileName;
std::string m_evaluation;
int m_targetZ;
int m_targetA;
int m_targetM;
@@ -70,6 +71,7 @@ class G4GIDI_target {
std::string const *getName( ) const { return( &m_target ); }
std::string const *getFilename( ) const { return( &m_fileName ); }
std::string const *getEvaluation( ) const { return( &m_evaluation ); }
int getZ( ) const { return( m_targetZ ); }
int getA( ) const { return( m_targetA ); }
int getM( ) const { return( m_targetM ); }
@@ -49,7 +49,7 @@ class G4LENDElasticCrossSection : public G4LENDCrossSection
//G4LENDElasticCrossSection()
//{;};
G4LENDElasticCrossSection( G4ParticleDefinition* pd )
:G4LENDCrossSection("LENDElasitcCrossSection")
:G4LENDCrossSection("LENDElasticCrossSection")
{
proj = pd;
//name = "LEND Elastic Cross Section for ";
@@ -44,7 +44,7 @@ namespace GRIN {
class GRIN_continuumGammas;
}
typedef std::set<int> ExcludeReactionsSet;
typedef std::set<std::size_t> ExcludeReactionsSet;
namespace Functions {
class XYs1d;
@@ -99,8 +99,9 @@ class GNDS_FileTypeInfo {
public:
GNDS_FileTypeInfo( );
GNDS_FileTypeInfo( GNDS_FileType a_GNDS_fileType, std::string a_projectileID = "", std::string a_targetID = "", std::string a_evaluation = "",
std::string a_interaction = "" );
GNDS_FileTypeInfo( GNDS_FileType a_GNDS_fileType, std::string const &a_projectileID = "",
std::string const &a_targetID = "", std::string const &a_evaluation = "",
std::string const &a_interaction = "" );
GNDS_FileTypeInfo( GNDS_FileTypeInfo const &a_GNDS_fileTypeInfo );
GNDS_FileTypeInfo &operator=( GNDS_FileTypeInfo const &a_rhs );
@@ -464,6 +465,11 @@ enum class FileType { XML, HDF };
#define GIDI_conserveNumberChars "number"
#define GIDI_conserveEnergyOutChars "energyOut"
// TargetInfo.
#define GIDI_targetInfoChars "targetInfo"
#define GIDI_atomFractionChars "atomFraction"
#define GIDI_isotopicAbundancesChars "isotopicAbundances"
// GRIN.
#define GIDI_GRIN_continuumGammasChars "GRIN_continuumGammas"
#define GIDI_captureNeutronSeparationEnergyChars "captureNeutronSeparationEnergy"
@@ -711,7 +717,7 @@ class PhysicalQuantity : public Form {
public:
PhysicalQuantity( HAPI::Node const &a_node, SetupInfo &a_setupInfo );
PhysicalQuantity( double a_value, std::string a_unit );
PhysicalQuantity( double a_value, std::string const &a_unit );
PhysicalQuantity( PhysicalQuantity const &a_physicalQuantity ) :
Form( FormType::physicalQuantity ),
m_value( a_physicalQuantity.value( ) ),
@@ -799,7 +805,7 @@ class Axis : public Form {
public:
Axis( HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type = FormType::axis );
Axis( int a_index, std::string a_label, std::string a_unit, FormType a_type = FormType::axis );
Axis( int a_index, std::string const &a_label, std::string const &a_unit, FormType a_type = FormType::axis );
Axis( Axis const &a_axis );
virtual ~Axis( );
@@ -884,11 +890,11 @@ namespace Array {
class FullArray {
public:
FullArray( std::vector<int> a_shape );
FullArray( std::vector<int> a_shape, std::vector<double> a_flattenedValues );
FullArray( std::vector<std::size_t> const &a_shape );
FullArray( std::vector<std::size_t> const &a_shape, std::vector<double> const &a_flattenedValues );
~FullArray( ) {}
std::vector<int> m_shape; /**< The shape of the array. */
std::vector<std::size_t> m_shape; /**< The shape of the array. */
std::vector<double> m_flattenedValues; /**< A *std::vector<double>* representing the flattened arrary. */
std::size_t size( ) const { return( m_flattenedValues.size( ) ); }
@@ -903,7 +909,7 @@ class FullArray {
class Array : public Form {
private:
std::vector<int> m_shape; /**< The shape of the array. */
std::vector<std::size_t> m_shape; /**< The shape of the array. */
std::string m_compression; /**< The compression of the array. Allowed values are *none*, *diagonal*, *flattened* or *embedded*. */
std::string m_symmetry; /**< The symmetry of the array. Allowed values are *none*, *lower* or *upper*. */
std::string m_permutation; /**< The permutation of the array. Allowed values are *none*, *-1*, and *1*. */
@@ -920,7 +926,7 @@ class Array : public Form {
std::size_t dimension( ) const { return( m_shape.size( ) ); } /**< Returns the dimension of the array. */
std::size_t size( ) const ;
std::vector<int> const &shape( ) const { return( m_shape ); } /**< Returns a const reference to member *m_shape*. */
std::vector<std::size_t> const &shape( ) const { return( m_shape ); } /**< Returns a const reference to member *m_shape*. */
FullArray constructArray( ) const ;
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent ) const ;
@@ -936,21 +942,18 @@ class Array : public Form {
class FlattenedArrayData : public Form {
public:
std::vector<int> m_shape; /**< The shape of the flattened array. */
std::vector<std::size_t> m_shape; /**< The shape of the flattened array. */
std::size_t m_numberOfStarts; /**< The number of start values. */
std::size_t m_numberOfLengths; /**< The number of length values. */
nf_Buffer<int> m_starts; /**< The start values. */
nf_Buffer<int> m_lengths; /**< The length values. */
nf_Buffer<double> m_dValues; /**< The given array data. */
// int32_t *m_starts; /**< The start values. */
// int32_t *m_lengths; /**< The length values. */
// std::vector<double> m_dValues; /**< The given array data. */
FlattenedArrayData( HAPI::Node const &a_node, SetupInfo &a_setupInfo, int a_dimensions, int a_useSystem_strtod );
~FlattenedArrayData( );
std::vector<int> const &shape( ) const { return( m_shape ); }
void setToValueInFlatRange( int a_start, int a_end, double a_value );
std::vector<std::size_t> const &shape( ) const { return( m_shape ); }
void setToValueInFlatRange( std::size_t a_start, std::size_t a_end, double a_value );
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent ) const ;
};
@@ -972,7 +975,7 @@ class Array3d : public Form {
Matrix matrix( std::size_t a_index ) const ;
void modifiedMultiGroupElasticForTNSL( int maxTNSL_index );
void modifiedMultiGroupElasticForTNSL( std::size_t maxTNSL_index );
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent ) const { m_array.toXMLList( a_writeInfo, a_indent ); }
};
@@ -1036,7 +1039,7 @@ class Function1dForm : public FunctionForm {
Function1dForm &operator=( Function1dForm const &a_rhs );
virtual double evaluate( double a_x1 ) const = 0;
virtual void mapToXsAndAdd( int a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
virtual void mapToXsAndAdd( std::size_t a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
virtual XYs1d *asXYs1d( bool a_asLinlin, double a_accuray, double a_lowerEps, double a_upperEps ) const ;
virtual void write( FILE *a_file, std::string const &a_format ) const ;
@@ -1065,7 +1068,7 @@ class Constant1d : public Function1dForm {
double domainMax( ) const { return( m_domainMax ); } /**< Returns the value of the *m_domainMax* member. */
double evaluate( double a_x1 ) const ;
void mapToXsAndAdd( int a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
void mapToXsAndAdd( std::size_t a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
XYs1d *asXYs1d( bool a_asLinlin, double a_accuray, double a_lowerEps, double a_upperEps ) const ;
void toXMLList_func( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, bool a_embedded, bool a_inRegions ) const ;
@@ -1094,7 +1097,7 @@ class XYs1d : public Function1dForm {
~XYs1d( );
XYs1d &operator=( XYs1d const &a_rhs );
std::size_t size( ) const { return( ptwXY_length( nullptr, m_ptwXY ) ); } /**< Returns the number of points (i.e., x,y pairs) in this. */
std::size_t size( ) const { return( static_cast<std::size_t>( ptwXY_length( nullptr, m_ptwXY ) ) ); } /**< Returns the number of points (i.e., x,y pairs) in this. */
ptwXYPoints const *ptwXY( ) const { return( m_ptwXY ); } /**< Returns the value of the *m_ptwXY* member. */
ptwXYPoints *ptwXY( ) { return( m_ptwXY ); } /**< Returns the value of the *m_ptwXY* member. */
@@ -1117,7 +1120,7 @@ class XYs1d : public Function1dForm {
XYs1d domainSliceMax( double a_domainMax ) const ;
double evaluate( double a_x1 ) const ;
void mapToXsAndAdd( int a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
void mapToXsAndAdd( std::size_t a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
XYs1d *asXYs1d( bool a_asLinlin, double a_accuray, double a_lowerEps, double a_upperEps ) const ;
double integrate( double a_dommainMin, double a_dommainMax );
@@ -1194,7 +1197,7 @@ class Polynomial1d : public Function1dForm {
std::vector<double> const &coefficients( ) const { return( m_coefficients ); } /**< Returns the value of the *m_coefficients* member. */
double evaluate( double a_x1 ) const ;
void mapToXsAndAdd( int a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
void mapToXsAndAdd( std::size_t a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
XYs1d *asXYs1d( bool a_asLinlin, double a_accuray, double a_lowerEps, double a_upperEps ) const ;
void toXMLList_func( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, bool a_embedded, bool a_inRegions ) const ;
@@ -1251,7 +1254,7 @@ class Gridded1d : public Function1dForm {
Vector const &data( ) const { return( m_data ); } /**< Returns the value of the *m_data* member. */
void setData( Vector const &a_data ) { m_data = a_data; } /**< Sets the *m_data* member to *a_data*. */
void modifiedMultiGroupElasticForTNSL( int a_maxTNSL_index );
void modifiedMultiGroupElasticForTNSL( std::size_t a_maxTNSL_index );
double evaluate( double a_x1 ) const ;
void toXMLList_func( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, bool a_embedded, bool a_inRegions ) const ;
@@ -1337,7 +1340,7 @@ class Regions1d : public Function1dForm {
void append( Function1dForm *a_function );
double evaluate( double a_x1 ) const ;
void mapToXsAndAdd( int a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
void mapToXsAndAdd( std::size_t a_offset, std::vector<double> const &a_Xs, std::vector<double> &a_results, double a_scaleFactor ) const ;
XYs1d *asXYs1d( bool a_asLinlin, double a_accuray, double a_lowerEps, double a_upperEps ) const ;
std::vector<double> const &Xs( ) const { return( m_Xs ); } /**< Returns the value of the *m_Xs* member. */
@@ -1971,7 +1974,7 @@ class Gridded3d : public Function3dForm {
Array3d const &data( ) const { return( m_data ); } /**< Returns the value of the *m_data* member. */
void modifiedMultiGroupElasticForTNSL( int maxTNSL_index );
void modifiedMultiGroupElasticForTNSL( std::size_t maxTNSL_index );
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent ) const ;
};
@@ -2569,7 +2572,7 @@ class Suite : public GUPI::Ancestry {
private:
std::string m_keyName; /**< The name of the key used to look up items in the suite. */
mutable Forms m_forms; /**< The list of nodes stored within *this*. */
std::map<std::string,int> m_map; /**< A map of *this* node labels to their index in *m_forms*. */
std::map<std::string,std::size_t> m_map; /**< A map of *this* node labels to their index in *m_forms*. */
Styles::Suite const *m_styles; /**< The Styles::Suite for the Protare that *this* resides in. */
bool m_allowsLazyParsing; /**< If **true**, the suite allows its elements to be lazy parsed. */
std::string m_href; /**< xlink to the to a Suite that has the elements for this Suite. */
@@ -2592,12 +2595,13 @@ class Suite : public GUPI::Ancestry {
const_iterator begin( ) const { return m_forms.begin( ); } /**< The C++ const *begin iterator* for *this*. */
iterator end( ) { return m_forms.end( ); } /**< The C++ *end iterator* for *this*. */
const_iterator end( ) const { return m_forms.end( ); } /**< The C++ const *end iterator* for *this*. */
int operator[]( std::string const &a_label ) const ;
std::size_t operator[]( std::string const &a_label ) const ;
template<typename T> T *get( std::size_t a_Index );
template<typename T> T const *get( std::size_t a_Index ) const ;
template<typename T> T *get( std::string const &a_label );
template<typename T> T const *get( std::string const &a_label ) const ;
template<typename T> T *getViaLineage( std::string const &a_label );
template<typename T> T *getViaLineage( std::string const &a_label ) const;
template<typename T> T *pop( std::size_t a_Index );
template<typename T> T *pop( std::string const &a_label );
@@ -2615,7 +2619,7 @@ class Suite : public GUPI::Ancestry {
iterator checkLazyParsingHelperFormIterator( iterator a_iter ) ;
const_iterator checkLazyParsingHelperFormIterator( const_iterator a_iter ) const ;
void modifiedMultiGroupElasticForTNSL( std::map<std::string,std::size_t> a_maximumTNSL_MultiGroupIndex );
void modifiedMultiGroupElasticForTNSL( std::map<std::string,std::size_t> const &a_maximumTNSL_MultiGroupIndex );
GUPI::Ancestry *findInAncestry3( std::string const &a_item );
GUPI::Ancestry const *findInAncestry3( std::string const &a_item ) const ;
std::vector<iterator> findAllOfMoniker( std::string const &a_moniker ) ;
@@ -2673,7 +2677,7 @@ template<typename T> T const *Suite::get( std::size_t a_index ) const {
template<typename T> T *Suite::get( std::string const &a_label ) {
int index = (*this)[a_label];
auto index = (*this)[a_label];
Form *__form = checkLazyParsingHelperForm( index );
T *object = dynamic_cast<T *>( __form );
@@ -2692,7 +2696,7 @@ template<typename T> T *Suite::get( std::string const &a_label ) {
template<typename T> T const *Suite::get( std::string const &a_label ) const {
int index = (*this)[a_label];
auto index = (*this)[a_label];
Form *__form = checkLazyParsingHelperForm( index );
T *object = dynamic_cast<T *>( __form );
@@ -2737,7 +2741,7 @@ template<typename T> T *Suite::pop( std::size_t a_index ) {
template<typename T> T *Suite::pop( std::string const &a_label ) {
int index = (*this)[a_label]; // This will throw an exception if *a_label* is not in *this*.
auto index = (*this)[a_label]; // This will throw an exception if *a_label* is not in *this*.
Form *__form = checkLazyParsingHelperForm( index );
T *object = dynamic_cast<T *>( __form );
@@ -2831,8 +2835,8 @@ class Data : public GUPI::Ancestry {
class Table : public Form {
private:
int m_rows; /**< The number of rows in the table. */
int m_coluns; /**< The number of columns in the table. */
std::size_t m_rows; /**< The number of rows in the table. */
std::size_t m_columns; /**< The number of columns in the table. */
std::string m_storageOrder; /**< The storageOrder for the data in the table. */
Suite m_columnHeaders; /**< The column header for the table. */
Data m_data; /**< The data for the table. */
@@ -2841,8 +2845,8 @@ class Table : public Form {
Table( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo );
~Table( );
int rows( ) const { return( m_rows ); } /**< Returns the value of the *m_rows* member. */
int columns( ) const { return( m_coluns ); } /**< Returns the value of the *m_coluns* member. */
std::size_t rows( ) const { return( m_rows ); } /**< Returns the value of the *m_rows* member. */
std::size_t columns( ) const { return( m_columns ); } /**< Returns the value of the *m_columns* member. */
std::string const &storageOrder( ) const { return( m_storageOrder ); } /**< Returns the value of the *m_storageOrder* member. */
Suite const &columnHeaders( ) const { return( m_columnHeaders ); } /**< Returns the value of the *m_columnHeaders* member. */
Data const &data( ) const { return( m_data ); } /**< Returns the value of the *m_data* member. */
@@ -2912,6 +2916,110 @@ class Transportable : public Form {
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent ) const ;
};
namespace TargetInfo {
/*
============================================================
========================= nuclide =========================
============================================================
*/
class Nuclide : public GUPI::Entry {
private:
double m_atomFraction; /**< The atom fraction for *this* isotope. */
public:
Nuclide( HAPI::Node const &a_node );
~Nuclide( );
std::string const &pid( ) const { return( keyValue( ) ); } /**< Returns a const reference to the results of the call to the *keyValue()* method. */
double atomFraction( ) const { return( m_atomFraction ); } /**< Returns the value of the *m_atomFraction* member. */
GUPI::Ancestry *findInAncestry3( LUPI_maybeUnused std::string const &a_item ) { return( nullptr ); }
GUPI::Ancestry const *findInAncestry3( LUPI_maybeUnused std::string const &a_item ) const { return( nullptr ); }
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent = "" ) const ;
};
/*
============================================================
===================== ChemicalElement =====================
============================================================
*/
class ChemicalElement : public GUPI::Entry {
private:
GUPI::Suite m_nuclides; /**< The list of nuclies for the chemical element. */
public:
ChemicalElement( HAPI::Node const &a_node );
~ChemicalElement( );
GUPI::Suite &nuclides( ) { return( m_nuclides ); }
GUPI::Suite const &nuclides( ) const { return( m_nuclides ); }
std::string const &symbol( ) const { return( keyValue( ) ); } /**< Returns a const reference to the results of the call to the *keyValue()* method. */
Nuclide const *operator[]( std::string const &a_pid ) const ;
GUPI::Ancestry *findInAncestry3( LUPI_maybeUnused std::string const &a_item ) { return( nullptr ); }
GUPI::Ancestry const *findInAncestry3( LUPI_maybeUnused std::string const &a_item ) const { return( nullptr ); }
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent = "" ) const ;
};
/*
============================================================
==================== IsotopicAbundances ====================
============================================================
*/
class IsotopicAbundances : public GUPI::Ancestry {
private:
GUPI::Suite m_chemicalElements;
public:
IsotopicAbundances( );
~IsotopicAbundances( );
void initialize( HAPI::Node const &a_node );
GUPI::Suite &chemicalElements( ) { return( m_chemicalElements ); } /**< Returns a reference to the *m_chemicalElements* member. */
GUPI::Suite const &chemicalElements( ) const { return( m_chemicalElements ); } /**< Returns a const reference to the *m_chemicalElements* member. */
ChemicalElement const *operator[]( std::string const &a_symbol ) const ;
GUPI::Ancestry *findInAncestry3( LUPI_maybeUnused std::string const &a_item ) { return( nullptr ); }
GUPI::Ancestry const *findInAncestry3( LUPI_maybeUnused std::string const &a_item ) const { return( nullptr ); }
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent = "" ) const ;
};
/*
============================================================
======================== TargetInfo =======================
============================================================
*/
class TargetInfo : public GUPI::Ancestry {
private:
IsotopicAbundances m_isotopicAbundances; /**< The list of isotopic abundances for a TNSL protare. */
public:
TargetInfo( );
~TargetInfo( );
void parseEvaluatedTargetInfo( HAPI::Node const &a_node );
IsotopicAbundances const &isotopicAbundances( ) const { return( m_isotopicAbundances ); } /**< Returns a const reference to the *m_isotopicAbundances* member. */
GUPI::Ancestry *findInAncestry3( LUPI_maybeUnused std::string const &a_item ) { return( nullptr ); }
GUPI::Ancestry const *findInAncestry3( LUPI_maybeUnused std::string const &a_item ) const { return( nullptr ); }
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent = "" ) const ;
};
} // End of namespace targetInfo.
/*
============================================================
======================= ExternalFile =======================
@@ -2987,7 +3095,7 @@ namespace ExternalFiles {
class Suite : public GIDI::Suite {
public:
void registerBinaryFiles(std::string a_parentDir, SetupInfo &a_setupInfo);
void registerBinaryFiles( std::string const &a_parentDir, SetupInfo &a_setupInfo );
};
@@ -3027,6 +3135,9 @@ class Base : public Form {
Base const *getDerivedStyle( ) const ;
Base const *getDerivedStyle( std::string const &a_moniker ) const ;
std::vector<Base const *> chain( ) const ;
bool isStyleInDerivedForm( Base const *a_style ) const ;
std::string baseXMLAttributes( GUPI::WriteInfo &a_writeInfo ) const ;
};
@@ -3280,10 +3391,19 @@ class URR_probabilityTables : public Base {
*/
class Suite : public GIDI::Suite {
private:
std::vector<Base const *> m_chainEnds; /**< The list of all the ends of the style chains. */
std::vector<Base const *> m_preProcessingChainEnds; /**< The list of all the ends of the pre-processed style chains. */
public:
Suite( );
std::string const *findLabelInLineage( GIDI::Suite const &a_suite, std::string const &a_label ) const ;
std::vector< std::vector<Base const *> > chains( bool a_ends ) const ;
void updateChainEnds( );
std::vector<Base const *> const &chainEnds( ) const { return( m_chainEnds ); } /**< Returns a const reference to the **m_chainEnds** member. */
std::vector<Base const *> const &preProcessingChainEnds( ) const { return( m_preProcessingChainEnds ); }
/**< Returns a const reference to the **m_preProcessingChainEnds** member. */
};
/*
@@ -3331,6 +3451,16 @@ template<typename T> T *Suite::getViaLineage( std::string const &a_label ) {
return( get<T>( *label ) );
}
/*
=========================================================
*/
template<typename T> T *Suite::getViaLineage( std::string const &a_label ) const {
std::string const *label = m_styles->findLabelInLineage( (Styles::Suite &) *this, a_label );
return( get<T>( *label ) );
}
/*
============================================================
==================== Transporting stuff ====================
@@ -3365,16 +3495,16 @@ class MultiGroup {
~MultiGroup( );
MultiGroup &operator=( MultiGroup const &a_rhs );
double operator[]( int const a_index ) const { return( m_boundaries[a_index] ); } /**< Returns the multi-group boundary at index *a_index*. */
double operator[]( std::size_t const a_index ) const { return( m_boundaries[a_index] ); } /**< Returns the multi-group boundary at index *a_index*. */
std::size_t size( ) const { return( m_boundaries.size( ) ); } /**< Returns the number of multi-group boundaries. */
int numberOfGroups( ) const { return( (int) ( m_boundaries.size( ) - 1 ) ); } /**< Returns the number of multi-group groups. */
std::size_t numberOfGroups( ) const { return( ( m_boundaries.size( ) - 1 ) ); } /**< Returns the number of multi-group groups. */
std::vector<double> const &boundaries( ) const { return( m_boundaries ); } /**< Returns the value of the *m_boundaries* member. */
double const *pointer( ) const { return( &(m_boundaries[0]) ); } /**< Returns a pointer to the beginning of the multi-group boundaries. */
void set( std::string const &a_label, std::vector<double> const &a_boundaries );
std::string const &label( ) const { return( m_label ); } /**< Returns the value of the *m_label* member. */
int multiGroupIndexFromEnergy( double a_energy, bool a_encloseOutOfRange ) const ;
void print( std::string const &a_indent, bool a_outline = false, int a_valuesPerLine = 10 ) const ;
void print( std::string const &a_indent, bool a_outline = false, unsigned int a_valuesPerLine = 10 ) const ;
};
/*
@@ -3396,7 +3526,7 @@ class Groups_from_bdfls {
MultiGroup getViaGID( int a_gid ) const;
std::vector<std::string> labels( ) const;
std::vector<int> GIDs( ) const;
void print( bool a_outline = true, int a_valuesPerLine = 10 ) const;
void print( bool a_outline = true, unsigned int a_valuesPerLine = 10 ) const;
private:
void initialize( char const *a_fileName );
@@ -3410,23 +3540,23 @@ class Groups_from_bdfls {
class Flux_order {
private:
int m_order; /**< The Legendre order of the flux. */
std::size_t m_order; /**< The Legendre order of the flux. */
std::vector<double> m_energies; /**< List of flux energies. */
std::vector<double> m_fluxes; /**< List of flux values - one for each element of m_energies. */
public:
Flux_order( int a_order, int a_length, double const *a_energies, double const *a_fluxes );
Flux_order( int a_order, std::vector<double> const &a_energies, std::vector<double> const &a_fluxes );
Flux_order( std::size_t a_order, std::size_t a_length, double const *a_energies, double const *a_fluxes );
Flux_order( std::size_t a_order, std::vector<double> const &a_energies, std::vector<double> const &a_fluxes );
Flux_order( Flux_order const &a_fluxOrder );
~Flux_order( );
int order( ) const { return( m_order ); } /**< Returns the value of the *m_order* member. */
int size( ) const { return( (int) m_energies.size( ) ); } /**< Returns the number of energy, flux pairs. */
std::size_t order( ) const { return( m_order ); } /**< Returns the value of the *m_order* member. */
std::size_t size( ) const { return( m_energies.size( ) ); } /**< Returns the number of energy, flux pairs. */
double const *energies( ) const { return( &(m_energies[0]) ); } /**< Returns a pointer to the beginning of the energy data. */
std::vector<double> const &v_energies( ) const { return( m_energies ); } /**< Returns the value of the *m_energies* member. */
double const *fluxes( ) const { return( &(m_fluxes[0]) ); } /**< Returns a pointer to the beginning of the flux data. */
std::vector<double> const &v_fluxes( ) const { return( m_fluxes ); } /**< Returns the value of the *m_fluxes* member. */
void print( int a_valuesPerLine = 10 ) const;
void print( unsigned int a_valuesPerLine = 10 ) const;
};
/*
@@ -3447,15 +3577,16 @@ class Flux {
Flux( Flux const &a_flux );
~Flux( );
Flux_order const &operator[]( int a_order ) const { return( m_fluxOrders[a_order] ); } /**< Returns the Flux_order for Legendre order *a_order*. */
int maxOrder( ) const { return( (int) m_fluxOrders.size( ) - 1 ); } /**< Returns the maximum number of Legendre orders for *this*. */
int size( ) const { return( (int) m_fluxOrders.size( ) ); } /**< Returns the number of stored Legendre orders. */
Flux_order const &operator[]( std::size_t a_order ) const { return( m_fluxOrders[a_order] ); }
/**< Returns the Flux_order for Legendre order *a_order*. */
std::size_t maxOrder( ) const { return( m_fluxOrders.size( ) - 1 ); } /**< Returns the maximum number of Legendre orders for *this*. */
std::size_t size( ) const { return( m_fluxOrders.size( ) ); } /**< Returns the number of stored Legendre orders. */
std::string const &label( ) const { return( m_label ); } /**< Returns the value of the *m_label* member. */
double temperature( ) const { return( m_temperature ); } /**< Returns the value of the *m_temperature* member. */
void addFluxOrder( Flux_order const &a_fluxOrder );
ProcessedFlux process( std::vector<double> const &a_multiGroup ) const ;
void print( std::string const &a_indent, bool a_outline = true, int a_valuesPerLine = 10 ) const ;
void print( std::string const &a_indent, bool a_outline = true, unsigned int a_valuesPerLine = 10 ) const ;
};
/*
@@ -3477,7 +3608,7 @@ class Fluxes_from_bdfls {
Functions::XYs3d *get3dViaFID( int a_fid ) const ;
std::vector<std::string> labels( ) const ;
std::vector<int> FIDs( ) const ;
void print( bool a_outline = true, int a_valuesPerLine = 10 ) const ;
void print( bool a_outline = true, unsigned int a_valuesPerLine = 10 ) const ;
private:
void initialize( char const *a_fileName, double a_temperature_MeV );
@@ -3516,7 +3647,7 @@ class Particle {
Transporting::Conserve m_conserve; /**< Indicates the conservation option for this transportable. */
MultiGroup m_multiGroup; /**< Coarse multi-group to collapse to. */
MultiGroup m_fineMultiGroup; /**< Fine multi-group to collapse from. For internal use only. */
std::vector<int> m_collapseIndices; /**< Indices for collapsing to m_multiGroup. */
std::vector<std::size_t> m_collapseIndices; /**< Indices for collapsing to m_multiGroup. */
std::vector<Flux> m_fluxes; /**< One flux for each temperature. */
std::vector<ProcessedFlux> m_processedFluxes; /**< One processed flux for each temperature. */
@@ -3533,12 +3664,12 @@ class Particle {
Transporting::Conserve conserve( ) const { return( m_conserve ); } /**< Returns the value of the *m_conserve* member. */
int multiGroupIndexFromEnergy( double a_e_in, bool a_encloseOutOfRange ) const { return( m_multiGroup.multiGroupIndexFromEnergy( a_e_in, a_encloseOutOfRange ) ); }
/**< Returns the coarse multi-group index corresponding to energy *a_e_in*. See MultiGroup::multiGroupIndexFromEnergy. */
int numberOfGroups( ) const { return( m_multiGroup.numberOfGroups( ) ); } /**< Returns the number of coarse multi-group groups. */
std::size_t numberOfGroups( ) const { return( m_multiGroup.numberOfGroups( ) ); } /**< Returns the number of coarse multi-group groups. */
MultiGroup multiGroup( ) const { return( m_multiGroup ); } /**< Returns the value of the *m_multiGroup* member. */
MultiGroup fineMultiGroup( ) const { return( m_fineMultiGroup ); } /**< Returns the value of the *m_fineMultiGroup* member. */
int appendFlux( Flux const &a_flux );
ProcessedFlux const *nearestProcessedFluxToTemperature( double a_temperature ) const;
std::vector<int> const &collapseIndices( ) const { return( m_collapseIndices ); } /**< Returns the value of the *m_collapseIndices* member. */
std::vector<std::size_t> const &collapseIndices( ) const { return( m_collapseIndices ); } /**< Returns the value of the *m_collapseIndices* member. */
void process( Transportable const &a_transportable, double a_epsilon = 1e-6 );
void print( std::string const &a_indent ) const ;
@@ -3635,7 +3766,7 @@ class MG : public Settings {
/**< Sets the *m_useMultiGroupSummedData* member to *a_useMultiGroupSummedData*. */
Form const *form( LUPI::StatusMessageReporting &a_smr, GIDI::Suite const &a_suite, Styles::TemperatureInfo const &a_temperatureInfo,
std::string a_dataType ) const ;
std::string a_dataType, std::string const &a_label = "" ) const ;
};
} // End of namespace Transporting.
@@ -3774,7 +3905,7 @@ class Product : public Form {
Component const &averageMomentum( ) const { return( m_averageMomentum ); } /**< Returns a const reference to the *m_averageMomentum* member. */
OutputChannel *outputChannel( ) const { return( m_outputChannel ); } /**< Returns a reference to the *m_outputChannel* member. */
void modifiedMultiGroupElasticForTNSL( std::map<std::string,std::size_t> a_maximumTNSL_MultiGroupIndex );
void modifiedMultiGroupElasticForTNSL( std::map<std::string,std::size_t> const &a_maximumTNSL_MultiGroupIndex );
bool hasFission( ) const ;
bool isDelayedFissionNeutronComplete( bool a_isDelayedNeutron ) const ;
@@ -3793,7 +3924,7 @@ class Product : public Form {
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,
int a_order ) const ;
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 ;
@@ -3803,7 +3934,7 @@ class Product : public Form {
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, int a_offset, std::vector<double> &a_productEnergies, std::vector<double> &a_productMomenta,
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 ;
@@ -3848,7 +3979,7 @@ class DelayedNeutron : public Form {
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, int a_order ) const ;
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,
@@ -3858,7 +3989,7 @@ class DelayedNeutron : public Form {
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, int a_offset, std::vector<double> &a_productEnergies, std::vector<double> &a_productMomenta,
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 ;
void calculateMultiGroupData( ProtareSingle const *a_protare, Styles::TemperatureInfo const &a_temperatureInfo,
std::string const &a_heatedMultiGroupLabel, MultiGroupCalulationInformation const &a_multiGroupCalulationInformation,
@@ -3880,7 +4011,7 @@ class DelayedNeutronProduct {
Product const *m_product;
public:
DelayedNeutronProduct( int a_delayedNeutronIndex, PhysicalQuantity a_rate, Product const *a_product ) :
DelayedNeutronProduct( int a_delayedNeutronIndex, PhysicalQuantity const &a_rate, Product const *a_product ) :
m_delayedNeutronIndex( a_delayedNeutronIndex ),
m_rate( a_rate ),
m_product( a_product ) {
@@ -3934,7 +4065,7 @@ class FissionFragmentData : public GUPI::Ancestry {
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, int a_order ) const ;
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,
@@ -3945,7 +4076,7 @@ class FissionFragmentData : public GUPI::Ancestry {
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, int a_offset, std::vector<double> &a_productEnergies, std::vector<double> &a_productMomenta,
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 ;
void calculateMultiGroupData( ProtareSingle const *a_protare, Styles::TemperatureInfo const &a_temperatureInfo,
std::string const &a_heatedMultiGroupLabel, MultiGroupCalulationInformation const &a_multiGroupCalulationInformation,
@@ -3972,7 +4103,7 @@ class OutputChannel : public GUPI::Ancestry {
Construction::FissionResiduals m_fissionResiduals; /**< This member specifies what fission redisual products will be added to the list of products produced in a fission reaction. */
public:
OutputChannel( bool a_twoBody, bool a_fissions, std::string a_process );
OutputChannel( bool a_twoBody, bool a_fissions, std::string const &a_process );
OutputChannel( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops,
PoPI::Database const &a_internalPoPs, Styles::Suite const *a_styles, bool a_isFission, bool a_addFissionResiduals );
~OutputChannel( );
@@ -3990,7 +4121,7 @@ class OutputChannel : public GUPI::Ancestry {
Construction::FissionResiduals fissionResiduals( ) const { return( m_fissionResiduals ); } /**< Returns the value of the *m_fissionResiduals* member. */
void modifiedMultiGroupElasticForTNSL( std::map<std::string,std::size_t> a_maximumTNSL_MultiGroupIndex );
void modifiedMultiGroupElasticForTNSL( std::map<std::string,std::size_t> const &a_maximumTNSL_MultiGroupIndex );
bool areAllProductsTracked( Transporting::Particles const &a_particles ) const ;
GUPI::Ancestry *findInAncestry3( std::string const &a_item );
@@ -4009,7 +4140,7 @@ class OutputChannel : public GUPI::Ancestry {
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, int a_order ) const ;
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,
@@ -4020,7 +4151,7 @@ class OutputChannel : public GUPI::Ancestry {
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, int a_offset, std::vector<double> &a_productEnergies, std::vector<double> &a_productMomenta,
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 ;
void calculateMultiGroupData( ProtareSingle const *a_protare, Styles::TemperatureInfo const &a_temperatureInfo,
std::string const &a_heatedMultiGroupLabel, MultiGroupCalulationInformation const &a_multiGroupCalulationInformation,
@@ -4116,7 +4247,7 @@ class Reaction : public Form {
friend class ProtareSingle;
private:
mutable int m_reactionIndex; /**< The index of the reaction in the ProtareSingle. */
mutable std::size_t m_reactionIndex; /**< The index of the reaction in the ProtareSingle. */
bool m_active; /**< If true, this reaction is used for calcualtion (e.g., its cross section is added to the total for its protare), otherwise, this reaction is ignored. */
int m_ENDF_MT; /**< The ENDF MT value for the reaction. */
int m_ENDL_C; /**< The ENDL C value for the reaction. */
@@ -4137,18 +4268,18 @@ class Reaction : public Form {
Component m_availableEnergy; /**< The GNDS <**availableEnergy**> node. */
Component m_availableMomentum; /**< The GNDS <**availableMomentum**> node. */
OutputChannel *m_outputChannel; /**< The reaction's output channel. */
void setReactionIndex( int a_reactionIndex ) const
void setReactionIndex( std::size_t a_reactionIndex ) const
{ m_reactionIndex = a_reactionIndex ; } /**< Sets *m_reactionIndex* to *a_reactionIndex*. */
public:
Reaction( int a_ENDF_MT, std::string a_fissionGenre );
Reaction( int a_ENDF_MT, std::string const &a_fissionGenre );
Reaction( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Protare const &a_protare,
Styles::Suite const *a_styles );
~Reaction( );
bool active( ) const { return( m_active ); } /**< Returns the value of the *m_active* member. */
void setActive( bool a_active ) { m_active = a_active; } /**< Sets *m_active* to *a_active*. */
int reactionIndex( ) const { return( m_reactionIndex ); } /**< Returns the value of the *m_reactionIndex* member. */
std::size_t reactionIndex( ) const { return( m_reactionIndex ); } /**< Returns the value of the *m_reactionIndex* member. */
int depth( ) const { return( m_outputChannel->depth( ) ); } /**< Returns the maximum product depth for this reaction. */
int ENDF_MT( ) const { return( m_ENDF_MT ); } /**< Returns the value of the *m_ENDF_MT* member. */
int ENDL_C( ) const { return( m_ENDL_C ); } /**< Returns the value of the *m_ENDL_C* member. */
@@ -4176,7 +4307,7 @@ class Reaction : public Form {
OutputChannel *outputChannel( ) const { return( m_outputChannel ); } /**< Returns a reference to the *m_outputChannel* member. */
void setOutputChannel( OutputChannel *a_outputChannel );
void modifiedMultiGroupElasticForTNSL( std::map<std::string,std::size_t> a_maximumTNSL_MultiGroupIndex );
void modifiedMultiGroupElasticForTNSL( std::map<std::string,std::size_t> const &a_maximumTNSL_MultiGroupIndex );
GUPI::Ancestry *findInAncestry3( std::string const &a_item );
GUPI::Ancestry const *findInAncestry3( std::string const &a_item ) const ;
@@ -4195,17 +4326,17 @@ class Reaction : public Form {
bool areAllProductsTracked( Transporting::Particles const &a_particles ) const ;
Vector multiGroupCrossSection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo )
const ;
Vector multiGroupCrossSection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_label = "" ) 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, int a_order ) const ;
Transporting::Particles const &a_particles, std::string const &a_productID, std::size_t a_order ) const ;
Matrix multiGroupFissionMatrix( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo,
Transporting::Particles const &a_particles, int a_order ) const ;
Transporting::Particles const &a_particles, std::size_t a_order ) const ;
Vector multiGroupAvailableEnergy( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings, Styles::TemperatureInfo const &a_temperatureInfo )
const ;
@@ -4229,7 +4360,7 @@ class Reaction : public Form {
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, int a_offset, std::vector<double> &a_productEnergies, std::vector<double> &a_productMomenta,
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 modifyCrossSection( Functions::XYs1d const *a_offset, Functions::XYs1d const *a_slope, bool a_updateMultiGroup = false );
@@ -4434,7 +4565,7 @@ class Protare : public GUPI::Ancestry {
virtual Documentation_1_10::Suite &documentations( ) = 0;
virtual Styles::Base &style( std::string const a_label ) = 0;
virtual Styles::Base &style( std::string const &a_label ) = 0;
virtual Styles::Suite &styles( ) = 0;
virtual Styles::Suite const &styles( ) const = 0;
@@ -4453,7 +4584,7 @@ class Protare : public GUPI::Ancestry {
virtual std::size_t numberOfOrphanProducts( ) const = 0;
virtual Reaction *orphanProduct( std::size_t a_index ) = 0;
virtual Reaction const *orphanProduct( std::size_t a_index ) const = 0;
virtual void updateReactionIndices( int a_offset ) const = 0;
virtual void updateReactionIndices( std::size_t a_offset ) const = 0;
virtual bool hasFission( ) const = 0;
virtual bool isDelayedFissionNeutronComplete( ) const = 0;
@@ -4467,7 +4598,8 @@ class Protare : public GUPI::Ancestry {
Styles::TemperatureInfo const &a_temperatureInfo ) const = 0;
virtual Vector multiGroupCrossSection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const = 0;
Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {},
std::string const &a_label = "" ) const = 0;
virtual Vector multiGroupQ( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, bool a_final, bool a_effectivePhotoAtomic = true,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const = 0;
@@ -4483,12 +4615,12 @@ class Protare : public GUPI::Ancestry {
virtual 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, int a_order, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const = 0;
std::string const &a_productID, std::size_t a_order, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const = 0;
virtual Matrix multiGroupFissionMatrix( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, int a_order,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const = 0;
virtual Vector multiGroupTransportCorrection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, int a_order,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
TransportCorrectionType a_transportCorrectionType, double a_temperature,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const = 0;
@@ -4534,9 +4666,10 @@ class ProtareSingle : public Protare {
private:
HAPI::File *m_doc; /**< If data read from file, this member is a pointer to the opened **HAPI::File** instance. */
HAPI::DataManager *m_dataManager; /**< If data read from hybrid file, this member is a pointer to the **HAPI::DataManager** instance. */
int m_numberOfLazyParsingHelperForms; /**< This counts the number of LazyParsingHelperForms instantiated. */
int m_numberOfLazyParsingHelperForms; /**< This counts the number of LazyParsingHelperForms instantiated. */
int m_numberOfLazyParsingHelperFormsReplaced; /**< This counts the number of LazyParsingHelperForms replaced with the appropriate form. */
LUPI::FormatVersion m_formatVersion; /**< Store the GNDS format version. */
TargetInfo::TargetInfo m_targetInfo; /**< Information about the target. Currently, the isotopic data for TNSL GNDS 2.1 files as stored in the evaluaed style. */
PoPI::Database m_internalPoPs; /**< The *PoPs* specified under the protare (e.g., reactionSuite) node. */
std::vector<std::string> m_libraries; /**< The list of libraries *this* was found in. */
@@ -4606,6 +4739,7 @@ class ProtareSingle : public Protare {
void incrementNumberOfLazyParsingHelperFormsReplaced( ) { ++m_numberOfLazyParsingHelperFormsReplaced; }
/**> Increments the *m_numberOfLazyParsingHelperFormsReplaced* member of this by 1. */
TargetInfo::TargetInfo const &targetInfo( ) const { return( m_targetInfo ); } /**< Returns a const reference to the *m_targetInfo* member. */
double projectileEnergyMin( ) const { return( m_projectileEnergyMin ); }
double projectileEnergyMax( ) const { return( m_projectileEnergyMax ); }
bool isTNSL_ProtareSingle( ) const { return( m_isTNSL_ProtareSingle ); } /**< Returns *true* if the instance is a ProtareSingle instance with only TNSL data and *false* otherwise. */
@@ -4663,8 +4797,8 @@ class ProtareSingle : public Protare {
ExternalFile const &externalFile( std::string const a_label ) const { return( *m_externalFiles.get<ExternalFile>( a_label ) ); } /**< Returns the external file with label *a_label*. */
ExternalFiles::Suite const &externalFiles( ) const { return( m_externalFiles ); } /**< Returns the value of the *m_externalFiles* member. */
Styles::Base &style( std::string const a_label ) { return( *m_styles.get<Styles::Base>( a_label ) ); } /**< Returns the style with label *a_label*. */
Styles::Base const &style( std::string const a_label ) const { return( *m_styles.get<Styles::Base const>( a_label ) ); } /**< Returns the const style with label *a_label*. */
Styles::Base &style( std::string const &a_label ) { return( *m_styles.get<Styles::Base>( a_label ) ); } /**< Returns the style with label *a_label*. */
Styles::Base const &style( std::string const &a_label ) const { return( *m_styles.get<Styles::Base const>( a_label ) ); } /**< Returns the const style with label *a_label*. */
Styles::Suite &styles( ) { return( m_styles ); } /**< Returns the value of the *m_styles* member. */
Styles::Suite const &styles( ) const { return( m_styles ); } /**< Returns a *const* reference to the *m_styles* member. */
@@ -4692,7 +4826,7 @@ class ProtareSingle : public Protare {
std::size_t numberOfIncompleteReactions( ) const { return( m_incompleteReactions.size( ) ); } /**< Returns the number of incomplete reactions in the **Protare**. */
Reaction *incompleteReaction( std::size_t a_index ) { return( m_incompleteReactions.get<Reaction>( a_index ) ); } /**< Returns the *a_index* - 1 reaction. */
Reaction const *incompleteReaction( std::size_t a_index ) const { return( m_incompleteReactions.get<Reaction>( a_index ) ); } /**< Returns the *a_index* - 1 reaction. */
void updateReactionIndices( int a_offset ) const;
void updateReactionIndices( std::size_t a_offset ) const;
bool hasFission( ) const ;
bool isDelayedFissionNeutronComplete( ) const ;
@@ -4706,7 +4840,8 @@ class ProtareSingle : public Protare {
Styles::TemperatureInfo const &a_temperatureInfo ) const ;
Vector multiGroupCrossSection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {},
std::string const &a_label = "" ) const ;
Vector multiGroupQ( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, bool a_final, bool a_effectivePhotoAtomic = true,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
@@ -4721,12 +4856,12 @@ class ProtareSingle : public Protare {
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, int a_order, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
std::string const &a_productID, std::size_t a_order, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
Matrix multiGroupFissionMatrix( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, int a_order,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
Vector multiGroupTransportCorrection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, int a_order,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
TransportCorrectionType a_transportCorrectionType, double a_temperature,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
@@ -4758,6 +4893,8 @@ class ProtareSingle : public Protare {
void saveAs( std::string const &a_fileName ) const ;
void toXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent = "" ) const ;
void parseEvaluatedTargetInfo( HAPI::Node const &a_node );
};
/*
@@ -4797,7 +4934,7 @@ class ProtareComposite : public Protare {
Documentation_1_10::Suite &documentations( );
Styles::Base &style( std::string const a_label );
Styles::Base &style( std::string const &a_label );
Styles::Suite &styles( );
Styles::Suite const &styles( ) const ;
@@ -4816,7 +4953,7 @@ class ProtareComposite : public Protare {
std::size_t numberOfOrphanProducts( ) const ;
Reaction *orphanProduct( std::size_t a_index );
Reaction const *orphanProduct( std::size_t a_index ) const ;
void updateReactionIndices( int a_offset ) const;
void updateReactionIndices( std::size_t a_offset ) const;
bool hasFission( ) const ;
bool isDelayedFissionNeutronComplete( ) const ;
@@ -4831,7 +4968,8 @@ class ProtareComposite : public Protare {
Vector multiGroupCrossSection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {},
std::string const &a_label = "" ) const ;
Vector multiGroupQ( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, bool a_final, bool a_effectivePhotoAtomic = true,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
@@ -4846,12 +4984,12 @@ class ProtareComposite : public Protare {
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, int a_order, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
std::string const &a_productID, std::size_t a_order, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
Matrix multiGroupFissionMatrix( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, int a_order,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
Vector multiGroupTransportCorrection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, int a_order,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
TransportCorrectionType a_transportCorrectionType, double a_temperature,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
@@ -4928,7 +5066,7 @@ class ProtareTNSL : public Protare {
Documentation_1_10::Suite &documentations( );
Styles::Base &style( std::string const a_label );
Styles::Base &style( std::string const &a_label );
Styles::Suite &styles( );
Styles::Suite const &styles( ) const ;
@@ -4947,7 +5085,7 @@ class ProtareTNSL : public Protare {
std::size_t numberOfOrphanProducts( ) const ;
Reaction *orphanProduct( std::size_t a_index );
Reaction const *orphanProduct( std::size_t a_index ) const ;
void updateReactionIndices( int a_offset ) const;
void updateReactionIndices( std::size_t a_offset ) const;
bool hasFission( ) const ;
bool isDelayedFissionNeutronComplete( ) const ;
@@ -4961,7 +5099,8 @@ class ProtareTNSL : public Protare {
Styles::TemperatureInfo const &a_temperatureInfo ) const ;
Vector multiGroupCrossSection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
Styles::TemperatureInfo const &a_temperatureInfo, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {},
std::string const &a_label = "" ) const ;
Vector multiGroupQ( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, bool a_final, bool a_effectivePhotoAtomic = true,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
@@ -4976,12 +5115,12 @@ class ProtareTNSL : public Protare {
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, int a_order, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
std::string const &a_productID, std::size_t a_order, ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
Matrix multiGroupFissionMatrix( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, int a_order,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
Vector multiGroupTransportCorrection( LUPI::StatusMessageReporting &a_smr, Transporting::MG const &a_settings,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, int a_order,
Styles::TemperatureInfo const &a_temperatureInfo, Transporting::Particles const &a_particles, std::size_t a_order,
TransportCorrectionType a_transportCorrectionType, double a_temperature,
ExcludeReactionsSet const &a_reactionsToExclude = ExcludeReactionsSet {} ) const ;
@@ -5453,19 +5592,19 @@ GNDS_FileType GNDS_fileType( std::string const &a_fileName, GNDS_FileTypeInfo &a
* The following are in the file GIDI_misc.cpp.
*/
long binarySearchVector( double a_x, std::vector<double> const &a_Xs );
void intsToXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, std::vector<int> a_values, std::string const &a_attributes );
void intsToXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, std::vector<int> const &a_values, std::string const &a_attributes );
void parseValuesOfDoubles( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, nf_Buffer<double> &a_vector );
void parseValuesOfDoubles( HAPI::Node const &a_node, SetupInfo &a_setupInfo, nf_Buffer<double> &a_vector, int a_useSystem_strtod );
void parseValuesOfInts( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, std::vector<int> &a_vector );
void parseValuesOfInts( HAPI::Node const &a_node, SetupInfo &a_setupInfo, nf_Buffer<int> &a_vector );
void doublesToXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, std::vector<double> a_values, std::size_t a_start = 0, bool a_newLine = true,
void doublesToXMLList( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, std::vector<double> const &a_values, std::size_t a_start = 0, bool a_newLine = true,
std::string const &a_valueType = "" );
Frame parseFrame( HAPI::Node const &a_node, SetupInfo &a_setupInfo, std::string const &a_name );
std::string frameToString( Frame a_frame );
std::string intToString( int a_value );
std::string size_t_ToString( std::size_t a_value );
std::string nodeWithValuesToDoubles( GUPI::WriteInfo &a_writeInfo, std::string const &a_nodeName, std::vector<double> const &a_values );
void excludeReactionsSetAdjust( ExcludeReactionsSet a_excludeReactionsSet, Protare const &a_protare );
void excludeReactionsSetAdjust( ExcludeReactionsSet &a_excludeReactionsSet, Protare const &a_protare );
Functions::Ys1d gridded1d2GIDI_Ys1d( Functions::Function1dForm const &a_function1d );
Functions::Ys1d vector2GIDI_Ys1d( Axes const &a_axes, Vector const &a_vector );
@@ -249,7 +249,7 @@ class Suite : public Ancestry {
private:
std::string m_keyName; /**< The name of the key used to look up items in the suite. */
mutable Entries m_entries; /**< The list of nodes stored within *this*. */
std::map<std::string,int> m_map; /**< A map of *this* node labels to their index in *m_entries*. */
std::map<std::string,std::size_t> m_map; /**< A map of *this* node labels to their index in *m_entries*. */
Suite( Suite const *a_suite ); // FIXME, should we make public or private copy constructor? Making private for now.
@@ -262,7 +262,7 @@ class Suite : public Ancestry {
std::string const &keyName( ) const { return( m_keyName ); } /**< Returns a const reference to the *m_keyName* member. */
std::size_t size( ) const { return( m_entries.size( ) ); } /**< Returns the number of node contained by *this*. */
int operator[]( std::string const &a_label ) const ;
std::size_t operator[]( std::string const &a_label ) const ;
typedef Entries::iterator iterator;
typedef Entries::const_iterator const_iterator;
iterator begin( ) { return m_entries.begin( ); } /**< The C++ begin iterator for *this*. */
@@ -336,7 +336,7 @@ template<typename T> T const *Suite::get( std::size_t a_index ) const {
template<typename T> T *Suite::get( std::string const &a_label ) {
int index = (*this)[a_label];
auto index = (*this)[a_label];
Entry *entry = m_entries[index];
T *object = dynamic_cast<T *>( entry );
@@ -355,7 +355,7 @@ template<typename T> T *Suite::get( std::string const &a_label ) {
template<typename T> T const *Suite::get( std::string const &a_label ) const {
int index = (*this)[a_label];
auto index = (*this)[a_label];
Entry *entry = m_entries[index];
T *object = dynamic_cast<T *>( entry );
@@ -54,7 +54,7 @@ class Attribute {
public:
inline Attribute() : m_node(nullptr), m_name() {}
inline Attribute(Node_internal *a_node, std::string const a_name) :
inline Attribute(Node_internal *a_node, std::string const &a_name) :
m_node(a_node),
m_name(a_name)
{
@@ -79,7 +79,7 @@ class Text {
public:
Text();
Text(std::string const a_text);
Text(std::string const &a_text);
~Text();
std::string const &get() const { return( m_text ); }
};
@@ -98,7 +98,7 @@ class Data_internal {
//virtual template <typename T> T read() = 0;
virtual void getDoubles(nf_Buffer<double> &buffer) = 0;
virtual void getInts(nf_Buffer<int> &buffer) = 0;
virtual int length() const = 0;
virtual size_t length() const = 0;
};
/*
@@ -155,7 +155,7 @@ class Data {
~Data();
void getDoubles(nf_Buffer<double> &buffer);
void getInts(nf_Buffer<int> &buffer);
int length() const;
size_t length() const;
};
/*
@@ -283,7 +283,8 @@ class PugiXMLData : public Data_internal {
private:
pugi::xml_node m_node;
int m_length;
size_t m_length;
bool m_dataRead;
public:
PugiXMLData();
@@ -291,7 +292,7 @@ class PugiXMLData : public Data_internal {
virtual ~PugiXMLData();
void getDoubles(nf_Buffer<double> &buffer);
void getInts(nf_Buffer<int> &buffer);
int length() const;
size_t length() const;
};
class PugiXMLFile : public File {
@@ -363,7 +364,7 @@ class HDFData : public Data_internal {
private:
hid_t m_node_id;
hid_t m_dataspace_id;
int m_length;
size_t m_length;
public:
HDFData();
@@ -371,7 +372,7 @@ class HDFData : public Data_internal {
virtual ~HDFData();
void getDoubles(nf_Buffer<double> &buffer);
void getInts(nf_Buffer<int> &buffer);
int length() const;
size_t length() const;
};
class HDFFile : public File {
@@ -48,6 +48,7 @@ namespace LUPI {
#define GNDS_formatVersion_1_10Chars "1.10"
#define GNDS_formatVersion_2_0Chars "2.0"
#define GNDS_formatVersion_2_0_LLNL_4Chars "2.0.LLNL_4"
#define GNDS_formatVersion_2_1Chars "2.1"
void deprecatedFunction( std::string const &a_functionName, std::string const &a_replacementName, std::string const &a_asOf );
@@ -115,7 +116,7 @@ class StatusMessageReporting {
bool isError( ) { return( smr_isError( &m_smr ) ); }
void clear( ) { smr_release( &m_smr ); }
std::string constructMessage( std::string a_prefix, int a_reports = 1, bool a_clear = false );
std::string constructFullMessage( std::string a_prefix, int a_reports = 1, bool a_clear = false );
std::string constructFullMessage( std::string const &a_prefix, int a_reports = 1, bool a_clear = false );
};
/*
@@ -190,7 +191,7 @@ class ArgumentBase {
std::string m_descriptor; /**< The desciption printed help. */
int m_minimumNeeded; /**< Minimum number of times *this* argument is required on the command line. */
int m_maximumNeeded; /**< Maximum number of times *this* argument is required on the command line. */
int m_counts; /**< The number of time this argument was entered on the command line. */
std::size_t m_counts; /**< The number of time this argument was entered on the command line. */
std::vector<std::string> m_values; /**< list of values entered for this argument. Only used for types Store, Append and Positional. */
void addAlias( std::string const &a_name ); /**< Adds the alias *a_name* to *this*. */
@@ -210,7 +211,7 @@ class ArgumentBase {
std::string const &descriptor( ) const { return( m_descriptor ); }
int minimumNeeded( ) const { return( m_minimumNeeded ); }
int maximumNeeded( ) const { return( m_maximumNeeded ); }
int counts( ) const { return( m_counts ); }
std::size_t counts( ) const { return( m_counts ); }
virtual std::string const &value( std::size_t a_index = 0 ) const ;
std::vector<std::string> const &values( ) const { return( m_values ); }
@@ -430,8 +431,11 @@ namespace Misc {
std::string stripString( std::string const &a_string, bool a_left = true, bool a_right = true );
std::vector<std::string> splitString( std::string const &a_string, char a_delimiter, bool a_strip = false );
std::vector<std::string> splitString( std::string const &a_string, std::string const &a_delimiter, bool a_strip = false );
std::string joinStrings( std::string const &a_sep, std::vector<std::string> a_strings );
std::string replaceString( std::string const &a_string, std::string const &a_old, std::string const &a_new, bool a_all );
std::vector<std::string> splitXLinkString( std::string const &a_string );
bool stringToInt( std::string const &a_string, int &a_value );
bool stringToSize_t( std::string const &a_string, std::size_t &a_value );
std::string argumentsToString( char const *a_format, ... );
std::string doubleToString3( char const *a_format, double a_value, bool a_reduceBits = false );
@@ -30,12 +30,14 @@ class DataBuffer {
std::size_t m_doubleIndex;
std::size_t m_charIndex;
std::size_t m_longIndex;
std::size_t m_size_tIndex;
int *m_intData;
float *m_floatData;
double *m_doubleData;
char *m_charData;
std::uint64_t *m_longData;
std::size_t *m_size_tData;
// For unpacking into pre-allocated memory
char *m_placementStart;
@@ -56,11 +58,15 @@ class DataBuffer {
m_doubleIndex( 0 ),
m_charIndex( 0 ),
m_longIndex( 0 ),
m_size_tIndex( 0 ),
m_intData( nullptr ),
m_floatData( nullptr ),
m_doubleData( nullptr ),
m_charData( nullptr ),
m_longData( nullptr ),
m_size_tData( nullptr ),
m_placementStart( nullptr ),
m_placement( nullptr ),
m_maxPlacementSize( 0 ),
@@ -75,11 +81,15 @@ class DataBuffer {
m_doubleIndex( 0 ),
m_charIndex( 0 ),
m_longIndex( 0 ),
m_size_tIndex( 0 ),
m_intData( nullptr ),
m_floatData( nullptr ),
m_doubleData( nullptr ),
m_charData( nullptr ),
m_longData( nullptr ),
m_size_tData( nullptr ),
m_placementStart( nullptr ),
m_placement( nullptr ),
m_maxPlacementSize( 0 ),
@@ -98,11 +108,12 @@ class DataBuffer {
delete [] m_doubleData;
delete [] m_charData;
delete [] m_longData;
delete [] m_size_tData;
}
LUPI_HOST_DEVICE void zeroIndexes( void ) {
m_intIndex = m_floatIndex = m_doubleIndex = m_charIndex = m_longIndex = 0;
m_intIndex = m_floatIndex = m_doubleIndex = m_charIndex = m_longIndex = m_size_tIndex = 0;
}
LUPI_HOST_DEVICE void copyIndexes( DataBuffer const &a_input ) {
@@ -112,6 +123,7 @@ class DataBuffer {
m_doubleIndex = a_input.m_doubleIndex;
m_charIndex = a_input.m_charIndex;
m_longIndex = a_input.m_longIndex;
m_size_tIndex = a_input.m_size_tIndex;
}
LUPI_HOST_DEVICE void simpleCopy( DataBuffer const &a_input ) {
@@ -121,12 +133,14 @@ class DataBuffer {
m_doubleIndex = a_input.m_doubleIndex;
m_charIndex = a_input.m_charIndex;
m_longIndex = a_input.m_longIndex;
m_size_tIndex = a_input.m_size_tIndex;
m_intData = a_input.m_intData;
m_floatData = a_input.m_floatData;
m_doubleData = a_input.m_doubleData;
m_charData = a_input.m_charData;
m_longData = a_input.m_longData;
m_size_tData = a_input.m_size_tData;
m_placementStart = a_input.m_placementStart;
m_placement = a_input.m_placement;
@@ -144,6 +158,7 @@ class DataBuffer {
m_doubleData = nullptr;
m_charData = nullptr;
m_longData = nullptr;
m_size_tData = nullptr;
}
LUPI_HOST_DEVICE void allocateBuffers( void ) {
@@ -153,6 +168,7 @@ class DataBuffer {
m_doubleData = new double[m_doubleIndex];
m_charData = new char[m_charIndex];
m_longData = new std::uint64_t[m_longIndex];
m_size_tData = new std::size_t[m_size_tIndex];
}
LUPI_HOST_DEVICE void freeMemory( void ) {
@@ -162,6 +178,8 @@ class DataBuffer {
delete [] m_doubleData;
delete [] m_charData;
delete [] m_longData;
delete [] m_size_tData;
zeroIndexes( );
nullOutPointers( );
}
@@ -170,7 +188,8 @@ class DataBuffer {
return( ( a_input.m_intIndex == m_intIndex ) && ( a_input.m_floatIndex == m_floatIndex ) &&
( a_input.m_doubleIndex == m_doubleIndex ) &&
( a_input.m_charIndex == m_charIndex ) && ( a_input.m_longIndex == m_longIndex ) );
( a_input.m_charIndex == m_charIndex ) && ( a_input.m_longIndex == m_longIndex ) &&
( a_input.m_size_tIndex == m_size_tIndex ) );
}
LUPI_HOST_DEVICE void incrementPlacement(std::size_t a_delta) {
@@ -225,6 +244,8 @@ class DataBuffer {
gpuErrorCheck( LUPI_GPU_MEMCPY( buf_tmp.m_charData, m_charData, sizeof(char) * m_charIndex, LUPI_GPU_HTOD ) );
gpuErrorCheck( LUPI_GPU_MALLOC( (void **) &buf_tmp.m_longData, sizeof(std::uint64_t) * m_longIndex ) );
gpuErrorCheck( LUPI_GPU_MEMCPY( buf_tmp.m_longData, m_longData, sizeof(std::uint64_t) * m_longIndex, LUPI_GPU_HTOD ) );
gpuErrorCheck( LUPI_GPU_MALLOC( (void **) &buf_tmp.m_size_tData, sizeof(std::size_t) * m_size_tIndex ) );
gpuErrorCheck( LUPI_GPU_MEMCPY( buf_tmp.m_size_tData, m_size_tData, sizeof(std::size_t) * m_size_tIndex, LUPI_GPU_HTOD ) );
gpuErrorCheck( LUPI_GPU_MALLOC( (void **) &buf_tmp.m_placementStart, buf_tmp.m_maxPlacementSize ) );
// Set to 0 for easier byte comparisons. This may be removed after testing is done
@@ -269,14 +290,15 @@ class DataBuffer {
#define DATA_MEMBER_INT( member, buf, mode) DATA_MEMBER_SIMPLE(member, (buf).m_intData, (buf).m_intIndex, mode)
#define DATA_MEMBER_FLOAT(member, buf, mode) DATA_MEMBER_SIMPLE(member, (buf).m_floatData, (buf).m_floatIndex, mode)
#define DATA_MEMBER_DOUBLE(member, buf, mode) DATA_MEMBER_SIMPLE(member, (buf).m_doubleData, (buf).m_doubleIndex, mode)
#define DATA_MEMBER_SIZE_T(member, buf, mode) DATA_MEMBER_SIMPLE(member, (buf).m_size_tData, (buf).m_size_tIndex, mode)
#define DATA_MEMBER_STRING(member, buf, mode) \
{if ( mode == LUPI::DataBuffer::Mode::Count ) {((buf).m_charIndex) += member.size(); ((buf).m_intIndex)++; } \
{if ( mode == LUPI::DataBuffer::Mode::Count ) {((buf).m_charIndex) += member.size(); ((buf).m_size_tIndex)++; } \
else if ( mode == LUPI::DataBuffer::Mode::Pack ) {std::size_t array_size = member.size(); \
(buf).m_intData[((buf).m_intIndex)++] = array_size; \
(buf).m_size_tData[((buf).m_size_tIndex)++] = array_size; \
for (std::size_t size_index = 0; size_index < array_size; size_index++)\
{(buf).m_charData[ ((buf).m_charIndex)++ ] = (member[size_index]); }} \
else if ( mode == LUPI::DataBuffer::Mode::Unpack ) {std::size_t array_size = (buf).m_intData[((buf).m_intIndex)++]; \
else if ( mode == LUPI::DataBuffer::Mode::Unpack ) {std::size_t array_size = (buf).m_size_tData[((buf).m_size_tIndex)++]; \
member.resize(array_size, &(buf).m_placement); \
for (std::size_t size_index = 0; size_index < array_size; size_index++) \
{member[size_index] = (buf).m_charData[ ((buf).m_charIndex)++ ]; }} \
@@ -287,12 +309,12 @@ class DataBuffer {
#define DATA_MEMBER_STD_STRING(member, buf, mode) { \
if ( mode == LUPI::DataBuffer::Mode::Count ) \
{((buf).m_charIndex) += member.size(); ((buf).m_intIndex)++; } \
{((buf).m_charIndex) += member.size(); ((buf).m_size_tIndex)++; } \
else if ( mode == LUPI::DataBuffer::Mode::Pack ) {std::size_t array_size = member.size(); \
(buf).m_intData[((buf).m_intIndex)++] = array_size; \
(buf).m_size_tData[((buf).m_size_tIndex)++] = array_size; \
for (std::size_t size_index = 0; size_index < array_size; size_index++)\
{(buf).m_charData[((buf).m_charIndex)++] = (member[size_index]); }} \
else if ( mode == LUPI::DataBuffer::Mode::Unpack ) {std::size_t array_size = (buf).m_intData[((buf).m_intIndex)++]; \
else if ( mode == LUPI::DataBuffer::Mode::Unpack ) {std::size_t array_size = (std::size_t) (buf).m_size_tData[((buf).m_size_tIndex)++]; \
member.resize(array_size); \
for (std::size_t size_index = 0; size_index < array_size; size_index++) \
{member[size_index] = (buf).m_charData[ ((buf).m_charIndex)++ ]; }} }
@@ -301,7 +323,7 @@ class DataBuffer {
#define DATA_MEMBER_VECTOR_FLOAT(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_INT(vector_size, (buf), mode); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) member.resize(vector_size, &(buf).m_placement); \
std::size_t bufferIndex = (buf).m_floatIndex; \
for ( std::size_t member_index = 0; member_index < vector_size; member_index += LUPI_WARP_SIZE, bufferIndex += LUPI_WARP_SIZE ) \
@@ -315,7 +337,7 @@ class DataBuffer {
#define DATA_MEMBER_VECTOR_DOUBLE(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_INT(vector_size, (buf), mode); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) member.resize(vector_size, &(buf).m_placement); \
std::size_t bufferIndex = (buf).m_doubleIndex; \
for ( std::size_t member_index = 0; member_index < vector_size; member_index += LUPI_WARP_SIZE, bufferIndex += LUPI_WARP_SIZE ) \
@@ -330,7 +352,7 @@ class DataBuffer {
#define DATA_MEMBER_VECTOR_FLOAT(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_INT(vector_size, (buf), mode); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) { \
if ((buf).m_sharedPlacement == nullptr) { \
member.resize(vector_size, &(buf).m_placement); \
@@ -349,7 +371,7 @@ class DataBuffer {
#define DATA_MEMBER_VECTOR_DOUBLE(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_INT(vector_size, (buf), mode); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) { \
if ((buf).m_sharedPlacement == nullptr) { \
member.resize(vector_size, &(buf).m_placement); \
@@ -371,7 +393,7 @@ class DataBuffer {
#define DATA_MEMBER_VECTOR_INT(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_INT(vector_size, (buf), mode); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) member.resize(vector_size, &(buf).m_placement); \
std::size_t bufferIndex = (buf).m_intIndex; \
for ( std::size_t member_index = 0; member_index < vector_size; member_index += LUPI_WARP_SIZE, bufferIndex += LUPI_WARP_SIZE ) \
@@ -386,7 +408,7 @@ class DataBuffer {
#define DATA_MEMBER_VECTOR_INT(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_INT(vector_size, (buf), mode); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) { \
if ((buf).m_sharedPlacement == nullptr) { \
member.resize(vector_size, &(buf).m_placement); \
@@ -408,7 +430,7 @@ class DataBuffer {
#define DATA_MEMBER_VECTOR_BOOL(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_INT(vector_size, (buf), mode); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) member.resize(vector_size, &(buf).m_placement); \
std::size_t bufferIndex = (buf).m_intIndex; \
for ( std::size_t member_index = 0; member_index < vector_size; member_index += LUPI_WARP_SIZE, bufferIndex += LUPI_WARP_SIZE ) \
@@ -423,7 +445,7 @@ class DataBuffer {
#define DATA_MEMBER_VECTOR_BOOL(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_INT(vector_size, (buf), mode); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) { \
if ((buf).m_sharedPlacement == nullptr) { \
member.resize(vector_size, &(buf).m_placement); \
@@ -459,4 +481,41 @@ class DataBuffer {
}
#endif
#if LUPI_WARP_SIZE > 1 && defined(LUPI_ON_GPU)
#define DATA_MEMBER_VECTOR_SIZE_T(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) member.resize(vector_size, &(buf).m_placement); \
std::size_t bufferIndex = (buf).m_size_tIndex; \
for ( std::size_t member_index = 0; member_index < vector_size; member_index += LUPI_WARP_SIZE, bufferIndex += LUPI_WARP_SIZE ) \
{ \
std::size_t thrMemberId = member_index + LUPI_THREADID; \
if (thrMemberId >= vector_size) continue; \
member[thrMemberId] = (buf).m_size_tData[bufferIndex + LUPI_THREADID]; \
} \
(buf).m_size_tIndex += vector_size; \
}
#else
#define DATA_MEMBER_VECTOR_SIZE_T(member, buf, mode) \
{ \
std::size_t vector_size = member.size(); \
DATA_MEMBER_SIZE_T(vector_size, (buf), mode); \
if ( mode == LUPI::DataBuffer::Mode::Unpack ) { \
if ((buf).m_sharedPlacement == nullptr) { \
member.resize(vector_size, &(buf).m_placement); \
} else { \
member.resize(vector_size, &(buf).m_sharedPlacement); \
} \
}\
if ( mode == LUPI::DataBuffer::Mode::Memory ) { \
(buf).incrementSharedPlacement(sizeof(std::size_t) * member.capacity()); \
} \
for ( std::size_t member_index = 0; member_index < vector_size; member_index++ ) \
{ \
DATA_MEMBER_SIZE_T(member[member_index], (buf), mode); \
} \
}
#endif
#endif // End of LUPI_data_buffer_hpp_included
@@ -49,17 +49,19 @@ class ProtareTNSL;
class Reaction;
class OutputChannel;
class ACE_URR_probabilityTables;
class GRIN_capture;
class GRIN_inelastic;
} // End of namespace MCGIDI.
#include <LUPI_dataBuffer.hpp>
#include "MCGIDI_sampling.hpp"
#include "MCGIDI_vector.hpp"
#include "MCGIDI_string.hpp"
#include <MCGIDI_sampling.hpp>
#include <MCGIDI_vector.hpp>
#include <MCGIDI_string.hpp>
namespace MCGIDI {
#define MCGIDI_nullReaction -10001
#define MCGIDI_nullReaction 999999999
// FIXME, this should not be used once physicalQuantity can handle changing units.
#define MCGIDI_speedOfLight_cm_sh 299.792458
@@ -111,8 +113,8 @@ class MC : public GIDI::Transporting::Settings {
LookupMode::Data1d m_crossSectionLookupMode; /**< Determines how cross sections are evaluated. */
LookupMode::Data1d m_other1dDataLookupMode; /**< Determines how 1d data other than cross sections are evaluated. */
LookupMode::Distribution m_distributionLookupMode; /**< Determines how distributions are evaluated and sampled. Currently, only pdf_cdf is allowed. */
Sampling::Upscatter::Model m_upscatterModel; /**< FIXME. */
std::string m_upscatterModelALabel; /**< FIXME. */
Sampling::Upscatter::Model m_upscatterModel; /**< This enum specified the upscatter model to use when sampling products. */
std::vector<double> m_upscatterModelAGroupBoundaries; /**< If specified (i.e., non-zero length) then these values are used as the group boundaries for the upscatter model A multi-group cross section. */
URR_mode m_URR_mode; /**< Selects if URR data are to be used, and it so, which type. */
bool m_wantTerrellPromptNeutronDistribution; /**< If true, prompt fission neutron distributions are sampled from the Terrell mode. */
bool m_wantRawTNSL_distributionSampling; /**< If true, the TNSL neutron distributions for coherent and incoherent elastic scattering are sampled from the double differential data. Otherwise, they are sampled from the distribution data. */
@@ -172,13 +174,13 @@ class MC : public GIDI::Transporting::Settings {
setDistributionLookupMode( a_distributionLookupMode ); } /**< See method **setDistributionLookupMode**. This method is deprecated. */
LUPI_HOST Sampling::Upscatter::Model upscatterModel( ) const { return( m_upscatterModel ); } /**< Returns the value of the **m_upscatterModel**. */
LUPI_HOST void set_upscatterModelA( std::string const &a_upscatterModelALabel );
LUPI_HOST void setUpscatterModelA( std::string const &a_upscatterModelALabel ) { set_upscatterModelA( a_upscatterModelALabel ); }
/**< See method **set_upscatterModelA**. */
LUPI_HOST std::string upscatterModelALabel( ) const { return( m_upscatterModelALabel ); } /**< Returns the value of the **m_upscatterModelALabel**. */
LUPI_HOST void setUpscatterModelA( ) { m_upscatterModel = Sampling::Upscatter::Model::A; } /**< See member *m_upscatterModel* to Sampling::Upscatter::Model::A. */
LUPI_HOST void setUpscatterModelB( ) { m_upscatterModel = Sampling::Upscatter::Model::B; } /**< Set member *m_upscatterModel* to Sampling::Upscatter::Model::B. */
LUPI_HOST void setUpscatterModelBSnLimits( ) { m_upscatterModel = Sampling::Upscatter::Model::BSnLimits; } /**< Set member *m_upscatterModel* to Sampling::Upscatter::Model::BSnLimits. */
LUPI_HOST void setUpscatterModelDBRC( ) { m_upscatterModel = Sampling::Upscatter::Model::DBRC; } /**< Set member *m_upscatterModel* to Sampling::Upscatter::Model::DBRC. */
LUPI_HOST std::vector<double> const &upscatterModelAGroupBoundaries( ) { return( m_upscatterModelAGroupBoundaries ); }
/**< Returns a const reference to the *m_upscatterModelAGroupBoundaries* member. */
LUPI_HOST void setUpscatterModelAGroupBoundaries( std::vector<double> const &a_groupBoundaries );
LUPI_HOST bool want_URR_probabilityTables( ) const {
LUPI::deprecatedFunction( "MCGIDI::Transporting::MC::want_URR_probabilityTables", "MCGIDI::Transporting::MC::_URR_mode", "" );
@@ -296,13 +298,14 @@ LUPI_HOST int MCGIDI_popsIndex( PoPI::Database const &a_pops, std::string const
* The values of *a_Xs* must be ascending (i.e., *a_Xs*[i] < *a_Xs*[i+1]).
*
*
* Returns -2 if a_x < a_Xs[0] or 0 if a_boundIndex is true,
* -1 if a_x > last point of a_Xs or a_Xs.size( ) - 1 if a_boundIndex is true, or
* Returns -2 if a_x < a_Xs[0] or return 0 if a_boundIndex is true,
* -1 if a_x > last point of a_Xs or returns a_Xs.size( ) - 1 if a_boundIndex is true, or
* the lower index of a_Xs which bound a_x otherwise.
-3 if a_Xs has not data (i.e, its size is 0).
*
* Note, when *a_boundIndex* is false the returned *index* can be negative and when it is true
* the return value will be a valid index of *a_Xs*, including its last point. The index of the last
* point is only returned when *a_boundIndex* is true and *a_x* is great than the last point of *a_Xs*.
* Note, when *a_boundIndex* is false the returned *index* can be negative and when it is true the return
* value will be a valid index of *a_Xs*, including its last point unless a_Xs has not data *. The index of
* the last point is only returned when *a_boundIndex* is true and *a_x* is great than the last point of *a_Xs*.
*
* @param a_x [in] The values whose bounding index within *a_Xs* is to be determined.
* @param a_Xs [in] The list of ascending values.
@@ -314,15 +317,15 @@ LUPI_HOST int MCGIDI_popsIndex( PoPI::Database const &a_pops, std::string const
LUPI_HOST_DEVICE inline int binarySearchVector( double a_x, Vector<double> const &a_Xs, bool a_boundIndex = false ) {
int lower = 0, middle, upper = (int) a_Xs.size( ) - 1;
std::size_t lower = 0, middle, upper = a_Xs.size( ) - 1;
if( a_x < a_Xs[0] ) {
if( a_Xs.size( ) == 0 ) {
return( -3 ); }
else if( a_x < a_Xs[0] ) {
if( a_boundIndex ) return( 0 );
return( -2 );
}
if( a_x > a_Xs[upper] ) {
if( a_boundIndex ) return( upper );
return( -2 ); }
else if( a_x > a_Xs.back( ) ) {
if( a_boundIndex ) return( static_cast<int>( upper ) );
return( -1 );
}
@@ -335,24 +338,24 @@ LUPI_HOST_DEVICE inline int binarySearchVector( double a_x, Vector<double> const
lower = middle;
}
}
return( lower );
return( static_cast<int>( lower ) );
}
/* *********************************************************************************************************//**
***********************************************************************************************************/
LUPI_HOST_DEVICE inline int binarySearchVectorBounded( double a_x, Vector<double> const &a_Xs, int a_lower,
int a_upper, bool a_boundIndex ) {
LUPI_HOST_DEVICE inline int binarySearchVectorBounded( double a_x, Vector<double> const &a_Xs, std::size_t a_lower,
std::size_t a_upper, bool a_boundIndex ) {
int middle;
std::size_t middle;
if( a_x < a_Xs[a_lower] ) {
if( a_boundIndex ) return( 0 );
return( -2 );
}
if( a_x > a_Xs[a_upper] ) {
if( a_boundIndex ) return( a_upper );
if( a_Xs.size( ) == 0 ) {
return( -3 ); }
else if( a_x < a_Xs[a_lower] ) {
if( a_boundIndex ) return( static_cast<int>( a_lower ) );
return( -2 ); }
else if( a_x > a_Xs[a_upper] ) {
if( a_boundIndex ) return( static_cast<int>( a_upper ) );
return( -1 );
}
@@ -365,7 +368,7 @@ LUPI_HOST_DEVICE inline int binarySearchVectorBounded( double a_x, Vector<double
a_lower = middle;
}
}
return( a_lower );
return( static_cast<int>( a_lower ) );
}
} // End of namespace MCGIDI.
@@ -390,17 +393,21 @@ class MultiGroupHash {
LUPI_HOST void initialize( GIDI::Protare const &a_protare, GIDI::Styles::TemperatureInfo const &a_temperatureInfo, std::string a_particleID );
public:
LUPI_HOST_DEVICE MultiGroupHash( );
LUPI_HOST MultiGroupHash( std::vector<double> a_boundaries );
LUPI_HOST_DEVICE MultiGroupHash( Vector<double> a_boundaries );
LUPI_HOST MultiGroupHash( GIDI::Protare const &a_protare, GIDI::Styles::TemperatureInfo const &a_temperatureInfo, std::string const &a_particleID = "" );
LUPI_HOST MultiGroupHash( GIDI::Protare const &a_protare, GIDI::Transporting::Particles const &a_particles );
LUPI_HOST MultiGroupHash( MultiGroupHash const &a_multiGroupHash );
LUPI_HOST MultiGroupHash &operator=( MultiGroupHash const &a_rhs ) = default;
LUPI_HOST_DEVICE Vector<double> const &boundaries( ) const { return( m_boundaries ); } /**< Returns a reference to **m_styles**. */
LUPI_HOST_DEVICE int index( double a_domain ) const {
LUPI_HOST_DEVICE std::size_t index( double a_domain ) const {
int _index = binarySearchVector( a_domain, m_boundaries );
if( _index == -2 ) return( 0 );
if( _index == -1 ) return( m_boundaries.size( ) - 2 );
return( _index );
return( static_cast<std::size_t>( _index ) );
}
LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
};
@@ -458,7 +465,7 @@ template <typename RNG>
inline LUPI_HOST_DEVICE void updateProtare( MCGIDI::Protare const *a_protare, double a_energy, RNG && a_rng );
LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
LUPI_HOST_DEVICE long internalSize( ) const { return m_URR_protareInfos.internalSize( ); }
LUPI_HOST_DEVICE std::size_t internalSize( ) const { return m_URR_protareInfos.internalSize( ); }
};
/*
@@ -522,7 +529,7 @@ class ACE_URR_probabilityTables {
class HeatedReactionCrossSectionContinuousEnergy {
private:
int m_offset; /**< The offset relative to the cross section grid of the first cross section value in *m_crossSections*. */
std::size_t m_offset; /**< The offset relative to the cross section grid of the first cross section value in *m_crossSections*. */
double m_threshold; /**< The threshold for the reaction. */
Vector<MCGIDI_FLOAT> m_crossSections; /**< The reaction's cross section. */
Transporting::URR_mode m_URR_mode; /**< The URR data (i.e., mode) *this* has. */
@@ -531,13 +538,13 @@ class HeatedReactionCrossSectionContinuousEnergy {
public:
LUPI_HOST_DEVICE HeatedReactionCrossSectionContinuousEnergy( );
LUPI_HOST HeatedReactionCrossSectionContinuousEnergy( int a_offset, double a_threshold, Vector<double> &a_crossSection );
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 { return( m_threshold ); } /**< Returns the value of the **m_threshold**. */
LUPI_HOST_DEVICE int offset( ) const { return( m_offset ); } /**< Returns the value of the **m_offset**. */
LUPI_HOST_DEVICE std::size_t offset( ) const { return( m_offset ); } /**< Returns the value of the **m_offset**. */
LUPI_HOST Vector<MCGIDI_FLOAT> const &crossSections( ) const { return( m_crossSections ); } /**< Returns a reference to the member **m_crossSections**. */
LUPI_HOST_DEVICE bool hasURR_probabilityTables( ) const {
return( ( m_URR_probabilityTables != nullptr ) || ( m_ACE_URR_probabilityTables != nullptr ) );
@@ -548,11 +555,11 @@ class HeatedReactionCrossSectionContinuousEnergy {
LUPI_HOST_DEVICE Probabilities::ProbabilityBase2d *URR_probabilityTables( ) const { return( m_URR_probabilityTables ); } /**< Returns the value of the *m_URR_probabilityTables*. */
LUPI_HOST_DEVICE ACE_URR_probabilityTables *_ACE_URR_probabilityTables( ) const { return( m_ACE_URR_probabilityTables ); } /**< Returns the value of the *m_ACE_URR_probabilityTables*. */
LUPI_HOST_DEVICE double crossSection( std::size_t a_index ) const {
int index = static_cast<int>( a_index ) - m_offset;
if( index < 0 ) return( 0.0 );
if( index >= static_cast<int>( m_crossSections.size( ) ) ) return( 0.0 );
if( a_index < m_offset ) return( 0.0 );
a_index -= m_offset;
if( a_index >= m_crossSections.size( ) ) return( 0.0 );
return( m_crossSections[index] );
return( m_crossSections[a_index] );
}
LUPI_HOST GIDI::Functions::XYs1d crossSectionAsGIDI_XYs1d( double a_temperature, Vector<double> const &a_energies ) const ;
@@ -591,8 +598,8 @@ class ContinuousEnergyGain {
if( a_particleIntid == m_particleIntid ) m_userParticleIndex = a_userParticleIndex; }
/**< Sets member *m_userParticleIntid* to *a_userParticleIndex* if particle's intid matchs *m_particleIntid*. */
LUPI_HOST_DEVICE Vector<MCGIDI_FLOAT> const &gain( ) const { return( m_gain ); }
LUPI_HOST void adjustGain( int a_energy_index, double a_gain ) { m_gain[a_energy_index] += a_gain; }
LUPI_HOST_DEVICE double gain( int a_energy_index, double a_energy_fraction ) const ;
LUPI_HOST void adjustGain( std::size_t a_energy_index, double a_gain ) { m_gain[a_energy_index] += a_gain; }
LUPI_HOST_DEVICE double gain( std::size_t a_energy_index, double a_energy_fraction ) 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,
@@ -608,7 +615,7 @@ class HeatedCrossSectionContinuousEnergy {
private:
double m_temperature; /**< The target temperature of the data. */
Vector<int> m_hashIndices; /**< The indicies for the energy hash function. */
Vector<std::size_t> m_hashIndices; /**< The indicies for the energy hash function. */
Vector<double> m_energies; /**< Energy grid for cross sections. */
Vector<MCGIDI_FLOAT> m_totalCrossSection; /**< The total cross section. */
Vector<MCGIDI_FLOAT> m_depositionEnergy; /**< The total continuous energy, deposition-energy cross section (related to the kinetic energy of the untracked outgoing particles). */
@@ -616,7 +623,7 @@ class HeatedCrossSectionContinuousEnergy {
Vector<MCGIDI_FLOAT> m_productionEnergy; /**< The total continuous energy, Q-value cross section. */
Vector<ContinuousEnergyGain *> m_gains; /**< The total continuous energy, gain cross section for each tracked particle. */
Transporting::URR_mode m_URR_mode; /**< The URR data (i.e., mode) *this* has. */
Vector<int> m_reactionsInURR_region; /**< A list of reactions within or below the upper URR regions. This is empty unless URR probability tables present and used. */
Vector<std::size_t> m_reactionsInURR_region; /**< A list of reactions within or below the upper URR regions. This is empty unless URR probability tables present and used. */
Vector<HeatedReactionCrossSectionContinuousEnergy *> m_reactionCrossSections;
/**< Reaction cross section data for each reaction. */
ACE_URR_probabilityTables *m_ACE_URR_probabilityTables; /**< The ACE URR probability tables for the summed URR cross section, if they were loaded. */
@@ -628,40 +635,41 @@ class HeatedCrossSectionContinuousEnergy {
std::vector<GIDI::Reaction const *> const &a_orphanProducts, bool a_fixedGrid, bool a_zeroReactions );
LUPI_HOST_DEVICE ~HeatedCrossSectionContinuousEnergy( );
LUPI_HOST_DEVICE int evaluationInfo( int a_hashIndex, double a_energy, double *a_energyFraction ) const ;
LUPI_HOST_DEVICE std::size_t evaluationInfo( std::size_t a_hashIndex, double a_energy, double *a_energyFraction ) const ;
LUPI_HOST HeatedReactionCrossSectionContinuousEnergy const *reactionCrossSection( int a_index ) const
LUPI_HOST HeatedReactionCrossSectionContinuousEnergy const *reactionCrossSection( std::size_t a_index ) const
{ return( m_reactionCrossSections[a_index] ); } /**< Returns the reaction cross section at index *a_index*. */
LUPI_HOST_DEVICE double temperature( ) const { return( m_temperature ); } /**< Returns the value of the **m_temperature** member. */
LUPI_HOST_DEVICE double minimumEnergy( ) const { return( m_energies[0] ); } /**< Returns the minimum cross section domain. */
LUPI_HOST_DEVICE double maximumEnergy( ) const { return( m_energies.back( ) ); } /**< Returns the maximum cross section domain. */
LUPI_HOST_DEVICE int numberOfReactions( ) const { return( (int) m_reactionCrossSections.size( ) ); }
LUPI_HOST_DEVICE std::size_t numberOfReactions( ) const { return( m_reactionCrossSections.size( ) ); }
/**< Returns the number of reaction cross section. */
LUPI_HOST_DEVICE int thresholdOffset( int a_reactionIndex ) const { return( m_reactionCrossSections[a_reactionIndex]->offset( ) ); }
LUPI_HOST_DEVICE std::size_t thresholdOffset( std::size_t a_reactionIndex ) const { return( m_reactionCrossSections[a_reactionIndex]->offset( ) ); }
/**< Returns the offset for the cross section for the reaction with index *a_reactionIndex*. */
LUPI_HOST_DEVICE double threshold( int a_reactionIndex ) const { return( m_reactionCrossSections[a_reactionIndex]->threshold( ) ); }
LUPI_HOST_DEVICE double threshold( std::size_t a_reactionIndex ) const { return( m_reactionCrossSections[a_reactionIndex]->threshold( ) ); }
/**< Returns the threshold for the reaction with index *a_reactionIndex*. */
LUPI_HOST_DEVICE bool hasURR_probabilityTables( ) const ;
LUPI_HOST_DEVICE double URR_domainMin( ) const ;
LUPI_HOST_DEVICE double URR_domainMax( ) const ;
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( int a_index ) const { return( m_reactionCrossSections[a_index]->hasURR_probabilityTables( ) ); }
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( std::size_t a_index ) const { return( m_reactionCrossSections[a_index]->hasURR_probabilityTables( ) ); }
LUPI_HOST_DEVICE Vector<MCGIDI_FLOAT> &totalCrossSection( ) { return( m_totalCrossSection ); } /**< Returns a reference to member *m_totalCrossSection*. */
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, int a_URR_index, int a_hashIndex, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, int a_URR_index, std::size_t a_hashIndex, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST GIDI::Functions::XYs1d crossSectionAsGIDI_XYs1d( ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, int a_hashIndex, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection2( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, double a_energy, int a_energyIndex, double a_energyFraction, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, double a_energy ) const ;
LUPI_HOST GIDI::Functions::XYs1d reactionCrossSectionAsGIDI_XYs1d( int a_reactionIndex ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, std::size_t a_hashIndex, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection2( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, double a_energy,
std::size_t a_energyIndex, double a_energyFraction, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, double a_energy ) const ;
LUPI_HOST GIDI::Functions::XYs1d reactionCrossSectionAsGIDI_XYs1d( std::size_t a_reactionIndex ) const ;
LUPI_HOST_DEVICE double depositionEnergy( int a_hashIndex, double a_energy ) const ;
LUPI_HOST_DEVICE double depositionMomentum( int a_hashIndex, double a_energy ) const ;
LUPI_HOST_DEVICE double productionEnergy( int a_hashIndex, double a_energy ) const ;
LUPI_HOST_DEVICE double gain( int a_hashIndex, double a_energy, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( int a_hashIndex, double a_energy, int a_particleIntid ) const ;
LUPI_HOST_DEVICE double depositionEnergy( std::size_t a_hashIndex, double a_energy ) const ;
LUPI_HOST_DEVICE double depositionMomentum( std::size_t a_hashIndex, double a_energy ) const ;
LUPI_HOST_DEVICE double productionEnergy( std::size_t a_hashIndex, double a_energy ) const ;
LUPI_HOST_DEVICE double gain( std::size_t a_hashIndex, double a_energy, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( std::size_t a_hashIndex, double a_energy, int a_particleIntid ) const ;
LUPI_HOST void setUserParticleIndex( int a_particleIndex, int a_userParticleIndex );
LUPI_HOST void setUserParticleIndexViaIntid( int a_particleIntid, int a_userParticleIndex );
@@ -689,6 +697,8 @@ class HeatedCrossSectionsContinuousEnergy {
LUPI_HOST_DEVICE HeatedCrossSectionsContinuousEnergy( );
LUPI_HOST_DEVICE ~HeatedCrossSectionsContinuousEnergy( );
LUPI_HOST_DEVICE void clear( );
LUPI_HOST void update( LUPI::StatusMessageReporting &a_smr, SetupInfo &a_setupInfo, Transporting::MC const &a_settings, GIDI::Transporting::Particles const &a_particles, DomainHash const &a_domainHash,
GIDI::Styles::TemperatureInfos const &a_temperatureInfos, std::vector<GIDI::Reaction const *> const &a_reactions,
std::vector<GIDI::Reaction const *> const &a_orphanProducts, bool a_fixedGrid, bool a_zeroReactions );
@@ -704,28 +714,28 @@ class HeatedCrossSectionsContinuousEnergy {
LUPI_HOST_DEVICE bool hasURR_probabilityTables( ) const { return( m_heatedCrossSections[0]->hasURR_probabilityTables( ) ); }
LUPI_HOST_DEVICE double URR_domainMin( ) const { return( m_heatedCrossSections[0]->URR_domainMin( ) ); }
LUPI_HOST_DEVICE double URR_domainMax( ) const { return( m_heatedCrossSections[0]->URR_domainMax( ) ); }
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( int a_index ) const { return( m_heatedCrossSections[0]->reactionHasURR_probabilityTables( a_index ) ); }
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( std::size_t a_index ) const { return( m_heatedCrossSections[0]->reactionHasURR_probabilityTables( a_index ) ); }
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, int a_URR_index, int a_hashIndex,
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, int a_URR_index, std::size_t a_hashIndex,
double a_temperature, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE void crossSectionVector( double a_temperature, double a_userFactor, std::size_t a_numberAllocated,
double *a_crossSectionVector ) const ;
LUPI_HOST GIDI::Functions::XYs1d crossSectionAsGIDI_XYs1d( double a_temperature ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, int a_hashIndex,
LUPI_HOST_DEVICE double reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, std::size_t a_hashIndex,
double a_temperature, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, double a_temperature, double a_energy_in ) const ;
LUPI_HOST GIDI::Functions::XYs1d reactionCrossSectionAsGIDI_XYs1d( int a_reactionIndex, double a_temperature ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_URR_index, double a_temperature, double a_energy_in ) const ;
LUPI_HOST GIDI::Functions::XYs1d reactionCrossSectionAsGIDI_XYs1d( std::size_t a_reactionIndex, double a_temperature ) const ;
template <typename RNG>
inline LUPI_HOST_DEVICE int sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_URR_index, int a_hashIndex,
double a_temperature, double a_energy, double a_crossSection, RNG && a_rng) const ;
inline LUPI_HOST_DEVICE std::size_t sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_URR_index,
std::size_t a_hashIndex, double a_temperature, double a_energy, double a_crossSection, RNG && a_rng) const ;
LUPI_HOST_DEVICE double depositionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double depositionMomentum( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double productionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double gain( int a_hashIndex, double a_temperature, double a_energy, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( int a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const ;
LUPI_HOST_DEVICE double depositionEnergy( 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 double productionEnergy( 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 double gainViaIntid( std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const ;
LUPI_HOST void setUserParticleIndex( int a_particleIndex, int a_userParticleIndex );
LUPI_HOST void setUserParticleIndexViaIntid( int a_particleIntid, int a_userParticleIndex );
@@ -764,7 +774,7 @@ class MultiGroupGain {
if( a_particleIntid == m_particleIntid ) m_userParticleIndex = a_userParticleIndex; }
/**< Sets member *m_userParticleIntid* to *a_userParticleIndex* if particle's intid matchs *m_particleIntid*. */
LUPI_HOST_DEVICE Vector<double> const &gain( ) const { return( m_gain ); }
LUPI_HOST_DEVICE double gain( int a_hashIndex ) const { return( m_gain[a_hashIndex] ); }
LUPI_HOST_DEVICE double gain( std::size_t a_hashIndex ) const { return( m_gain[a_hashIndex] ); }
LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
LUPI_HOST void write( FILE *a_file ) const ;
@@ -779,23 +789,23 @@ class HeatedReactionCrossSectionMultiGroup {
private:
double m_threshold;
int m_offset;
std::size_t m_offset;
Vector<double> m_crossSections; // Multi-group reaction cross section
double m_augmentedThresholdCrossSection; // Augmented cross section at m_offset for rejecting when projectile energy is below m_threshold.
// This value is added to m_crossSections[m_offset] when sampling an isotope or reaction.
public:
LUPI_HOST_DEVICE HeatedReactionCrossSectionMultiGroup( );
LUPI_HOST HeatedReactionCrossSectionMultiGroup( SetupInfo &a_setupInfo, Transporting::MC const &a_settings, int a_offset,
std::vector<double> const &a_crossSection, double a_threshold );
LUPI_HOST HeatedReactionCrossSectionMultiGroup( SetupInfo &a_setupInfo, Transporting::MC const &a_settings,
std::size_t a_offset, std::vector<double> const &a_crossSection, double a_threshold );
LUPI_HOST_DEVICE double operator[]( std::size_t a_index ) const { return( m_crossSections[a_index] ); } /**< Returns the value of the cross section at multi-group index *a_index*. */
LUPI_HOST_DEVICE double threshold( ) const { return( m_threshold ); } /**< Returns the value of the **m_threshold**. */
LUPI_HOST_DEVICE int offset( ) const { return( m_offset ); } /**< Returns the value of the **m_offset**. */
LUPI_HOST_DEVICE std::size_t offset( ) const { return( m_offset ); } /**< Returns the value of the **m_offset**. */
LUPI_HOST_DEVICE double crossSection( std::size_t a_index, bool a_sampling = false ) const {
int index = (int)a_index - m_offset;
if( index < 0 ) return( 0 );
if( index >= (int)m_crossSections.size( ) ) return( 0 );
if( a_index < m_offset ) return( 0.0 );
std::size_t index = a_index - m_offset;
if( index >= m_crossSections.size( ) ) return( 0.0 );
double _crossSection( m_crossSections[index] );
if( a_sampling && ( index == 0 ) ) {
@@ -805,7 +815,7 @@ class HeatedReactionCrossSectionMultiGroup {
}
LUPI_HOST_DEVICE double augmentedThresholdCrossSection( ) const { return( m_augmentedThresholdCrossSection ); } /**< Returns the value of the **m_augmentedThresholdCrossSection**. */
LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
LUPI_HOST void write( FILE *a_file, int a_reactionIndex ) const ;
LUPI_HOST void write( FILE *a_file, std::size_t a_reactionIndex ) const ;
};
/*
@@ -834,26 +844,27 @@ class HeatedCrossSectionMultiGroup {
LUPI_HOST_DEVICE HeatedReactionCrossSectionMultiGroup *operator[]( std::size_t a_index ) const { return( m_reactionCrossSections[a_index] ); }
/**< Returns the HeatedReactionCrossSectionMultiGroup for the reaction at index *a_index *a_index*. */
LUPI_HOST_DEVICE int numberOfReactions( ) const { return( (int) m_reactionCrossSections.size( ) ); }
LUPI_HOST_DEVICE std::size_t numberOfReactions( ) const { return( m_reactionCrossSections.size( ) ); }
/**< Returns the number of reactions stored in *this*. */
LUPI_HOST_DEVICE int thresholdOffset( int a_index ) const { return( m_reactionCrossSections[a_index]->offset( ) ); }
LUPI_HOST_DEVICE std::size_t thresholdOffset( std::size_t a_index ) const { return( m_reactionCrossSections[a_index]->offset( ) ); }
/**< Returns the offset for the cross section for the reaction with index *a_index*. */
LUPI_HOST_DEVICE double threshold( int a_index ) const { return( m_reactionCrossSections[a_index]->threshold( ) ); }
LUPI_HOST_DEVICE double threshold( std::size_t a_index ) const { return( m_reactionCrossSections[a_index]->threshold( ) ); }
LUPI_HOST_DEVICE Vector<double> &totalCrossSection( ) { return( m_totalCrossSection ); } /**< Returns a reference to member *m_totalCrossSection*. */
LUPI_HOST_DEVICE double crossSection( int a_hashIndex, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double augmentedCrossSection( int a_hashIndex ) const { return( m_augmentedCrossSection[a_hashIndex] ); }
LUPI_HOST_DEVICE double crossSection( std::size_t a_hashIndex, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double augmentedCrossSection( std::size_t a_hashIndex ) const { return( m_augmentedCrossSection[a_hashIndex] ); }
/**< Returns the value of the of the augmented cross section the reaction at index *a_index*. */
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, int a_hashIndex, bool a_sampling = false ) const {
LUPI_HOST_DEVICE double reactionCrossSection( std::size_t a_reactionIndex, std::size_t a_hashIndex,
bool a_sampling = false ) const {
return( m_reactionCrossSections[a_reactionIndex]->crossSection( a_hashIndex, a_sampling ) ); }
/**< Returns the reaction's cross section for the reaction at index *a_reactionIndex* and multi-group index *a_hashIndex*. */
LUPI_HOST_DEVICE double depositionEnergy( int a_hashIndex ) const { return( m_depositionEnergy[a_hashIndex] ); }
LUPI_HOST_DEVICE double depositionMomentum( int a_hashIndex ) const { return( m_depositionMomentum[a_hashIndex] ); }
LUPI_HOST_DEVICE double productionEnergy( int a_hashIndex ) const { return( m_productionEnergy[a_hashIndex] ); }
LUPI_HOST_DEVICE double gain( int a_hashIndex, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( int a_hashIndex, int a_particleIntid ) const ;
LUPI_HOST_DEVICE double depositionEnergy( std::size_t a_hashIndex ) const { return( m_depositionEnergy[a_hashIndex] ); }
LUPI_HOST_DEVICE double depositionMomentum( std::size_t a_hashIndex ) const { return( m_depositionMomentum[a_hashIndex] ); }
LUPI_HOST_DEVICE double productionEnergy( std::size_t a_hashIndex ) const { return( m_productionEnergy[a_hashIndex] ); }
LUPI_HOST_DEVICE double gain( std::size_t a_hashIndex, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( std::size_t a_hashIndex, int a_particleIntid ) const ;
LUPI_HOST void setUserParticleIndex( int a_particleIndex, int a_userParticleIndex );
LUPI_HOST void setUserParticleIndexViaIntid( int a_particleIntid, int a_userParticleIndex );
@@ -872,7 +883,7 @@ class HeatedCrossSectionsMultiGroup {
private:
Vector<double> m_temperatures;
Vector<double> m_thresholds;
Vector<int> m_multiGroupThresholdIndex; /**< This is the group where threshold starts, -1 otherwise. */
Vector<int> m_multiGroupThresholdIndex; /**< This is the group where threshold starts, -1 otherwise. */
Vector<double> m_projectileMultiGroupBoundariesCollapsed;
Vector<HeatedCrossSectionMultiGroup *> m_heatedCrossSections;
@@ -896,19 +907,20 @@ class HeatedCrossSectionsMultiGroup {
LUPI_HOST_DEVICE double threshold( std::size_t a_index ) const { return( m_thresholds[a_index] ); } /**< Returns the threshold for the reaction at index *a_index*. */
LUPI_HOST_DEVICE double crossSection( int a_hashIndex, double a_temperature, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double crossSection( std::size_t a_hashIndex, double a_temperature, bool a_sampling = false ) 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 reactionCrossSection( int a_reactionIndex, int a_hashIndex, double a_temperature, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, double a_temperature, double a_energy_in ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( std::size_t a_reactionIndex, std::size_t a_hashIndex, double a_temperature, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( std::size_t a_reactionIndex, double a_temperature, double a_energy_in ) const ;
template <typename RNG>
inline LUPI_HOST_DEVICE int sampleReaction( int a_hashIndex, double a_temperature, double a_energy_in, double a_crossSection, RNG &&rng) const;
inline LUPI_HOST_DEVICE std::size_t sampleReaction( std::size_t a_hashIndex, double a_temperature, double a_energy_in,
double a_crossSection, RNG &&rng) const;
LUPI_HOST_DEVICE double depositionEnergy( int a_hashIndex, double a_temperature ) const ;
LUPI_HOST_DEVICE double depositionMomentum( int a_hashIndex, double a_temperature ) const ;
LUPI_HOST_DEVICE double productionEnergy( int a_hashIndex, double a_temperature ) const ;
LUPI_HOST_DEVICE double gain( int a_hashIndex, double a_temperature, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( int a_hashIndex, double a_temperature, int a_particleIntid ) const ;
LUPI_HOST_DEVICE double depositionEnergy( std::size_t a_hashIndex, double a_temperature ) const ;
LUPI_HOST_DEVICE double depositionMomentum( std::size_t a_hashIndex, double a_temperature ) const ;
LUPI_HOST_DEVICE double productionEnergy( std::size_t a_hashIndex, double a_temperature ) const ;
LUPI_HOST_DEVICE double gain( std::size_t a_hashIndex, double a_temperature, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( std::size_t a_hashIndex, double a_temperature, int a_particleIntid ) const ;
LUPI_HOST void setUserParticleIndex( int a_particleIndex, int a_userParticleIndex );
LUPI_HOST void setUserParticleIndexViaIntid( int a_particleIntid, int a_userParticleIndex );
@@ -962,7 +974,7 @@ class NuclideGammaBranchStateInfo {
double m_nuclearLevelEnergyWidth; /**< This is 0.0 except for GRIN realized continuum levels where this is the energy width from this level to the next higher level. */
double m_multiplicity; /**< The average multiplicity of photons emitted including the emission from sub-levels. */
double m_averageGammaEnergy; /**< The average energy of photons emitted including the emission from sub-levels. */
Vector<int> m_branchIndices; /**< The list of indices into the ProtareSingle.m_branches member that this level decays to. */
Vector<std::size_t> m_branchIndices; /**< The list of indices into the ProtareSingle.m_branches member that this level decays to. */
public:
LUPI_HOST_DEVICE NuclideGammaBranchStateInfo( );
@@ -978,7 +990,7 @@ class NuclideGammaBranchStateInfo {
/**< Returns the value of the *m_nuclearLevelEnergyWidth* member. */
LUPI_HOST_DEVICE double multiplicity( ) const { return( m_multiplicity ); } /**< Returns the value of the **m_multiplicity** member. */
LUPI_HOST_DEVICE double averageGammaEnergy( ) const { return( m_averageGammaEnergy ); } /**< Returns the value of the **m_averageGammaEnergy** member. */
LUPI_HOST_DEVICE Vector<int> const &branchIndices( ) const { return( m_branchIndices ); } /**< Returns the value of the **m_branchIndices** member. */
LUPI_HOST_DEVICE Vector<std::size_t> const &branchIndices( ) const { return( m_branchIndices ); } /**< Returns the value of the **m_branchIndices** member. */
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,
@@ -1020,7 +1032,7 @@ class GRIN_levelsAndProbabilities {
class GRIN_inelasticForEnergy {
private:
Vector<int> m_indices;
Vector<std::size_t> m_indices;
Vector<double> m_thresholds;
GRIN_levelsAndProbabilities m_levelsAndProbabilities;
@@ -1078,7 +1090,7 @@ class GRIN_inelastic {
class GRIN_captureToCompound {
private:
int m_index; /**< This is the index into ProtareSingle.m_nuclideGammaBranchStateInfos of the compound level forms by the capture. */
std::size_t m_index; /**< This is the index into ProtareSingle.m_nuclideGammaBranchStateInfos of the compound level forms by the capture. */
GRIN_levelsAndProbabilities m_continuumIndices; /**< This is the list of the levels the compound can decay to minus the known levels. */
public:
@@ -1086,7 +1098,7 @@ class GRIN_captureToCompound {
LUPI_HOST GRIN_captureToCompound( SetupInfo &a_setupInfo, PoPI::Database const &a_pops, std::string a_compoundId );
LUPI_HOST_DEVICE ~GRIN_captureToCompound( );
LUPI_HOST_DEVICE int index( ) const { return( m_index ); }
LUPI_HOST_DEVICE std::size_t index( ) const { return( m_index ); }
template <typename RNG>
inline LUPI_HOST_DEVICE int sampleCaptureLevel( ProtareSingle const *a_protare, double a_energy, RNG && a_rng, bool a_checkEnergy ) const ;
LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
@@ -1291,7 +1303,7 @@ class OutputChannel {
LUPI_HOST_DEVICE Vector<Product *> const &products( ) const { return( m_products ); } /**< Returns the value of the **m_products**. */
Vector<DelayedNeutron *> delayedNeutrons( ) const { return( m_delayedNeutrons ); }
LUPI_HOST_DEVICE DelayedNeutron const *delayedNeutron( int a_index ) const { return( m_delayedNeutrons[a_index] ); }
LUPI_HOST_DEVICE DelayedNeutron const *delayedNeutron( std::size_t a_index ) const { return( m_delayedNeutrons[a_index] ); }
LUPI_HOST void moveProductsEtAlToReaction( std::vector<Product *> &a_products, Functions::Function1d **a_totalDelayedNeutronMultiplicity,
std::vector<DelayedNeutron *> &a_delayedNeutrons, std::vector<Functions::Function1d_d1 *> &a_Qs );
@@ -1324,8 +1336,8 @@ class Reaction {
private:
ProtareSingle *m_protareSingle; /**< The ProtareSingle this reaction resides in. */
int m_reactionIndex; /**< The index of the reaction in the ProtareSingle. */
int m_GIDI_reactionIndex; /**< The index of the reaction in the GIDI::ProtareSingle. */
std::size_t m_reactionIndex; /**< The index of the reaction in the ProtareSingle. */
std::size_t m_GIDI_reactionIndex; /**< The index of the reaction in the GIDI::ProtareSingle. */
String m_label; /**< The **GNDS** label for the reaction. */
int m_ENDF_MT; /**< The ENDF MT value for the reaction. */
int m_ENDL_C; /**< The ENDL C value for the reaction. */
@@ -1337,14 +1349,12 @@ class Reaction {
double m_targetMass; /**< The mass of the target. */
double m_crossSectionThreshold; /**< The threshold for the reaction. */
double m_twoBodyThreshold; /**< This is the T_1 value needed to do two-body kinematics. */
bool m_upscatterModelASupported;
bool m_hasFinalStatePhotons; /**< If **true**, *this* reaction has a photon with finalState attribute. */
int m_fissionResiduaIntid; /**< The intid of the special ENDL 99120 or 99125 fission residual. */
int m_fissionResiduaIndex; /**< The index of the special ENDL 99120 or 99125 fission residual. */
int m_fissionResiduaUserIndex; /**< The user index of the special ENDL 99120 or 99125 fission residual. */
GIDI::Construction::FissionResiduals m_fissionResiduals; /**< This member specifies what fission redisual products will be added to the list of products produced in a fission reaction. */
double m_fissionResidualMass; /**< The mass of the special ENDL 99120 or 99125 fission residual. */
Vector<double> m_upscatterModelACrossSection; /**< The multi-group cross section to use for upscatter model A. */
Vector<int> m_productIntids; /**< The list of all products *this* reaction can product by their intid. */
Vector<int> m_productIndices; /**< The list of all products *this* reaction can product by their index. */
@@ -1362,7 +1372,7 @@ class Reaction {
#ifdef MCGIDI_USE_OUTPUT_CHANNEL
OutputChannel *m_outputChannel; /**< The output channel for this reaction. Only used if the C macro MCGIDI_USE_OUTPUT is defined. */
#endif
Vector<int> m_associatedOrphanProductIndices; /**< The indices in the Protare's m_orphanProducts member for the orphanProducts associated with this reaction. */
Vector<std::size_t> m_associatedOrphanProductIndices; /**< The indices in the Protare's m_orphanProducts member for the orphanProducts associated with this reaction. */
Vector<Product *> m_associatedOrphanProducts; /**< The list of products from the orphanProduct reaction. */ /* Do not delete entries as owned by orphanProduct reaction. */
// Still need m_availableEnergy and m_availableMomentum.
@@ -1382,13 +1392,13 @@ class Reaction {
GIDI::Styles::TemperatureInfos const &a_temperatureInfos );
LUPI_HOST_DEVICE ~Reaction( );
inline LUPI_HOST_DEVICE void updateProtareSingleInfo( ProtareSingle *a_protareSingle, int a_reactionIndex ) {
inline LUPI_HOST_DEVICE void updateProtareSingleInfo( ProtareSingle *a_protareSingle, std::size_t a_reactionIndex ) {
m_protareSingle = a_protareSingle;
m_reactionIndex = a_reactionIndex;
}
LUPI_HOST_DEVICE ProtareSingle const *protareSingle( ) const { return( m_protareSingle ); } /**< Returns the value of the **m_protareSingle**. */
LUPI_HOST_DEVICE int reactionIndex( ) const { return( m_reactionIndex ); } /**< Returns the value of the **m_reactionIndex**. */
LUPI_HOST_DEVICE int GIDI_reactionIndex( ) const { return( m_GIDI_reactionIndex ); } /**< Returns the value of the **m_GIDI_reactionIndex** member. */
LUPI_HOST_DEVICE ProtareSingle const *protareSingle( ) const { return( m_protareSingle ); } /**< Returns the value of the **m_protareSingle**. */
LUPI_HOST_DEVICE std::size_t reactionIndex( ) const { return( m_reactionIndex ); } /**< Returns the value of the **m_reactionIndex**. */
LUPI_HOST_DEVICE std::size_t GIDI_reactionIndex( ) const { return( m_GIDI_reactionIndex ); } /**< Returns the value of the **m_GIDI_reactionIndex** member. */
LUPI_HOST_DEVICE String const &label( ) const { return( m_label ); } /**< Returns the value of the **m_label**. */
LUPI_HOST_DEVICE int ENDF_MT( ) const { return( m_ENDF_MT ); } /**< Returns the value of the **m_ENDF_MT**. */
LUPI_HOST_DEVICE int ENDL_C( ) const { return( m_ENDL_C ); } /**< Returns the value of the **m_ENDL_C**. */
@@ -1400,15 +1410,16 @@ class Reaction {
LUPI_HOST_DEVICE double targetMass( ) const { return( m_targetMass ); } /**< Returns the value of the **m_targetMass**. */
LUPI_HOST_DEVICE double crossSectionThreshold( ) const { return( m_crossSectionThreshold ); } /**< Returns the value of the **m_crossSectionThreshold**. */
LUPI_HOST_DEVICE double twoBodyThreshold( ) const { return( m_twoBodyThreshold ); } /**< Returns the value of the *m_twoBodyThreshold* member. */
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, std::size_t a_hashIndex,
double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, double a_temperature, double a_energy ) const ;
LUPI_HOST GIDI::Functions::XYs1d crossSectionAsGIDI_XYs1d( double a_temperature ) const ;
LUPI_HOST_DEVICE Vector<int> const &productIntids( ) const { return( m_productIntids ); }
LUPI_HOST_DEVICE Vector<int> const &productIndices( ) const { return( m_productIndices ); } /**< Returns a const reference to the *m_productIntids* member. */
LUPI_HOST_DEVICE Vector<int> const &userProductIndices( ) const { return( m_userProductIndices ); } /**< Returns a const reference to the *m_productIndices* member. */
LUPI_HOST_DEVICE MCGIDI_VectorSizeType numberOfProducts( ) const { return( m_products.size( ) ); } /**< Returns the number of products in the **m_products** member. */
LUPI_HOST_DEVICE Product const *product( int a_index ) const { return( m_products[a_index] ); }
LUPI_HOST_DEVICE std::size_t numberOfProducts( ) const { return( m_products.size( ) ); } /**< Returns the number of products in the **m_products** member. */
LUPI_HOST_DEVICE Product const *product( std::size_t a_index ) const { return( m_products[a_index] ); }
LUPI_HOST_DEVICE int productMultiplicity( int a_index ) const ;
LUPI_HOST_DEVICE int productMultiplicityViaIntid( int a_intid ) const ;
LUPI_HOST_DEVICE int productMultiplicities( int a_index ) const {
@@ -1425,22 +1436,19 @@ class Reaction {
#ifdef MCGIDI_USE_OUTPUT_CHANNEL
LUPI_HOST_DEVICE OutputChannel const *outputChannel( ) const { return( m_outputChannel ); } /**< Returns the value of the **m_outputChannel**. */
#endif
LUPI_HOST_DEVICE Vector<int> associatedOrphanProductIndices( ) const { return( m_associatedOrphanProductIndices ); } /**< Returns the value of the **m_associatedOrphanProductIndicex** member. */
LUPI_HOST_DEVICE Vector<std::size_t> associatedOrphanProductIndices( ) const { return( m_associatedOrphanProductIndices ); } /**< Returns the value of the **m_associatedOrphanProductIndicex** member. */
LUPI_HOST void addOrphanProductToProductList( std::vector<Product *> &a_associatedOrphanProducts ) const ;
LUPI_HOST_DEVICE void addOrphanProductToProductList( Vector<Product *> &a_associatedOrphanProducts ) const ;
LUPI_HOST_DEVICE void addOrphanProductToProductList( Vector<Reaction *> &a_orphanProducts ) ;
LUPI_HOST void setOrphanProductData( std::vector<int> const &a_associatedOrphanProductIndcies,
LUPI_HOST void setOrphanProductData( std::vector<std::size_t> const &a_associatedOrphanProductIndcies,
std::vector<Product *> const &a_associatedOrphanProducts );
LUPI_HOST_DEVICE bool upscatterModelASupported( ) const { return( m_upscatterModelASupported ); }
LUPI_HOST_DEVICE Vector<double> const &upscatterModelACrossSection( ) const { return( m_upscatterModelACrossSection ); }
/**< Returns the value of the **m_upscatterModelACrossSection**. */
LUPI_HOST void setUserParticleIndex( int a_particleIndex, int a_userParticleIndex );
LUPI_HOST void setUserParticleIndexViaIntid( int a_particleIntid, int a_userParticleIndex );
LUPI_HOST void setModelDBRC_data( Sampling::Upscatter::ModelDBRC_data *a_modelDBRC_data );
template <typename RNG, typename PUSHBACK>
inline LUPI_HOST_DEVICE void sampleProducts( Protare const *a_protare, double a_projectileEnergy, Sampling::Input &a_input,
inline LUPI_HOST_DEVICE void sampleProducts( Protare const *a_protare, Sampling::Input &a_input,
RNG && a_rng, PUSHBACK && a_push_back, Sampling::ProductHandler &a_products, bool a_checkOrphanProducts = true ) const ;
template <typename RNG, typename PUSHBACK>
inline LUPI_HOST_DEVICE static void sampleNullProducts( Protare const &a_protare, double a_projectileEnergy, Sampling::Input &a_input,
@@ -1534,7 +1542,7 @@ class Protare {
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE std::size_t numberOfProtares( ) const MCGIDI_TRUE_VIRTUAL; /**< Returns the number of protares contained in *this*. */
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE ProtareSingle const *protare( std::size_t a_index ) const MCGIDI_TRUE_VIRTUAL; /**< Returns the **a_index** - 1 Protare contained in *this*. */
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE ProtareSingle *protare( std::size_t a_index ) MCGIDI_TRUE_VIRTUAL; /**< Returns the **a_index** - 1 Protare contained in *this*. */
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE ProtareSingle const *protareWithReaction( int a_index ) const MCGIDI_TRUE_VIRTUAL; /**< Returns the *ProtareSingle* that contains the (*a_index* - 1) reaction. */
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE ProtareSingle const *protareWithReaction( std::size_t a_index ) const MCGIDI_TRUE_VIRTUAL; /**< Returns the *ProtareSingle* that contains the (*a_index* - 1) reaction. */
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double minimumEnergy( ) const MCGIDI_TRUE_VIRTUAL; /**< Returns the minimum cross section domain. */
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double maximumEnergy( ) const MCGIDI_TRUE_VIRTUAL ; /**< Returns the maximum cross section domain. */
@@ -1544,9 +1552,9 @@ class Protare {
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST Vector<double> const &projectileMultiGroupBoundariesCollapsed( ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE std::size_t numberOfReactions( ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE Reaction const *reaction( int a_index ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE Reaction const *reaction( std::size_t a_index ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE std::size_t numberOfOrphanProducts( ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE Reaction const *orphanProduct( int a_index ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE Reaction const *orphanProduct( std::size_t a_index ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE bool hasFission( ) const MCGIDI_TRUE_VIRTUAL;
@@ -1556,27 +1564,28 @@ class Protare {
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE bool hasURR_probabilityTables( ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double URR_domainMin( ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double URR_domainMax( ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( int a_index ) const MCGIDI_TRUE_VIRTUAL ;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( std::size_t a_index ) const MCGIDI_TRUE_VIRTUAL ;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double threshold( std::size_t a_index ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos,
int a_hashIndex, double a_temperature, double a_energy, bool a_sampling = false ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE void crossSectionVector( double a_temperature, double a_userFactor, int a_numberAllocated,
double *a_crossSectionVector ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_hashIndex,
std::size_t a_hashIndex, double a_temperature, double a_energy, bool a_sampling = false ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE void crossSectionVector( double a_temperature, double a_userFactor,
std::size_t a_numberAllocated, double *a_crossSectionVector ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION 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 MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos,
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos,
double a_temperature, double a_energy ) const MCGIDI_TRUE_VIRTUAL;
template <typename RNG>
inline MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE int sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex,
double a_temperature, double a_energy, double a_crossSection, RNG && a_rng) const MCGIDI_TRUE_VIRTUAL;
inline MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE std::size_t sampleReaction( Sampling::Input &a_input,
URR_protareInfos const &a_URR_protareInfos, std::size_t a_hashIndex, double a_crossSection, RNG && a_rng) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double depositionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double depositionMomentum( int a_hashIndex, double a_temperature, double a_energy ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double productionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double gain( int a_hashIndex, double a_temperature, double a_energy, int a_particleIndex ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double gainViaIntid( int a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double depositionEnergy( std::size_t a_hashIndex, double a_temperature, double a_energy ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double depositionMomentum( std::size_t a_hashIndex, double a_temperature, double a_energy ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double productionEnergy( std::size_t a_hashIndex, double a_temperature, double a_energy ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double gain( std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIndex ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE double gainViaIntid( std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const MCGIDI_TRUE_VIRTUAL;
MCGIDI_VIRTUAL_FUNCTION LUPI_HOST_DEVICE Vector<double> const &upscatterModelAGroupVelocities( ) const MCGIDI_TRUE_VIRTUAL;
@@ -1599,15 +1608,22 @@ class Protare {
*/
class ProtareSingle : public Protare {
friend ProtareTNSL;
private:
String m_interaction; /**< The protare's interaction string. */
int m_URR_index; /**< The index of the protare in the URR_protareInfos list. If negative, not in list. */
bool m_hasURR_probabilityTables; /**< *true* if URR probability tables present and *false* otherwise. */
double m_URR_domainMin; /**< If URR probability tables present this is the minimum of the projectile energy domain for the tables. */
double m_URR_domainMax; /**< If URR probability tables present this is the maximum of the projectile energy domain for the tables. */
DomainHash m_domainHash; /**< A copy of the domain hash supplied by the user. */
bool m_upscatterModelASupported; /**< If **true**, upscatter model A plus can be used for this protare. */
Vector<double> m_projectileMultiGroupBoundaries; /**< The multi-group boundaries for the projectile. Only used if m_crossSectionLookupMode and/or m_other1dDataLookupMode is multiGroup. */
Vector<double> m_projectileMultiGroupBoundariesCollapsed; /**< The collased, multi-group boundaries for the projectile. Only used if m_crossSectionLookupMode and/or m_other1dDataLookupMode is multiGroup. */
Vector<double> m_upscatterModelAGroupEnergies; /**< The speed of the projectile at each multi-group boundary. Need by upscatter model A. */
Vector<double> m_upscatterModelAGroupVelocities; /**< The speed of the projectile at each multi-group boundary. Need by upscatter model A. */
Vector<double> m_upscatterModelACrossSection; /**< The multi-group cross section to use for upscatter model A plus. */
MultiGroupHash m_multiGroupHash; /**< For upscatter model A with multi-group cross section data, this is the multi-group hash needed to lookup to cross section for the adjusted projectile energy. */
Vector<Reaction *> m_reactions; /**< The list of reactions. */
Vector<Reaction *> m_orphanProducts; /**< The list of orphan products. */
@@ -1622,12 +1638,13 @@ class ProtareSingle : public Protare {
LUPI_HOST void setupNuclideGammaBranchStateInfos( SetupInfo &a_setupInfo, GIDI::ProtareSingle const &a_protare,
bool a_makePhotonEmissionProbabilitiesOne, bool a_zeroNuclearLevelEnergyWidth );
LUPI_HOST_DEVICE void setUpscatterModelASupported( bool a_upscatterModelASupported ) { m_upscatterModelASupported = a_upscatterModelASupported; } /**< Sets the value of *m_upscatterModelASupported* to *a_upscatterModelASupported*. */
public:
LUPI_HOST_DEVICE ProtareSingle( );
LUPI_HOST ProtareSingle( LUPI::StatusMessageReporting &a_smr, GIDI::ProtareSingle 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,
std::set<int> const &a_reactionsToExclude, int a_reactionsToExcludeOffset = 0, bool a_allowFixedGrid = true );
GIDI::ExcludeReactionsSet const &a_reactionsToExclude, std::size_t a_reactionsToExcludeOffset = 0, bool a_allowFixedGrid = true );
LUPI_HOST_DEVICE ~ProtareSingle( );
LUPI_HOST_DEVICE bool isPhotoAtomic( ) const { return( m_isPhotoAtomic ); }
@@ -1659,7 +1676,7 @@ class ProtareSingle : public Protare {
LUPI_HOST_DEVICE std::size_t numberOfProtares( ) const { return( 1 ); } /**< Returns the number of protares contained in *this*. */
LUPI_HOST_DEVICE ProtareSingle const *protare( std::size_t a_index ) const ;
LUPI_HOST_DEVICE ProtareSingle *protare( std::size_t a_index );
LUPI_HOST_DEVICE ProtareSingle const *protareWithReaction( int a_index ) const ;
LUPI_HOST_DEVICE ProtareSingle const *protareWithReaction( std::size_t a_index ) const ;
LUPI_HOST_DEVICE double minimumEnergy( ) const {
if( m_continuousEnergy ) return( m_heatedCrossSections.minimumEnergy( ) );
@@ -1675,40 +1692,51 @@ class ProtareSingle : public Protare {
/**< Returns the value of the **m_projectileMultiGroupBoundariesCollapsed** member. */
LUPI_HOST_DEVICE std::size_t numberOfReactions( ) const { return( m_reactions.size( ) ); } /**< Returns the number of reactions of *this*. */
LUPI_HOST_DEVICE Reaction const *reaction( int a_index ) const { return( m_reactions[a_index] ); } /**< Returns the (a_index-1)^th reaction of *this*. */
LUPI_HOST_DEVICE Reaction const *reaction( std::size_t a_index ) const { return( m_reactions[a_index] ); } /**< Returns the (a_index-1)^th reaction of *this*. */
LUPI_HOST_DEVICE std::size_t numberOfOrphanProducts( ) const { return( m_orphanProducts.size( ) ); } /**< Returns the number of orphan products of *this*. */
LUPI_HOST_DEVICE Reaction const *orphanProduct( int a_index ) const { return( m_orphanProducts[a_index] ); } /**< Returns the (a_index-1)^th orphan product of *this*. */
LUPI_HOST_DEVICE Reaction const *orphanProduct( std::size_t a_index ) const { return( m_orphanProducts[a_index] ); } /**< Returns the (a_index-1)^th orphan product of *this*. */
LUPI_HOST_DEVICE bool hasFission( ) const ;
LUPI_HOST_DEVICE String interaction( ) const { return( m_interaction ); }
LUPI_HOST_DEVICE bool hasIncoherentDoppler( ) const ;
LUPI_HOST_DEVICE int URR_index( ) const { return( m_URR_index ); }
LUPI_HOST_DEVICE void URR_index( int a_URR_index ) { m_URR_index = a_URR_index; }
LUPI_HOST_DEVICE void setURR_index( int a_URR_index ) { m_URR_index = a_URR_index; }
LUPI_HOST_DEVICE bool inURR( double a_energy ) const ;
LUPI_HOST_DEVICE bool hasURR_probabilityTables( ) const { return( m_hasURR_probabilityTables ); }
LUPI_HOST_DEVICE double URR_domainMin( ) const { return( m_URR_domainMin ); }
LUPI_HOST_DEVICE double URR_domainMax( ) const { return( m_URR_domainMax ); }
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( int a_index ) const { return( m_heatedCrossSections.reactionHasURR_probabilityTables( a_index ) ); }
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( std::size_t a_index ) const { return( m_heatedCrossSections.reactionHasURR_probabilityTables( a_index ) ); }
LUPI_HOST_DEVICE double threshold( std::size_t a_index ) const {
if( m_continuousEnergy ) return( m_heatedCrossSections.threshold( a_index ) );
return( m_heatedMultigroupCrossSections.threshold( a_index ) ); } /**< Returns the threshold for the reaction at index *a_index*. */
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE void crossSectionVector( double a_temperature, double a_userFactor, int a_numberAllocated, double *a_crossSectionVector ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, double a_temperature, double a_energy ) 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 void crossSectionVector( double a_temperature, double a_userFactor, std::size_t a_numberAllocated,
double *a_crossSectionVector ) 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 double reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, double a_temperature, double a_energy ) const ;
template <typename RNG>
inline LUPI_HOST_DEVICE int sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, double a_crossSection, RNG && a_rng ) const ;
inline LUPI_HOST_DEVICE bool sampleTargetBetaForUpscatterModelA( Sampling::Input &a_input, RNG && a_rng ) const ;
template <typename RNG>
inline LUPI_HOST_DEVICE std::size_t sampleReaction( Sampling::Input &a_input, URR_protareInfos const &a_URR_protareInfos,
std::size_t a_hashIndex, double a_crossSection, RNG && a_rng ) const ;
LUPI_HOST_DEVICE double depositionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double depositionMomentum( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double productionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double gain( int a_hashIndex, double a_temperature, double a_energy, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( int a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const ;
LUPI_HOST_DEVICE double depositionEnergy( 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 double productionEnergy( 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 double gainViaIntid( std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const ;
LUPI_HOST_DEVICE bool upscatterModelASupported( ) const { return( m_upscatterModelASupported ); } /**< Returns the value of the **m_upscatterModelASupported** member. */
LUPI_HOST_DEVICE Vector<double> const &upscatterModelAGroupEnergies( ) const { return( m_upscatterModelAGroupEnergies ); } /**< Returns a reference to the **m_upscatterModelAGroupEnergies** member. */
LUPI_HOST_DEVICE Vector<double> const &upscatterModelAGroupVelocities( ) const { return( m_upscatterModelAGroupVelocities ); } /**< Returns a reference to the **m_upscatterModelAGroupVelocities** member. */
LUPI_HOST_DEVICE Vector<double> const &upscatterModelACrossSection( ) const { return( m_upscatterModelACrossSection ); }
/**< Returns the value of the **m_upscatterModelACrossSection**. */
LUPI_HOST_DEVICE void serialize2( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
LUPI_HOST_DEVICE long sizeOf2( ) const { return sizeof(*this); }
@@ -1732,7 +1760,7 @@ class ProtareComposite : public Protare {
LUPI_HOST_DEVICE ProtareComposite( );
LUPI_HOST ProtareComposite( LUPI::StatusMessageReporting &a_smr, GIDI::ProtareComposite 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,
std::set<int> const &a_reactionsToExclude, int a_reactionsToExcludeOffset = 0, bool a_allowFixedGrid = true );
GIDI::ExcludeReactionsSet const &a_reactionsToExclude, std::size_t a_reactionsToExcludeOffset = 0, bool a_allowFixedGrid = true );
LUPI_HOST_DEVICE ~ProtareComposite( );
Vector<ProtareSingle *> protares( ) const { return( m_protares ); } /**< Returns the value of the **m_protares** member. */
@@ -1744,7 +1772,7 @@ class ProtareComposite : public Protare {
LUPI_HOST_DEVICE std::size_t numberOfProtares( ) const { return( m_protares.size( ) ); } /**< Returns the number of protares contained in *this*. */
LUPI_HOST_DEVICE ProtareSingle const *protare( std::size_t a_index ) const ;
LUPI_HOST_DEVICE ProtareSingle *protare( std::size_t a_index );
LUPI_HOST_DEVICE ProtareSingle const *protareWithReaction( int a_index ) const ;
LUPI_HOST_DEVICE ProtareSingle const *protareWithReaction( std::size_t a_index ) const ;
LUPI_HOST_DEVICE double minimumEnergy( ) const { return( m_minimumEnergy ); } /**< Returns the value of the **m_minimumEnergy** member. */
LUPI_HOST_DEVICE double maximumEnergy( ) const { return( m_maximumEnergy ); } /**< Returns the value of the **m_maximumEnergy** member. */
@@ -1757,10 +1785,10 @@ class ProtareComposite : public Protare {
LUPI_HOST_DEVICE std::size_t numberOfReactions( ) const { return( m_numberOfReactions ); }
/**< Returns the value of the **m_numberOfReactions** member. */
LUPI_HOST_DEVICE Reaction const *reaction( int a_index ) const ;
LUPI_HOST_DEVICE Reaction const *reaction( std::size_t a_index ) const ;
LUPI_HOST_DEVICE std::size_t numberOfOrphanProducts( ) const { return( m_numberOfOrphanProducts ); }
/**< Returns the value of the **m_numberOfOrphanProducts** member. */
LUPI_HOST_DEVICE Reaction const *orphanProduct( int a_index ) const ;
LUPI_HOST_DEVICE Reaction const *orphanProduct( std::size_t a_index ) const ;
LUPI_HOST_DEVICE bool hasFission( ) const ;
LUPI_HOST_DEVICE bool hasIncoherentDoppler( ) const ;
@@ -1769,22 +1797,26 @@ class ProtareComposite : public Protare {
LUPI_HOST_DEVICE bool hasURR_probabilityTables( ) const ;
LUPI_HOST_DEVICE double URR_domainMin( ) const ;
LUPI_HOST_DEVICE double URR_domainMax( ) const ;
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( int a_index ) const ;
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( std::size_t a_index ) const ;
LUPI_HOST_DEVICE double threshold( std::size_t a_index ) const ;
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE void crossSectionVector( double a_temperature, double a_userFactor, int a_numberAllocated, double *a_crossSectionVector ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, double a_temperature, double a_energy ) 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 void crossSectionVector( double a_temperature, double a_userFactor, std::size_t a_numberAllocated,
double *a_crossSectionVector ) 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 double reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, double a_temperature, double a_energy ) const ;
template <typename RNG>
inline LUPI_HOST_DEVICE int sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, double a_crossSection, RNG && a_rng ) const ;
inline LUPI_HOST_DEVICE std::size_t sampleReaction( Sampling::Input &a_input, URR_protareInfos const &a_URR_protareInfos,
std::size_t a_hashIndex, double a_crossSection, RNG && a_rng ) const ;
LUPI_HOST_DEVICE double depositionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double depositionMomentum( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double productionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double gain( int a_hashIndex, double a_temperature, double a_energy, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( int a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const ;
LUPI_HOST_DEVICE double depositionEnergy( 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 double productionEnergy( 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 double gainViaIntid( std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const ;
LUPI_HOST_DEVICE Vector<double> const &upscatterModelAGroupVelocities( ) const { return( m_protares[0]->upscatterModelAGroupVelocities( ) ); }
/**< Returns a reference to the **m_upscatterModelAGroupVelocities** member. */
@@ -1812,7 +1844,7 @@ class ProtareTNSL : public Protare {
LUPI_HOST_DEVICE ProtareTNSL( );
LUPI_HOST ProtareTNSL( LUPI::StatusMessageReporting &a_smr, GIDI::ProtareTNSL 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,
std::set<int> const &a_reactionsToExclude, int a_reactionsToExcludeOffset = 0, bool a_allowFixedGrid = true );
GIDI::ExcludeReactionsSet const &a_reactionsToExclude, std::size_t a_reactionsToExcludeOffset = 0, bool a_allowFixedGrid = true );
LUPI_HOST_DEVICE ~ProtareTNSL( );
LUPI_HOST_DEVICE ProtareSingle const *protareWithElastic( ) const { return( m_protareWithElastic ); } /**< Returns the **m_protareWithElastic** member. */
@@ -1829,7 +1861,7 @@ class ProtareTNSL : public Protare {
LUPI_HOST_DEVICE std::size_t numberOfProtares( ) const { return( 2 ); } /**< Always Returns 2. */
LUPI_HOST_DEVICE ProtareSingle const *protare( std::size_t a_index ) const ;
LUPI_HOST_DEVICE ProtareSingle *protare( std::size_t a_index );
LUPI_HOST_DEVICE ProtareSingle const *protareWithReaction( int a_index ) const ;
LUPI_HOST_DEVICE ProtareSingle const *protareWithReaction( std::size_t a_index ) const ;
LUPI_HOST_DEVICE double minimumEnergy( ) const { return( m_protareWithElastic->minimumEnergy( ) ); } /**< Returns the minimum cross section domain. */
LUPI_HOST_DEVICE double maximumEnergy( ) const { return( m_protareWithElastic->maximumEnergy( ) ); } /**< Returns the maximum cross section domain. */
@@ -1841,10 +1873,10 @@ class ProtareTNSL : public Protare {
/**< Returns the value of the **m_projectileMultiGroupBoundariesCollapsed** member. */
LUPI_HOST_DEVICE std::size_t numberOfReactions( ) const { return( m_TNSL->numberOfReactions( ) + m_protareWithElastic->numberOfReactions( ) ); }
LUPI_HOST_DEVICE Reaction const *reaction( int a_index ) const ;
LUPI_HOST_DEVICE Reaction const *reaction( std::size_t a_index ) const ;
LUPI_HOST_DEVICE std::size_t numberOfOrphanProducts( ) const { return( m_protareWithElastic->numberOfOrphanProducts( ) ); }
/**< Returns the number of orphan products in the normal ProtareSingle. */
LUPI_HOST_DEVICE Reaction const *orphanProduct( int a_index ) const { return( m_protareWithElastic->orphanProduct( a_index ) ); }
LUPI_HOST_DEVICE Reaction const *orphanProduct( std::size_t a_index ) const { return( m_protareWithElastic->orphanProduct( a_index ) ); }
/**< Returns the (a_index - 1 )^th orphan product in the normal ProtareSingle. */
LUPI_HOST_DEVICE bool hasFission( ) const { return( m_protareWithElastic->hasFission( ) ); } /* Returns the normal ProtareSingle's hasFission value. */
@@ -1854,22 +1886,26 @@ class ProtareTNSL : public Protare {
LUPI_HOST_DEVICE bool hasURR_probabilityTables( ) const { return( m_protareWithElastic->hasURR_probabilityTables( ) ); }
LUPI_HOST_DEVICE double URR_domainMin( ) const { return( m_protareWithElastic->URR_domainMin( ) ); }
LUPI_HOST_DEVICE double URR_domainMax( ) const { return( m_protareWithElastic->URR_domainMax( ) ); }
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( int a_index ) const ;
LUPI_HOST_DEVICE bool reactionHasURR_probabilityTables( std::size_t a_index ) const ;
LUPI_HOST_DEVICE double threshold( std::size_t a_index ) const ;
LUPI_HOST_DEVICE double crossSection( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE void crossSectionVector( double a_temperature, double a_userFactor, int a_numberAllocated, double *a_crossSectionVector ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, bool a_sampling = false ) const ;
LUPI_HOST_DEVICE double reactionCrossSection( int a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, double a_temperature, double a_energy ) 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 void crossSectionVector( double a_temperature, double a_userFactor, std::size_t a_numberAllocated,
double *a_crossSectionVector ) 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 double reactionCrossSection( std::size_t a_reactionIndex, URR_protareInfos const &a_URR_protareInfos, double a_temperature, double a_energy ) const ;
template <typename RNG>
inline LUPI_HOST_DEVICE int sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, double a_crossSection, RNG && a_rng ) const ;
inline LUPI_HOST_DEVICE std::size_t sampleReaction( Sampling::Input &a_input, URR_protareInfos const &a_URR_protareInfos,
std::size_t a_hashIndex, double a_crossSection, RNG && a_rng ) const ;
LUPI_HOST_DEVICE double depositionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double depositionMomentum( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double productionEnergy( int a_hashIndex, double a_temperature, double a_energy ) const ;
LUPI_HOST_DEVICE double gain( int a_hashIndex, double a_temperature, double a_energy, int a_particleIndex ) const ;
LUPI_HOST_DEVICE double gainViaIntid( int a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const ;
LUPI_HOST_DEVICE double depositionEnergy( 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 double productionEnergy( 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 double gainViaIntid( std::size_t a_hashIndex, double a_temperature, double a_energy, int a_particleIntid ) const ;
LUPI_HOST_DEVICE Vector<double> const &upscatterModelAGroupVelocities( ) const { return( m_protareWithElastic->upscatterModelAGroupVelocities( ) ); }
/**< Returns a reference to the **m_upscatterModelAGroupVelocities** member. */
@@ -1884,8 +1920,8 @@ class ProtareTNSL : public Protare {
============================================================
*/
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, std::set<int> const &a_reactionsToExclude,
int a_reactionsToExcludeOffset = 0, bool a_allowFixedGrid = true );
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 );
LUPI_HOST Vector<double> GIDI_VectorDoublesToMCGIDI_VectorDoubles( GIDI::Vector a_vector );
LUPI_HOST void addVectorItemsToSet( Vector<int> const &a_from, std::set<int> &a_to );
@@ -55,6 +55,7 @@ class Distribution {
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double angleBiasing( Reaction const *a_reaction, double a_temperature, double a_energy_in, double a_mu_lab,
RNG && a_rng, double &a_energy_out ) const MCGIDI_TRUE_VIRTUAL;
LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
};
/*
@@ -36,7 +36,7 @@ LUPI_HOST_DEVICE void MCGIDI::URR_protareInfos::updateProtare( MCGIDI::Protare c
ProtareSingle *protareSingle = const_cast<ProtareSingle *>( a_protare->protare( i1 ) );
if( protareSingle->URR_index( ) >= 0 ) {
URR_protareInfo &URR_protare_info = m_URR_protareInfos[protareSingle->URR_index( )];
URR_protareInfo &URR_protare_info = m_URR_protareInfos[static_cast<std::size_t>(protareSingle->URR_index())];
URR_protare_info.m_inURR = protareSingle->inURR( a_energy );
if( URR_protare_info.inURR( ) ) URR_protare_info.m_rng_Value = a_rng( );
@@ -370,7 +370,7 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::AngularTwoBody::sample( double a_X,
double _x = targetMass( ) * ( a_X - m_twoBodyThreshold ) / ( finalMass * finalMass );
double Kp; // Kp is the total kinetic energy for m3 and m4 in the COM frame.
a_input.m_sampledType = Sampling::SampledType::firstTwoBody;
a_input.setSampledType( Sampling::SampledType::firstTwoBody );
if( m_Upscatter ) {
if( ( a_input.m_upscatterModel == Sampling::Upscatter::Model::B ) || ( a_input.m_upscatterModel == Sampling::Upscatter::Model::BSnLimits )
@@ -478,7 +478,7 @@ LUPI_HOST_DEVICE bool MCGIDI::Distributions::AngularTwoBody::upscatterModelB( do
const double C0 = 1.0410423479, C1 = 3.9626339162e-4, C2 =-1.8654539193e-3, C3 = 1.0264818153e-4;
double neutronMass = projectileMass( ); // Mass are in incident energy unit / c**2.
double _targetMass = targetMass( );
double temperature = 1e-3 * a_input.m_temperature; // Assumes m_temperature is in keV/K.
double temperature = a_input.temperature( );
double kineticLabMax = 1e4 * temperature;
if( a_input.m_upscatterModel == Sampling::Upscatter::Model::BSnLimits ) {
@@ -550,7 +550,7 @@ LUPI_HOST_DEVICE bool MCGIDI::Distributions::AngularTwoBody::upscatterModelB( do
}
double sinRelative = sqrt( 1.0 - cosRelative * cosRelative ); // Sine of angle between projectile velocity and relative velocity.
a_input.m_relativeMu = cosRelative;
a_input.m_muLab = muProjectileTarget;
a_input.m_targetBeta = targetBeta;
a_input.m_relativeBeta = relativeBeta;
@@ -629,7 +629,7 @@ LUPI_HOST_DEVICE bool MCGIDI::Distributions::AngularTwoBody::upscatterModelB( do
template <typename RNG>
LUPI_HOST_DEVICE void MCGIDI::Distributions::Uncorrelated::sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const {
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_mu = m_angular->sample( a_X, a_rng( ), a_rng );
a_input.m_energyOut1 = m_energy->sample( a_X, a_rng( ), a_rng );
a_input.m_phi = 2. * M_PI * a_rng( );
@@ -748,7 +748,7 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::EnergyAngularMC::sample( double a_X
double energyOut_1, energyOut_2;
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_energyOut1 = m_energy->sample2dOf3d( a_X, a_rng( ), a_rng, &energyOut_1, &energyOut_2 );
a_input.m_mu = m_angularGivenEnergy->sample( a_X, energyOut_1, energyOut_2, a_rng( ), a_rng );
a_input.m_phi = 2. * M_PI * a_rng( );
@@ -833,7 +833,7 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::AngularEnergyMC::sample( double a_X
double mu_1, mu_2;
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_mu = m_angular->sample2dOf3d( a_X, a_rng( ), a_rng, &mu_1, &mu_2 );
a_input.m_energyOut1 = m_energyGivenAngular->sample( a_X, mu_1, mu_2, a_rng( ), a_rng );
a_input.m_phi = 2. * M_PI * a_rng( );
@@ -876,7 +876,7 @@ LUPI_HOST_DEVICE double MCGIDI::Distributions::AngularEnergyMC::angleBiasing( LU
template <typename RNG>
LUPI_HOST_DEVICE void MCGIDI::Distributions::KalbachMann::sample( double a_X, Sampling::Input &a_input, RNG && a_rng ) const {
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_energyOut1 = m_f->sample( a_X, a_rng( ), a_rng );
double rValue = m_r->evaluate( a_X, a_input.m_energyOut1 );
double aValue = m_a->evaluate( a_X, a_input.m_energyOut1 );
@@ -976,13 +976,14 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::CoherentPhotoAtomicScattering::samp
a_input.m_energyOut1 = a_X;
int lowerIndex = binarySearchVector( a_X, m_energies );
int intLowerIndex = binarySearchVector( a_X, m_energies );
if( lowerIndex < 1 ) {
if( intLowerIndex < 1 ) {
do {
a_input.m_mu = 1.0 - 2.0 * a_rng( );
} while( ( 1.0 + a_input.m_mu * a_input.m_mu ) < 2.0 * a_rng( ) ); }
else {
std::size_t lowerIndex = static_cast<std::size_t>( intLowerIndex );
double _a = m_a[lowerIndex];
double X_i = m_energies[lowerIndex];
double formFactor_i = m_formFactor[lowerIndex];
@@ -1010,7 +1011,8 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::CoherentPhotoAtomicScattering::samp
double partialIntegral = a_rng( ) * normalization;
double X;
if( anomalousFactorSquared == 0.0 ) {
lowerIndex = binarySearchVector( partialIntegral, m_integratedFormFactorSquared );
intLowerIndex = binarySearchVector( partialIntegral, m_integratedFormFactorSquared );
lowerIndex = static_cast<std::size_t>( intLowerIndex );
if( lowerIndex == 0 ) {
X = sqrt( 2.0 * partialIntegral ) / m_formFactor[0]; }
@@ -1102,7 +1104,7 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::IncoherentPhotoAtomicScattering::sa
} while( scatteringFactor < a_rng( ) * scatteringFactorMax );
}
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_energyOut1 = energyOut * PoPI_electronMass_MeV_c2;
a_input.m_mu = mu;
a_input.m_phi = 2.0 * M_PI * a_rng( );
@@ -1143,11 +1145,12 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::IncoherentBoundToFreePhotoAtomicSca
// Sample electron momentum projection, pz
occupation_pz = occupationNumberMax*a_rng();
int lowerIndex = binarySearchVector( occupation_pz, m_occupationNumber );
if( lowerIndex == -1 ){
int intLowerIndex = binarySearchVector( occupation_pz, m_occupationNumber );
if( intLowerIndex == -1 ){
pz = m_pz.back();
}
else{
std::size_t lowerIndex = static_cast<std::size_t>( intLowerIndex );
pz = m_pz[lowerIndex] + (occupation_pz-m_occupationNumber[lowerIndex])*(m_pz[lowerIndex+1]-m_pz[lowerIndex])/(m_occupationNumber[lowerIndex+1]-m_occupationNumber[lowerIndex]);
}
@@ -1184,12 +1187,11 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::IncoherentBoundToFreePhotoAtomicSca
}
}
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_energyOut1 = energyOut * PoPI_electronMass_MeV_c2;
a_input.m_mu = mu;
a_input.m_phi = 2.0 * M_PI * a_rng( );
a_input.m_frame = productFrame( );
}
/* *********************************************************************************************************//**
@@ -1263,12 +1265,13 @@ LUPI_HOST_DEVICE double MCGIDI::Distributions::IncoherentBoundToFreePhotoAtomicS
// Sample electron momentum projection, pz
occupationNumberMax = evaluateOccupationNumber( a_energy_in, -1.0 );
occupation_pz = occupationNumberMax*a_rng();
int lowerIndex = binarySearchVector( occupation_pz, m_occupationNumber );
int intLowerIndex = binarySearchVector( occupation_pz, m_occupationNumber );
pz = 0;
if( lowerIndex == -1 ){
if( intLowerIndex == -1 ){
pz = m_pz.back();
}
else{
std::size_t lowerIndex = static_cast<std::size_t>( intLowerIndex );
pz = m_pz[lowerIndex] + (occupation_pz-m_occupationNumber[lowerIndex])*(m_pz[lowerIndex+1]-m_pz[lowerIndex])/(m_occupationNumber[lowerIndex+1]-m_occupationNumber[lowerIndex]);
}
@@ -1381,7 +1384,7 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::PairProductionGamma::sample( LUPI_m
a_input.m_mu *= -1.0;
a_input.m_phi += M_PI;
}
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_energyOut1 = PoPI_electronMass_MeV_c2;
a_input.m_frame = productFrame( );
}
@@ -1423,7 +1426,7 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::CoherentElasticTNSL::sample( double
if( a_energy <= m_energies[0] ) {
a_input.m_mu = 1.0; }
else {
double temperature = 1e-3 * a_input.m_temperature; // Assumes m_temperature is in keV/K.
double temperature = a_input.temperature( );
if( temperature < m_temperatures[0] ) temperature = m_temperatures[0];
if( temperature > m_temperatures.back( ) ) temperature = m_temperatures.back( );
std::size_t temperatureIndex = (std::size_t) MCGIDI::binarySearchVector( temperature, m_temperatures, true );
@@ -1437,18 +1440,19 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::CoherentElasticTNSL::sample( double
}
double fractionSecondTemperature = 1.0 - fractionFirstTemperature;
int energyIndexMax = MCGIDI::binarySearchVector( a_energy, m_energies, true );
int intEnergyIndexMax = MCGIDI::binarySearchVector( a_energy, m_energies, true );
std::size_t energyIndexMax = static_cast<std::size_t>( intEnergyIndexMax );
if( a_energy == m_energies[energyIndexMax] ) --energyIndexMax;
double randomTotal = a_rng( ) * ( fractionFirstTemperature * pointer1[energyIndexMax] + fractionSecondTemperature * pointer2[energyIndexMax] );
int energyIndex = 0;
std::size_t energyIndex = 0;
for( ; energyIndex < energyIndexMax; ++energyIndex ) {
if( randomTotal <= fractionFirstTemperature * pointer1[energyIndex] + fractionSecondTemperature * pointer2[energyIndex] ) break;
}
a_input.m_mu = 1.0 - 2.0 * m_energies[energyIndex] / a_energy;
}
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_energyOut1 = a_energy;
a_input.m_phi = 2.0 * M_PI * a_rng( );
}
@@ -1471,7 +1475,6 @@ template <typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Distributions::CoherentElasticTNSL::angleBiasing( LUPI_maybeUnused Reaction const *a_reaction, LUPI_maybeUnused double a_temperature,
double a_energy_in, LUPI_maybeUnused double a_mu_lab, LUPI_maybeUnused RNG && a_rng, double &a_energy_out ) const {
// double temperature = 1e-3 * a_temperature; // Assumes a_temperature is in keV/K.
double probability = 0.0;
a_energy_out = a_energy_in;
@@ -1491,7 +1494,7 @@ template <typename RNG>
LUPI_HOST_DEVICE void MCGIDI::Distributions::IncoherentElasticTNSL::sample( double a_energy, Sampling::Input &a_input,
RNG && a_rng ) const {
double temperature = 1e-3 * a_input.m_temperature / m_temperatureToMeV_K; // Assumes m_temperature is in keV/K.
double temperature = a_input.temperature( ) / m_temperatureToMeV_K;
double W_prime = m_DebyeWallerIntegral->evaluate( temperature );
double twoEW = 2 * a_energy * W_prime;
double expOfTwice_twoEW = exp( -2 * twoEW );
@@ -1506,7 +1509,7 @@ LUPI_HOST_DEVICE void MCGIDI::Distributions::IncoherentElasticTNSL::sample( doub
a_input.m_mu = 1.0 + log( expOfTwice_twoEW + sampled_cdf * ( 1.0 - expOfTwice_twoEW ) ) / twoEW;
}
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_energyOut1 = a_energy;
a_input.m_phi = 2.0 * M_PI * a_rng( );
}
@@ -1529,7 +1532,7 @@ template <typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Distributions::IncoherentElasticTNSL::angleBiasing( LUPI_maybeUnused Reaction const *a_reaction, double a_temperature,
double a_energy_in, double a_mu_lab, LUPI_maybeUnused RNG && a_rng, double &a_energy_out ) const {
double temperature = 1e-3 * a_temperature / m_temperatureToMeV_K; // Assumes a_temperature is in keV/K.
double temperature = a_temperature / m_temperatureToMeV_K;
double W_prime = m_DebyeWallerIntegral->evaluate( temperature );
double twoEW = 2 * a_energy_in * W_prime;
double probability = exp( -twoEW * ( 1.0 - a_mu_lab ) ) * twoEW / ( 1.0 - exp( -2 * twoEW ) );
@@ -1550,7 +1553,7 @@ LUPI_HOST_DEVICE double MCGIDI::Distributions::IncoherentElasticTNSL::angleBiasi
template <typename RNG>
LUPI_HOST_DEVICE void MCGIDI::Distributions::Unspecified::sample( LUPI_maybeUnused double a_X, Sampling::Input &a_input, LUPI_maybeUnused RNG && a_rng ) const {
a_input.m_sampledType = Sampling::SampledType::unspecified;
a_input.setSampledType( Sampling::SampledType::unspecified );
a_input.m_energyOut1 = 0.;
a_input.m_mu = 0.;
a_input.m_phi = 0.;
@@ -1649,14 +1652,15 @@ LUPI_HOST_DEVICE double MCGIDI::Probabilities::ProbabilityBase1d::sample( double
template <typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Probabilities::Xs_pdf_cdf1d::sample( double a_rngValue, LUPI_maybeUnused RNG && a_rng ) const {
int lower = binarySearchVector( a_rngValue, m_cdf );
int intLower = binarySearchVector( a_rngValue, m_cdf );
double domainValue = 0;
if( lower < 0 ) { // This should never happen.
LUPI_THROW( "Xs_pdf_cdf1d::sample: lower < 0." );
if( intLower < 0 ) { // This should never happen.
LUPI_THROW( "Xs_pdf_cdf1d::sample: intLower < 0." );
}
std::size_t lower = static_cast<std::size_t>( intLower );
if( interpolation( ) == Interpolation::FLAT ) {
double fraction = ( m_cdf[lower+1] - a_rngValue ) / ( m_cdf[lower+1] - m_cdf[lower] );
domainValue = fraction * m_Xs[lower] + ( 1 - fraction ) * m_Xs[lower+1]; }
@@ -1870,13 +1874,14 @@ C Then use rngValue to sample from pdf1(x1) and maybe pdf2(x1) and interpolat
C determine x1.
*/
double sampledValue = 0;
int lower = binarySearchVector( a_x2, m_Xs );
int intLower = binarySearchVector( a_x2, m_Xs );
if( lower == -2 ) {
if( intLower == -2 ) {
sampledValue = m_probabilities[0]->sample( a_rngValue, a_rng ); }
else if( lower == -1 ) {
else if( intLower == -1 ) {
sampledValue = m_probabilities.back( )->sample( a_rngValue, a_rng ); }
else {
auto lower = static_cast<std::size_t>( intLower );
double sampled1 = m_probabilities[lower]->sample( a_rngValue, a_rng );
if( interpolation( ) == Interpolation::FLAT ) {
@@ -1922,15 +1927,16 @@ C Samples from a pdf(x1|x2). First determine which pdf(s) to sample from given
C and maybe pdf2(x1) and interpolate to determine x1.
*/
double sampledValue = 0;
int lower = binarySearchVector( a_x2, m_Xs );
int intLower = binarySearchVector( a_x2, m_Xs );
if( lower == -2 ) {
if( intLower == -2 ) {
sampledValue = m_probabilities[0]->sample( a_rngValue, a_rng );
*a_x1_2 = *a_x1_1 = sampledValue; }
else if( lower == -1 ) {
else if( intLower == -1 ) {
sampledValue = m_probabilities.back( )->sample( a_rngValue, a_rng );
*a_x1_2 = *a_x1_1 = sampledValue; }
else {
std::size_t lower = static_cast<std::size_t>( intLower );
*a_x1_1 = m_probabilities[lower]->sample( a_rngValue, a_rng );
if( interpolation( ) == Interpolation::FLAT ) {
@@ -1961,15 +1967,17 @@ C and maybe pdf2(x1) and interpolate to determine x1.
template <typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Probabilities::Regions2d::sample( double a_x2, double a_rngValue, RNG && a_rng ) const {
int lower = binarySearchVector( a_x2, m_Xs );
int intLower = binarySearchVector( a_x2, m_Xs );
if( lower < 0 ) {
if( lower == -1 ) { // a_x2 > last value of m_Xs.
if( intLower < 0 ) {
if( intLower == -1 ) { // a_x2 > last value of m_Xs.
return( m_probabilities.back( )->sample( a_x2, a_rngValue, a_rng ) );
}
lower = 0; // a_x2 < first value of m_Xs.
intLower = 0; // a_x2 < first value of m_Xs.
}
std::size_t lower = static_cast<std::size_t>( intLower );
return( m_probabilities[lower]->sample( a_x2, a_rngValue, a_rng ) );
}
@@ -1983,10 +1991,22 @@ LUPI_HOST_DEVICE double MCGIDI::Probabilities::Recoil2d::sample( LUPI_maybeUnuse
return( 0.0 );
}
/* *********************************************************************************************************
* Sampling for NBody phase space.
*
* @param a_x2 [in] Incident energy of the projectile.
* @param a_rngValue [in] The GIDI::Protare whose data is to be used to construct *this*.
* @param a_rng [in] This argument is not used by this method but needed to match ProbabilityBase1d::sample's definition.
***********************************************************************************************************/
template <typename RNG>
LUPI_HOST_DEVICE double MCGIDI::Probabilities::NBodyPhaseSpace2d::sample( double a_x2, double a_rngValue, RNG && a_rng ) const {
return( ( m_energy_in_COMFactor * a_x2 + m_Q ) * m_massFactor * m_dist->sample( a_rngValue, a_rng ) );
double energyMax = m_energy_in_COMFactor * a_x2 + m_Q;
if( energyMax < 0.0 ) return( 0.0 ); // Kludge for now until for upscatter model A until sampling below threshold is fixed.
return( energyMax * m_massFactor * m_dist->sample( a_rngValue, a_rng ) );
}
inline LUPI_HOST_DEVICE static double MCGIDI_sampleEvaporation( double a_xMax, double a_rngValue ) {
@@ -2056,7 +2076,7 @@ LUPI_HOST_DEVICE double MCGIDI::Probabilities::Watt2d::sample( double a_x2, LUPI
* From MCAPM via Sample Watt Spectrum as in TART ( Kalos algorithm ).
*/
double WattMin = 0., WattMax = a_x2 - m_U, x, y, z, energyOut, rand1, rand2;
double Watt_a = 1./m_a->evaluate( a_x2 ); // Kalos algorithm uses the inverse of the a parameter stored in GNDS
double Watt_a = 1./m_a->evaluate( a_x2 ); // Kalos algorithm uses the inverse of the 'a' parameter stored in GNDS
double Watt_b = m_b->evaluate( a_x2 );
x = 1. + ( Watt_b / ( 8. * Watt_a ) );
@@ -2112,13 +2132,14 @@ C Then use rngValue to sample from pdf2_1(x2) and maybe pdf2_2(x2) and interp
C determine x1.
*/
double sampledValue = 0;
int lower = binarySearchVector( a_x3, m_Xs );
int intLower = binarySearchVector( a_x3, m_Xs );
if( lower == -2 ) { // x3 < first value of Xs.
if( intLower == -2 ) { // x3 < first value of Xs.
sampledValue = m_probabilities[0]->sample( a_x2_1, a_rngValue, a_rng ); }
else if( lower == -1 ) { // x3 > last value of Xs.
else if( intLower == -1 ) { // x3 > last value of Xs.
sampledValue = m_probabilities.back( )->sample( a_x2_1, a_rngValue, a_rng ); }
else {
std::size_t lower = static_cast<std::size_t>( intLower );
double sampled1 = m_probabilities[lower]->sample( a_x2_1, a_rngValue, a_rng );
if( interpolation( ) == Interpolation::FLAT ) {
@@ -2150,31 +2171,43 @@ C determine x1.
// From file: MCGIDI_heatedCrossSections.cpp
/* *********************************************************************************************************//**
* Returns the requested reaction's multi-group cross section for target temperature *a_temperature* and projectile multi-group *a_hashIndex*.
*
* @param a_URR_protareInfos [in] URR information.
* @param a_URR_index [in] If not negative, specifies the index in *a_URR_protareInfos*.
* @param a_hashIndex [in] Specifies projectile energy hash index.
* @param a_temperature [in] The temperature of the target.
* @param a_energy [in] The energy of the projectile.
* @param a_crossSection [in] The total cross section for the protare at *a_temperature* and *a_energy*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
***********************************************************************************************************/
template <typename RNG>
LUPI_HOST_DEVICE int MCGIDI::HeatedCrossSectionsContinuousEnergy::sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_URR_index,
int a_hashIndex, double a_temperature, double a_energy, double a_crossSection, RNG && a_rng ) const {
LUPI_HOST_DEVICE std::size_t MCGIDI::HeatedCrossSectionsContinuousEnergy::sampleReaction( URR_protareInfos const &a_URR_protareInfos,
int a_URR_index, std::size_t a_hashIndex, double a_temperature, double a_energy, double a_crossSection, RNG && a_rng ) const {
int i1, sampled_reaction_index, temperatureIndex1, temperatureIndex2, number_of_temperatures = static_cast<int>( m_temperatures.size( ) );
std::size_t sampled_reaction_index, temperatureIndex1, temperatureIndex2, number_of_temperatures = m_temperatures.size( );
double sampleCrossSection = a_crossSection * a_rng( );
if( a_temperature <= m_temperatures[0] ) {
temperatureIndex1 = 0;
temperatureIndex2 = temperatureIndex1; }
else if( a_temperature >= m_temperatures.back( ) ) {
temperatureIndex1 = static_cast<int>( m_temperatures.size( ) ) - 1;
temperatureIndex1 = m_temperatures.size( ) - 1;
temperatureIndex2 = temperatureIndex1; }
else {
for( i1 = 0; i1 < number_of_temperatures; ++i1 ) if( a_temperature < m_temperatures[i1] ) break;
std::size_t i1 = 0;
for( ; i1 < number_of_temperatures; ++i1 ) if( a_temperature < m_temperatures[i1] ) break;
temperatureIndex1 = i1 - 1;
temperatureIndex2 = i1;
}
int numberOfReactions = m_heatedCrossSections[0]->numberOfReactions( );
std::size_t numberOfReactions = m_heatedCrossSections[0]->numberOfReactions( );
double energyFraction1, energyFraction2, crossSectionSum = 0.0;
HeatedCrossSectionContinuousEnergy &heatedCrossSection1 = *m_heatedCrossSections[temperatureIndex1];
int energyIndex1 = heatedCrossSection1.evaluationInfo( a_hashIndex, a_energy, &energyFraction1 );
std::size_t energyIndex1 = heatedCrossSection1.evaluationInfo( a_hashIndex, a_energy, &energyFraction1 );
if( temperatureIndex1 == temperatureIndex2 ) {
for( sampled_reaction_index = 0; sampled_reaction_index < numberOfReactions; ++sampled_reaction_index ) {
@@ -2187,7 +2220,7 @@ LUPI_HOST_DEVICE int MCGIDI::HeatedCrossSectionsContinuousEnergy::sampleReaction
/ ( m_temperatures[temperatureIndex2] - m_temperatures[temperatureIndex1] );
double temperatureFraction1 = 1.0 - temperatureFraction2;
HeatedCrossSectionContinuousEnergy &heatedCrossSection2 = *m_heatedCrossSections[temperatureIndex2];
int energyIndex2 = heatedCrossSection2.evaluationInfo( a_hashIndex, a_energy, &energyFraction2 );
std::size_t energyIndex2 = heatedCrossSection2.evaluationInfo( a_hashIndex, a_energy, &energyFraction2 );
for( sampled_reaction_index = 0; sampled_reaction_index < numberOfReactions; ++sampled_reaction_index ) {
if( m_thresholds[sampled_reaction_index] >= a_energy ) continue;
@@ -2226,22 +2259,22 @@ LUPI_HOST_DEVICE int MCGIDI::HeatedCrossSectionsContinuousEnergy::sampleReaction
* @param a_hashIndex [in] The multi-group index.
* @param a_temperature [in] The temperature of the target.
* @param a_energy [in] The energy of the projectile.
* @param a_crossSection [in] The index of the reaction.
* @param a_crossSection [in] The total cross section for the protare at *a_temperature* and *a_energy*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
***********************************************************************************************************/
template <typename RNG>
LUPI_HOST_DEVICE int MCGIDI::HeatedCrossSectionsMultiGroup::sampleReaction( int a_hashIndex, double a_temperature, double a_energy, double a_crossSection,
LUPI_HOST_DEVICE std::size_t MCGIDI::HeatedCrossSectionsMultiGroup::sampleReaction( std::size_t a_hashIndex, double a_temperature, double a_energy, double a_crossSection,
RNG && a_rng ) const {
int i1, sampled_reaction_index, temperatureIndex1, temperatureIndex2, numberOfTemperatures = static_cast<int>( m_temperatures.size( ) );
std::size_t i1, sampled_reaction_index, temperatureIndex1, temperatureIndex2, numberOfTemperatures = m_temperatures.size( );
double sampleCrossSection = a_crossSection * a_rng( );
if( a_temperature <= m_temperatures[0] ) {
temperatureIndex1 = 0;
temperatureIndex2 = temperatureIndex1; }
else if( a_temperature >= m_temperatures.back( ) ) {
temperatureIndex1 = static_cast<int>( m_temperatures.size( ) ) - 1;
temperatureIndex1 = m_temperatures.size( ) - 1;
temperatureIndex2 = temperatureIndex1; }
else {
for( i1 = 0; i1 < numberOfTemperatures; ++i1 ) if( a_temperature < m_temperatures[i1] ) break;
@@ -2249,7 +2282,7 @@ LUPI_HOST_DEVICE int MCGIDI::HeatedCrossSectionsMultiGroup::sampleReaction( int
temperatureIndex2 = i1;
}
int numberOfReactions = m_heatedCrossSections[0]->numberOfReactions( );
std::size_t numberOfReactions = m_heatedCrossSections[0]->numberOfReactions( );
double crossSectionSum = 0;
HeatedCrossSectionMultiGroup &heatedCrossSection1 = *m_heatedCrossSections[temperatureIndex1];
@@ -2273,7 +2306,7 @@ LUPI_HOST_DEVICE int MCGIDI::HeatedCrossSectionsMultiGroup::sampleReaction( int
if( sampled_reaction_index == numberOfReactions ) return( MCGIDI_nullReaction );
if( m_multiGroupThresholdIndex[sampled_reaction_index] == a_hashIndex ) {
if( m_multiGroupThresholdIndex[sampled_reaction_index] == static_cast<int>( a_hashIndex ) ) {
double energyAboveThreshold = a_energy - m_thresholds[sampled_reaction_index];
if( energyAboveThreshold <= ( a_rng( ) * ( m_projectileMultiGroupBoundariesCollapsed[a_hashIndex+1] - m_thresholds[sampled_reaction_index] ) ) )
@@ -2286,7 +2319,8 @@ LUPI_HOST_DEVICE int MCGIDI::HeatedCrossSectionsMultiGroup::sampleReaction( int
// From file: MCGIDI_misc.cpp
/* *********************************************************************************************************//**
* The function returns a normalized Maxwellian speed (i.e., v = |velocity|) in 3d (i.e., v^2 Exp( -v^2 )).
* This function returns a normalized Maxwellian speed (i.e., v = |velocity|) in 3d (i.e., x^2 Exp( -x^2 ))
* where v = sqrt(2 * T / m) * x.
* Using formula in https://link.springer.com/content/pdf/10.1007%2Fs10955-011-0364-y.pdf.
* Author Nader M.A. Mohamed, title "Efficient Algorithm for Generating Maxwell Random Variables".
*
@@ -2309,74 +2343,7 @@ inline LUPI_HOST_DEVICE double sampleBetaFromMaxwellian( RNG && a_rng ) {
return( beta );
}
/* *********************************************************************************************************//**
* This function is used internally to sample a target's velocity (speed and cosine of angle relative to projectile)
* for a heated target using zero temperature, multi-grouped cross sections.
*
* @param a_protare [in] The Protare instance for the projectile and target.
* @param a_projectileEnergy [in] The energy of the projectile in the lab frame of the target.
* @param a_input [in] Contains needed input like the targets temperature. Also will have the target sampled velocity on return if return value is *true*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
*
* @return Returns *true* if target velocity is sampled and false otherwise.
***********************************************************************************************************/
namespace MCGIDI {
template <typename RNG>
inline LUPI_HOST_DEVICE bool sampleTargetBetaForUpscatterModelA( Protare const *a_protare, double a_projectileEnergy, Sampling::Input &a_input,
RNG && a_rng ) {
double projectileBeta = MCGIDI_particleBeta( a_protare->projectileMass( ), a_projectileEnergy );
double temperature = a_input.m_temperature * 1e-3; // FIXME Assumes m_temperature is in keV/k for now.
double targetThermalBeta = MCGIDI_particleBeta( a_protare->targetMass( ), temperature );
if( targetThermalBeta < 1e-4 * projectileBeta ) return( false );
double relativeBetaMin = projectileBeta - 2.0 * targetThermalBeta;
double relativeBetaMax = projectileBeta + 2.0 * targetThermalBeta;
Vector<double> const &upscatterModelAGroupVelocities = a_protare->upscatterModelAGroupVelocities( );
int maxIndex = (int) upscatterModelAGroupVelocities.size( ) - 2;
int relativeBetaMinIndex = binarySearchVector( relativeBetaMin, upscatterModelAGroupVelocities, true );
int relativeBetaMaxIndex = binarySearchVector( relativeBetaMax, upscatterModelAGroupVelocities, true );
double targetBeta, relativeBeta, mu;
if( relativeBetaMinIndex >= maxIndex ) relativeBetaMinIndex = maxIndex;
if( relativeBetaMaxIndex >= maxIndex ) relativeBetaMaxIndex = maxIndex;
if( relativeBetaMinIndex == relativeBetaMaxIndex ) {
targetBeta = targetThermalBeta * sampleBetaFromMaxwellian( a_rng );
mu = 1.0 - 2.0 * a_rng( );
relativeBeta = sqrt( targetBeta * targetBeta + projectileBeta * projectileBeta - 2.0 * mu * targetBeta * projectileBeta ); }
else {
Vector<double> const &upscatterModelACrossSection = a_input.m_reaction->upscatterModelACrossSection( );
double reactionRate;
double reactionRateMax = 0;
for( int i1 = relativeBetaMinIndex; i1 <= relativeBetaMaxIndex; ++i1 ) {
reactionRate = upscatterModelACrossSection[i1] * upscatterModelAGroupVelocities[i1+1];
if( reactionRate > reactionRateMax ) reactionRateMax = reactionRate;
}
do {
targetBeta = targetThermalBeta * sampleBetaFromMaxwellian( a_rng );
mu = 1.0 - 2.0 * a_rng( );
relativeBeta = sqrt( targetBeta * targetBeta + projectileBeta * projectileBeta - 2.0 * mu * targetBeta * projectileBeta );
int index = binarySearchVector( relativeBeta, upscatterModelAGroupVelocities, true );
if( index > maxIndex ) index = maxIndex;
reactionRate = upscatterModelACrossSection[index] * relativeBeta;
} while( reactionRate < a_rng( ) * reactionRateMax );
}
a_input.m_projectileBeta = projectileBeta;
a_input.m_relativeMu = mu;
a_input.m_targetBeta = targetBeta;
a_input.m_relativeBeta = relativeBeta;
a_input.m_projectileEnergy = particleKineticEnergy( a_protare->projectileMass( ), relativeBeta );
return( true );
}
/* *********************************************************************************************************//**
* This function boost a particle from one frame to another frame. The frames have a relative speed *a_boostSpeed*
@@ -2392,8 +2359,9 @@ inline LUPI_HOST_DEVICE void upScatterModelABoostParticle( Sampling::Input &a_in
double C_rel = 1.0;
if( a_input.m_relativeBeta != 0.0 ) {
C_rel = ( a_input.m_projectileBeta - a_input.m_relativeMu * a_input.m_targetBeta ) / a_input.m_relativeBeta;
if( C_rel > 1.0 ) C_rel = 1.0; // Handle round-off issue. Probably should check who big the issue is.
C_rel = ( a_input.m_projectileBeta - a_input.m_muLab * a_input.m_targetBeta ) / a_input.m_relativeBeta;
if( C_rel > 1.0 ) C_rel = 1.0; // Handle round-off issue. Probably should check how big the issue is.
if( C_rel < -1.0 ) C_rel = -1.0; // Handle round-off issue. Probably should check how big the issue is.
}
double S_rel = sqrt( 1.0 - C_rel * C_rel );
@@ -2402,8 +2370,8 @@ inline LUPI_HOST_DEVICE void upScatterModelABoostParticle( Sampling::Input &a_in
a_product.m_px_vx = -S_rel * pz_vz + C_rel * a_product.m_px_vx;
double targetSpeed = MCGIDI_speedOfLight_cm_sec * a_input.m_targetBeta;
a_product.m_pz_vz += a_input.m_relativeMu * targetSpeed;
a_product.m_px_vx += sqrt( 1.0 - a_input.m_relativeMu * a_input.m_relativeMu ) * targetSpeed;
a_product.m_pz_vz += a_input.m_muLab * targetSpeed;
a_product.m_px_vx += sqrt( 1.0 - a_input.m_muLab * a_input.m_muLab ) * targetSpeed;
double phi = 2.0 * M_PI * a_rng( );
double sine = sin( phi );
@@ -2417,6 +2385,7 @@ inline LUPI_HOST_DEVICE void upScatterModelABoostParticle( Sampling::Input &a_in
a_product.m_kineticEnergy = particleKineticEnergyFromBeta2( a_product.m_productMass, speed2 );
}
}
@@ -2703,33 +2672,32 @@ LUPI_HOST_DEVICE void MCGIDI::Product::angleBiasingViaIntid( Reaction const *a_r
/* *********************************************************************************************************//**
* Samples a reaction of *this* and returns its index.
*
* @param a_URR_protareInfos [in] URR information.
* @param a_hashIndex [in] The cross section hash index.
* @param a_temperature [in] The target temperature.
* @param a_energy [in] The projectile energy.
* @param a_crossSection [in] The total cross section at *a_temperature* and *a_energy*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
* @param a_input [in/out] Sample options requested by user.
* @param a_URR_protareInfos [in] URR information.
* @param a_hashIndex [in] Specifies the continuous energy hash index or multi-group index.
* @param a_crossSection [in] The total cross section for the protare at *a_input.temperature()* and *a_input.energy()*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
*
* @return The index of the sampled reaction.
***********************************************************************************************************/
template <typename RNG>
LUPI_HOST_DEVICE int MCGIDI::Protare::sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature,
double a_energy, double a_crossSection, RNG && a_rng ) const {
LUPI_HOST_DEVICE std::size_t MCGIDI::Protare::sampleReaction( Sampling::Input &a_input, URR_protareInfos const &a_URR_protareInfos,
std::size_t a_hashIndex, double a_crossSection, RNG && a_rng ) const {
int reactionIndex = -1;
std::size_t reactionIndex = MCGIDI_nullReaction;
switch( protareType( ) ) {
case ProtareType::single:
reactionIndex = static_cast<ProtareSingle const *>( this )->sampleReaction( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy,
reactionIndex = static_cast<ProtareSingle const *>( this )->sampleReaction( a_input, a_URR_protareInfos, a_hashIndex,
a_crossSection, a_rng );
break;
case ProtareType::composite:
reactionIndex = static_cast<ProtareComposite const *>( this )->sampleReaction( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy,
reactionIndex = static_cast<ProtareComposite const *>( this )->sampleReaction( a_input, a_URR_protareInfos, a_hashIndex,
a_crossSection, a_rng );
break;
case ProtareType::TNSL:
reactionIndex = static_cast<ProtareTNSL const *>( this )->sampleReaction( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy,
reactionIndex = static_cast<ProtareTNSL const *>( this )->sampleReaction( a_input, a_URR_protareInfos, a_hashIndex,
a_crossSection, a_rng );
break;
}
@@ -2754,10 +2722,9 @@ LUPI_HOST_DEVICE void MCGIDI::ProtareSingle::sampleBranchingGammas( Sampling::In
double energyLevelSampleWidthUpper = 0.0; // Used for GRIN continuum levels to add variaction to outgoing photons.
NuclideGammaBranchStateInfo *nuclideGammaBranchStateInfo = nullptr;
if( initialStateIndex >= 0 ) nuclideGammaBranchStateInfo = m_nuclideGammaBranchStateInfos[initialStateIndex];
// std::cout << initialStateIndex << " " << nuclideGammaBranchStateInfo->nuclearLevelEnergy( ) << std::endl;
if( initialStateIndex >= 0 ) nuclideGammaBranchStateInfo = m_nuclideGammaBranchStateInfos[static_cast<std::size_t>(initialStateIndex)];
while( initialStateIndex >= 0 ) {
Vector<int> const &branchIndices = nuclideGammaBranchStateInfo->branchIndices( );
auto const &branchIndices = nuclideGammaBranchStateInfo->branchIndices( );
double random = a_rng( );
double sum = 0.0;
@@ -2770,16 +2737,15 @@ LUPI_HOST_DEVICE void MCGIDI::ProtareSingle::sampleBranchingGammas( Sampling::In
double energyLevelSampleWidthLower = 0.0;
initialStateIndex = nuclideGammaBranchInfo->residualStateIndex( );
if( initialStateIndex >= 0 ) {
nuclideGammaBranchStateInfo = m_nuclideGammaBranchStateInfos[initialStateIndex];
nuclideGammaBranchStateInfo = m_nuclideGammaBranchStateInfos[static_cast<std::size_t>(initialStateIndex)];
energyLevelSampleWidthLower = a_rng( ) * nuclideGammaBranchStateInfo->nuclearLevelEnergyWidth( );
}
if( nuclideGammaBranchInfo->photonEmissionProbability( ) > a_rng( ) ) {
a_input.m_sampledType = Sampling::SampledType::photon;
a_input.setSampledType( Sampling::SampledType::photon );
a_input.m_dataInTargetFrame = false;
a_input.m_frame = GIDI::Frame::lab;
a_input.m_energyOut1 = nuclideGammaBranchInfo->gammaEnergy( ) + energyLevelSampleWidthUpper - energyLevelSampleWidthLower;
// std::cout << a_input.m_energyOut1 << " " << nuclideGammaBranchInfo->gammaEnergy( ) << " " << energyLevelSampleWidthUpper << " " << energyLevelSampleWidthLower << std::endl;
a_input.m_mu = 1.0 - 2.0 * a_rng( );
a_input.m_phi = 2.0 * M_PI * a_rng( );
@@ -2793,25 +2759,114 @@ LUPI_HOST_DEVICE void MCGIDI::ProtareSingle::sampleBranchingGammas( Sampling::In
}
/* *********************************************************************************************************//**
* Returns the index of a sampled reaction for a target with termpature *a_temperature*, a projectile with energy *a_energy* and total cross section
* *a_crossSection*. Random numbers are obtained via *a_rng*.
* This function is used internally to sample a target's velocity (speed and cosine of angle relative to projectile)
* for a heated target using zero temperature, multi-grouped cross sections.
*
* @param a_URR_protareInfos [in] URR information.
* @param a_hashIndex [in] Specifies the continuous energy or multi-group index.
* @param a_temperature [in] The temperature of the target.
* @param a_energy [in] The energy of the projectile.
* @param a_crossSection [in] The total cross section.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
* @param a_input [in/out] Contains needed input like the targets temperature. Also will have the target sampled velocity on return if return value is *true*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
*
* @return Returns *true* if target velocity is sampled and false otherwise.
***********************************************************************************************************/
template <typename RNG>
LUPI_HOST_DEVICE int MCGIDI::ProtareSingle::sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy,
double a_crossSection, RNG && a_rng ) const {
inline LUPI_HOST_DEVICE bool MCGIDI::ProtareSingle::sampleTargetBetaForUpscatterModelA( Sampling::Input &a_input, RNG && a_rng ) const {
if( m_continuousEnergy ) return( m_heatedCrossSections.sampleReaction( a_URR_protareInfos, m_URR_index, a_hashIndex, a_temperature, a_energy,
a_crossSection, a_rng ) );
double projectileBeta = MCGIDI_particleBeta( m_projectileMass, a_input.energy( ) );
double targetThermalBeta = MCGIDI_particleBeta( m_targetMass, a_input.temperature( ) );
return( m_heatedMultigroupCrossSections.sampleReaction( a_hashIndex, a_temperature, a_energy, a_crossSection, a_rng ) );
a_input.m_projectileBeta = projectileBeta;
a_input.m_relativeBeta = projectileBeta;
a_input.m_muLab = 0.0;
a_input.m_targetBeta = 0.0;
if( targetThermalBeta < 1e-4 * projectileBeta ) return( false );
a_input.m_modelTemperature = 0.0;
double relativeBetaMin = projectileBeta - 2.0 * targetThermalBeta;
double relativeBetaMax = projectileBeta + 2.0 * targetThermalBeta;
std::size_t maxIndex = m_upscatterModelAGroupVelocities.size( ) - 2;
int intRelativeBetaMinIndex = binarySearchVector( relativeBetaMin, m_upscatterModelAGroupVelocities, true );
std::size_t relativeBetaMinIndex = static_cast<std::size_t>( intRelativeBetaMinIndex );
int intRelativeBetaMaxIndex = binarySearchVector( relativeBetaMax, m_upscatterModelAGroupVelocities, true );
std::size_t relativeBetaMaxIndex = static_cast<std::size_t>( intRelativeBetaMaxIndex );
double targetBeta, relativeBeta, mu;
if( relativeBetaMinIndex >= maxIndex ) relativeBetaMinIndex = maxIndex;
if( relativeBetaMaxIndex >= maxIndex ) relativeBetaMaxIndex = maxIndex;
if( relativeBetaMinIndex == relativeBetaMaxIndex ) {
targetBeta = targetThermalBeta * sampleBetaFromMaxwellian( a_rng );
mu = 1.0 - 2.0 * a_rng( );
relativeBeta = sqrt( targetBeta * targetBeta + projectileBeta * projectileBeta - 2.0 * mu * targetBeta * projectileBeta ); }
else {
double reactionRate;
double reactionRateMax = 0;
for( std::size_t i1 = relativeBetaMinIndex; i1 <= relativeBetaMaxIndex; ++i1 ) {
reactionRate = m_upscatterModelACrossSection[i1] * m_upscatterModelAGroupVelocities[i1+1];
if( reactionRate > reactionRateMax ) reactionRateMax = reactionRate;
}
do {
targetBeta = targetThermalBeta * sampleBetaFromMaxwellian( a_rng );
mu = 1.0 - 2.0 * a_rng( );
relativeBeta = sqrt( targetBeta * targetBeta + projectileBeta * projectileBeta - 2.0 * mu * targetBeta * projectileBeta );
std::size_t index = static_cast<std::size_t>( binarySearchVector( relativeBeta, m_upscatterModelAGroupVelocities, true ) );
if( index > maxIndex ) index = maxIndex;
reactionRate = m_upscatterModelACrossSection[index] * relativeBeta;
} while( reactionRate < a_rng( ) * reactionRateMax );
}
a_input.m_modelEnergy = particleKineticEnergy( m_projectileMass, relativeBeta );
a_input.m_relativeBeta = relativeBeta;
a_input.m_muLab = mu;
a_input.m_targetBeta = targetBeta;
return( true );
}
/* *********************************************************************************************************//**
* Returns the index of a sampled reaction for target temperature, projectile energy and total cross section
* as specified via argument *a_input*. Random numbers are obtained via *a_rng*.
*
* @param a_input [in/out] Sample options requested by user. The values m_modelTemperature and m_modelEnergy are set by this method.
* @param a_URR_protareInfos [in] URR information.
* @param a_hashIndex [in] Specifies the continuous energy hash index or multi-group index.
* @param a_crossSection [in] The total cross section for the protare at *a_input.temperature()* and *a_input.energy()*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
***********************************************************************************************************/
template <typename RNG>
LUPI_HOST_DEVICE std::size_t MCGIDI::ProtareSingle::sampleReaction( Sampling::Input &a_input, URR_protareInfos const &a_URR_protareInfos,
std::size_t a_hashIndex, double a_crossSection, RNG && a_rng ) const {
std::size_t hashIndex = a_hashIndex;
double crossSection1 = a_crossSection;
a_input.m_dataInTargetFrame = false;
a_input.m_modelTemperature = a_input.m_temperature;
a_input.m_modelEnergy = a_input.m_energy;
if( upscatterModelASupported( ) && ( a_input.m_upscatterModel == Sampling::Upscatter::Model::A ) ) {
a_input.m_dataInTargetFrame = sampleTargetBetaForUpscatterModelA( a_input, a_rng );
if( a_input.m_dataInTargetFrame ) {
if( m_continuousEnergy ) {
hashIndex = m_domainHash.index( a_input.m_modelEnergy ); }
else {
hashIndex = m_multiGroupHash.index( a_input.m_modelEnergy );
}
crossSection1 = crossSection( a_URR_protareInfos, hashIndex, a_input.m_modelTemperature, a_input.m_modelEnergy, true );
}
}
if( m_continuousEnergy ) return( m_heatedCrossSections.sampleReaction( a_URR_protareInfos, m_URR_index, hashIndex,
a_input.m_modelTemperature, a_input.m_modelEnergy, crossSection1, a_rng ) );
return( m_heatedMultigroupCrossSections.sampleReaction( hashIndex, a_input.m_modelTemperature, a_input.m_modelEnergy,
crossSection1, a_rng ) );
}
@@ -2820,30 +2875,30 @@ LUPI_HOST_DEVICE int MCGIDI::ProtareSingle::sampleReaction( URR_protareInfos con
/* *********************************************************************************************************//**
* Samples a reaction of *this* and returns its index.
*
* @param a_URR_protareInfos [in] URR information.
* @param a_hashIndex [in] The cross section hash index.
* @param a_temperature [in] The target temperature.
* @param a_energy [in] The projectile energy.
* @param a_crossSection [in] The total cross section at *a_temperature* and *a_energy*.
* @param a_input [in] Sample options requested by user.
* @param a_URR_protareInfos [in] URR information.
* @param a_hashIndex [in] Specifies the continuous energy hash index or multi-group index.
* @param a_crossSection [in] The total cross section for the protare at *a_input.temperature()* and *a_input.energy()*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
*
* @return The index of the sampled reaction.
* @return The index of the sampled reaction.
***********************************************************************************************************/
template <typename RNG>
LUPI_HOST_DEVICE int MCGIDI::ProtareComposite::sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, double a_crossSection, RNG && a_rng ) const {
LUPI_HOST_DEVICE std::size_t MCGIDI::ProtareComposite::sampleReaction( Sampling::Input &a_input, URR_protareInfos const &a_URR_protareInfos,
std::size_t a_hashIndex, double a_crossSection, RNG && a_rng ) const {
std::size_t length = static_cast<std::size_t>( m_protares.size( ) );
int reaction_index = 0;
std::size_t reaction_index = 0;
double cross_section_sum = 0.0;
double cross_section_rng = a_rng( ) * a_crossSection;
for( std::size_t i1 = 0; i1 < length; ++i1 ) {
double cross_section = m_protares[i1]->crossSection( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, true );
double cross_section = m_protares[i1]->crossSection( a_URR_protareInfos, a_hashIndex, a_input.temperature( ), a_input.energy( ), true );
cross_section_sum += cross_section;
if( cross_section_sum > cross_section_rng ) {
int reaction_index2 = m_protares[i1]->sampleReaction( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, cross_section, a_rng );
std::size_t reaction_index2 = m_protares[i1]->sampleReaction( a_input, a_URR_protareInfos, a_hashIndex, cross_section, a_rng );
reaction_index += reaction_index2;
if( reaction_index2 == MCGIDI_nullReaction ) reaction_index = MCGIDI_nullReaction;
@@ -2861,32 +2916,33 @@ LUPI_HOST_DEVICE int MCGIDI::ProtareComposite::sampleReaction( URR_protareInfos
/* *********************************************************************************************************//**
* Returns the total cross section.
*
* @param a_input [in] Sample options requested by user.
* @param a_URR_protareInfos [in] URR information.
* @param a_hashIndex [in] The cross section hash index.
* @param a_temperature [in] The target temperature.
* @param a_energy [in] The projectile energy.
* @param a_crossSection [in] The total cross section at *a_temperature* and *a_energy*.
* @param a_hashIndex [in] Specifies the continuous energy hash index or multi-group index.
* @param a_crossSection [in] The total cross section for the protare at *a_input.temperature()* and *a_input.energy()*.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
*
* @return The index of the sampled reaction.
***********************************************************************************************************/
template <typename RNG>
LUPI_HOST_DEVICE int MCGIDI::ProtareTNSL::sampleReaction( URR_protareInfos const &a_URR_protareInfos, int a_hashIndex, double a_temperature, double a_energy, double a_crossSection, RNG && a_rng ) const {
LUPI_HOST_DEVICE std::size_t MCGIDI::ProtareTNSL::sampleReaction( Sampling::Input &a_input, URR_protareInfos const &a_URR_protareInfos,
std::size_t a_hashIndex, double a_crossSection, RNG && a_rng ) const {
int reactionIndex = 0;
std::size_t reactionIndex = 0;
if( ( a_energy < m_TNSL_maximumEnergy ) && ( a_temperature <= m_TNSL_maximumTemperature ) ) {
double TNSL_crossSection = m_TNSL->crossSection( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, true );
if( ( a_input.energy( ) < m_TNSL_maximumEnergy ) && ( a_input.temperature( ) <= m_TNSL_maximumTemperature ) ) {
double TNSL_crossSection = m_TNSL->crossSection( a_URR_protareInfos, a_hashIndex, a_input.temperature( ), a_input.energy( ), true );
if( TNSL_crossSection > a_rng( ) * a_crossSection ) {
reactionIndex = m_TNSL->sampleReaction( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, TNSL_crossSection, a_rng ); }
reactionIndex = m_TNSL->sampleReaction( a_input, a_URR_protareInfos, a_hashIndex, TNSL_crossSection, a_rng ); }
else {
reactionIndex = m_protareWithoutElastic->sampleReaction( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_crossSection - TNSL_crossSection, a_rng );
reactionIndex = m_protareWithoutElastic->sampleReaction( a_input, a_URR_protareInfos, a_hashIndex,
a_crossSection - TNSL_crossSection, a_rng );
if( reactionIndex != MCGIDI_nullReaction ) reactionIndex += m_numberOfTNSLReactions + 1;
} }
else {
reactionIndex = m_protareWithElastic->sampleReaction( a_URR_protareInfos, a_hashIndex, a_temperature, a_energy, a_crossSection, a_rng );
reactionIndex = m_protareWithElastic->sampleReaction( a_input, a_URR_protareInfos, a_hashIndex, a_crossSection, a_rng );
if( reactionIndex != MCGIDI_nullReaction ) reactionIndex += m_numberOfTNSLReactions;
}
@@ -2900,7 +2956,6 @@ LUPI_HOST_DEVICE int MCGIDI::ProtareTNSL::sampleReaction( URR_protareInfos const
* This method adds sampled products to *a_products*.
*
* @param a_protare [in] The Protare this Reaction belongs to.
* @param a_projectileEnergy [in] The energy of the projectile.
* @param a_input [in] Sample options requested by user.
* @param a_rng [in] The random number generator function that returns a double in the range [0, 1.0).
* @param a_products [in] The object to add all sampled products to.
@@ -2908,25 +2963,16 @@ LUPI_HOST_DEVICE int MCGIDI::ProtareTNSL::sampleReaction( URR_protareInfos const
***********************************************************************************************************/
template <typename RNG, typename PUSHBACK>
LUPI_HOST_DEVICE void MCGIDI::Reaction::sampleProducts( Protare const *a_protare, double a_projectileEnergy, Sampling::Input &a_input,
LUPI_HOST_DEVICE void MCGIDI::Reaction::sampleProducts( Protare const *a_protare, Sampling::Input &a_input,
RNG && a_rng, PUSHBACK && a_push_back, Sampling::ProductHandler &a_products, bool a_checkOrphanProducts ) const {
double projectileEnergy = a_projectileEnergy;
double projectileEnergy = a_input.modelEnergy( );
a_input.m_GRIN_intermediateResidual = -1;
a_input.m_reaction = this;
a_input.m_projectileMass = m_projectileMass;
a_input.m_targetMass = m_targetMass;
a_input.m_relativeMu = 0.0;
a_input.m_targetBeta = 0.0;
a_input.m_relativeBeta = MCGIDI_particleBeta( m_projectileMass, a_projectileEnergy );
a_input.m_dataInTargetFrame = false;
if( upscatterModelASupported( ) && ( a_input.m_upscatterModel == Sampling::Upscatter::Model::A ) ) {
a_input.m_dataInTargetFrame = sampleTargetBetaForUpscatterModelA( m_protareSingle, a_projectileEnergy, a_input, a_rng );
if( a_input.m_dataInTargetFrame ) projectileEnergy = a_input.m_projectileEnergy;
}
a_input.m_relativeBeta = MCGIDI_particleBeta( m_projectileMass, projectileEnergy );
if( m_GRIN_specialSampleProducts ) {
if( m_GRIN_capture != nullptr ) {
@@ -2966,7 +3012,7 @@ LUPI_HOST_DEVICE void MCGIDI::Reaction::sampleProducts( Protare const *a_protare
}
if( m_totalDelayedNeutronMultiplicity != nullptr ) {
double totalDelayedNeutronMultiplicity = m_totalDelayedNeutronMultiplicity->evaluate( a_projectileEnergy );
double totalDelayedNeutronMultiplicity = m_totalDelayedNeutronMultiplicity->evaluate( projectileEnergy );
if( a_rng( ) < totalDelayedNeutronMultiplicity ) { // Assumes that totalDelayedNeutronMultiplicity < 1.0, which it is.
double sum = 0.0;
@@ -2976,12 +3022,12 @@ LUPI_HOST_DEVICE void MCGIDI::Reaction::sampleProducts( Protare const *a_protare
DelayedNeutron const *delayedNeutron1 = m_delayedNeutrons[i1];
Product const &product = delayedNeutron1->product( );
sum += product.multiplicity( )->evaluate( a_projectileEnergy );
sum += product.multiplicity( )->evaluate( projectileEnergy );
if( sum >= totalDelayedNeutronMultiplicity ) {
product.distribution( )->sample( a_projectileEnergy, a_input, a_rng );
product.distribution( )->sample( projectileEnergy, a_input, a_rng );
a_input.m_delayedNeutronIndex = delayedNeutron1->delayedNeutronIndex( );
a_input.m_delayedNeutronDecayRate = delayedNeutron1->rate( );
a_products.add( a_projectileEnergy, product.intid( ), product.index( ), product.userParticleIndex( ), product.mass( ), a_input, a_rng, a_push_back, false );
a_products.add( a_input.energy( ), product.intid( ), product.index( ), product.userParticleIndex( ), product.mass( ), a_input, a_rng, a_push_back, false );
break;
}
}
@@ -2989,7 +3035,7 @@ LUPI_HOST_DEVICE void MCGIDI::Reaction::sampleProducts( Protare const *a_protare
}
if( m_fissionResiduaIntid != -1 ) { // Special treatment to add 2 ENDL 99120 or 99125 products.
a_input.m_sampledType = MCGIDI::Sampling::SampledType::unspecified;
a_input.setSampledType( MCGIDI::Sampling::SampledType::unspecified );
a_input.m_frame = GIDI::Frame::lab;
a_input.m_energyOut1 = 0.0;
a_input.m_mu = 0.0;
@@ -3032,11 +3078,11 @@ LUPI_HOST_DEVICE bool MCGIDI::GRIN_capture::sampleProducts( ProtareSingle const
double availableEnergy = m_captureNeutronSeparationEnergy + a_projectileEnergy;
int primaryCaptureLevelIndex = GRIN_captureLevelProbability1->sampleCaptureLevel( a_protare, availableEnergy, a_rng );
NuclideGammaBranchStateInfo const *nuclideGammaBranchStateInfo = a_protare->nuclideGammaBranchStateInfos( )[primaryCaptureLevelIndex];
NuclideGammaBranchStateInfo const *nuclideGammaBranchStateInfo = a_protare->nuclideGammaBranchStateInfos( )[static_cast<std::size_t>(primaryCaptureLevelIndex)];
a_input.m_GRIN_intermediateResidual = nuclideGammaBranchStateInfo->intid( );
a_input.m_sampledType = Sampling::SampledType::photon;
a_input.setSampledType( Sampling::SampledType::photon );
a_input.m_dataInTargetFrame = false;
a_input.m_frame = GIDI::Frame::lab;
@@ -3083,7 +3129,7 @@ LUPI_HOST_DEVICE bool MCGIDI::GRIN_inelastic::sampleProducts( ProtareSingle cons
int levelIndex = inelasticForEnergy->sampleLevelIndex( a_projectileEnergy, a_rng( ) );
if( levelIndex < 0 ) return( false );
NuclideGammaBranchStateInfo const *nuclideGammaBranchStateInfo = a_protare->nuclideGammaBranchStateInfos( )[levelIndex];
NuclideGammaBranchStateInfo const *nuclideGammaBranchStateInfo = a_protare->nuclideGammaBranchStateInfos( )[static_cast<std::size_t>(levelIndex)];
a_input.m_GRIN_intermediateResidual = nuclideGammaBranchStateInfo->intid( );
@@ -3103,7 +3149,7 @@ LUPI_HOST_DEVICE bool MCGIDI::GRIN_inelastic::sampleProducts( ProtareSingle cons
}
if( Kp < 0 ) Kp = 0.; // FIXME There needs to be a better test here.
a_input.m_sampledType = Sampling::SampledType::firstTwoBody;
a_input.setSampledType( Sampling::SampledType::firstTwoBody );
a_input.m_mu = 1.0 - 2.0 * a_rng( );
a_input.m_phi = 2. * M_PI * a_rng( );
kinetics_COMKineticEnergy2LabEnergyAndMomentum( betaBoast, Kp, m_neutronMass, residualMass, a_input );
@@ -3195,7 +3241,7 @@ LUPI_HOST_DEVICE void MCGIDI::Reaction::sampleNullProducts( Protare const &a_pro
RNG && a_rng, PUSHBACK && a_push_back, Sampling::ProductHandler &a_products ) {
a_input.m_GRIN_intermediateResidual = -1;
a_input.m_sampledType = Sampling::SampledType::uncorrelatedBody;
a_input.setSampledType( Sampling::SampledType::uncorrelatedBody );
a_input.m_dataInTargetFrame = false;
a_input.m_frame = GIDI::Frame::lab;
a_input.m_delayedNeutronIndex = -1;
@@ -24,7 +24,7 @@ namespace MCGIDI {
class DomainHash {
private:
int m_bins; /**< The number of bins for the hash. */
std::size_t m_bins; /**< The number of bins for the hash. */
double m_domainMin; /**< The minimum domain value for the hash. */
double m_domainMax; /**< The maximum domain value for the hash. */
double m_u_domainMin; /**< The log of m_domainMin ). */
@@ -33,18 +33,18 @@ class DomainHash {
public:
LUPI_HOST_DEVICE DomainHash( );
LUPI_HOST_DEVICE DomainHash( int a_bins, double a_domainMin, double a_domainMax );
LUPI_HOST_DEVICE DomainHash( std::size_t a_bins, double a_domainMin, double a_domainMax );
LUPI_HOST_DEVICE DomainHash( DomainHash const &a_domainHash );
LUPI_HOST_DEVICE int bins( ) const { return( m_bins ); } /**< Returns the value of the **m_bins**. */
LUPI_HOST_DEVICE std::size_t bins( ) const { return( m_bins ); } /**< Returns the value of the **m_bins**. */
LUPI_HOST_DEVICE double domainMin( ) const { return( m_domainMin ); } /**< Returns the value of the **m_domainMax**. */
LUPI_HOST_DEVICE double domainMax( ) const { return( m_domainMax ); } /**< Returns the value of the **m_domainMax**. */
LUPI_HOST_DEVICE double u_domainMin( ) const { return( m_u_domainMin ); } /**< Returns the value of the **m_u_domainMin**. */
LUPI_HOST_DEVICE double u_domainMax( ) const { return( m_u_domainMax ); } /**< Returns the value of the **m_u_domainMax**. */
LUPI_HOST_DEVICE double inverse_du( ) const { return( m_inverse_du ); } /**< Returns the value of the **m_inverse_du**. */
LUPI_HOST_DEVICE int index( double a_domain ) const ;
LUPI_HOST_DEVICE Vector<int> map( Vector<double> const &a_domainValues ) const ;
LUPI_HOST_DEVICE std::size_t index( double a_domain ) const ;
LUPI_HOST_DEVICE Vector<std::size_t > map( Vector<double> const &a_domainValues ) const ;
LUPI_HOST_DEVICE void serialize( LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode );
@@ -54,8 +54,9 @@ class DomainHash {
namespace Sampling {
enum class SampledType { firstTwoBody, secondTwoBody, uncorrelatedBody, unspecified, photon };
class ProductHandler;
LUPI_HOST_DEVICE int evaluationForHashIndex( int a_hashIndex, Vector<int> const &a_hashIndices, double a_energy,
LUPI_HOST_DEVICE std::size_t evaluationForHashIndex( std::size_t a_hashIndex, Vector<std::size_t> const &a_hashIndices, double a_energy,
Vector<double> const &a_energies, double *a_energyFraction );
namespace Upscatter {
@@ -75,7 +76,7 @@ class ModelDBRC_data {
double m_targetMass; /**< The mass of the target. */
Vector<double> m_energies; /**< The energy grid for the cross section. */
Vector<double> m_crossSections; /**< The cross sections corresponding to the energy grid. */
Vector<int> m_hashIndices; /**< The indicies for the energy hash function. */
Vector<std::size_t> m_hashIndices; /**< The indicies for the energy hash function. */
MCGIDI::DomainHash m_domainHash; /**< The hash "function". */
public:
@@ -134,26 +135,40 @@ class ClientCodeRNGData : public ClientRandomNumberGenerator {
=========================== Input ==========================
============================================================
*/
class Input {
friend ProtareSingle;
friend Reaction;
friend MCGIDI::Sampling::ProductHandler;
friend GRIN_capture;
friend GRIN_inelastic;
private:
bool m_wantVelocity = true ; /**< See member m_isVelocity in class Product for meaning. This is user input. */
bool m_dataInTargetFrame = false; /**< **True** if the data are in the target's frame and **false** otherwise. */
double m_modelTemperature = 0.0; /**< The temperature used when sampling product data. For example, in upscatter model A the projectile is boosted into a sampled target's frame and the modelled temperature is 0.0. */
double m_modelEnergy = 0.0; /**< The projectile energy used when sampling product data (see comment for member **m_modelTemperature**. */
SampledType m_sampledType = SampledType::uncorrelatedBody; /**< For internal use only. Set by distributions and used in the method **MCGIDI::Sampling::ProductHandler::add**. */
// The next 2 members are set by the user via the setTemperatureAndEnergy method.
double m_temperature = 0.0; /**< The temperature of the material. This member is set by the user. */
double m_energy = 0.0; /**< The energy of the projectile. This member is set by the user. */
public:
double m_temperature = 0.0; /**< Set by user. */
Upscatter::Model m_upscatterModel = Upscatter::Model::none; /**< The upscatter model to use when sampling a target's velocity. */
// The rest of the members are set by MCGIDI methods.
// These five are used for upscatter model A.
bool m_dataInTargetFrame = false; /**< **true if the data are in the target's frame and **false** otherwise. */
// These five are used for upscatter model A and the last 4 also used by model B.
double m_projectileBeta = 0.0; /**< The beta = speed / c of the projectile. */
double m_relativeMu = 0.0; /**< BRB */
double m_muLab = 0.0; /**< The cosine of the angle between the projectile's and the sampled target's velocities. */
double m_targetBeta = 0.0; /**< The beta = speed / c of the target. */
double m_relativeBeta = 0.0; /**< The beta = speed / c of the relative speed between the projectile and the target.*/
double m_relativeBeta = 0.0; /**< The beta = speed / c of the relative speed between the projectile and the target. */
double m_projectileEnergy = 0.0; /**< The energy of the projectile. */
SampledType m_sampledType = SampledType::uncorrelatedBody; /**< BRB */
Reaction const *m_reaction = nullptr; /**< The current reaction whose products are being sampled. */
double m_projectileMass = 0.0; /**< The mass of the projectile. */
@@ -182,7 +197,17 @@ class Input {
LUPI_HOST_DEVICE Input( bool a_wantVelocity, Upscatter::Model a_upscatterModel );
LUPI_HOST_DEVICE bool wantVelocity( ) const { return( m_wantVelocity ); } /**< BRB */
LUPI_HOST_DEVICE bool wantVelocity( ) const { return( m_wantVelocity ); } /**< Returns the value of the *m_wantVelocity* member. */
LUPI_HOST_DEVICE double temperature( ) const { return( m_temperature ); } /**< Returns the value of the *m_temperature* member. */
LUPI_HOST_DEVICE double energy( ) const { return( m_energy ); } /**< Returns the value of the *m_energy* member. */
LUPI_HOST_DEVICE void setTemperatureAndEnergy( double a_temperature, double a_energy );
LUPI_HOST_DEVICE bool dataInTargetFrame( ) const { return( m_dataInTargetFrame ); } /**< Returns the value of the *m_dataInTargetFrame*. */
LUPI_HOST_DEVICE double modelTemperature( ) const { return( m_modelTemperature ); } /**< Returns the value of the *m_dataInTargetFrame* member. */
LUPI_HOST_DEVICE double modelEnergy( ) const { return( m_modelEnergy ); } /**< Returns the value of the *m_modelEnergy* member. */
SampledType sampledType( ) const { return( m_sampledType ); } /**< Returns the value of the *m_sampledType* member. */
LUPI_HOST_DEVICE void setSampledType( SampledType a_sampledType ) { m_sampledType = a_sampledType; } /**< Sets the member *m_sampledType* to *a_sampledType*. */
};
/*
@@ -266,7 +291,7 @@ class StdVectorProductHandler : public ProductHandler {
LUPI_HOST_DEVICE ~StdVectorProductHandler( ) { }
LUPI_HOST_DEVICE std::size_t size( ) { return( m_products.size( ) ); }
LUPI_HOST_DEVICE Product &operator[]( long a_index ) { return( m_products[a_index] ); }
LUPI_HOST_DEVICE Product &operator[]( std::size_t a_index ) { return( m_products[a_index] ); }
LUPI_HOST_DEVICE std::vector<Product> &products( ) { return( m_products ); }
LUPI_HOST_DEVICE void push_back( Product &a_product ) { m_products.push_back( a_product ); }
LUPI_HOST_DEVICE void clear( ) { m_products.clear( ); }
@@ -109,9 +109,9 @@ class String
LUPI_HOST_DEVICE size_type capacity() const { return allocated_-1; }
// 8 byte alligned size
LUPI_HOST_DEVICE long internalSize() const {
long delta = allocated_;
long sub = delta % 8;
LUPI_HOST_DEVICE size_t internalSize() const {
size_t delta = allocated_;
size_t sub = delta % 8;
if (sub != 0) delta += (8-sub);
return delta * sizeof(char);
}
@@ -19,6 +19,8 @@
#include <typeinfo>
#include <fstream>
#include <exception>
#include <utility>
#include <stddef.h>
#include <LUPI.hpp>
#include <HAPI.hpp>
@@ -34,6 +36,12 @@ namespace PoPI {
#define PoPI_PoPsChars "PoPs"
#define PoPI_idChars "id"
#define PoPI_symbolChars "symbol"
#define PoPI_chemicalElementsChars "chemicalElements"
#define PoPI_chemicalElementChars "chemicalElement"
#define PoPI_isotopesChars "isotopes"
#define PoPI_isotopeChars "isotope"
#define PoPI_gaugeBosonChars "gaugeBoson"
#define PoPI_leptonChars "lepton"
#define PoPI_baryonChars "baryon"
@@ -132,19 +140,19 @@ class Database;
void appendXMLEnd( std::vector<std::string> &a_XMLList, std::string const &a_label );
int particleZ( Base const &a_particle, bool a_isNeutronProtonANucleon = false );
int particleZ( Database const &a_pops, int a_index, bool a_isNeutronProtonANucleon = false );
int particleZ( Database const &a_pops, std::size_t a_index, bool a_isNeutronProtonANucleon = false );
int particleZ( Database const &a_pops, std::string const &a_id, bool a_isNeutronProtonANucleon = false );
int particleA( Base const &a_particle, bool a_isNeutronProtonANucleon = false );
int particleA( Database const &a_pops, int a_index, bool a_isNeutronProtonANucleon = false );
int particleA( Database const &a_pops, std::size_t a_index, bool a_isNeutronProtonANucleon = false );
int particleA( Database const &a_pops, std::string const &a_id, bool a_isNeutronProtonANucleon = false );
int particleZA( Base const &a_particle, bool a_isNeutronProtonANucleon = false );
int particleZA( Database const &a_pops, int a_index, bool a_isNeutronProtonANucleon = false );
int particleZA( Database const &a_pops, std::size_t a_index, bool a_isNeutronProtonANucleon = false );
int particleZA( Database const &a_pops, std::string const &a_id, bool a_isNeutronProtonANucleon = false );
int particleMetaStableIndex( Base const &a_particle );
int particleMetaStableIndex( Database const &a_pops, int a_index );
int particleMetaStableIndex( Database const &a_pops, std::size_t a_index );
int particleMetaStableIndex( Database const &a_pops, std::string const &a_id );
std::string specialParticleID( SpecialParticleID_mode a_mode, std::string const &a_id );
@@ -311,7 +319,7 @@ class Suite {
void appendFromParentNode2( HAPI::Node const &a_node, T2 *a_parent );
std::string::size_type size( void ) const { return( m_items.size( ) ); } /**< Returns the number of items in the suite. */
T &operator[]( int a_index ) const { return( *m_items[a_index] ); } /**< Returns the item at index *a_index*. */
T &operator[]( std::size_t a_index ) const { return( *m_items[a_index] ); } /**< Returns the item at index *a_index*. */
std::string const &moniker( void ) { return( m_moniker ); } /**< Returns the value of the *m_moniker* member. */
void toXMLList( std::vector<std::string> &a_XMLList, std::string const &a_indent1 ) const ;
@@ -358,7 +366,7 @@ void Suite<T, T2>::appendFromParentNode( HAPI::Node const &a_node, Database *a_D
template <class T, class T2>
void Suite<T, T2>::appendFromParentNode2( HAPI::Node const &a_node, T2 *a_parent ) {
for( HAPI::Node child = a_node.first_child( ); !child.empty( ); child = child.next_sibling( ) ) {
for( HAPI::Node child = a_node.first_child( ); !child.empty( ); child.to_next_sibling( ) ) {
T *item = new T( child, a_parent );
m_items.push_back( item );
}
@@ -380,7 +388,7 @@ void Suite<T, T2>::toXMLList( std::vector<std::string> &a_XMLList, std::string c
if( _size == 0 ) return;
std::string header = a_indent1 + "<" + m_moniker + ">";
a_XMLList.push_back( header );
a_XMLList.push_back( std::move( header ) );
for( std::string::size_type i1 = 0; i1 < _size; ++i1 ) m_items[i1]->toXMLList( a_XMLList, indent2 );
appendXMLEnd( a_XMLList, m_moniker );
@@ -576,7 +584,7 @@ class NuclideGammaBranchStateInfo {
std::vector<NuclideGammaBranchInfo> m_branches;
public:
NuclideGammaBranchStateInfo( std::string a_state, int a_intid, std::string const &a_kind, double a_nuclearLevelEnergy );
NuclideGammaBranchStateInfo( std::string const &a_state, int a_intid, std::string const &a_kind, double a_nuclearLevelEnergy );
std::string const &state( ) const { return( m_state ); } /**< Returns the value of the *m_state* member. */
int intid( ) const { return( m_intid ); } /**< Returns the value of the *m_intid* member. */
@@ -631,7 +639,7 @@ class Base {
private:
std::string m_id; /**< The **PoPs** id for the particle or **PoPs** symbol for a chemicalElement or isotope. */
Particle_class m_class; /**< The **Particle_class** for the particle, chemicalElement or isotope. */
int m_index; /**< The for the particle, chemicalElement or isotope. */
std::size_t m_index; /**< The for the particle, chemicalElement or isotope. */
int m_intid; /**< The unique integer id for a particle or a meta-stable alias. For a non meta-stable alias, an isotope or chemical element, this is -1. */
void setIntid( int a_intid ) { m_intid = a_intid; } /**< Sets the value of the *m_intid* member to *a_intid*. */
@@ -642,8 +650,8 @@ class Base {
virtual ~Base( );
std::string const &ID( void ) const { return( m_id ); } /**< Returns a *const* reference to the *m_id* member of *this*. */
int index( void ) const { return( m_index ); } /**< Returns the value of the *m_index* member of *this*. */
void setIndex( int a_index ) { m_index = a_index; } /**< Sets the value of the *m_index* member of *this* to *a_index*. */
std::size_t index( void ) const { return( m_index ); } /**< Returns the value of the *m_index* member of *this*. */
void setIndex( std::size_t a_index ) { m_index = a_index; } /**< Sets the value of the *m_index* member of *this* to *a_index*. */
int intid( ) const { return( m_intid ); } /**< Returns the value of the *m_intid* member. */
Particle_class Class( void ) const { return( m_class ); } /**< Returns the value of the *m_class* member of *this*. */
virtual bool isParticle( ) const { return( true ); } /**< Returns **true** if *this* is a **Particle** and **false** it *this* is a **ChemicalElement** or **Isotope** instance. */
@@ -685,7 +693,7 @@ class IDBase : public Base {
IDBase( HAPI::Node const &a_node, Particle_class a_class );
virtual ~IDBase( ); // BRB This should be virtual but I cannot get it to work without crashing.
int addToDatabase( Database *a_DB );
std::size_t addToDatabase( Database *a_DB );
double massValue2( Database const &a_DB, std::string const &a_unit ) const ;
};
@@ -703,7 +711,7 @@ class SymbolBase : public Base {
std::string const &symbol( ) const { return( ID( ) ); } /**< Returns the value of the symbol. */
int addToSymbols( Database *a_DB );
std::size_t addToSymbols( Database *a_DB );
bool isParticle( ) const { return( false ); }
};
@@ -1079,15 +1087,15 @@ class Alias : public IDBase {
private:
std::string m_pid; /**< The id of the particle *this* is an alias for. */
int m_pidIndex; /**< The index of the particle with id *m_pid*. */
std::size_t m_pidIndex; /**< The index of the particle with id *m_pid*. */
public:
Alias( HAPI::Node const &a_node, Database *a_DB, Particle_class a_class = Particle_class::alias );
virtual ~Alias( );
std::string const &pid( void ) const { return( m_pid ); } /**< Returns a *const* reference to the *m_pid* member of *this*. */
int pidIndex( void ) const { return( m_pidIndex ); } /**< Returns a *const* reference to the *m_pidIndex* member of *this*. */
void setPidIndex( int a_index ) { m_pidIndex = a_index; } /**< Set the member *m_pidIndex* to *a_index*. */
std::size_t pidIndex( void ) const { return( m_pidIndex ); } /**< Returns a *const* reference to the *m_pidIndex* member of *this*. */
void setPidIndex( std::size_t a_index ) { m_pidIndex = a_index; } /**< Set the member *m_pidIndex* to *a_index*. */
void toXMLList( std::vector<std::string> &a_XMLList, std::string const &a_indent1 ) const ;
};
@@ -1124,11 +1132,11 @@ class Database {
std::string m_name; /**< The **GNDS** **name** of the first file read in. */
std::string m_version; /**< The **GNDS** **version** of the first file read in. */
ParticleList m_list; /**< The internal list of the particles. */
std::map<std::string, int> m_idsMap; // Be careful with this as a map[key] will add key if it is not in the map.
std::map<int, int> m_intidsMap; // Be careful with this as a map[key] will add key if it is not in the map.
std::map<std::string, std::size_t> m_idsMap; // Be careful with this as a map[key] will add key if it is not in the map.
std::map<int, std::size_t> m_intidsMap; // Be careful with this as a map[key] will add key if it is not in the map.
/**< This maps each particle id to a unique index. */
SymbolList m_symbolList; /**< The internal list of the symbols. */
std::map<std::string, int> m_symbolMap; // Be careful with this as a map[key] will add key if it is not in the map.
std::map<std::string, std::size_t> m_symbolMap; // Be careful with this as a map[key] will add key if it is not in the map.
/**< This maps each symbol to a unique index. */
std::vector<Alias *> m_unresolvedAliases; /**< This is used internally to store aliases when a **PoPs** node is being parsed as the aliases onde is parsed before the particles are parsed. */
@@ -1164,47 +1172,47 @@ class Database {
std::string::size_type size( void ) const { return( m_list.size( ) ); } /**< Returns the number of particle in *this*. */
ParticleList const &list( ) { return( m_list ); } /**< Returns a *const* *reference* to the *m_list* member. */
SymbolList const &symbolList( ) { return( m_symbolList ); } /**< Returns a *const* *reference* to the *m_symbolList* member. */
int operator[]( std::string const &a_id ) const ;
std::size_t operator[]( std::string const &a_id ) const ;
template<typename T> T const &get( std::string const &a_id ) const ;
template<typename T> T const &get( int a_index ) const ;
template<typename T> T const &get( std::size_t a_index ) const ;
Particle const &particle( std::string const &a_id ) const { return( get<Particle>( a_id ) ); } /**< Returns a *const* *reference* to the particle with id *a_id*. */
Particle const &particle( int a_index ) const { return( get<Particle>( a_index ) ); } /**< Returns a *const* *reference* to the particle with index *a_index*. */
Particle const &particle( std::size_t a_index ) const { return( get<Particle>( a_index ) ); } /**< Returns a *const* *reference* to the particle with index *a_index*. */
IDBase const &idBase( std::string const &a_id ) const { return( get<IDBase>( a_id ) ); } /**< Returns a *const* *reference* to a **IDBase** instance with id *a_id*. */
IDBase const &idBase( int &a_index ) const { return( get<IDBase>( a_index ) ); } /**< Returns a *const* *reference* to a **IDBase** instance with id *a_index*. */
IDBase const &idBase( std::size_t &a_index ) const { return( get<IDBase>( a_index ) ); } /**< Returns a *const* *reference* to a **IDBase** instance with id *a_index*. */
ParticleList const &particleList( ) const { return( m_list ); } /**< Returns a *const* *reference* to the *m_list* variable of *this*. */
SymbolList symbolList( ) const { return( m_symbolList ); } /**< Returns a *const* *reference* to the *m_symbolList* variable of *this*. */
bool exists( std::string const &a_id ) const ;
bool exists( int a_index ) const ;
bool exists( std::size_t a_index ) const ;
bool existsIntid( int a_intid ) const ;
Suite<ChemicalElement, Database> const &chemicalElements( ) const { return( m_chemicalElements ); }
/**< Returns a *const* *reference* to the *m_chemicalElements* variable of *this*. */
bool isParticle( std::string const &a_id ) const { return( get<Base>( a_id ).isParticle( ) ); } /**< Returns **true** if *a_id* is a particle and **false** otherwise. */
bool isParticle( int a_index ) const { return( m_list[a_index]->isParticle( ) ); } /**< Returns **true** if *a_index* is a particle and **false** otherwise. */
bool isParticle( std::size_t a_index ) const { return( m_list[a_index]->isParticle( ) ); } /**< Returns **true** if *a_index* is a particle and **false** otherwise. */
bool isAlias( std::string const &a_id ) const { return( get<Base>( a_id ).isAlias( ) ); } /**< Returns **true** if *a_id* is an alias and **false** otherwise. */
bool isAlias( int a_index ) const { return( m_list[a_index]->isAlias( ) ); } /**< Returns **true** if *a_index* is an alias and **false** otherwise. */
bool isAlias( std::size_t a_index ) const { return( m_list[a_index]->isAlias( ) ); } /**< Returns **true** if *a_index* is an alias and **false** otherwise. */
bool isMetaStableAlias( std::string const &a_id ) const { return( get<Base>( a_id ).isMetaStableAlias( ) ); }
/**< Returns **true** if *a_id* is a meta-stable and **false** otherwise. */
bool isMetaStableAlias( int a_index ) const { return( m_list[a_index]->isMetaStableAlias( ) ); }
bool isMetaStableAlias( std::size_t a_index ) const { return( m_list[a_index]->isMetaStableAlias( ) ); }
/**< Returns **true** if *a_index* is a meta-stable and **false** otherwise. */
std::vector<std::string> aliasReferences( std::string const &a_id );
std::string final( std::string const &a_id, bool a_returnAtMetaStableAlias = false ) const ;
int final( int a_index, bool a_returnAtMetaStableAlias = false ) const ;
std::size_t final( std::size_t a_index, bool a_returnAtMetaStableAlias = false ) const ;
std::string chemicalElementSymbol( std::string const &a_id ) const ;
std::string isotopeSymbol( std::string const &a_id ) const ;
int intid( std::string const &a_id ) const ;
int intid( int a_index ) const ;
int indexFromIntid( int a_intid ) const ;
int intid( std::size_t a_index ) const ;
std::size_t indexFromIntid( int a_intid ) const ;
int add( Base *a_item );
int addSymbol( SymbolBase *a_item );
std::size_t add( Base *a_item );
std::size_t addSymbol( SymbolBase *a_item );
void calculateNuclideGammaBranchStateInfos( NuclideGammaBranchStateInfos &a_nuclideGammaBranchStateInfos, Database const *a_pops2,
std::vector<std::string> a_extraGammaBranchStates ) const ;
std::vector<std::string> &a_extraGammaBranchStates ) const ;
void calculateNuclideGammaBranchStateInfos2( NuclideGammaBranchStateInfos &a_nuclideGammaBranchStateInfos ) const ;
double massValue( std::string const &a_id, std::string const &a_unit ) const ;
@@ -1222,7 +1230,7 @@ class Database {
* @return A *const* reference to the particle at index *a_index*.
***********************************************************************************************************/
template<typename T> T const &Database::get( int a_index ) const {
template<typename T> T const &Database::get( std::size_t a_index ) const {
Base *particle = m_list[a_index];
if( particle == nullptr ) throw std::range_error( std::string( "particle not in database" ) );
@@ -1242,7 +1250,7 @@ template<typename T> T const &Database::get( int a_index ) const {
template<typename T> T const &Database::get( std::string const &a_id ) const {
int index = (*this)[a_id];
auto index = (*this)[a_id];
Base *particle = m_list[index];
T const *object = dynamic_cast<T const *>( particle );
if( object == nullptr ) throw std::bad_cast( );
@@ -37,7 +37,10 @@ class Reaction {
std::vector<std::string> const &a_intermediates, std::string const &a_process, std::string const &reactionLabel,
std::string const &convarianceFlag );
bool isFission( ) const;
int multiplicity( std::string const &a_productId ) const;
void products( double a_energyMax, std::set<std::string> &a_products ) const ;
void printAsRIS_file( int a_labelWidth ) const ;
};
class Protare {
@@ -47,9 +50,10 @@ class Protare {
std::string m_projectile; /**< The PoPs id for the projectile. */
std::string m_target; /**< The PoPs id for the target. */
std::string m_evaluation; /**< The evaluation for the protare. */
std::string m_energyUnit; /**< The energy unit in the file for the protare. */
double m_energyConversionFactor; /**< Factor to convert from file energy units to user energy units. */
std::map<std::string, std::string> m_aliases; /**< The list of meta-stable aliases in the protare. */
std::vector<std::pair<std::string, std::string> > m_aliases; /**< The list of meta-stable aliases in the protare and the nuclide they alias. */
std::vector<Reaction *> m_reactions; /**< The list of **Reaction** instances for the protare. */
public:
@@ -60,15 +64,18 @@ class Protare {
std::string const &projectile( ) { return( m_projectile ); }
std::string const &target( ) { return( m_target ); }
std::string const &evaluation( ) { return( m_evaluation ); }
std::vector<Reaction *> const &reactions( ) const { return( m_reactions ); }
void Oops( std::vector<std::string> const &a_elements );
void addAlias( std::vector<std::string> const &a_elements );
bool fissionPresent( ) const;
void setAddingAliases( ) { m_addMode = 1; } /**< Tells **add** method to call the **addAlias** method. */
void addReaction( std::vector<std::string> const &a_elements );
void setAddingReactions( ) { m_addMode = 2; } /**< Tells **add** method to call the **addReaction** method. */
void add( std::vector<std::string> const &a_elements );
void products( Projectile const *a_projectile, int a_level, int a_maxLevel, double a_energyMax, std::map<std::string, int> &a_products ) const ;
void printAsRIS_file( ) const ;
};
class Target {
@@ -84,8 +91,11 @@ class Target {
~Target( );
void add( Protare *a_protare );
bool fissionPresent( ) const;
std::vector<Reaction *> const &reactions( ) const { return( m_protares[0]->reactions( ) ); }
void products( Projectile const *a_projectile, int a_level, int a_maxLevel, double a_energyMax, std::map<std::string, int> &a_products ) const ;
void print( std::string const &a_indent = "" ) const ;
void printAsRIS_file( ) const ;
};
class Projectile {
@@ -101,8 +111,13 @@ class Projectile {
~Projectile( );
void add( Protare *a_protare );
bool fissionPresent( std::vector<std::string> targetIds ) const;
std::vector<std::string> targetIds( ) const ;
void products( std::string const &a_target, int a_level, int a_maxLevel, double a_energyMax, std::map<std::string, int> &a_products ) const ;
std::vector<std::string> filterProducts( std::vector<std::string> const &a_productIds ) const ;
Target const *target( std::string const &a_targetName ) const;
void print( std::string const &a_indent = "" ) const ;
void printAsRIS_file( ) const ;
};
class Projectiles {
@@ -116,9 +131,12 @@ class Projectiles {
void add( Protare *a_protare );
void clear( );
std::vector<std::string> projectileIds( ) const ;
Projectile const *projectile( std::string const &a_projectile ) const ;
std::vector<std::string> products( std::string const &a_projectile, std::vector<std::string> const &a_seedTargets, int a_maxLevel,
double a_energyMax ) const ;
double a_energyMax, bool a_onlyIncludeTargets = true ) const ;
void print( std::string const &a_indent = "" ) const ;
void printAsRIS_file( ) const ;
};
void readRIS( std::string const &a_fileName, std::string const &a_energyUnit, Projectiles &a_projectiles );
@@ -1,5 +1,5 @@
#define G4GIDI_MAJOR 1
#define G4GIDI_MINOR 1
#define G4GIDI_PATCHLEVEL 13
#define G4GIDI_VERSION "1.1.13"
#define G4GIDI_GIT "62db2f9b95bcd850c8821e70db50c4c94874cc4d"
#define G4GIDI_PATCHLEVEL 22
#define G4GIDI_VERSION "1.1.22"
#define G4GIDI_GIT "67ec00868c75fdae76066418afc6c418eca69081"