55 int intid = a_pops.
intid( a_id );
66 intid = 1000 * parseIdInfo.
Z( ) + parseIdInfo.
A( );
85 if( !a_pops.
exists( a_id ) )
return( -1 );
87 return(
static_cast<int>( a_pops[a_id] ) );
101 for( std::size_t i1 = 0; i1 < a_vector.
size( ); ++i1 ) vector[i1] = a_vector[i1];
129 if( a_particleBeta < 1e-4 )
return( 0.5 * a_mass_unitOfEnergy * a_particleBeta * a_particleBeta );
131 return( a_mass_unitOfEnergy * ( 1.0 / sqrt( 1.0 - a_particleBeta * a_particleBeta ) - 1.0 ) );
146 if( a_particleBeta2 < 1e-8 )
return( 0.5 * a_mass_unitOfEnergy * a_particleBeta2 );
148 return( a_mass_unitOfEnergy * ( 1.0 / sqrt( 1.0 - a_particleBeta2 ) - 1.0 ) );
163 double betaProjectile =
MCGIDI_particleBeta( a_massProjectile, a_kineticEnergyProjectile );
165 return( betaProjectile / ( 1.0 + a_massTarget / ( a_massProjectile + a_kineticEnergyProjectile ) ) );
186 double &a_muMinus,
double &a_JacobianMinus ) {
188 int numberOfSolutions = 0;
189 double boostBeta2 = a_boostBeta * a_boostBeta;
190 double productBeta2 = a_productBeta * a_productBeta;
191 double muLab2 = a_muLab * a_muLab;
192 double oneMinusMuLab2 = 1.0 - muLab2;
193 double oneMinusBoostBeta2 = 1.0 - boostBeta2;
194 double oneMinusBoostBeta2MuLab2 = 1.0 - boostBeta2 * muLab2;
199 if( ( a_productBeta == 0.0 ) || ( a_muLab == 1.0 ) )
return( 1 );
201 if( a_productBeta >= a_boostBeta ) {
202 numberOfSolutions = 1; }
204 if( a_muLab > 0.0 ) {
205 if( productBeta2 * oneMinusBoostBeta2MuLab2 > boostBeta2 * oneMinusMuLab2 ) numberOfSolutions = 2;
209 if( numberOfSolutions == 0 )
return( 0 );
211 double sqrt_b2minus4ac = sqrt( oneMinusBoostBeta2 * ( productBeta2 * oneMinusBoostBeta2MuLab2 - boostBeta2 * oneMinusMuLab2 ) );
212 double minusbTerm = a_boostBeta * oneMinusMuLab2;
213 double inv2a = 1.0 / ( a_productBeta * oneMinusBoostBeta2MuLab2 );
215 a_muPlus = ( a_muLab * sqrt_b2minus4ac - minusbTerm ) * inv2a;
216 a_muMinus = ( -a_muLab * sqrt_b2minus4ac - minusbTerm ) * inv2a;
218 double JacobianTerm1 = 2.0 * boostBeta2 * a_muLab / oneMinusBoostBeta2MuLab2;
219 double JacobianTerm2 = 2.0 * a_muLab * a_boostBeta / ( a_productBeta * oneMinusBoostBeta2MuLab2 );
220 double JacobianTerm3 = productBeta2 * ( 1.0 - 2.0 * boostBeta2 * muLab2 ) - boostBeta2 * ( 1.0 - 2.0 * muLab2 );
221 JacobianTerm3 *= oneMinusBoostBeta2 / ( a_productBeta * oneMinusBoostBeta2MuLab2 * sqrt_b2minus4ac );
223 a_JacobianPlus = fabs( a_muPlus * JacobianTerm1 + JacobianTerm2 + JacobianTerm3 );
224 a_JacobianMinus = fabs( a_muMinus * JacobianTerm1 + JacobianTerm2 - JacobianTerm3 );
226 return( numberOfSolutions );
240 int distributionType = 0;
244 distributionType = 0;
247 distributionType = 1;
250 distributionType = 2;
253 distributionType = 3;
256 distributionType = 4;
259 distributionType = 5;
262 distributionType = 6;
265 distributionType = 7;
268 distributionType = 8;
271 distributionType = 9;
274 distributionType = 10;
277 distributionType = 11;
280 distributionType = 12;
283 distributionType = 13;
286 distributionType = 14;
290 return( distributionType );
352 LUPI_THROW(
"intToDistributionType: unsupported distribution type." );
369 std::size_t vectorSize = a_products.
size( );
370 int vectorSizeInt = (int) vectorSize;
372 vectorSize = (std::size_t) vectorSizeInt;
376 for( std::size_t vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) {
382 a_products[vectorIndex] =
new Product;
390 for( std::size_t vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) {
391 a_products[vectorIndex]->serialize( a_buffer, a_mode );
406 std::size_t vectorSize = a_delayedNeutrons.
size( );
407 int vectorSizeInt = (int) vectorSize;
409 vectorSize = (std::size_t) vectorSizeInt;
413 for( std::size_t vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) {
427 for( std::size_t vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) {
428 a_delayedNeutrons[vectorIndex]->serialize( a_buffer, a_mode );
443 std::size_t vectorSize = a_Qs.
size( );
444 int vectorSizeInt = (int) vectorSize;
446 vectorSize = (std::size_t) vectorSizeInt;
454 for( std::size_t vectorIndex = 0; vectorIndex < vectorSize; ++vectorIndex ) {
470 int fissionResidualsInt = 0;
473 switch( a_fissionResiduals ) {
477 fissionResidualsInt = 1;
480 fissionResidualsInt = 2;
488 switch( fissionResidualsInt ) {
512 std::vector<double> vector( a_input.
size( ) );
514 std::size_t index = 0;
515 for(
auto iter = a_input.
begin( ); iter != a_input.
end( ); ++iter, ++index ) vector[index] = *iter;
530 std::vector<double> vector( a_input.
size( ) );
532 std::size_t index = 0;
533 for(
auto iter = a_input.
begin( ); iter != a_input.
end( ); ++iter, ++index ) vector[index] = *iter;
#define DATA_MEMBER_INT( member, buf, mode)
#define MCGIDI_particleBeta(a_mass_unitOfEnergy, a_kineticEnergy)
LUPI_HOST_DEVICE void incrementPlacement(std::size_t a_delta)
GIDI::ProtareSingle const & m_GIDI_protare
std::map< std::string, ACE_URR_probabilityTablesFromGIDI * > m_ACE_URR_probabilityTablesFromGIDI
GIDI::GRIN::GRIN_continuumGammas const * m_GRIN_continuumGammas
LUPI_HOST SetupInfo(ProtareSingle &a_protare, GIDI::ProtareSingle const &a_GIDI_protare, PoPI::Database const &a_popsUser, PoPI::Database const &a_pops)
PoPI::Database const & m_popsUser
ProtareSingle & m_protare
PoPI::Database const & m_pops
LUPI_HOST_DEVICE std::size_t internalSize() const
LUPI_HOST_DEVICE std::size_t size() const
LUPI_HOST_DEVICE iterator begin()
LUPI_HOST_DEVICE void resize(std::size_t s, char **address=nullptr, bool mem_flag=CPU_MEM)
LUPI_HOST_DEVICE iterator end()
bool exists(std::string const &a_id) const
int intid(std::string const &a_id) const
@ coherentPhotoAtomicScattering
@ incoherentPhotoAtomicScattering
@ incoherentPhotoAtomicScatteringElectron
@ incoherentBoundToFreePhotoAtomicScattering
Simple C++ string class, useful as replacement for std::string if this cannot be used,...
LUPI_HOST int MCGIDI_popsIntid(PoPI::Database const &a_pops, std::string const &a_ID)
LUPI_HOST void addVectorItemsToSet(Vector< int > const &a_from, std::set< int > &a_to)
LUPI_HOST_DEVICE double boostSpeed(double a_massProjectile, double a_kineticEnergyProjectile, double a_massTarget)
LUPI_HOST_DEVICE void serializeFissionResiduals(GIDI::Construction::FissionResiduals &a_fissionResiduals, LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE void serializeDelayedNeutrons(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Vector< DelayedNeutron * > &a_delayedNeutrons)
LUPI_HOST Vector< double > GIDI_VectorDoublesToMCGIDI_VectorDoubles(GIDI::Vector a_vector)
LUPI_HOST_DEVICE void serializeQs(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Vector< Functions::Function1d_d1 * > &a_Qs)
LUPI_HOST_DEVICE double particleKineticEnergy(double a_mass_unitOfEnergy, double a_particleBeta)
LUPI_HOST int MCGIDI_popsIndex(PoPI::Database const &a_pops, std::string const &a_ID)
LUPI_HOST_DEVICE void serializeProducts(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Vector< Product * > &a_products)
LUPI_HOST_DEVICE double particleKineticEnergyFromBeta2(double a_mass_unitOfEnergy, double a_particleBeta2)
LUPI_HOST std::vector< double > vectorToSTD_vector(Vector< double > a_input)
LUPI_HOST_DEVICE int distributionTypeToInt(Distributions::Type a_type)
LUPI_HOST_DEVICE int muCOM_From_muLab(double a_muLab, double a_boostBeta, double a_productBeta, double &a_muPlus, double &a_JacobianPlus, double &a_muMinus, double &a_JacobianMinus)
LUPI_HOST_DEVICE Functions::Function1d_d1 * serializeFunction1d_d1(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Functions::Function1d_d1 *a_function1d)
LUPI_HOST_DEVICE Distributions::Type intToDistributionType(int a_type)
static std::string const photon
static std::string const neutron
static std::string const FissionProductENDL99125
static std::string const FissionProductENDL99120
static int constexpr FissionProductENDL99120
static int constexpr photon
static int constexpr neutron
static int constexpr FissionProductENDL99125