17 if( order < 0 )
throw 1;
34 if( length != (
int) fluxes.size( ) )
throw 1;
35 initialize( order, length, &(energies[0]), &(fluxes[0]) );
49 if( order < 0 )
throw 1;
54 for(
int i1 = 0; i1 <
length; ++i1 )
mFluxes[i1] = fluxes[i1];
60 if (
this != &fluxOrder ) {
77 bool printIndent =
true;
80 std::cout <<
" ORDER: " <<
mOrder << std::endl;
81 for(
int iE = 0; iE <
nE; ++iE ) {
82 if( printIndent ) std::cout <<
" ";
86 if( ( ( iE + 1 ) % valuesPerLine ) == 0 ) {
87 std::cout << std::endl;
91 if( nE % valuesPerLine ) std::cout << std::endl;
124 if (
this != &flux ) {
161 std::cout <<
"FLUX: label = '" <<
mLabel <<
"': maximum order = " << (
size( ) + 1 ) << std::endl;
162 if( outline )
return;
163 for( std::vector<GIDI_settings_flux_order>::const_iterator iter =
mFluxOrders.begin( ); iter <
mFluxOrders.end( ); ++iter ) iter->print( valuesPerLine );
171 GIDI_settings_fluxes_from_bdfls::GIDI_settings_fluxes_from_bdfls( std::string
const &fileName,
double temperature_MeV = 0 ) {
173 initialize( fileName.c_str( ), temperature_MeV );
178 GIDI_settings_fluxes_from_bdfls::GIDI_settings_fluxes_from_bdfls(
char const *fileName,
double temperature_MeV = 0 ) {
185 GIDI_settings_fluxes_from_bdfls::GIDI_settings_fluxes_from_bdfls( cbdfls_file
const *bdfls,
double temperature_MeV = 0 ) {
187 initialize2( bdfls, temperature_MeV );
197 if( ( bdfls = cbdflsOpen( fileName, &Error ) ) == NULL )
throw Error;
198 initialize2( bdfls, temperature_MeV );
199 cbdflsRelease( bdfls );
204 void GIDI_settings_fluxes_from_bdfls::initialize2( cbdfls_file
const *bdfls,
double temperature_MeV ) {
206 int nf,
length, *fids, order;
207 double *energies, *fluxes;
210 nf = cbdflsFIDs( (cbdfls_file *) bdfls, &fids );
211 for(
int if1 = 0; if1 < nf; ++if1 ) {
212 sprintf( label,
"LLNL_fid_%.3d", fids[if1] );
214 order = cbdflsGetFluxOrder( (cbdfls_file *) bdfls, fids[if1] );
215 for(
int io = 0; io <= order; ++io ) {
216 length = cbdflsGetFlux( (cbdfls_file *) bdfls, fids[if1], io, &energies, &fluxes );
220 mFluxes.push_back( flux );
227 GIDI_settings_fluxes_from_bdfls::~GIDI_settings_fluxes_from_bdfls( ) {
237 sprintf( label,
"LLNL_fid_%.3d", fid );
238 for(
int if1 = 0; if1 < (
int) mFluxes.size( ); ++if1 ) {
239 if( mFluxes[if1].isLabel( label ) )
return( mFluxes[if1] );
246 std::vector<std::string> GIDI_settings_fluxes_from_bdfls::getLabels(
void ) {
248 int size = (
int) mFluxes.size( );
249 std::vector<std::string> labels( size );
251 for(
int if1 = 0; if1 < size; ++if1 ) labels[if1] = mFluxes[if1].getLabel( );
257 std::vector<int> GIDI_settings_fluxes_from_bdfls::getFIDs(
void ) {
259 int size = (
int) mFluxes.size( );
260 std::vector<int> fids( size );
263 for(
int if1 = 0; if1 < size; ++if1 ) {
264 fids[if1] = (
int) strtol( &(mFluxes[if1].getLabel( ).c_str( )[9]), &
e, 10 );
273 int nfs = (
int) mFluxes.size( );
275 std::cout <<
"BDFLS FLUXes: number of fluxes = " << nfs << std::endl;
276 for(
int if1 = 0; if1 < nfs ; ++if1 ) mFluxes[if1].
print( outline, valuesPerLine );