17 if( order < 0 )
throw 1;
32 int length = (
int) energies.size( );
34 if( length != (
int) fluxes.size( ) )
throw 1;
35 initialize( order, length, &(energies[0]), &(fluxes[0]) );
49 if( order < 0 )
throw 1;
53 for(
int i1 = 0; i1 < length; ++i1 )
mEnergies[i1] = energies[i1];
54 for(
int i1 = 0; i1 < length; ++i1 )
mFluxes[i1] = fluxes[i1];
68 bool printIndent =
true;
71 std::cout <<
" ORDER: " <<
mOrder << std::endl;
72 for(
int iE = 0; iE <
nE; ++iE ) {
73 if( printIndent ) std::cout <<
" ";
77 if( ( ( iE + 1 ) % valuesPerLine ) == 0 ) {
78 std::cout << std::endl;
82 if( nE % valuesPerLine ) std::cout << std::endl;
141 std::cout <<
"FLUX: label = '" <<
mLabel <<
"': maximum order = " << (
size( ) + 1 ) << std::endl;
142 if( outline )
return;
143 for( std::vector<GIDI_settings_flux_order>::const_iterator iter =
mFluxOrders.begin( ); iter <
mFluxOrders.end( ); ++iter ) iter->print( valuesPerLine );
151 GIDI_settings_fluxes_from_bdfls::GIDI_settings_fluxes_from_bdfls( std::string
const &fileName,
double temperature_MeV = 0 ) {
153 initialize( fileName.c_str( ), temperature_MeV );
158 GIDI_settings_fluxes_from_bdfls::GIDI_settings_fluxes_from_bdfls(
char const *fileName,
double temperature_MeV = 0 ) {
165 GIDI_settings_fluxes_from_bdfls::GIDI_settings_fluxes_from_bdfls( cbdfls_file
const *bdfls,
double temperature_MeV = 0 ) {
167 initialize2( bdfls, temperature_MeV );
177 if( ( bdfls = cbdflsOpen( fileName, &Error ) ) == NULL )
throw Error;
178 initialize2( bdfls, temperature_MeV );
179 cbdflsRelease( bdfls );
184 void GIDI_settings_fluxes_from_bdfls::initialize2( cbdfls_file
const *bdfls,
double temperature_MeV ) {
186 int nf, length, *fids, order;
187 double *energies, *fluxes;
190 nf = cbdflsFIDs( (cbdfls_file *) bdfls, &fids );
191 for(
int if1 = 0; if1 < nf; ++if1 ) {
192 sprintf( label,
"LLNL_fid_%.3d", fids[if1] );
194 order = cbdflsGetFluxOrder( (cbdfls_file *) bdfls, fids[if1] );
195 for(
int io = 0; io <= order; ++io ) {
196 length = cbdflsGetFlux( (cbdfls_file *) bdfls, fids[if1], io, &energies, &fluxes );
200 mFluxes.push_back( flux );
207 GIDI_settings_fluxes_from_bdfls::~GIDI_settings_fluxes_from_bdfls( ) {
217 sprintf( label,
"LLNL_fid_%.3d", fid );
218 for(
int if1 = 0; if1 < (
int) mFluxes.size( ); ++if1 ) {
219 if( mFluxes[if1].isLabel( label ) )
return( mFluxes[if1] );
226 std::vector<std::string> GIDI_settings_fluxes_from_bdfls::getLabels(
void ) {
228 int size = (
int) mFluxes.size( );
229 std::vector<std::string> labels( size );
231 for(
int if1 = 0; if1 < size; ++if1 ) labels[if1] = mFluxes[if1].getLabel( );
237 std::vector<int> GIDI_settings_fluxes_from_bdfls::getFIDs(
void ) {
239 int size = (
int) mFluxes.size( );
240 std::vector<int> fids( size );
243 for(
int if1 = 0; if1 < size; ++if1 ) {
244 fids[if1] = (
int) strtol( &(mFluxes[if1].getLabel( ).c_str( )[9]), &
e, 10 );
253 int nfs = (
int) mFluxes.size( );
255 std::cout <<
"BDFLS FLUXes: number of fluxes = " << nfs << std::endl;
256 for(
int if1 = 0; if1 < nfs ; ++if1 ) mFluxes[if1].
print( outline, valuesPerLine );
void print(G4double elem)
void print(int valuesPerLine=10) const
std::vector< GIDI_settings_flux_order > mFluxOrders
void print(bool outline=true, int valuesPerLine=10) const
GIDI_settings_flux_order(int order)
void initialize(int order, int length, double const *energies, double const *fluxes)
std::vector< double > mFluxes
void addFluxOrder(GIDI_settings_flux_order const &fluxOrder)
void initialize(Config const *const theConfig)
Initialize the clustering model based on the Config object.
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
GIDI_settings_flux(std::string const &label, double temperature_MeV)
~GIDI_settings_flux_order()
std::vector< double > mEnergies
GIDI_settings_flux_order const * operator[](int order) const
std::string getLabel() const