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: 1843 $ 00029 * $Date: 2006-04-20 11:38:46 -0700 (Thu, 20 Apr 2006) $ 00030 * $Author: dbrown $ 00031 * $Id: distrib_base.hpp 1843 2006-04-20 18:38:46Z dbrown $ 00032 * 00033 * ******** fete: From ENDF To ENDL ********* 00034 */ 00035 00036 // header for the classes for energy and angle distributions 00037 00038 #ifndef DISTRIB_BASE_CLASS 00039 #define DISTRIB_BASE_CLASS 00040 00041 #include "list_1d.hpp" 00042 #include "global_params.hpp" 00043 00044 using namespace std; 00045 extern GlobalParameterClass Global; 00046 00047 // -------------------- class distrib_base ------------------ 00048 //! Base class for one link in the lists used in energy and angle distributions. 00049 00050 class distrib_base : public dd_list 00051 { 00052 protected: 00053 bool debug_on; // for checking the 2-d interpolation 00054 double tol_1d; // accuracy of linear interpolation 00055 double cut_off; // don't impose accuracy below this value 00056 00057 // the maximum probability, used in the tolerance check 00058 double max_P; 00059 00060 public: 00061 vector<double> equi_prob; // the equally probable bins 00062 double weight; // The weights add to 1 for multiple models 00063 int num_bins; 00064 int interp_type; // type of interpolation between this list and the previous 00065 bool bin_interp; // if true, use the equi-probable bins to check 00066 // interpolation, otherwise use unit-base interpolation 00067 00068 // other usual names for the tag 00069 inline double& mu() 00070 { 00071 return tag; 00072 } 00073 inline double& E_gamma() // for MF13 files 00074 { 00075 return tag; 00076 } 00077 00078 // debug_on = true; // for checking the 2-d interpolation 00079 00080 //!default constructor 00081 distrib_base(void): debug_on(false), tol_1d(Global.Value("tol_1d")), 00082 cut_off(Global.Value("cut_off_1d")), max_P(1.0), 00083 equi_prob(static_cast<int>(Global.Value("num_mf5_bins"))+1,0.0), 00084 weight(1.0), 00085 num_bins(static_cast<int>(Global.Value("num_mf5_bins"))), 00086 interp_type(0), bin_interp(true){} 00087 00088 // *** start of virtual functions *** 00089 // the distribution function---it depends on the model 00090 virtual double f(double E) = 0; 00091 // *** end of virtual functions *** 00092 00093 // Interpolate this list between left_list and right_list 00094 // using the equiprobable bins. 00095 void list_interp(double e_in, distrib_base& left_list, 00096 distrib_base& right_list); 00097 00098 void print(); 00099 00100 // Expand part of a list to achieve the tolerance 00101 void thicken( dd_list::iterator first, dd_list::iterator last ); 00102 00103 // Expand the entire list to achieve the tolerance 00104 void thicken( ); 00105 00106 // get the probability for this list. 00107 // This routine is used for double differential data 00108 double get_norm(); 00109 00110 // ensure that the total probability is 1 00111 void renorm(); 00112 00113 // renormalize with the norm given 00114 void renorm(double Norm); 00115 00116 // make the equally probable energy bins 00117 void get_bins(); 00118 00119 //mirror a distribution in energy 00120 void mirror(); 00121 00122 // This routine widens the delta functions for the whole list 00123 void widen_delta( ); 00124 00125 // Check the accuracy of 2d linear interpolation based on the 00126 // equally probable bins. 00127 bool check_equiprob(distrib_base& left_list, 00128 distrib_base& right_list, double tol_2d); 00129 00130 // This routine was once used to check unit-based interpolation. 00131 bool check_interp_2d(double tol_2d, double cut_off_2d); 00132 00133 }; 00134 #endif 00135 00136 00137