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

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Functions::TerrellFissionNeutronMultiplicityModel:

Public Member Functions

LUPI_HOST_DEVICE TerrellFissionNeutronMultiplicityModel ()
LUPI_HOST TerrellFissionNeutronMultiplicityModel (double a_width, Function1d_d1 *a_multiplicity)
LUPI_HOST_DEVICE ~TerrellFissionNeutronMultiplicityModel ()
template<typename RNG>
LUPI_HOST_DEVICE int sampleBoundingInteger (double a_energy, RNG &&a_rng) const
LUPI_HOST_DEVICE double evaluate (double a_energy) const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
Public Member Functions inherited from MCGIDI::Functions::Function1d
LUPI_HOST_DEVICE Function1d ()
LUPI_HOST_DEVICE Function1d (double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
LUPI_HOST_DEVICE ~Function1d ()
LUPI_HOST_DEVICE Function1dType type () const
LUPI_HOST_DEVICE String typeString () const
template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION int sampleBoundingInteger (double a_x1, RNG &&a_rng) const
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate (double a_x1) const MCGIDI_TRUE_VIRTUAL
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
template<typename RNG>
LUPI_HOST_DEVICE int sampleBoundingInteger (double a_x1, RNG &&a_rng) const
Public Member Functions inherited from MCGIDI::Functions::FunctionBase
LUPI_HOST_DEVICE FunctionBase ()
LUPI_HOST FunctionBase (GIDI::Functions::FunctionForm const &a_function)
LUPI_HOST_DEVICE FunctionBase (int a_dimension, double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
virtual LUPI_HOST_DEVICE ~FunctionBase ()=0
LUPI_HOST_DEVICE Interpolation interpolation () const
LUPI_HOST_DEVICE double domainMin () const
LUPI_HOST_DEVICE double domainMax () const
LUPI_HOST_DEVICE double outerDomainValue () const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Additional Inherited Members

Protected Attributes inherited from MCGIDI::Functions::Function1d
Function1dType m_type

Detailed Description

Definition at line 243 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ TerrellFissionNeutronMultiplicityModel() [1/2]

LUPI_HOST_DEVICE MCGIDI::Functions::TerrellFissionNeutronMultiplicityModel::TerrellFissionNeutronMultiplicityModel ( )

Definition at line 818 of file MCGIDI_functions.cc.

818 :
819 m_width( 1.079 ),
820 m_multiplicity( nullptr ) {
821
823}

◆ TerrellFissionNeutronMultiplicityModel() [2/2]

LUPI_HOST MCGIDI::Functions::TerrellFissionNeutronMultiplicityModel::TerrellFissionNeutronMultiplicityModel ( double a_width,
Function1d_d1 * a_multiplicity )

Definition at line 828 of file MCGIDI_functions.cc.

828 :
829 Function1d( a_multiplicity->domainMin( ), a_multiplicity->domainMax( ), a_multiplicity->interpolation( ), a_multiplicity->outerDomainValue( ) ),
830 m_width( a_width ),
831 m_multiplicity( a_multiplicity ) {
832
834 if( a_width < 0.0 ) m_width = 1.079;
835}

◆ ~TerrellFissionNeutronMultiplicityModel()

LUPI_HOST_DEVICE MCGIDI::Functions::TerrellFissionNeutronMultiplicityModel::~TerrellFissionNeutronMultiplicityModel ( )

Definition at line 840 of file MCGIDI_functions.cc.

840 {
841
842 delete m_multiplicity;
843}

Member Function Documentation

◆ evaluate()

LUPI_HOST_DEVICE double MCGIDI::Functions::TerrellFissionNeutronMultiplicityModel::evaluate ( double a_energy) const

Evaluated the m_multiplicity function at energy a_energy.

Parameters
a_energy[in] The energy of the projectile.
Returns
The number of emitted, prompt neutrons.

Definition at line 853 of file MCGIDI_functions.cc.

853 {
854
855 return( m_multiplicity->evaluate( a_energy ) );
856}

◆ sampleBoundingInteger()

template<typename RNG>
LUPI_HOST_DEVICE int MCGIDI::Functions::TerrellFissionNeutronMultiplicityModel::sampleBoundingInteger ( double a_energy,
RNG && a_rng ) const

Sample the number of fission prompt neutrons using Terrell's modified Gaussian distribution. Method uses Red Cullen's algoritm (see UCRL-TR-222526).

Parameters
a_energy[in] The energy of the projectile.
a_rng[in] The random number generator function the uses a_rngState to generator a double in the range [0, 1.0).
a_rngState[in/out] The random number generator state.
Returns
The sampled number of emitted, prompt neutrons for fission.

Definition at line 1617 of file MCGIDI_headerSource.hpp.

1617 {
1618
1619 const double Terrell_BSHIFT = -0.43287;
1620 double width = M_SQRT2 * m_width;
1621 double temp1 = m_multiplicity->evaluate( a_energy ) + 0.5;
1622 double temp2 = temp1 / width;
1623 double expo = exp( -temp2 * temp2 );
1624 double cshift = temp1 + Terrell_BSHIFT * m_width * expo / ( 1.0 - expo );
1625
1626 double multiplicity = 1.0;
1627 do {
1628 double rw = sqrt( -log( a_rng( ) ) );
1629 double theta = ( 2.0 * M_PI ) * a_rng();
1630
1631 multiplicity = width * rw * cos( theta ) + cshift;
1632 } while ( multiplicity < 0.0 );
1633
1634 return( static_cast<int>( floor( multiplicity ) ) );
1635}
#define M_PI
Definition SbMath.h:33

◆ serialize()

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

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

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

Definition at line 866 of file MCGIDI_functions.cc.

866 {
867
868 Function1d::serialize( a_buffer, a_mode );
869 DATA_MEMBER_DOUBLE( m_width, a_buffer, a_mode );
870
871 m_multiplicity = serializeFunction1d_d1( a_buffer, a_mode, m_multiplicity );
872}
#define DATA_MEMBER_DOUBLE(member, buf, mode)
LUPI_HOST_DEVICE void serialize(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
LUPI_HOST_DEVICE Functions::Function1d_d1 * serializeFunction1d_d1(LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode, Functions::Function1d_d1 *a_function1d)

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