Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

more/phys/nuclear.h

Go to the documentation of this file.
00001 //  Copyright (C) 2001  Petter Urkedal (petter.urkedal@matfys.lth.se)
00002 //
00003 //  This file is free software; you can redistribute it and/or modify
00004 //  it under the terms of the GNU General Public License as published by
00005 //  the Free Software Foundation; either version 2 of the License, or
00006 //  (at your option) any later version.
00007 //
00008 //  This file is distributed in the hope that it will be useful,
00009 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //  GNU General Public License for more details.
00012 //
00013 //  You should have received a copy of the GNU General Public License
00014 //  along with this program; if not, write to the Free Software
00015 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00016 //
00017 //  As a special exception, you may use this file as part of a free
00018 //  software library without restriction.  Specifically, if other files
00019 //  instantiate templates or use macros or inline functions from this
00020 //  file, or you compile this file and link it with other files to
00021 //  produce an executable, this file does not by itself cause the
00022 //  resulting executable to be covered by the GNU General Public
00023 //  License.  This exception does not however invalidate any other
00024 //  reasons why the executable file might be covered by the GNU General
00025 //  Public License.
00026 //
00027 //  $Id: nuclear.h,v 1.1 2002/05/30 18:01:40 petter_urkedal Exp $
00028 
00029 
00030 #ifndef PHYSICS_NUCLEAR_H
00031 #define PHYSICS_NUCLEAR_H
00032 
00033 #include <iosfwd>
00034 #include <string>
00035 #include <more/math/qtypes.h>
00036 #include <more/io/syncstream.h>
00037 #include <cstdlib>
00038 
00039 
00040 namespace more {
00041 namespace phys {
00042 
00043   namespace nuclear_unit_constants {
00044     const double mp = 938.280;
00045     const double mn = 939.573;
00046     const double mN = 938.927;
00047     const double hbar = 197.329;
00048     const double f_2mN_hbar2 = 0.0482259;
00049     const double f_hbar2_2mN = 20.7358;
00050   }
00051 
00052 
00053   // ---   n u c l e u s   ---
00054 
00055   extern more::minus_half_tag  mt_neut;  // neutron iso-spin z-projection
00056   extern more::half_tag        mt_prot;  // proton iso-spin z-projection
00057 
00058   extern int nuclear_magic_number_array[];
00059   extern std::size_t nuclear_magic_number_count;
00060 
00061   bool is_nuclear_magic_number(int);
00062 
00063   std::string chemical_symbol(int Z);
00064   std::string chemical_name(int Z);
00065   int Z_of_chemical(std::string name_or_symbol);
00066   int Z_first_unnamed();
00067 
00068   struct nucleus
00069   {
00070       nucleus() : n_p(0), n_n(0) {}
00071 
00072       nucleus(int N, int Z);
00073 
00074       nucleus(const nucleus& x)
00075           : n_p(x.n_p), n_n(x.n_n) {}
00076 
00077       nucleus&
00078       operator=(nucleus const& x)
00079       {
00080           n_n = x.n_n; n_p = x.n_p;
00081           return *this;
00082       }
00083 
00084 #if defined(MORE_BACKWARD) && MORE_BACKWARD < 20000612
00085       int N() const { return n_n; }
00086       int Z() const { return n_p; }
00087       int A() const { return n_n+n_p; }
00088       int n_particles(more::pm_half const& mt) const
00089         { return mt == more::half? n_p : n_n; }
00090       static int Z(std::string s) { return n_prot(s); }
00091 #endif
00092       int n_neut() const { return n_n; }
00093       int n_prot() const { return n_p; }
00094       int n_part() const { return n_n + n_p; }
00095       int n_part(more::pm_half const& mt) const
00096         { return mt == more::half? n_p : n_n; }
00097       int n_part(more::half_tag) const { return n_p; }
00098       int n_part(more::minus_half_tag) const { return n_n; }
00099 
00100       /// \depreciated
00101       std::string chemical_name() const { return phys::chemical_symbol(n_p); }
00102 
00103       std::string chemical_symbol() const
00104       { return phys::chemical_symbol(n_p); }
00105 
00106       std::string chemical_full_name() const
00107       { return phys::chemical_name(n_p); }
00108 
00109       std::string name() const;
00110 
00111       void sync(more::io::syncstream&);
00112 
00113       /// \depreciated
00114       static int n_prot(std::string s) { return Z_of_chemical(s); }
00115       /// \depreciated
00116       static std::string chemical_name(int Z_)
00117       { return phys::chemical_symbol(Z_); }
00118       /// \depreciated
00119       static int n_prot_unnamed() { return Z_first_unnamed(); }
00120       // XXX is is allowed to overload the non-static member function
00121       // chemical_name() with a static chemical_name(int)?
00122 
00123     private:
00124 //       static const char *chemical_name_table[Z_first_unnamed+1];
00125       unsigned char n_p, n_n;
00126   };
00127 
00128   inline bool operator==(nucleus const& X, nucleus const& Y)
00129   {
00130       return X.n_neut() == Y.n_neut()
00131           && Y.n_prot() == Y.n_prot();
00132   }
00133   inline bool operator!=(nucleus const& X, nucleus const& Y)
00134   {
00135       return !(X == Y);
00136   }
00137   inline bool operator<(nucleus const& X, nucleus const& Y)
00138   {
00139       int A0 = X.n_part();
00140       int A1 = Y.n_part();
00141       if (A0 < A1)
00142           return true;
00143       if (A0 > A1)
00144           return false;
00145       return X.n_prot() < Y.n_prot();
00146   }
00147   inline bool operator>(nucleus const& X, nucleus const& Y)
00148   {
00149       return Y < X;
00150   }
00151   inline bool operator<=(nucleus const& X, nucleus const& Y)
00152   {
00153       return !(Y < X);
00154   }
00155   inline bool operator>=(nucleus const& X, nucleus const& Y)
00156   {
00157       return !(X < Y);
00158   }
00159 
00160   std::istream& operator>>(std::istream&, nucleus&);
00161   std::ostream& operator<<(std::ostream&, const nucleus&);
00162 
00163   inline nucleus neighbor(nucleus const& nucl, int delta_N, int delta_Z) {
00164       return nucleus(nucl.n_neut() + delta_N, nucl.n_prot() + delta_Z);
00165   }
00166 
00167   /** The binding energy according to the semiempirical mass formula. */
00168   double semiempirical_binding(nucleus const&);
00169 
00170   /** Returns semiempirical (neutron, proton) separation energies. */
00171   std::pair<double, double>
00172   semiempirical_separation_energies(nucleus const& nucl);
00173 
00174   /** This gives a rough philter of nuclei which are very unbound. It uses
00175       the semiempirical mass formula. */
00176   bool is_reasonably_bound(nucleus const&);
00177 
00178 #if 0
00179   // ---   n u c l e a r   s t a t e   ---
00180 
00181   class nuclear_state : public nucleus {
00182 
00183       more::halfint spin_;
00184       more::pm_one parity_;
00185       more::halfint isospin_;
00186       double energy;
00187 
00188     public:
00189       more::pm_one parity() { return parity_; }
00190       more::halfint spin() { return spin_; }
00191       more::halfint isospin() { return isospin_; }
00192       more::halfint isospin_z() { return (n_prot() - n_neut())*more::half; }
00193       double excitation_energy() { return energy; }
00194 
00195       nuclear_state(const nucleus& nuc, more::halfint J, more::pm_one pi,
00196                     more::halfint T, double E=0.0)
00197           : nucleus(nuc), spin_(J), parity_(pi), isospin_(T), energy(E) {}
00198 
00199       nuclear_state(const nucleus& nuc, more::halfint J,
00200                     more::pm_one pi, double E = 0.0)
00201           : nucleus(nuc), spin_(J), parity_(pi),
00202             isospin_(isospin_z()), energy(E) {}
00203   };
00204 #endif
00205 
00206 
00207 } // namespace phys
00208 } // namespace more
00209 
00210 #endif

Generated on Sat Sep 7 19:11:22 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.