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

#include <GIDI.hpp>

Public Member Functions

 Groups_from_bdfls (std::string const &a_fileName)
 Groups_from_bdfls (char const *a_fileName)
 ~Groups_from_bdfls ()
MultiGroup viaLabel (std::string const &a_label) const
MultiGroup getViaGID (int a_gid) const
std::vector< std::string > labels () const
std::vector< int > GIDs () const
void print (bool a_outline=true, unsigned int a_valuesPerLine=10) const

Detailed Description

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

Definition at line 3515 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Groups_from_bdfls() [1/2]

GIDI::Transporting::Groups_from_bdfls::Groups_from_bdfls ( std::string const & a_fileName)

Reads in multi-group data from a bdfls file as a list of MultiGroup instances.

Parameters
a_fileName[in] The bdfls file name.

Definition at line 183 of file GIDI_settings_group.cc.

183 {
184
185 initialize( a_fileName.c_str( ) );
186}

◆ Groups_from_bdfls() [2/2]

GIDI::Transporting::Groups_from_bdfls::Groups_from_bdfls ( char const * a_fileName)

Reads in multi-group data from a bdfls file as a list of MultiGroup instances.

Parameters
a_fileName[in] The bdfls file name.

Definition at line 194 of file GIDI_settings_group.cc.

194 {
195
196 initialize( a_fileName );
197}

◆ ~Groups_from_bdfls()

GIDI::Transporting::Groups_from_bdfls::~Groups_from_bdfls ( )

Definition at line 248 of file GIDI_settings_group.cc.

248 {
249
250}

Member Function Documentation

◆ getViaGID()

MultiGroup GIDI::Transporting::Groups_from_bdfls::getViaGID ( int a_gid) const

Returns the MultiGroup whose gid is a_gid.

Parameters
a_gid[in] The bdfls gid.
Returns
Returns the MultiGroup whose label is a_label.

Definition at line 274 of file GIDI_settings_group.cc.

274 {
275
276 std::string label( LLNL_gidToLabel( a_gid ) );
277
278 return( viaLabel( label ) );
279}
MultiGroup viaLabel(std::string const &a_label) const
std::string LLNL_gidToLabel(int a_gid)
Definition GIDI_misc.cc:311

◆ GIDs()

std::vector< int > GIDI::Transporting::Groups_from_bdfls::GIDs ( ) const

Returns a list of gid's for all the MultiGroup's present in this.

Returns
The list of gid's.

Definition at line 302 of file GIDI_settings_group.cc.

302 {
303
304 std::size_t size = m_multiGroups.size( );
305 std::vector<int> fids( size );
306 char *e;
307
308 for( std::size_t if1 = 0; if1 < size; ++if1 ) {
309 fids[if1] = (int) strtol( &(m_multiGroups[if1].label( ).c_str( )[9]), &e, 10 );
310 }
311 return( fids );
312}

◆ labels()

std::vector< std::string > GIDI::Transporting::Groups_from_bdfls::labels ( ) const

Returns a list of label's for all the MultiGroup's present in this.

Returns
Returns the MultiGroup whose label is a_label.

Definition at line 287 of file GIDI_settings_group.cc.

287 {
288
289 std::size_t size = m_multiGroups.size( );
290 std::vector<std::string> _labels( size );
291
292 for( std::size_t if1 = 0; if1 < size; ++if1 ) _labels[if1] = m_multiGroups[if1].label( );
293 return( _labels );
294}

◆ print()

void GIDI::Transporting::Groups_from_bdfls::print ( bool a_outline = true,
unsigned int a_valuesPerLine = 10 ) const

Print each MultiGroup to std::cout in this. Mainly for debugging.

Parameters
a_outline[in] Passed to each MultiGroup print method.
a_valuesPerLine[in] Passed to each MultiGroup print method.

Definition at line 321 of file GIDI_settings_group.cc.

321 {
322
323 std::size_t ngs = m_multiGroups.size( );
324
325 std::cout << "BDFLS GROUPs: number of groups = " << ngs << std::endl;
326 for( std::size_t if1 = 0; if1 < ngs ; ++if1 ) m_multiGroups[if1].print( " ", a_outline, a_valuesPerLine );
327}
void print(bool a_outline=true, unsigned int a_valuesPerLine=10) const

Referenced by print().

◆ viaLabel()

MultiGroup GIDI::Transporting::Groups_from_bdfls::viaLabel ( std::string const & a_label) const

Returns the MultiGroup whose label is a_label.

Parameters
a_label[in] The label of the MultiGroup to return.
Returns
Returns the MultiGroup whose label is a_label.

Definition at line 259 of file GIDI_settings_group.cc.

259 {
260
261 for( std::size_t ig = 0; ig < m_multiGroups.size( ); ++ig ) {
262 if( m_multiGroups[ig].label( ) == a_label ) return( m_multiGroups[ig] );
263 }
264 throw Exception( "Groups_from_bdfls::viaLabel: label not found." );
265}

Referenced by getViaGID().


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