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

mf15classes.cpp

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: 1785 $
00029  * $Date: 2006-03-22 16:03:58 -0800 (Wed, 22 Mar 2006) $
00030  * $Author: dbrown $
00031  * $Id: mf15classes.cpp 1785 2006-03-23 00:03:58Z dbrown $
00032  * 
00033  * ******** fete: From ENDF To ENDL *********
00034  */
00035 
00036 // implementation of the mf15 class for 2-d linked lists
00037 
00038 #include "mf15classes.hpp"
00039 #include "endl_formats.hpp"
00040 
00041 extern ENDLClass ENDL;
00042 
00043 // ********* for class MF15_list *************
00044 // ----------- MF15_list::read_data -----------------
00045 void MF15_list::read_data( mf15_file& inFile )
00046 // This routine is used to read in ENDF/B-VI continuuous gamma
00047 // distributions
00048 {
00049   int ZA;
00050   double AWR;
00051   int LF;   // 1 for tabulated continuum
00052   int NC;   // number of file sections
00053   int NR;   // number of interpolation regions
00054   int NP;   // number of incident energies
00055 
00056   // read the first line
00057   inFile.read_line1(&ZA, &AWR, &NC);
00058   if(NC > 1)
00059   {
00060     Unimplemented("MF15_list::read_data","Implement multiple subsections for mf15");
00061   }
00062 
00063   // get the weights for this subsection
00064   inFile.weight_line(&LF, &NR, &NP);
00065   if(LF != 1)
00066   {
00067     SevereError("MF15_list::read_data",
00068         pastenum("Implement model LF: ",LF)+" in mf15");
00069   }
00070   
00071   // read the interpolation regions
00072   inFile.get_regions(NR, weights.NBT, weights.INT);
00073   
00074   // read and save the weights
00075   weights.read_data( NP, inFile, ENDL.Max_E_in );
00076 
00077   // how to interpolate with respect to incident energy
00078   inFile.E_in_interp(&NR, &NP);
00079   inFile.get_regions(NR, NBT, INT);
00080 
00081   // don't save the data if we are above the maximum incident energy
00082   bool done = false;
00083 
00084   // make the 2-d list
00085   for(int count = 0; count < NP; ++count)
00086   {
00087     one_e_dist( inFile, &done );
00088   }
00089 
00090   // record the types of interpolation between 1-d lists
00091   set_interp();
00092 
00093   if((NR > 1) || (INT[0] != 2))
00094   {
00095     table_interp( );
00096   }
00097 
00098   // did we exceed the maximum incident energy?
00099   two_d_iterator last_link = end( );
00100   --last_link;
00101   if( last_link->E_in( ) > ENDL.Max_E_in )
00102   {
00103     chop_highE( ENDL.Max_E_in );
00104   }
00105 }
00106 
00107 // ----------- MF15_list::one_e_dist -----------------
00108 void MF15_list::one_e_dist( mf15_file& inFile, bool *done )
00109 // This routine is used to read in ENDF/B-VI one continuuous gamma
00110 // distribution.
00111 // set done = true if E_in >= ENDL.Max_E_in
00112 {
00113   string linebuff;
00114   string strbuff;
00115 
00116   // the head for this incident energy
00117   int NR;   // number of interpolation regions
00118   int NP;   // number of secondary energies
00119   double E_in;
00120   two_d_iterator e_in_link;
00121 
00122   inFile.get_E_in( &E_in, &NR, &NP );
00123   E_in *= ENDL.eV2MeV;  // change to MeV
00124 
00125   // start a new two_d_link for this incident energy
00126   one_d_table new_link;
00127   if( !(*done) )
00128   {
00129     insert(end(), new_link);
00130     e_in_link = end();
00131     --e_in_link;  // points to the new link
00132     e_in_link->E_in( ) = E_in;
00133     inFile.get_regions(NR, e_in_link->NBT, e_in_link->INT);
00134   }
00135   else
00136   {
00137     inFile.get_regions(NR, new_link.NBT, new_link.INT);
00138   }
00139 
00140   // read the data for this incident energy
00141   for( int iNP=0; iNP < NP; iNP++ ) //Loop over NP data pairs
00142   { 
00143     double E_out;
00144     double Prob;
00145 
00146     int iP=iNP % 3;  //There are 3 pairs per line
00147     if ( iP == 0 ) getline( inFile, linebuff); //Read in new line
00148     strbuff = linebuff.substr(iP*22, 22); //Grab the right pair
00149     read_dd(&strbuff, &E_out, &Prob );
00150     if ( E_out==-999.0 || Prob==-999.0 ) //read_PAIR sends -999.0 if problem
00151     {
00152       SevereError("MF15_list::one_e_dist","read_PAIR messed up!");
00153     }
00154     else if( !(*done) )
00155     {
00156       E_out *= ENDL.eV2MeV;
00157       dd_link XYdata(E_out, Prob);
00158       e_in_link->insert(e_in_link->end(), XYdata);
00159     }
00160   }
00161   if( !(*done) )
00162   {
00163     // expand any histogram data and widen any jumps
00164     e_in_link->expand_interp( ENDL.Max_E_out );
00165     e_in_link->widen_jumps();
00166     e_in_link->renorm();
00167     // we may be done
00168     double dE = ENDL_EPSILON( ENDL.Max_E_in );
00169     if( E_in > ENDL.Max_E_in - dE )
00170     {
00171       *done = true;
00172     }
00173   }
00174 }

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