Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

ENDF_file.hpp

Go to the documentation of this file.
00001 /*
00002  * ******** fete: From ENDF To ENDL *********
00003  * 
00004  * Copyright (c) 2006, The Regents of the University of California. 
00005  * All rights reserved.
00006  * 
00007  * Produced at the Lawrence Livermore National Laboratory. 
00008  * Written by David A. Brown, Gerry Hedstrom, Tony Hill
00009  * 
00010  * This file is part of fete v1.0  (UCRL-CODE-218718)
00011  * 
00012  * Please read the COPYING file for "Our Notice and GNU General 
00013  * Public License" in the root of this software distribution.  
00014  * 
00015  * This program is free software; you can redistribute it and/or modify 
00016  * it under the terms of the GNU General Public License (as published by 
00017  * the Free Software Foundation) version 2, dated June 1991. 
00018  * 
00019  * This program is distributed in the hope that it will be useful, 
00020  * but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF 
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms 
00022  * and conditions of the GNU General Public License for more details. 
00023  * 
00024  * You should have received a copy of the GNU General Public License along 
00025  * with this program; if not, write to the Free Software Foundation, Inc., 
00026  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
00027  * 
00028  * $Revision: 1889 $
00029  * $Date: 2006-08-29 09:28:59 -0700 (Tue, 29 Aug 2006) $
00030  * $Author: dbrown $
00031  * $Id: ENDF_file.hpp 1889 2006-08-29 16:28:59Z dbrown $
00032  * 
00033  * ******** fete: From ENDF To ENDL *********
00034  */
00035 
00036 // declarations for ENDF/B-VI input files
00037 
00038 #ifndef ENDF_file_DEF
00039 #define ENDF_file_DEF
00040 
00041 #include <stdio.h>
00042 #include <fstream>
00043 #include <string>
00044 #include <vector>
00045 
00046 #include "endl_formats.hpp"
00047 #include "global_params.hpp"
00048 #include "messaging.hpp"
00049 
00050 extern ENDLClass ENDL;
00051 extern GlobalParameterClass Global;
00052 
00053 using namespace std;
00054 
00055 // ------------------- class ENDF_file ---------------
00056 //! Base class for reading intermediate ENDF file sections
00057 class ENDF_file : public ifstream
00058 {
00059 protected:
00060   //! Generic read of the first line
00061   void mfx_line1(int *ZA, double *AWR, int *I1, int *I2,
00062     int *I3, int *I4);
00063 
00064   //! Generic read of the second line
00065   void mfx_line2(double *D1, double *D2, int *I1, int *I2,
00066     int *I3, int *I4);
00067 
00068 public:
00069   inline ENDF_file()
00070   {
00071   }
00072   inline ~ENDF_file()
00073   {
00074   }
00075   //! Opens the intermediate ENDF file
00076   inline void open( int F, int T, bool verbose=true )
00077   {
00078     if (verbose) Info("ENDF_file::open","Opening file "+endf_file_name(F, T)+"...");
00079     ifstream::open(endf_file_name(F, T).c_str());
00080   }
00081 
00082   //! Reads the interpolation information
00083   void get_regions(int NR, vector<int>& NBT, vector<int>& INT);
00084 
00085   //! Skips the next N entries in the file
00086   void skip(int N);
00087 };
00088 
00089 // ------------------- class mf1_file ---------------
00090 //! Derived class used for reading intermediate MF=1 ENDF data
00091 class mf1_file : public ENDF_file
00092 {
00093 public:
00094   //! Reads the first line
00095   void read_line1(int *ZA, double *AWR, int *LNU);
00096 
00097   //! Reads the time constants line
00098   void delay_head(int *NC);
00099 
00100   //! Reads the multiplicity line
00101   void mult_head(int *NR, int *NP);
00102 };
00103 
00104 // ------------------- class mf3_file ---------------
00105 //! Derived class used for reading intermediate MF=3 ENDF data
00106 class mf3_file : public ENDF_file
00107 {
00108 public:
00109   //! Reads the first line
00110   void read_line1(int *ZA, double *AWR);
00111 
00112   //! Reads the second line
00113   void read_line2(double *QM, double *QI, int *LR, int *NR, int *NP);
00114 };
00115 
00116 // ------------------- class mf4_file ---------------
00117 //! Derived class used for reading intermediate MF=4 ENDF data
00118 class mf4_file : public ENDF_file
00119 {
00120 public:
00121   //! Reads the first line
00122   void read_line1(int *ZA, double *AWR, int *LVT, int *LTT);
00123 
00124   //! Reads the second line
00125   void read_line2(int *LI, int *LCT, int *NK, int *NM);
00126 
00127   //! Reads the third line
00128   void read_line3(int *NR, int *NE);
00129 };
00130 
00131 // ------------------- class mf5_file ---------------
00132 //! Derived class used for reading intermediate MF=5 ENDF data
00133 class mf5_file : public ENDF_file
00134 {
00135 public:
00136   //! Reads the first line
00137   void read_line1(int *ZA, double *AWR, int *NK);
00138 
00139   //! Reads the second line
00140   void read_line2(double *U, int *LF, int *NR, int *NP);
00141 
00142   //! Reads the Madland-Nix header line
00143   void read_Madland(double *EFL, double *EFH, int *NR, int *NE);
00144 };
00145 
00146 // ------------------- class mf6_file ---------------
00147 //! Derived class used for reading intermediate MF=6 ENDF data
00148 class mf6_file : public ENDF_file
00149 {
00150 public:
00151   //! Reads the first line
00152   void read_line1(int *ZA, double *AWR, int *LCT, int *NK);
00153 
00154   //! Reads the header line for a particle in an mf6 file
00155   void particle_line1(int *ZAP, double *AWP, int *LIP,
00156     int *LAW, int *NR, int *NP);
00157 
00158   //! Gets the model for a particle in an mf6 file for LAW = 1
00159   void get_model( int *LANG, int *LEP, int *NR, int *NE );
00160 
00161   //! Gets the incident energy, number of discrete gammas, and number of E_out for isotropic gammas
00162   void gamma_ein( double *e_in, int *ND, int *NEP );
00163 
00164   //! Gets the total mass and number of particles for a phase-space file
00165   void phase_space( double *APSX, int *NPSX );
00166 
00167   //! Gets the number of incident energies for a gen_mf4 file
00168   void mf4_line1( int *NR, int *NE );
00169 
00170   //! Gets the model for a gen_mf4 incident energy
00171   void mf4_line2( double *e_in, int *LANG, int *NW, int *NL );
00172 
00173   //! Gets the number of incident energies for an ENDL_table
00174   void ENDL( int *NR, int *NE );
00175 
00176   //! Gets the incident energy or cosine for an ENDL_table
00177   void ENDL_head( double *e_in, int *NR, int *NE );
00178 
00179   //! Gets the incident energy and the order for a Legendre table
00180   void Legendre_E_in( double *e_in, int *ND, int *order, int *NE );
00181 
00182   //! Gets the spin for charged-particle scattering
00183   void read_spin( double *spin, int *NR, int *NE );
00184 
00185   //! Gets the model for charged-particle scattering
00186   void read_model( double *e_in, int *LTP, int *NL );
00187 };
00188 
00189 // ------------------- class mf12_file ---------------
00190 //! Derived class used for reading intermediate MF=12 ENDF data
00191 class mf12_file : public ENDF_file
00192 {
00193 public:
00194   //! Reads the first line
00195   void read_line1(int *ZA, double *AWR, int *LO, int *LG,
00196     int *NK);
00197 
00198   //! Reads the second line
00199   void read_line2(int *NR, int *NP);
00200 
00201   //! Reads the first line for particular gamma
00202   void gamma_line1(double *EG, double *ES, int *LP, int *LF,
00203     int *NR, int *NP);
00204 };
00205 
00206 // ------------------- class mf13_file ---------------
00207 //! Derived class used for reading intermediate MF=13 ENDF data
00208 class mf13_file : public ENDF_file
00209 {
00210 public:
00211   //! Reads the first line
00212   void read_line1(int *ZA, double *AWR, int *NK);
00213 
00214   //! Reads the second line
00215   void read_line2(int *NR, int *NP);
00216 
00217   //! Reads the first line for particular gamma
00218   void gamma_line1(double *EG, double *ES, int *LP, int *LF,
00219     int *NR, int *NP);
00220 };
00221 
00222 // ------------------- class mf14_file ---------------
00223 //! Derived class used for reading intermediate MF=14 ENDF data
00224 class mf14_file : public mf4_file
00225 {
00226 public:
00227   //! Reads the first line
00228   void first_line(int *ZA, double *AWR, int *LI, int *LTT,
00229     int *NK, int *NI);
00230 
00231   //! Reads the gamma energy and the amount of data
00232   void read_EG( double *EG, int *NR, int *NE );
00233 
00234   //! Reads the discrete energy for an isotropic distribution
00235   void discrete( double *EG );
00236 
00237   //! Reads the incident energy and the Legendre order
00238   void Leg_head( double *e_in, int *NL );
00239 
00240   //! Returns the maximum Legendre order for gamma distributions
00241   int get_order( int NK, int NI );
00242 
00243   //! Skips the NI isotropic lines
00244   void skip_iso( int NI );
00245 };
00246 
00247 // ------------------- class mf15_file ---------------
00248 //! Derived class used for reading intermediate MF=15 ENDF data
00249 class mf15_file : public ENDF_file
00250 {
00251 public:
00252   //! Reads the first line
00253   void read_line1(int *ZA, double *AWR, int *NC);
00254 
00255   //! Reads the line containing the weights
00256   void weight_line(int *LF, int *NR, int *NP);
00257 
00258   //! Get the number of incident neutron energies
00259   void E_in_interp(int *NR, int *NP);
00260 
00261   //! Get the number of secondary neutron energies
00262   void get_E_in(double *E_in, int *NR, int *NP);
00263 };
00264 
00265 // ------------------- class mt458_file ---------------
00266 //! Derived class used for reading intermediate MF=458 ENDF data
00267 class mt458_file : public ENDF_file
00268 {
00269 public:
00270   //! Reads the first line
00271   void read_line1(int *ZA, double *AWR);
00272 
00273   //! Reads the second line
00274   void read_line2(int *num_E, int *num_data);
00275 
00276   //! Reads a data line
00277   void read_data( double *E_1, double *dE_1, double *E_2,
00278     double *dE_2, double *E_3, double *dE_3 );
00279 
00280   //! Resets the Q value
00281   double reduce_Q( double Q );
00282 
00283 };
00284 
00285 #endif

Generated on Thu Sep 7 10:30:03 2006 for fete -- From ENDFB6 To ENDL by doxygen 1.3.4