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 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/hadronic/models/lend/src/GIDI_settings_flux.cc (Version 11.3.0) and /processes/hadronic/models/lend/src/GIDI_settings_flux.cc (Version 9.1)


  1 /*                                                  1 
  2 # <<BEGIN-copyright>>                             
  3 # <<END-copyright>>                               
  4 */                                                
  5                                                   
  6 #include <iostream>                               
  7 #include <stdlib.h>                               
  8                                                   
  9 #include "GIDI_settings.hh"                       
 10                                                   
 11 /*  ---- GIDI_settings_flux_order ----  */        
 12 /*                                                
 13 ==============================================    
 14 */                                                
 15 GIDI_settings_flux_order::GIDI_settings_flux_o    
 16                                                   
 17     if( order < 0 ) throw 1;                      
 18     mOrder = order;                               
 19 }                                                 
 20 /*                                                
 21 ==============================================    
 22 */                                                
 23 GIDI_settings_flux_order::GIDI_settings_flux_o    
 24                                                   
 25     initialize( order, length, energies, fluxe    
 26 }                                                 
 27 /*                                                
 28 ==============================================    
 29 */                                                
 30 GIDI_settings_flux_order::GIDI_settings_flux_o    
 31                                                   
 32     int length = (int) energies.size( );          
 33                                                   
 34     if( length != (int) fluxes.size( ) ) throw    
 35     initialize( order, length, &(energies[0]),    
 36 }                                                 
 37 /*                                                
 38 ==============================================    
 39 */                                                
 40 GIDI_settings_flux_order::GIDI_settings_flux_o    
 41                                                   
 42     initialize( fluxOrder.mOrder, fluxOrder.si    
 43 }                                                 
 44 /*                                                
 45 ==============================================    
 46 */                                                
 47 void GIDI_settings_flux_order::initialize( int    
 48                                                   
 49     if( order < 0 ) throw 1;                      
 50     mOrder = order;                               
 51     mEnergies.resize( length, 0 );                
 52     mFluxes.resize( length, 0 );                  
 53     for( int i1 = 0; i1 < length; ++i1 ) mEner    
 54     for( int i1 = 0; i1 < length; ++i1 ) mFlux    
 55 }                                                 
 56 /*                                                
 57 ==============================================    
 58 */                                                
 59 GIDI_settings_flux_order& GIDI_settings_flux_o    
 60   if ( this != &fluxOrder ) {                     
 61     initialize( fluxOrder.mOrder, fluxOrder.si    
 62   }                                               
 63   return *this;                                   
 64 }                                                 
 65 /*                                                
 66 ==============================================    
 67 */                                                
 68 GIDI_settings_flux_order::~GIDI_settings_flux_    
 69                                                   
 70 }                                                 
 71 /*                                                
 72 ==============================================    
 73 */                                                
 74 void GIDI_settings_flux_order::print( int valu    
 75                                                   
 76     int nE = (int) mEnergies.size( );             
 77     bool printIndent = true;                      
 78     char buffer[2 * 128];                         
 79                                                   
 80     std::cout << "    ORDER: " << mOrder << st    
 81     for( int iE = 0; iE < nE; ++iE ) {            
 82         if( printIndent ) std::cout << "    ";    
 83         printIndent = false;                      
 84         snprintf( buffer, sizeof buffer, "   %    
 85         std::cout << buffer;                      
 86         if( ( ( iE + 1 ) % valuesPerLine ) ==     
 87             std::cout << std::endl;               
 88             printIndent = true;                   
 89         }                                         
 90     }                                             
 91     if( nE % valuesPerLine ) std::cout << std:    
 92 }                                                 
 93                                                   
 94 /*  ---- GIDI_settings_flux ----  */              
 95 /*                                                
 96 ==============================================    
 97 */                                                
 98 GIDI_settings_flux::GIDI_settings_flux( std::s    
 99                                                   
100     mLabel = label;                               
101     mTemperature = temperature;                   
102 }                                                 
103 /*                                                
104 ==============================================    
105 */                                                
106 GIDI_settings_flux::GIDI_settings_flux( char c    
107                                                   
108     mLabel = label;                               
109     mTemperature = temperature;                   
110 }                                                 
111 /*                                                
112 ==============================================    
113 */                                                
114 GIDI_settings_flux::GIDI_settings_flux( GIDI_s    
115                                                   
116     mLabel = flux.getLabel( );                    
117     mTemperature = flux.mTemperature;             
118     for( std::vector<GIDI_settings_flux_order>    
119 }                                                 
120 /*                                                
121 ==============================================    
122 */                                                
123 GIDI_settings_flux& GIDI_settings_flux::operat    
124   if ( this != &flux ) {                          
125     mLabel = flux.getLabel();                     
126     mTemperature = flux.mTemperature;             
127     for( std::vector<GIDI_settings_flux_order>    
128   }                                               
129   return *this;                                   
130 }                                                 
131 /*                                                
132 ==============================================    
133 */                                                
134 GIDI_settings_flux::~GIDI_settings_flux( ) {      
135                                                   
136 }                                                 
137 /*                                                
138 ==============================================    
139 */                                                
140 GIDI_settings_flux_order const *GIDI_settings_    
141                                                   
142     return( &(mFluxOrders[index]) );              
143 }                                                 
144 /*                                                
145 ==============================================    
146 */                                                
147 void GIDI_settings_flux::addFluxOrder( GIDI_se    
148 /*                                                
149 *   Orders can only be added in sequence (e.g.    
150 */                                                
151     int order = fluxOrder.getOrder( );            
152                                                   
153     if( order > (int) mFluxOrders.size( ) ) th    
154     mFluxOrders.push_back( fluxOrder );           
155 }                                                 
156 /*                                                
157 ==============================================    
158 */                                                
159 void GIDI_settings_flux::print( bool outline,     
160                                                   
161     std::cout << "FLUX: label = '" << mLabel <    
162     if( outline ) return;                         
163     for( std::vector<GIDI_settings_flux_order>    
164 }                                                 
165                                                   
166 #if 0                                             
167 /*  ---- GIDI_settings_fluxes_from_bdfls ----     
168 /*                                                
169 ==============================================    
170 */                                                
171 GIDI_settings_fluxes_from_bdfls::GIDI_settings    
172                                                   
173     initialize( fileName.c_str( ), temperature    
174 }                                                 
175 /*                                                
176 ==============================================    
177 */                                                
178 GIDI_settings_fluxes_from_bdfls::GIDI_settings    
179                                                   
180     initialize( fileName, temperature_MeV );      
181 }                                                 
182 /*                                                
183 ==============================================    
184 */                                                
185 GIDI_settings_fluxes_from_bdfls::GIDI_settings    
186                                                   
187     initialize2( bdfls, temperature_MeV );        
188 }                                                 
189 /*                                                
190 ==============================================    
191 */                                                
192 void GIDI_settings_fluxes_from_bdfls::initiali    
193                                                   
194     cbdfls_file *bdfls;                           
195     cbdflsErrors Error;                           
196                                                   
197     if( ( bdfls = cbdflsOpen( fileName, &Error    
198     initialize2( bdfls, temperature_MeV );        
199     cbdflsRelease( bdfls );                       
200 }                                                 
201 /*                                                
202 ==============================================    
203 */                                                
204 void GIDI_settings_fluxes_from_bdfls::initiali    
205                                                   
206     int nf, length, *fids, order;                 
207     double *energies, *fluxes;                    
208     char label[100];                              
209                                                   
210     nf = cbdflsFIDs( (cbdfls_file *) bdfls, &f    
211     for( int if1 = 0; if1 < nf; ++if1 ) {         
212         snprintf( label, sizeof label, "LLNL_f    
213         GIDI_settings_flux flux = GIDI_setting    
214         order = cbdflsGetFluxOrder( (cbdfls_fi    
215         for( int io = 0; io <= order; ++io ) {    
216             length = cbdflsGetFlux( (cbdfls_fi    
217             GIDI_settings_flux_order flux_orde    
218             flux.addFluxOrder( flux_order );      
219         }                                         
220         mFluxes.push_back( flux );                
221     }                                             
222     return;                                       
223 }                                                 
224 /*                                                
225 ==============================================    
226 */                                                
227 GIDI_settings_fluxes_from_bdfls::~GIDI_setting    
228                                                   
229 }                                                 
230 /*                                                
231 ==============================================    
232 */                                                
233 GIDI_settings_flux GIDI_settings_fluxes_from_b    
234                                                   
235     char label[100];                              
236                                                   
237     snprintf( label, sizeof label, "LLNL_fid_%    
238     for( int if1 = 0; if1 < (int) mFluxes.size    
239         if( mFluxes[if1].isLabel( label ) ) re    
240     }                                             
241     throw 1;                                      
242 }                                                 
243 /*                                                
244 ==============================================    
245 */                                                
246 std::vector<std::string> GIDI_settings_fluxes_    
247                                                   
248     int size = (int) mFluxes.size( );             
249     std::vector<std::string> labels( size );      
250                                                   
251     for( int if1 = 0; if1 < size; ++if1 ) labe    
252     return( labels );                             
253 }                                                 
254 /*                                                
255 ==============================================    
256 */                                                
257 std::vector<int> GIDI_settings_fluxes_from_bdf    
258                                                   
259     int size = (int) mFluxes.size( );             
260     std::vector<int> fids( size );                
261     char *e;                                      
262                                                   
263     for( int if1 = 0; if1 < size; ++if1 ) {       
264         fids[if1] = (int) strtol( &(mFluxes[if    
265     }                                             
266     return( fids );                               
267 }                                                 
268 /*                                                
269 ==============================================    
270 */                                                
271 void GIDI_settings_fluxes_from_bdfls::print( b    
272                                                   
273     int nfs = (int) mFluxes.size( );              
274                                                   
275     std::cout << "BDFLS FLUXes: number of flux    
276     for( int if1 = 0; if1 < nfs ; ++if1 ) mFlu    
277 }                                                 
278 #endif                                            
279