25 initialize( particle.mPoPId, particle.mTransporting, particle.mEnergyMode );
27 for( std::vector<GIDI_settings_processedFlux>::const_iterator iter = particle.mProcessedFluxes.begin( ); iter != particle.mProcessedFluxes.end( ); ++iter ) {
28 mProcessedFluxes.push_back( *iter );
37 mTransporting = transporting;
43 if( energyMode_ != energyMode )
throw 1;
44 mEnergyMode = energyMode;
59 if( mGroupX != NULL )
ptwX_free( mGroupX );
61 if( mGroup.
size( ) > 0 ) {
70 if( mGroupX != NULL )
ptwX_free( mGroupX );
78 std::vector<GIDI_settings_processedFlux>::iterator iter;
80 for( iter = mProcessedFluxes.begin( ); iter != mProcessedFluxes.end( ); ++iter ) {
81 if( temperature <= iter->getTemperature( ) )
break;
92 double priorTemperature, lastTemperature;
93 std::vector<GIDI_settings_processedFlux>::const_iterator iter;
95 if( mProcessedFluxes.size( ) == 0 )
return( NULL );
97 priorTemperature = mProcessedFluxes[0].getTemperature( );
99 lastTemperature = mProcessedFluxes[0].getTemperature( );
100 for( iter = mProcessedFluxes.begin( ); iter != mProcessedFluxes.end( ); ++iter ) {
101 lastTemperature = iter->getTemperature( );
102 if( lastTemperature > temperature )
break;
104 priorTemperature = iter->getTemperature( );
106 if( iter == mProcessedFluxes.end( ) ) {
111 if( std::fabs( lastTemperature - temperature ) > std::fabs( temperature - priorTemperature ) ) --iter;
120 if( mGroupX == NULL )
return( NULL );
122 if( processedFlux == NULL )
return( NULL );
123 return( processedFlux->
groupFunction( smr, mGroupX, ptwXY1, order ) );
136 double const *energies, *fluxes;
138 for(
int order = 0; order < (
int) flux.
size( ); ++order ) {
139 fluxOrder = flux[order];
143 fluxOrder->
size( ), energies, fluxes, &status_nf, 0 ) ) == NULL )
goto err;
144 mFluxXY.push_back( fluxXY );
146 mGroupedFlux.push_back( groupedFluxX );
162 for(
int order = 0; order < (
int) mFlux.
size( ); ++order ) {
163 if( ( fluxXY =
ptwXY_clone( flux.mFluxXY[order], &status_nf ) ) == NULL )
goto err;
164 mFluxXY.push_back( fluxXY );
165 if( ( fluxX =
ptwX_clone( flux.mGroupedFlux[order], &status_nf ) ) == NULL )
goto err;
166 mGroupedFlux.push_back( fluxX );
171 for( std::vector<ptwXYPoints *>::iterator iter = mFluxXY.begin( ); iter != mFluxXY.end( ); ++iter )
ptwXY_free( *iter );
172 for( std::vector<ptwXPoints *>::iterator iter = mGroupedFlux.begin( ); iter != mGroupedFlux.end( ); ++iter )
ptwX_free( *iter );
180 for( std::vector<ptwXYPoints *>::iterator iter = mFluxXY.begin( ); iter != mFluxXY.end( ); ++iter )
ptwXY_free( *iter );
181 for( std::vector<ptwXPoints *>::iterator iter = mGroupedFlux.begin( ); iter != mGroupedFlux.end( ); ++iter )
ptwX_free( *iter );
192 if( groupX == NULL )
return( NULL );
193 if( order < 0 ) order = 0;
194 if( order >= (
int) mFluxXY.size( ) ) order = (
int) mFluxXY.size( ) - 1;
GIDI::ptwXPoints * groupFunction(GIDI::statusMessageReporting *smr, GIDI::ptwXPoints *groupX, GIDI::ptwXYPoints *ptwXY1, int order) const
GIDI::ptwXPoints * groupFunction(GIDI::statusMessageReporting *smr, GIDI::ptwXYPoints *ptwXY1, double temperature, int order) const
double const * getEnergies(void) const
ptwXYPoints * ptwXY_createFrom_Xs_Ys(ptwXY_interpolation interpolation, ptwXY_interpolationOtherInfo const *interpolationOtherInfo, double biSectionMax, double accuracy, int64_t primarySize, int64_t secondarySize, int64_t length, double const *Xs, double const *Ys, nfu_status *status, int userFlag)
int addFlux(GIDI::statusMessageReporting *smr, GIDI_settings_flux const &flux)
GIDI_settings_particle(int PoPId, bool transporting, int energyMode)
ptwXYPoints * ptwXY_clone(ptwXYPoints *ptwXY, nfu_status *status)
void setGroup(GIDI_settings_group const &group)
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
double getTemperature() const
GIDI_settings_processedFlux(GIDI_settings_flux const &flux, GIDI::ptwXPoints *groupX)
double const * getFluxes(void) const
ptwXPoints * ptwX_create(int64_t size, int64_t length, double const *xs, nfu_status *status)
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
enum nfu_status_e nfu_status
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
~GIDI_settings_particle()
double ptwXY_getXMin(ptwXYPoints *ptwXY)
GIDI_settings_processedFlux const * nearestFluxToTemperature(double temperature) const
ptwXPoints * ptwX_clone(ptwXPoints *ptwX, nfu_status *status)
double const * pointer(void) const
ptwXPoints * ptwXY_groupOneFunction(ptwXYPoints *ptwXY, ptwXPoints *groupBoundaries, ptwXY_group_normType normType, ptwXPoints *ptwX_norm, nfu_status *status)
ptwXYPoints * ptwXY_xSlice(ptwXYPoints *ptwXY, double xMin, double xMax, int64_t secondarySize, int fill, nfu_status *status)
ptwXPoints * ptwXY_groupTwoFunctions(ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, ptwXPoints *groupBoundaries, ptwXY_group_normType normType, ptwXPoints *ptwX_norm, nfu_status *status)
~GIDI_settings_processedFlux()
#define GIDI_settings_projectileEnergyMode_grouped
int initialize(int PoPId, bool transporting, int energyMode)
double ptwXY_getXMax(ptwXYPoints *ptwXY)
#define GIDI_settings_projectileEnergyMode_continuousEnergy