47 std::vector<URR_protareInfo> URR_protareInfo_1;
49 for( std::size_t i1 = 0; i1 < a_protares.
size( ); ++i1 ) {
50 Protare *protare = a_protares[i1];
52 for( std::size_t i2 = 0; i2 < protare->numberOfProtares( ); ++i2 ) {
56 protareSingle->
setURR_index(
static_cast<int>( URR_protareInfo_1.size( ) ) );
62 m_URR_protareInfos.reserve( URR_protareInfo_1.size( ) );
63 m_URR_protareInfos.clear( );
64 for( std::size_t i1 = 0; i1 < URR_protareInfo_1.size( ); ++i1 ) m_URR_protareInfos.push_back( URR_protareInfo_1[i1] );
77 std::size_t vectorSize = m_URR_protareInfos.size( );
78 int vectorSizeInt = (int) vectorSize;
80 vectorSize = (std::size_t) vectorSizeInt;
84 for( std::size_t vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) {
85 m_URR_protareInfos[vectorIndex].serialize( a_buffer, a_mode );
109 std::vector<double>
const &a_crossSection ) :
115 for( std::size_t index = 0; index <
m_propabilities.size( ); ++index ) {
141 std::size_t index =
static_cast<std::size_t
>( intIndex );
211 if(
m_energies.size( ) ==
capacity( ) )
LUPI_THROW(
"ACE_URR_probabilityTables::addEnergyData: adding too many ACE_URR_probabilityTables." );
229 std::size_t index_t = (std::size_t) index;
254 for( std::size_t vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) {
268 ACE_URR_probabilityTable1->
serialize( a_buffer, a_mode );
287 int64_t numberConverted;
291 bool needToInitialize(
true );
292 std::map<std::size_t, std::string> columnNames;
297 for(
auto incidentEnergyIter = incidentEnergies.begin( ); incidentEnergyIter != incidentEnergies.end( ); ++incidentEnergyIter ) {
300 std::size_t numberOfRows =
static_cast<std::size_t
>( table.rows( ) );
301 std::size_t numberOfColumns =
static_cast<std::size_t
>( table.columns( ) );
303 std::size_t columnIndex = 0;
304 for(
auto columnHeaderIter = table.columnHeaders( ).begin( ); columnHeaderIter != table.columnHeaders( ).end( ); ++columnHeaderIter ) {
306 if( needToInitialize && columnIndex > 0 ) {
309 columnNames[columnIndex] = columnHeader->
name( );
313 needToInitialize =
false;
317 std::string
const &body = data.
body( );
318 char const *text = body.c_str( );
320 if( dValues ==
nullptr )
throw GIDI::Exception(
"convertACE_URR_probabilityTablesFromGIDI: nfu_stringToListOfDoubles failed." );
322 std::vector<std::vector<double> > columns( numberOfColumns );
323 for( columnIndex = 0; columnIndex < numberOfColumns; ++columnIndex ) {
324 columns[columnIndex].reserve( numberOfRows );
325 for( std::size_t rowIndex = 0; rowIndex < numberOfRows; ++rowIndex ) columns[columnIndex].push_back( dValues[rowIndex*numberOfColumns+columnIndex] );
329 for( columnIndex = 1; columnIndex < numberOfColumns; ++columnIndex ) {
352 switch( a_URR_mode ) {
383 if( a_ACE_URR_probabilityTables !=
nullptr ) type = 1;
385 if( type == 0 )
return(
nullptr );
398 a_ACE_URR_probabilityTables->
serialize( a_buffer, a_mode );
400 return( a_ACE_URR_probabilityTables );
#define DATA_MEMBER_CAST(member, buf, mode, someType)
#define DATA_MEMBER_VECTOR_DOUBLE(member, buf, mode)
#define DATA_MEMBER_DOUBLE(member, buf, mode)
#define DATA_MEMBER_INT( member, buf, mode)
Table::Table const & table() const
std::vector< IncidentEnergy * > Forms
Suite const & ACE_URR_probabilityTables() const
std::string const & name() const
std::string const & body() const
std::string const & sep() const
LUPI_HOST_DEVICE void incrementPlacement(std::size_t a_delta)
LUPI_HOST_DEVICE double energy() const
LUPI_HOST_DEVICE ~ACE_URR_probabilityTable()
Vector< double > m_propabilities
Vector< double > m_crossSections
LUPI_HOST_DEVICE double sample(double a_rng_Value)
LUPI_HOST_DEVICE ACE_URR_probabilityTable()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST ACE_URR_probabilityTablesFromGIDI()
LUPI_HOST ~ACE_URR_probabilityTablesFromGIDI()
std::map< std::string, ACE_URR_probabilityTables * > m_ACE_URR_probabilityTables
LUPI_HOST_DEVICE void reserve(std::size_t a_capacity)
Vector< ACE_URR_probabilityTable * > m_ACE_URR_probabilityTables
LUPI_HOST_DEVICE void push_back(ACE_URR_probabilityTable *a_ACE_URR_probabilityTable)
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE ACE_URR_probabilityTables()
LUPI_HOST_DEVICE std::size_t capacity() const
LUPI_HOST_DEVICE ~ACE_URR_probabilityTables()
LUPI_HOST_DEVICE double sample(double a_energy, double a_rng_Value)
Vector< double > m_energies
LUPI_HOST_DEVICE void setURR_index(int a_URR_index)
LUPI_HOST_DEVICE bool hasURR_probabilityTables() const
std::map< std::string, ACE_URR_probabilityTablesFromGIDI * > m_ACE_URR_probabilityTablesFromGIDI
LUPI_HOST URR_mode _URR_mode() const
LUPI_HOST LookupMode::Data1d crossSectionLookupMode() const
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE URR_protareInfos()
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST void setup(Vector< Protare * > &a_protares)
LUPI_HOST_DEVICE std::size_t size() const
@ ACE_URR_probabilityTables
Simple C++ string class, useful as replacement for std::string if this cannot be used,...
LUPI_HOST_DEVICE ACE_URR_probabilityTables * serializeACE_URR_probabilityTables(ACE_URR_probabilityTables *a_ACE_URR_probabilityTables, LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE Transporting::URR_mode serializeURR_mode(Transporting::URR_mode a_URR_mode, LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE int binarySearchVector(double a_x, Vector< double > const &a_Xs, bool a_boundIndex=false)
LUPI_HOST void convertACE_URR_probabilityTablesFromGIDI(GIDI::ProtareSingle const &a_protare, Transporting::MC &a_settings, SetupInfo &a_setupInfo)
double * nfu_stringToListOfDoubles(statusMessageReporting *smr, char const *str, char sep, int64_t *numberConverted, char **endCharacter, int useSystem_strtod)