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

#include <GIDI.hpp>

Public Member Functions

 Fluxes_from_bdfls (std::string const &a_fileName, double a_temperature_MeV)
 Fluxes_from_bdfls (char const *a_fileName, double a_temperature_MeV)
 ~Fluxes_from_bdfls ()
Flux getViaFID (int a_fid) const
Functions::XYs3dget3dViaFID (int a_fid) const
std::vector< std::string > labels () const
std::vector< int > FIDs () const
void print (bool a_outline=true, unsigned int a_valuesPerLine=10) const

Detailed Description

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

Definition at line 3597 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Fluxes_from_bdfls() [1/2]

GIDI::Transporting::Fluxes_from_bdfls::Fluxes_from_bdfls ( std::string const & a_fileName,
double a_temperature_MeV = 0 )

Reads in fluxes from a bdfls file as a list of Flux instances.

Parameters
a_fileName[in] The bdfls file name.
a_temperature_MeV[in] The temperature to assign to the read fluxes.

Definition at line 224 of file GIDI_settings_flux.cc.

224 {
225
226 initialize( a_fileName.c_str( ), a_temperature_MeV );
227}

◆ Fluxes_from_bdfls() [2/2]

GIDI::Transporting::Fluxes_from_bdfls::Fluxes_from_bdfls ( char const * a_fileName,
double a_temperature_MeV = 0 )

Reads in fluxes from a bdfls file as a list of Flux instances.

Parameters
a_fileName[in] The bdfls file name.
a_temperature_MeV[in] The temperature to assign to the read fluxes.

Definition at line 236 of file GIDI_settings_flux.cc.

236 {
237
238 initialize( a_fileName, a_temperature_MeV );
239}

◆ ~Fluxes_from_bdfls()

GIDI::Transporting::Fluxes_from_bdfls::~Fluxes_from_bdfls ( )

Definition at line 324 of file GIDI_settings_flux.cc.

324 {
325
326}

Member Function Documentation

◆ FIDs()

std::vector< int > GIDI::Transporting::Fluxes_from_bdfls::FIDs ( ) const

Returns a list of integer fid for the Flux's read in from bdfls file.

Returns
The list of fid's.

Definition at line 402 of file GIDI_settings_flux.cc.

402 {
403
404 auto size = m_fluxes.size( );
405 std::vector<int> fids( size );
406 char *e;
407
408 for( std::size_t if1 = 0; if1 < size; ++if1 ) {
409 fids[if1] = (int) strtol( &(m_fluxes[if1].label( ).c_str( )[9]), &e, 10 );
410 }
411 return( fids );
412}

◆ get3dViaFID()

Functions::XYs3d * GIDI::Transporting::Fluxes_from_bdfls::get3dViaFID ( int a_fid) const

Returns the 3-d function flux f(T,E,mu) whose fid is a_fid. In f(T,E,mu), T is the temperature, E is the projectile'e energy and mu is the cos(theta) where theta is measured relative to the projectile velocity.

Parameters
a_fid[in] The fid of the Flux to return.
Returns
Returns the 3-d function flux f(T,E,mu).

Definition at line 353 of file GIDI_settings_flux.cc.

353 {
354
355 Flux flux = getViaFID( a_fid );
356
357 Axes axes;
358 axes.append( new Axis( 3, "temperature", "MeV/k" ) );
359 axes.append( new Axis( 2, "energy_in", "MeV" ) );
360 axes.append( new Axis( 1, "mu", "" ) );
361 axes.append( new Axis( 0, "flux", "1/s" ) );
362
363 Functions::XYs3d *xys3d = new Functions::XYs3d( axes, ptwXY_interpolationLinLin, 0, flux.temperature( ) );
364 Functions::XYs2d *xys2d = new Functions::XYs2d( axes, ptwXY_interpolationLinLin );
365
366 xys3d->setLabel( flux.label( ) );
367
368 std::vector<double> const &energies = flux[0].v_energies( );
369 for( std::size_t i1 = 0; i1 < energies.size( ); ++i1 ) {
370 Functions::Legendre1d *legendre1d = new Functions::Legendre1d( axes, 0, energies[i1] );
371 std::vector<double> &coefficients = legendre1d->coefficients( );
372
373 for( std::size_t i2 = 0; i2 < flux.size( ); ++i2 ) coefficients.push_back( flux[i2].fluxes( )[i1] );
374 xys2d->append( legendre1d );
375 }
376 xys3d->append( xys2d );
377
378 return( xys3d );
379}
@ ptwXY_interpolationLinLin
Definition ptwXY.h:37

◆ getViaFID()

Flux GIDI::Transporting::Fluxes_from_bdfls::getViaFID ( int a_fid) const

Returns the Flux instance whose fid is a_fid.

Parameters
a_fid[in] The fid of the Flux to return.
Returns
Returns the Flux whose fid is a_fid.

Definition at line 335 of file GIDI_settings_flux.cc.

335 {
336
337 std::string label( LLNL_fidToLabel( a_fid ) );
338
339 for( std::size_t if1 = 0; if1 < m_fluxes.size( ); ++if1 ) {
340 if( m_fluxes[if1].label( ) == label ) return( m_fluxes[if1] );
341 }
342 throw Exception( "Fluxes_from_bdfls::getViaFID: fid not found." );
343}
std::string LLNL_fidToLabel(int a_fid)
Definition GIDI_misc.cc:324

Referenced by get3dViaFID().

◆ labels()

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

Returns a list of fid strings (i.e., labels) for the Flux's read in from bdfls file.

Returns
The list of fid's.

Definition at line 387 of file GIDI_settings_flux.cc.

387 {
388
389 auto size = m_fluxes.size( );
390 std::vector<std::string> _labels( size );
391
392 for( std::size_t if1 = 0; if1 < size; ++if1 ) _labels[if1] = m_fluxes[if1].label( );
393 return( _labels );
394}

◆ print()

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

Print the list of Flux's to std::cout. Mainly for debugging.

Parameters
a_outline[in] Passed to other print methods.
a_valuesPerLine[in] Passed to other print methods.

Definition at line 421 of file GIDI_settings_flux.cc.

421 {
422
423 auto nfs = m_fluxes.size( );
424
425 std::cout << "BDFLS FLUXes: number of fluxes = " << nfs << std::endl;
426 for( std::size_t if1 = 0; if1 < nfs ; ++if1 ) m_fluxes[if1].print( " ", a_outline, a_valuesPerLine );
427}
void print(bool a_outline=true, unsigned int a_valuesPerLine=10) const

Referenced by print().


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