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 "list_3d.hpp"
00039 #include "endl_formats.hpp"
00040 #include "global_params.hpp"
00041
00042 extern ENDLClass ENDL;
00043 extern GlobalParameterClass Global;
00044
00045
00046
00047 void three_d_link::make_cos_link(double e_in,
00048 two_d_arbitrary::iterator new_cos)
00049
00050 {
00051 new_cos->E_in() = e_in;
00052
00053
00054 for(two_d_arbitrary::iterator this_cos = begin(); this_cos != end();
00055 ++this_cos)
00056 {
00057
00058 double prob = this_cos->get_norm();
00059 dd_link new_link(this_cos->mu(), prob);
00060 new_cos->insert(new_cos->end(), new_link);
00061
00062
00063 this_cos->renorm(prob);
00064 }
00065
00066
00067 new_cos->renorm();
00068 }
00069
00070
00071
00072
00073
00074 three_d_list::three_d_list()
00075 {
00076
00077 debug_on = false;
00078
00079
00080 Num_mu = static_cast<int>( Global.Value("num_mu_3d"));
00081 }
00082
00083 void three_d_list::print()
00084
00085 {
00086
00087 for(three_d_list::iterator this_e_in = begin();
00088 this_e_in != end(); ++this_e_in)
00089 {
00090 cout<<"----------- E_in = " << this_e_in->E_in() << endl;
00091 this_e_in->print();
00092 }
00093 cout << endl;
00094 }
00095
00096
00097 void three_d_list::write_endl()
00098
00099
00100 {
00101
00102 ENDL.set_I_number( 3 );
00103
00104 fstream endl_file;
00105 string file_name = ENDL.file_name;
00106
00107 if(empty())
00108 {
00109 Warning("three_d_list::write_endl","The file "+file_name+" is empty.");
00110 return;
00111 }
00112
00113 if ( ENDL.new_file() )
00114 {
00115 endl_file.open(file_name.c_str(),ios::out);
00116 Info("three_d_list::write_endl","Opening ENDL file "+file_name);
00117 }
00118 else
00119 {
00120 endl_file.open(file_name.c_str(),ios::out|ios::app);
00121 Info("three_d_list::write_endl","Appending ENDL file "+file_name);
00122 }
00123
00124
00125 endl_file<<ENDL.header_line_1<<endl;
00126 endl_file<<ENDL.header_line_2<<endl;
00127 endl_file.setf(ios::scientific,ios::floatfield);
00128
00129
00130 double old_E_in = -1.0;
00131 for(three_d_list::iterator E_in_link = begin();
00132 E_in_link != end();
00133 ++E_in_link)
00134 {
00135
00136 if(E_in_link->E_in() == old_E_in)
00137 {
00138 Warning("three_d_list::write_endl",
00139 pastenum("Widen the jump in three_d_list at E_in: ",old_E_in));
00140 }
00141 old_E_in = E_in_link->E_in();
00142 double old_mu = -2.0;
00143 for(two_d_list<one_d_table>::iterator cos_link = E_in_link->begin();
00144 cos_link != E_in_link->end();
00145 ++cos_link)
00146 {
00147
00148 if(cos_link->mu() == old_mu)
00149 {
00150 Warning("three_d_list::write_endl",
00151 pastenum("Widen the jump in cos_list at E_in: ",old_E_in)+
00152 pastenum(" mu: ",old_mu));
00153 }
00154 old_mu = cos_link->mu();
00155 double old_x = -2.0;
00156 for(dd_list::iterator E_out_link = cos_link->begin();
00157 E_out_link != cos_link->end();
00158 ++E_out_link)
00159 {
00160
00161 if(E_out_link->x == old_x)
00162 {
00163 Warning("three_d_list::write_endl",
00164 pastenum("Widen the jump in one_d_list at E_in: ",old_E_in)+
00165 pastenum(" mu: ",old_mu)+
00166 pastenum(" x: ",old_x));
00167 }
00168 old_x = E_out_link->x;
00169 endl_file << ENDL.data( E_in_link->E_in(),
00170 cos_link->mu(),
00171 E_out_link->E_out(),
00172 E_out_link->y )
00173 <<endl;
00174 }
00175 }
00176 }
00177
00178
00179 endl_file<<ENDL.eof_line<<endl;
00180
00181
00182 Info("three_d_list::write_endl","Closing ENDL file "+file_name);
00183 endl_file.close();
00184
00185
00186
00187 cosines.write_endl(1);
00188 }
00189