Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
MCGIDI_delayedNeutron.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#include "MCGIDI.hpp"
11
12namespace MCGIDI {
13
14/*! \class DelayedNeutron
15 * This class represents a **GNDS** <**DelayedNeutron**> node.
16 */
17
18/* *********************************************************************************************************//**
19 * Default constructor used when broadcasting a Protare as needed by MPI or GPUs.
20 ***********************************************************************************************************/
21
23 m_delayedNeutronIndex( -1 ),
24 m_rate( 0.0 ),
25 m_product( ) {
26
27}
28
29/* *********************************************************************************************************//**
30 * @param a_index [in] Fix me.
31 * @param a_delayedNeutron [in] The GIDI::DelayedNeutron whose data is to be used to construct *this*.
32 * @param a_setupInfo [in] Used internally when constructing a Protare to pass information to other constructors.
33 * @param a_settings [in] Used to pass user options to the *this* to instruct it which data are desired.
34 * @param a_particles [in] List of transporting particles and their information (e.g., multi-group boundaries and fluxes).
35 ***********************************************************************************************************/
36
37LUPI_HOST DelayedNeutron::DelayedNeutron( int a_index, GIDI::DelayedNeutron const *a_delayedNeutron, SetupInfo &a_setupInfo,
38 Transporting::MC const &a_settings, GIDI::Transporting::Particles const &a_particles ) :
39 m_delayedNeutronIndex( a_index ),
40 m_rate( 0.0 ),
41 m_product( &a_delayedNeutron->product( ), a_setupInfo, a_settings, a_particles, false ) {
42
43 GIDI::PhysicalQuantity const *rate = a_delayedNeutron->rate( ).get<GIDI::PhysicalQuantity>( 0 );
44 m_rate = rate->value( );
45}
46
47/* *********************************************************************************************************//**
48 ***********************************************************************************************************/
49
53
54/* *********************************************************************************************************//**
55 * Updates the m_userParticleIndex to *a_userParticleIndex* for all particles with PoPs index *a_particleIndex*.
56 *
57 * @param a_particleIndex [in] The PoPs index of the particle whose user index is to be set.
58 * @param a_userParticleIndex [in] The particle index specified by the user.
59 ***********************************************************************************************************/
60
61LUPI_HOST void DelayedNeutron::setUserParticleIndex( int a_particleIndex, int a_userParticleIndex ) {
62
63 m_product.setUserParticleIndex( a_particleIndex, a_userParticleIndex );
64}
65
66/* *********************************************************************************************************//**
67 * Updates the m_userParticleIndex to *a_userParticleIndex* for all particles with PoPs intid *a_particleIntid*.
68 *
69 * @param a_particleIndex [in] The PoPs intid of the particle whose user index is to be set.
70 * @param a_userParticleIndex [in] The particle index specified by the user.
71 ***********************************************************************************************************/
72
73LUPI_HOST void DelayedNeutron::setUserParticleIndexViaIntid( int a_particleIntid, int a_userParticleIndex ) {
74
75 m_product.setUserParticleIndexViaIntid( a_particleIntid, a_userParticleIndex );
76}
77
78/* *********************************************************************************************************//**
79 * This method serializes *this* for broadcasting as needed for MPI and GPUs. The method can count the number of required
80 * bytes, pack *this* or unpack *this* depending on *a_mode*.
81 *
82 * @param a_buffer [in] The buffer to read or write data to depending on *a_mode*.
83 * @param a_mode [in] Specifies the action of this method.
84 ***********************************************************************************************************/
85
87
88 DATA_MEMBER_INT( m_delayedNeutronIndex, a_buffer, a_mode );
89 DATA_MEMBER_DOUBLE( m_rate, a_buffer, a_mode );
90 m_product.serialize( a_buffer, a_mode );
91}
92
93}
#define DATA_MEMBER_DOUBLE(member, buf, mode)
#define DATA_MEMBER_INT( member, buf, mode)
#define LUPI_HOST_DEVICE
#define LUPI_HOST
LUPI_HOST_DEVICE double rate() const
Definition MCGIDI.hpp:1259
LUPI_HOST void setUserParticleIndex(int a_particleIndex, int a_userParticleIndex)
LUPI_HOST_DEVICE DelayedNeutron()
LUPI_HOST void setUserParticleIndexViaIntid(int a_particleIntid, int a_userParticleIndex)
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE Product const & product() const
Definition MCGIDI.hpp:1260
LUPI_HOST_DEVICE ~DelayedNeutron()
Simple C++ string class, useful as replacement for std::string if this cannot be used,...
Definition MCGIDI.hpp:43