nucmass_dz.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2017, Andrew W. Steiner
5 
6  This file is part of O2scl.
7 
8  O2scl is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  O2scl is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with O2scl. If not, see <http://www.gnu.org/licenses/>.
20 
21  -------------------------------------------------------------------
22 */
23 #ifndef O2SCL_DZ_MASS_H
24 #define O2SCL_DZ_MASS_H
25 
26 /** \file nucmass_dz.h
27  \brief File defining \ref o2scl::nucmass_dz_table and other classes
28 */
29 
30 #include <boost/numeric/ublas/vector.hpp>
31 #include <boost/numeric/ublas/matrix.hpp>
32 
33 #include <o2scl/nucmass.h>
34 #include <o2scl/tensor.h>
35 
36 #ifndef DOXYGEN_NO_O2NS
37 namespace o2scl {
38 #endif
39 
40  /** \brief Duflo-Zuker mass formula from tables
41 
42  The mass formulas from \ref Duflo95 as given in the
43  files <tt>du_zu_28.feb95</tt> and <tt>du_zu_10.feb96</tt>
44  as obtained from http://amdc.in2p3.fr/web/dz.html . These
45  data files have been reformatted for \o2 into HDF files
46  with names <tt>du_zu_95.o2</tt> and <tt>du_zu_96.o2</tt>.
47  */
49 
50  public:
51 
52  /** \brief Create a new mass formula object
53 
54  The string \c model is either <tt>"95"</tt>
55  or <tt>"96"</tt>.
56  */
57  nucmass_dz_table(std::string model="96", bool external=false);
58 
59  virtual ~nucmass_dz_table();
60 
61  /** \brief Return false if the mass formula does not include
62  specified nucleus
63  */
64  virtual bool is_included(int Z, int N);
65 
66  /// Given \c Z and \c N, return the mass excess in MeV
67  virtual double mass_excess(int Z, int N);
68 
69  /// Verify that the constructor properly loaded the table
70  bool is_loaded() { return (n>0); }
71 
72  /// Return the type, \c "nucmass_dz_table".
73  virtual const char *type() { return "nucmass_dz_table"; }
74 
75  /// Return number of entries
76  int get_nentries() { return n; }
77 
78 #ifndef DOXYGEN_INTERNAL
79 
80  protected:
81 
82  /// The reference for the original data
83  std::string reference;
84 
85  /// Table containing the data
87 
88  /// The last table index for caching
89  int last;
90 
91  /// The total number of entries
92  int n;
93 
94 #endif
95 
96  };
97 
98  /** \brief The 10-parameter Duflo-Zuker mass formula
99 
100  This class is designed to provide essentially identical results
101  to the original 10-parameter Duflo-Zuker code (see \ref Duflo95)
102  at
103 
104  http://amdc.in2p3.fr/theory/du_zu_10.feb96fort
105 
106  The default values of \ref nucmass::m_neut and \ref
107  nucmass::m_prot are adjusted to make sure that the mass
108  excesses match the values given in the original.
109 
110  \todo This appears to be limited for large nuclei because 'i'
111  becomes larger than imax and then statements like
112  noc[i][j]=moc-ju and noc[i+1][j]=ju become invalid. This needs
113  to be more carefully understood and documented. For now,
114  is_included() just arbitrarily chooses 240 as a maximum for N
115  and Z.
116  \comment
117  Are there any bound nuclei for which the arrays aren't
118  sufficient? Maybe not, in which case there isn't really a
119  problem.
120  \endcomment
121  \todo Document each field.
122  */
124 
125  public:
126 
131 
132 #ifndef DOXYGEN_INTERNAL
133 
134  protected:
135 
136  /** \name Workspace vectors used internally
137 
138  These are allocated in the class constructor.
139  */
140  //@{
141  /** \brief Desc
142 
143  Note that the first index is already 0 indexed in the DZ version
144  */
146 
147  /// Desc
148  ubvector y;
149 
150  /// Desc
151  ubvector pp;
152 
153  /// Desc
154  ubvector oei;
155 
156  /// Desc
157  ubvector dei;
158 
159  /// Desc
160  ubvector qx;
161 
162  /// Desc
163  ubvector dx;
164 
165  /// Desc
166  ubvector op;
167 
168  /// Desc
169  ubvector os;
170 
171  /// Desc
172  ubvector dyda;
173 
174  /// Desc
175  ubvector_int n2;
176 
177  /// Desc
178  ubmatrix_int noc;
179  //@}
180 
181 #endif
182 
183  public:
184 
185  nucmass_dz_fit();
186 
187  virtual ~nucmass_dz_fit();
188 
189  /// Coefficients
190  ubvector b;
191 
192  /** \brief Return false if the mass formula does not include
193  specified nucleus
194  */
195  virtual bool is_included(int Z, int N);
196 
197  /// Return the type, \c "nucmass_dz_fit".
198  virtual const char *type() { return "nucmass_dz_fit"; }
199 
200  /// Fix parameters from an array for fitting
201  virtual int fit_fun(size_t nv, const ubvector &x);
202 
203  /// Fill array with guess from present values for fitting
204  virtual int guess_fun(size_t nv, ubvector &x);
205 
206  /** \brief Return the binding energy in MeV
207 
208  This function reproduces the original function called
209  <tt>mass10()</tt>, except that, to be consistent
210  with the other \o2 nuclear mass classes, it returns
211  the binding energy with the opposite sign from the
212  original.
213  */
214  virtual double binding_energy(int Z, int N);
215 
216  /** \brief Return the binding energy in MeV
217  */
218  virtual double binding_energy_d(double Z, double N);
219 
220  /** \brief Given \c Z and \c N, return the mass excess in MeV
221  */
222  virtual double mass_excess(int Z, int N);
223 
224  /** \brief Given \c Z and \c N, return the mass excess in MeV
225  */
226  virtual double mass_excess_d(double Z, double N);
227 
228  };
229 
230  /** \brief The 33-parameter Duflo-Zuker mass formula
231 
232  This class is designed to provide essentially identical results
233  to the original Duflo-Zuker code (see \ref Duflo95) at
234 
235  http://amdc.in2p3.fr/theory/dz31.f
236 
237  (Two parameters were added by Duflo and Zuker after the fact to
238  the original 31-parameter code, and still referred to as
239  <tt>dz31.f</tt>.)
240 
241  The default values of \ref nucmass::m_neut and \ref
242  nucmass::m_prot are adjusted to make sure that the mass
243  excesses match the values given in the original.
244 
245  \todo Document each field.
246 
247  Some explanations about the individual terms come from
248  \ref MendozaTemis10 and the work by
249  G. Bertsch at
250  http://www.phys.washington.edu/users/bertsch/duflo2.ps
251 
252  - <tt>a[0]</tt>: "Full master term". Density sqaured divided by
253  cube root of A. This is the master term which includes the bulk
254  energy from the liquid droplet model and the harmonic oscillator
255  effects
256  - <tt>a[2]</tt>: "Full spin-orbit term +"
257  - <tt>a[4]</tt>: "Full spin-orbit term -"
258  - <tt>a[6]</tt>: "Full cross term"
259  - <tt>a[8]</tt>: "Partial master term"
260  - <tt>a[10]</tt>: "Partial spin-orbit term +"
261  - <tt>a[12]</tt>: "Partial spin-orbit term -"
262  - <tt>a[14]</tt>: "S3", polarizability of the valence spin-orbit shell
263  - <tt>a[16]</tt>: "SQ", "QQM", a neutron-proton interaction
264  - <tt>a[18], a[19]</tt>: "D3" balance of monopole effects
265  - <tt>a[20], a[21], a[24], a[25]</tt>: "QQ+"/"QQ-", Quadrupole
266  terms, corresponding to filling equidistant Nilsson orbits
267  - <tt>a[22], a[23]</tt>: "D0", Loss of monopole and gain of quadrupole
268  energy for intruders
269  - <tt>a[26]</tt>: "TT", Symmetry energy
270  - <tt>a[28]</tt>: "SS"
271  - <tt>a[30]</tt>: "C", Coulomb energy
272  - <tt>a[31]</tt>: "P0", First pairing energy term
273  - <tt>a[32]</tt>: "P1", Second pairing energy term
274 
275  For odd parameters up to <tt>a[29]</tt>, the odd parameter is just
276  the preceeding even term divided by the cube root of A.
277 
278  Note that the original code states that, <tt>"for i even
279  a(i,program) =a(i-1,paper)*a(i,paper)"</tt>.
280  */
282 
283  public:
284 
289 
290 #ifndef DOXYGEN_INTERNAL
291 
292  protected:
293 
294  /** \name Workspace vectors used internally
295 
296  These are allocated in the class constructor.
297  */
298  //@{
299  ubvector dyda, fyda, fyd0, onps, oei, dei, op2, ym, op1;
300  ubvector shell, sshell;
301  tensor3<> op, onp, ot;
302  ubvector_int n4, nn, jup, jud, n2;
303  ubmatrix_int noc;
304  //@}
305 
306 #endif
307 
308  public:
309 
311 
312  virtual ~nucmass_dz_fit_33();
313 
314  /// Coefficients
315  ubvector a;
316 
317  /// Return the type, \c "nucmass_dz_fit_33".
318  virtual const char *type() { return "nucmass_dz_fit_33"; }
319 
320  /// Fix parameters from an array for fitting
321  virtual int fit_fun(size_t nv, const ubvector &x);
322 
323  /// Fill array with guess from present values for fitting
324  virtual int guess_fun(size_t nv, ubvector &x);
325 
326  /** \brief Return false if the mass formula does not include
327  specified nucleus
328  */
329  virtual bool is_included(int Z, int N);
330 
331  /** \brief Return the binding energy in MeV
332 
333  This function reproduces the original function called
334  <tt>EMASSDZ()</tt>, except that, to be consistent
335  with the other \o2 nuclear mass classes, it returns
336  the binding energy with the opposite sign from the
337  original.
338  */
339  virtual double binding_energy(int Z, int N);
340 
341  /** \brief Return the binding energy in MeV
342  */
343  virtual double binding_energy_d(double Z, double N);
344 
345  /** \brief Given \c Z and \c N, return the mass excess in MeV
346  */
347  virtual double mass_excess(int Z, int N);
348 
349  /** \brief Given \c Z and \c N, return the mass excess in MeV
350  */
351  virtual double mass_excess_d(double Z, double N);
352 
353  };
354 
355 #ifndef DOXYGEN_NO_O2NS
356 }
357 #endif
358 
359 #endif
ubvector pp
Desc.
Definition: nucmass_dz.h:151
int get_nentries()
Return number of entries.
Definition: nucmass_dz.h:76
ubvector qx
Desc.
Definition: nucmass_dz.h:160
ubvector b
Coefficients.
Definition: nucmass_dz.h:190
ubvector_int n2
Desc.
Definition: nucmass_dz.h:175
bool is_loaded()
Verify that the constructor properly loaded the table.
Definition: nucmass_dz.h:70
virtual bool is_included(int Z, int N)
Return false if the mass formula does not include specified nucleus.
ubvector a
Coefficients.
Definition: nucmass_dz.h:315
ubvector op
Desc.
Definition: nucmass_dz.h:166
nucmass_dz_table(std::string model="96", bool external=false)
Create a new mass formula object.
int n
The total number of entries.
Definition: nucmass_dz.h:92
virtual double binding_energy(int Z, int N)
Return the binding energy in MeV.
Definition: nucmass.h:248
virtual const char * type()
Return the type, "nucmass_dz_table".
Definition: nucmass_dz.h:73
Duflo-Zuker mass formula from tables.
Definition: nucmass_dz.h:48
table data
Table containing the data.
Definition: nucmass_dz.h:86
ubvector oei
Desc.
Definition: nucmass_dz.h:154
ubvector y
Desc.
Definition: nucmass_dz.h:148
std::string reference
The reference for the original data.
Definition: nucmass_dz.h:83
virtual double mass_excess(int Z, int N)
Given Z and N, return the mass excess in MeV.
The 10-parameter Duflo-Zuker mass formula.
Definition: nucmass_dz.h:123
ubvector dyda
Desc.
Definition: nucmass_dz.h:172
virtual double mass_excess_d(double Z, double N)
Given Z and N, return the mass excess in MeV.
ubvector dx
Desc.
Definition: nucmass_dz.h:163
virtual const char * type()
Return the type, "nucmass_dz_fit_33".
Definition: nucmass_dz.h:318
Tabulated nuclear masses [abstract base].
Definition: nucmass.h:325
ubvector dei
Desc.
Definition: nucmass_dz.h:157
virtual double binding_energy_d(double Z, double N)
Return the binding energy in MeV.
Definition: nucmass.h:258
The 33-parameter Duflo-Zuker mass formula.
Definition: nucmass_dz.h:281
ubvector os
Desc.
Definition: nucmass_dz.h:169
ubmatrix_int noc
Desc.
Definition: nucmass_dz.h:178
int last
The last table index for caching.
Definition: nucmass_dz.h:89
virtual const char * type()
Return the type, "nucmass_dz_fit".
Definition: nucmass_dz.h:198
tensor3 onp
Desc.
Definition: nucmass_dz.h:145
Fittable mass formula [abstract base].
Definition: nucmass.h:347

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).