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: nuclei.cpp 1735 2006-02-09 21:47:26Z dbrown $ 00032 * 00033 * ******** fete: From ENDF To ENDL ********* 00034 */ 00035 00036 // inplementation of the Particle class 00037 00038 #include "nuclei.hpp" 00039 #include "bdfls_tools.hpp" 00040 #include "messaging.hpp" 00041 00042 extern bdflsClass bdfls; 00043 00044 // *************** Nuclei class ******************* 00045 // ----------- Nuclei::Nuclei ----------------- 00046 Nuclei::Nuclei() 00047 { 00048 ZA = 0; 00049 Z = 0; 00050 N = 0; 00051 A = 0; 00052 AWR = 0.0; 00053 tau = 0.0; 00054 } 00055 // ----------- Nuclei::Nuclei ----------------- 00056 Nuclei::Nuclei(int za) 00057 { 00058 ZA = za; 00059 crack_ZA(); 00060 00061 // also set the atomic weight 00062 if ( za == 0 ) 00063 { 00064 AWR = 0.0; 00065 } 00066 else 00067 { 00068 mass_life_list::iterator XYptr; 00069 if(!bdfls.Mass_Life.at(za, XYptr)) 00070 { 00071 SevereError("Nuclei::Nuclei",pastenum("no mass found for za: ",za)); 00072 } 00073 AWR = XYptr->Mass(); 00074 } 00075 } 00076 // ----------- Nuclei::~Nuclei ----------------- 00077 Nuclei::~Nuclei() 00078 { 00079 } 00080 // ----------- Nuclei::set ----------------- 00081 void Nuclei::set(int za) 00082 { 00083 ZA = za; 00084 crack_ZA(); 00085 00086 // also set the atomic weight 00087 if ( za == 0 ) 00088 { 00089 AWR = 0.0; 00090 } 00091 else 00092 { 00093 mass_life_list::iterator XYptr; 00094 if(!bdfls.Mass_Life.at(za, XYptr)) 00095 { 00096 SevereError("Nuclei::set",pastenum("no mass found for za: ",za)); 00097 } 00098 AWR = XYptr->Mass(); 00099 } 00100 } 00101 // ----------- Nuclei::crack_ZA ----------------- 00102 void Nuclei::crack_ZA() 00103 // get the proton (Z), neutron (N), and mass (A) numbers for the ZA 00104 { 00105 Z = ZA/1000; 00106 A = ZA - 1000*Z; 00107 if(A == 0) 00108 { 00109 N = 0; // a natural target 00110 } 00111 else 00112 { 00113 N = A - Z; 00114 } 00115 }