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

file_names.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: 1735 $
00029  * $Date: 2006-02-09 13:47:26 -0800 (Thu, 09 Feb 2006) $
00030  * $Author: dbrown $
00031  * $Id: file_names.cpp 1735 2006-02-09 21:47:26Z dbrown $
00032  * 
00033  * ******** fete: From ENDF To ENDL *********
00034  */
00035 
00036 // Implementation of writing routines
00037 #include "file_names.hpp"
00038 
00039 string endl_file_name( int outgoing_particle, int C, int I, int S)
00040 {
00041   string s_f;
00042   ostringstream os_f;
00043   os_f<<
00044     setw(2)<<"yo"<<
00045     setw(2)<<outgoing_particle<<
00046     setw(1)<<"c"<<
00047     setw(2)<<C<<
00048     setw(1)<<"i"<<
00049     setw(3)<<I<<
00050     setw(1)<<"s"<<
00051     setw(3)<<S;
00052 
00053   //Copy output string stream to normal string
00054   s_f=os_f.str(); 
00055 
00056   //replace blanks with zeros...
00057   for( int i=0; i<s_f.length(); i++ )
00058     if ( s_f.at(i)==' ' )
00059       s_f.replace(i,1,"0") ;
00060 
00061   return( s_f );
00062 }
00063 
00064 
00065 string endf_file_name( int F, int T )
00066 {
00067   string s_f;
00068   ostringstream os_f;
00069   os_f<<
00070     setw(2)<<"mf"<<
00071     setw(2)<<F<<
00072     setw(2)<<"mt"<<
00073     setw(3)<<T;
00074 
00075   //Copy output string stream to normal string
00076   s_f=os_f.str(); 
00077 
00078   //replace blanks with zeros...
00079   for( int i=0; i<s_f.length(); i++ )
00080     if ( s_f.at(i)==' ' )
00081       s_f.replace(i,1,"0") ;
00082 
00083   return( s_f );
00084 }
00085 
00086 

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