Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI::Transporting::MultiGroup Class Reference

#include <GIDI.hpp>

Public Member Functions

 MultiGroup ()
 MultiGroup (std::string const &a_label, int a_length, double const *a_values)
 MultiGroup (std::string const &a_label, std::vector< double > const &a_boundaries)
 MultiGroup (Group const &a_group)
 MultiGroup (MultiGroup const &a_multiGroup)
 ~MultiGroup ()
MultiGroupoperator= (MultiGroup const &a_rhs)
double operator[] (std::size_t const a_index) const
std::size_t size () const
std::size_t numberOfGroups () const
std::vector< double > const & boundaries () const
double const * pointer () const
void set (std::string const &a_label, std::vector< double > const &a_boundaries)
std::string const & label () const
int multiGroupIndexFromEnergy (double a_energy, bool a_encloseOutOfRange) const
void print (std::string const &a_indent, bool a_outline=false, unsigned int a_valuesPerLine=10) const

Detailed Description

Specifies the flux data for a specified Legendre order (see class Flux).

Definition at line 3483 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ MultiGroup() [1/5]

GIDI::Transporting::MultiGroup::MultiGroup ( )

Definition at line 27 of file GIDI_settings_group.cc.

27 {
28
29}

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

◆ MultiGroup() [2/5]

GIDI::Transporting::MultiGroup::MultiGroup ( std::string const & a_label,
int a_length,
double const * a_boundaries )
Parameters
a_label[in] The label for the MultiGroup.
a_length[in] The number of boundaries values.
a_boundaries[in] The list of boundaries.

Definition at line 37 of file GIDI_settings_group.cc.

37 :
38 m_label( a_label ) {
39
40 for( int i1 = 0; i1 < a_length; ++i1 ) m_boundaries.push_back( a_boundaries[i1] );
41}

◆ MultiGroup() [3/5]

GIDI::Transporting::MultiGroup::MultiGroup ( std::string const & a_label,
std::vector< double > const & a_boundaries )
Parameters
a_label[in] The label for the MultiGroup.
a_boundaries[in] The list of boundaries.

Definition at line 48 of file GIDI_settings_group.cc.

48 :
49 m_label( a_label ),
50 m_boundaries( a_boundaries ) {
51
52}

◆ MultiGroup() [4/5]

GIDI::Transporting::MultiGroup::MultiGroup ( Group const & a_group)
Parameters
a_group[in] The Group used to set this.

Definition at line 58 of file GIDI_settings_group.cc.

58 :
59 m_label( a_group.label( ) ),
60 m_boundaries( a_group.data( ) ) {
61
62}

◆ MultiGroup() [5/5]

GIDI::Transporting::MultiGroup::MultiGroup ( MultiGroup const & a_multiGroup)
Parameters
a_multiGroup[in] The MultiGroup instance to copy.

Definition at line 68 of file GIDI_settings_group.cc.

68 :
69 m_label( a_multiGroup.label( ) ),
70 m_boundaries( a_multiGroup.boundaries( ) ) {
71
72}

◆ ~MultiGroup()

GIDI::Transporting::MultiGroup::~MultiGroup ( )

Definition at line 77 of file GIDI_settings_group.cc.

77 {
78
79}

Member Function Documentation

◆ boundaries()

std::vector< double > const & GIDI::Transporting::MultiGroup::boundaries ( ) const
inline

Returns the value of the m_boundaries member.

Definition at line 3501 of file GIDI.hpp.

Referenced by MultiGroup(), MCGIDI::MultiGroupHash::MultiGroupHash(), GIDI::multiGroupXYs1d(), and operator=().

◆ label()

std::string const & GIDI::Transporting::MultiGroup::label ( ) const
inline

Returns the value of the m_label member.

Definition at line 3505 of file GIDI.hpp.

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

◆ multiGroupIndexFromEnergy()

int GIDI::Transporting::MultiGroup::multiGroupIndexFromEnergy ( double a_energy,
bool a_encloseOutOfRange ) const

Returns the multi-group index whose boundaries enclose a_energy. If a_encloseOutOfRange is true and a_energy is below the lowest boundary, 0 is returned, otherwise -2 is returned. If a_encloseOutOfRange is true and a_energy is above the highest boundary, the last multi-group index is returned, otherwise -1 is returned.

Parameters
a_energy[in] The energy of the whose index is to be returned.
a_encloseOutOfRangeDetermines the action if energy is below or above the domain of the boundaries.
Returns
The index whose boundaries enclose a_energy.

