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 );
179 if (
this != &flux ) {
181 for( std::vector<ptwXYPoints *>::iterator iter = mFluxXY.begin( ); iter != mFluxXY.end( ); ++iter )
ptwXY_free( *iter );
182 for( std::vector<ptwXPoints *>::iterator iter = mGroupedFlux.begin( ); iter != mGroupedFlux.end( ); ++iter )
ptwX_free( *iter );
188 for(
int order = 0; order < (int) mFlux.
size( ); ++order ) {
189 if( ( fluxXY =
ptwXY_clone( flux.mFluxXY[order], &status_nf ) ) == NULL )
goto err;
190 mFluxXY.push_back( fluxXY );
191 if( ( fluxX =
ptwX_clone( flux.mGroupedFlux[order], &status_nf ) ) == NULL )
goto err;
192 mGroupedFlux.push_back( fluxX );
198 for( std::vector<ptwXYPoints *>::iterator iter = mFluxXY.begin( ); iter != mFluxXY.end( ); ++iter )
ptwXY_free( *iter );
199 for( std::vector<ptwXPoints *>::iterator iter = mGroupedFlux.begin( ); iter != mGroupedFlux.end( ); ++iter )
ptwX_free( *iter );
207 for( std::vector<ptwXYPoints *>::iterator iter = mFluxXY.begin( ); iter != mFluxXY.end( ); ++iter )
ptwXY_free( *iter );
208 for( std::vector<ptwXPoints *>::iterator iter = mGroupedFlux.begin( ); iter != mGroupedFlux.end( ); ++iter )
ptwX_free( *iter );
219 if( groupX == NULL )
return( NULL );
220 if( order < 0 ) order = 0;
221 if( order >= (
int) mFluxXY.size( ) ) order = (int) mFluxXY.size( ) - 1;
#define GIDI_settings_projectileEnergyMode_grouped
#define GIDI_settings_projectileEnergyMode_continuousEnergy
double const * getEnergies(void) const
double const * getFluxes(void) const
double getTemperature() const
double const * pointer(void) const
GIDI::ptwXPoints * groupFunction(GIDI::statusMessageReporting *smr, GIDI::ptwXYPoints *ptwXY1, double temperature, int order) const
int addFlux(GIDI::statusMessageReporting *smr, GIDI_settings_flux const &flux)
~GIDI_settings_particle()
GIDI_settings_particle(int PoPId, bool transporting, int energyMode)
GIDI_settings_processedFlux const * nearestFluxToTemperature(double temperature) const
void setGroup(GIDI_settings_group const &group)
int initialize(int PoPId, bool transporting, int energyMode)
GIDI_settings_processedFlux(GIDI_settings_flux const &flux, GIDI::ptwXPoints *groupX)
GIDI::ptwXPoints * groupFunction(GIDI::statusMessageReporting *smr, GIDI::ptwXPoints *groupX, GIDI::ptwXYPoints *ptwXY1, int order) const
GIDI_settings_processedFlux & operator=(const GIDI_settings_processedFlux &flux)
~GIDI_settings_processedFlux()
enum nfu_status_e nfu_status
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)
@ ptwXY_group_normType_none
@ ptwXY_group_normType_norm
@ ptwXY_interpolationLinLin
double ptwXY_getXMin(ptwXYPoints *ptwXY)
ptwXPoints * ptwXY_groupTwoFunctions(ptwXYPoints *ptwXY1, ptwXYPoints *ptwXY2, ptwXPoints *groupBoundaries, ptwXY_group_normType normType, ptwXPoints *ptwX_norm, nfu_status *status)
ptwXYPoints * ptwXY_free(ptwXYPoints *ptwXY)
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)
ptwXYPoints * ptwXY_clone(ptwXYPoints *ptwXY, nfu_status *status)
double ptwXY_getXMax(ptwXYPoints *ptwXY)
ptwXPoints * ptwX_clone(ptwXPoints *ptwX, nfu_status *status)
ptwXPoints * ptwX_free(ptwXPoints *ptwX)
ptwXPoints * ptwX_create(int64_t size, int64_t length, double const *xs, nfu_status *status)