00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "mf6_gammas.hpp"
00039
00040 extern ENDLClass ENDL;
00041 extern GlobalParameterClass Global;
00042
00043
00044
00045 mf6_table::iterator mf6_table::new_one_d( mf6_table::iterator where )
00046 {
00047 SevereError("mf6_table::new_one_d", "Implement the routine");
00048 return 0;
00049 }
00050
00051
00052 void mf6_table::read_data( mf6_file& inFile, int LEP, int NE )
00053
00054
00055
00056 {
00057
00058 for ( int iNE=0; iNE < NE; iNE++ )
00059 {
00060 one_E_in( inFile, LEP );
00061 }
00062 }
00063
00064
00065 void mf6_table::one_E_in( mf6_file& inFile, int LEP )
00066 {
00067 double E_1;
00068 int ND;
00069 int NEP;
00070
00071 string linebuff;
00072 string strbuff;
00073
00074 inFile.gamma_ein( &E_1,
00075 &ND,
00076 &NEP );
00077
00078
00079 E_1 *= ENDL.eV2MeV;
00080
00081 one_d_table e_in_link;
00082 e_in_link.E_in() = E_1;
00083 insert(end(), e_in_link);
00084 mf6_table::iterator this_ein = end();
00085 --this_ein;
00086
00087
00088
00089 one_d_table gamma_lines;
00090 gamma_lines.E_in() = E_1;
00091
00092 for( int iNP=0; iNP < NEP; iNP++ )
00093 {
00094 int iP=iNP % 3;
00095 if ( iP == 0 )
00096 {
00097 getline( inFile, linebuff );
00098 }
00099 strbuff = linebuff.substr( iP*22, 22 );
00100 double X, Y;
00101 read_dd(&strbuff, &X, &Y );
00102
00103 X *= ENDL.eV2MeV;
00104 dd_link XYdata( X, Y );
00105
00106 if( iNP < ND )
00107 {
00108 if ( Y > 0.0 )
00109 {
00110
00111 one_d_table::iterator next_line = gamma_lines.find_next( X );
00112 gamma_lines.insert( next_line, XYdata );
00113 }
00114 }
00115 else
00116 {
00117 this_ein->insert( this_ein->end( ), XYdata );
00118 }
00119 }
00120
00121 this_ein->dd_list::expand_interp( LEP, ENDL.Max_E_out );
00122
00123 if( gamma_lines.size( ) > 0 )
00124 {
00125 gamma_lines.widen_delta( );
00126 if( this_ein->size( ) > 0 )
00127 {
00128
00129 (*this_ein) += gamma_lines;
00130 }
00131 else
00132 {
00133
00134 this_ein->copy( gamma_lines );
00135 }
00136 }
00137 this_ein->renorm( );
00138 }
00139
00140
00141
00142 void mf6_gammas::read_data( mf6_file& inFile, int LEP,
00143 int NR, int num_E_in )
00144
00145 {
00146
00147 inFile.get_regions( NR, NBT, INT );
00148
00149
00150 mf6_table e_dist;
00151 e_dist.read_data( inFile, LEP, num_E_in );
00152
00153
00154 for(mf6_table::iterator e_dist_ptr = e_dist.begin();
00155 e_dist_ptr != e_dist.end(); ++e_dist_ptr)
00156 {
00157 mf6_table e_in_link;
00158 insert(end(), e_in_link);
00159
00160
00161 mf6_gammas::iterator this_link = end();
00162 --this_link;
00163
00164
00165 expand_E_in(e_dist_ptr, this_link);
00166
00167
00168 one_d_table new_cos;
00169 cosines.insert(cosines.end(), new_cos);
00170
00171
00172 two_d_table::iterator cos_ptr = cosines.end();
00173 --cos_ptr;
00174 cos_ptr->E_in() = e_dist_ptr->E_in();
00175
00176
00177 dd_link new_link(-1.0, 0.5);
00178 cos_ptr->insert(cos_ptr->end(), new_link);
00179 new_link.x = 1.0;
00180 cos_ptr->insert(cos_ptr->end(), new_link);
00181 }
00182
00183 write_endl( );
00184 }
00185
00186 void mf6_gammas::expand_E_in(mf6_table::iterator e_dist_ptr,
00187 mf6_gammas::iterator this_link)
00188
00189 {
00190 this_link->E_in() = e_dist_ptr->E_in();
00191
00192 for (int count = 0; count < 2; ++count)
00193 {
00194 double this_mu = -1.0 + 2*count;
00195
00196 one_d_table mu_link;
00197 mu_link.mu() = this_mu;
00198 this_link->insert(this_link->end(), mu_link);
00199
00200
00201 mf6_table::iterator mu_ptr = this_link->end();
00202 --mu_ptr;
00203
00204 for(dd_list::iterator e_dist_link = e_dist_ptr->begin();
00205 e_dist_link != e_dist_ptr->end(); ++e_dist_link)
00206 {
00207 dd_link e_out_link(e_dist_link->x, e_dist_link->y);
00208 mu_ptr->insert(mu_ptr->end(), e_out_link);
00209 }
00210 }
00211 }