Definition at line 109 of file GIDI_settings_group.cc.

109 {
110
111 std::size_t iMin = 0, iMid, iMax = m_boundaries.size( ), iMaxM1 = iMax - 1;
112
113 if( iMax == 0 ) return( -3 );
114 if( a_energy < m_boundaries[0] ) {
115 if( a_encloseOutOfRange ) return( 0 );
116 return( -2 );
117 }
118 if( a_energy > m_boundaries[iMaxM1] ) {
119 if( a_encloseOutOfRange ) return( static_cast<int>( iMax ) - 2 );
120 return( -1 );
121 }
122 while( 1 ) {
123 iMid = ( iMin + iMax ) >> 1;
124 if( iMid == iMin ) break;
125 if( a_energy < m_boundaries[iMid] ) {
126 iMax = iMid; }
127 else {
128 iMin = iMid;
129 }
130 }
131 if( iMin == iMaxM1 ) iMin--;
132 return( static_cast<int>( iMin ) );
133}

◆ numberOfGroups()

std::size_t GIDI::Transporting::MultiGroup::numberOfGroups ( ) const
inline

Returns the number of multi-group groups.

Definition at line 3500 of file GIDI.hpp.

Referenced by GIDI::Transporting::Settings::multiGroupZeroMatrix(), and GIDI::Transporting::Settings::multiGroupZeroVector().

◆ operator=()

MultiGroup & GIDI::Transporting::MultiGroup::operator= ( MultiGroup const & a_rhs)

The assignment operator. This method sets the members of this to those of a_rhs.

Parameters
a_rhs[in] Instance whose member are used to set the members of this.
Returns
A reference to the updated MultiGroup instance.

Definition at line 89 of file GIDI_settings_group.cc.

89 {
90
91 if( this != &a_rhs ) {
92 m_label = a_rhs.label( );
93 m_boundaries = a_rhs.boundaries( );
94 }
95
96 return( *this );
97}

◆ operator[]()

double GIDI::Transporting::MultiGroup::operator[] ( std::size_t const a_index) const
inline

Returns the multi-group boundary at index a_index.

Definition at line 3498 of file GIDI.hpp.

◆ pointer()

double const * GIDI::Transporting::MultiGroup::pointer ( ) const
inline

Returns a pointer to the beginning of the multi-group boundaries.

Definition at line 3502 of file GIDI.hpp.

◆ print()

void GIDI::Transporting::MultiGroup::print ( std::string const & a_indent,
bool a_outline = false,
unsigned int a_valuesPerLine = 10 ) const

Print the MultiGroup to std::cout. Mainly for debugging.

Parameters
a_indent[in] The std::string to print at the beginning.
a_outline[in] If true, does not print the flux values.
a_valuesPerLine[in] The number of points (i.e., energy, flux pairs) to print per line.

Definition at line 154 of file GIDI_settings_group.cc.

154 {
155
156 std::size_t nbs = size( );
157 bool printIndent( true );
158
159 std::cout << a_indent << "GROUP: label = '" << m_label << "': length = " << nbs << std::endl;
160 if( a_outline ) return;
161 for( std::size_t ib = 0; ib < nbs; ib++ ) {
162 if( printIndent ) std::cout << a_indent;
163 printIndent = false;
164 std::cout << LUPI::Misc::argumentsToString( "%16.8e", m_boundaries[ib] );
165 if( ( ( ib + 1 ) % a_valuesPerLine ) == 0 ) {
166 std::cout << std::endl;
167 printIndent = true;
168 }
169 }
170 if( nbs % a_valuesPerLine ) std::cout << std::endl;
171}
std::size_t size() const
Definition GIDI.hpp:3499
std::string argumentsToString(char const *a_format,...)
Definition LUPI_misc.cc:305

◆ set()

void GIDI::Transporting::MultiGroup::set ( std::string const & a_label,
std::vector< double > const & a_boundaries )
Parameters
a_label[in] The label for this.
a_boundaries[in] The boundaries to set this to.

Definition at line 140 of file GIDI_settings_group.cc.

140 {
141
142 m_label = a_label;
143 m_boundaries = a_boundaries;
144}

◆ size()

std::size_t GIDI::Transporting::MultiGroup::size ( ) const
inline

Returns the number of multi-group boundaries.

Definition at line 3499 of file GIDI.hpp.

Referenced by multiGroupIndexFromEnergy(), and print().


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