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

#include <MCGIDI.hpp>

Public Member Functions

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 MultiGroupHashoperator= (MultiGroupHash const &a_rhs)=default
LUPI_HOST_DEVICE Vector< double > const & boundaries () const
LUPI_HOST_DEVICE std::size_t index (double a_domain) const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Detailed Description

This class stores a multi-group boundaries and has a method index that returns an index of the group for the requested domain value.

Definition at line 388 of file MCGIDI.hpp.

Constructor & Destructor Documentation

◆ MultiGroupHash() [1/6]

LUPI_HOST_DEVICE MCGIDI::MultiGroupHash::MultiGroupHash ( )

Definition at line 155 of file MCGIDI_domainHash.cc.

155 {
156
157}

Referenced by MultiGroupHash(), and operator=().

◆ MultiGroupHash() [2/6]

LUPI_HOST MCGIDI::MultiGroupHash::MultiGroupHash ( std::vector< double > a_boundaries)
Parameters
a_boundaries[in] The list of multi-group boundaries.

Definition at line 163 of file MCGIDI_domainHash.cc.

163 :
164 m_boundaries( a_boundaries ) {
165
166}

◆ MultiGroupHash() [3/6]

LUPI_HOST_DEVICE MCGIDI::MultiGroupHash::MultiGroupHash ( Vector< double > a_boundaries)
Parameters
a_boundaries[in] The list of multi-group boundaries.

Definition at line 172 of file MCGIDI_domainHash.cc.

172 :
173 m_boundaries( a_boundaries ) {
174
175}

◆ MultiGroupHash() [4/6]

LUPI_HOST MCGIDI::MultiGroupHash::MultiGroupHash ( GIDI::Protare const & a_protare,
GIDI::Styles::TemperatureInfo const & a_temperatureInfo,
std::string const & a_particleID = "" )

This constructor gets the list of multi-group boundaries from the first GIDI::Styles::MultiGroup of a_protare. It calls MultiGroupHash::initialize to set up this.

Parameters
a_protare[in] The GIDI::Protare containing the GIDI::Styles::MultiGroup style.
a_temperatureInfo[in] This is used to determine the multi-group boundaries.
a_particleID[in] The PoPs' id of the particle whose multi-group boundaries are desired.

Definition at line 186 of file MCGIDI_domainHash.cc.

186 {
187
188 initialize( a_protare, a_temperatureInfo, a_particleID );
189}

◆ MultiGroupHash() [5/6]

LUPI_HOST MCGIDI::MultiGroupHash::MultiGroupHash ( GIDI::Protare const & a_protare,
GIDI::Transporting::Particles const & a_particles )

This constructor gets the list of multi-group boundaries from the GIDI::Particle of a_particles that is the projectile.

Parameters
a_protare[in] The GIDI::Protare containing the GIDI::Styles::MultiGroup style.
a_particles[in] The list of transportable particles.

Definition at line 198 of file MCGIDI_domainHash.cc.

198 {
199
200 GIDI::Transporting::Particle const &particle = *a_particles.particle( a_protare.projectile( ).pid( ) );
201
202 m_boundaries = particle.multiGroup( ).boundaries( );
203}
std::vector< double > const & boundaries() const
Definition GIDI.hpp:3501
MultiGroup multiGroup() const
Definition GIDI.hpp:3668

◆ MultiGroupHash() [6/6]

LUPI_HOST MCGIDI::MultiGroupHash::MultiGroupHash ( MultiGroupHash const & a_multiGroupHash)

This constructor gets the list of multi-group boundaries from the GIDI::Particle of a_particles that is the projectile.

Parameters
a_protare[in] The GIDI::Protare containing the GIDI::Styles::MultiGroup style.
a_particles[in] The list of transportable particles.

Definition at line 212 of file MCGIDI_domainHash.cc.

212 :
213 m_boundaries( a_multiGroupHash.boundaries( ) ) {
214
215}

Member Function Documentation

◆ boundaries()

LUPI_HOST_DEVICE Vector< double > const & MCGIDI::MultiGroupHash::boundaries ( ) const
inline

Returns a reference to m_styles.

Definition at line 404 of file MCGIDI.hpp.

Referenced by MultiGroupHash().

◆ index()

LUPI_HOST_DEVICE std::size_t MCGIDI::MultiGroupHash::index ( double a_domain) const
inline

Definition at line 405 of file MCGIDI.hpp.

405 {
406 int _index = binarySearchVector( a_domain, m_boundaries );
407
408 if( _index == -2 ) return( 0 );
409 if( _index == -1 ) return( m_boundaries.size( ) - 2 );
410 return( static_cast<std::size_t>( _index ) );
411 }
LUPI_HOST_DEVICE int binarySearchVector(double a_x, Vector< double > const &a_Xs, bool a_boundIndex=false)
Definition MCGIDI.hpp:318

◆ operator=()

LUPI_HOST MultiGroupHash & MCGIDI::MultiGroupHash::operator= ( MultiGroupHash const & a_rhs)
default

◆ serialize()

LUPI_HOST_DEVICE void MCGIDI::MultiGroupHash::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 243 of file MCGIDI_domainHash.cc.

243 {
244
245 DATA_MEMBER_VECTOR_DOUBLE( m_boundaries, a_buffer, a_mode );
246}
#define DATA_MEMBER_VECTOR_DOUBLE(member, buf, mode)

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