nucmass_gen.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2014-2020, 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_NUCMASS_GEN_H
24 #define O2SCL_NUCMASS_GEN_H
25 
26 /** \file nucmass_gen.h
27  \brief File defining \ref o2scl::nucmass_gen
28 */
29 
30 #include <cmath>
31 #include <string>
32 #include <map>
33 #include <o2scl/nucmass.h>
34 
35 #ifndef DOXYGEN_NO_O2NS
36 namespace o2scl {
37 #endif
38 
39  /** \brief Nuclear properties
40  */
41  class nucmass_gen : public nucmass_table {
42 
43  public:
44 
45  nucmass_gen();
46 
47  ~nucmass_gen();
48 
49  /** \brief Load a file with binding energies
50  */
51  int load_be(std::string fname, std::string be_col,
52  double be_units, bool external=false);
53 
54  /// Return the type, \c "nucmass_gen".
55  virtual const char *type() { return "nucmass_gen"; }
56 
57  /// Returns true if data has been loaded
58  bool is_loaded() { return (n>0); }
59 
60  /** \brief Return false if the mass formula does not include
61  specified nucleus
62  */
63  virtual bool is_included(int Z, int N);
64 
65  /// Return number of entries
66  virtual size_t get_nentries() { return n; }
67 
68  /// Given \c Z and \c N, return the mass excess in MeV
69  virtual double mass_excess(int Z, int N);
70 
71  /// Given \c Z and \c N, return the mass excess in MeV
72  virtual double get_string(int Z, int N, std::string column);
73 
74 #ifndef DOXYGEN_INTERNAL
75 
76  protected:
77 
78  /// The \ref o2scl::table object containing the data
80 
81  /// Column which refers to the mass excess
82  size_t mex_col_ix;
83 
84  /// The last table index for caching
85  int last;
86 
87 #endif
88 
89  };
90 
91 #ifndef DOXYGEN_NO_O2NS
92 }
93 #endif
94 
95 #endif
o2scl::nucmass_gen
Nuclear properties.
Definition: nucmass_gen.h:41
o2scl::nucmass_table::n
size_t n
The number of entries.
Definition: nucmass.h:341
o2scl::table
o2scl::nucmass_gen::is_loaded
bool is_loaded()
Returns true if data has been loaded.
Definition: nucmass_gen.h:58
o2scl::nucmass_gen::last
int last
The last table index for caching.
Definition: nucmass_gen.h:85
o2scl::nucmass_gen::is_included
virtual bool is_included(int Z, int N)
Return false if the mass formula does not include specified nucleus.
o2scl::nucmass_gen::get_nentries
virtual size_t get_nentries()
Return number of entries.
Definition: nucmass_gen.h:66
o2scl::nucmass_gen::mass_excess
virtual double mass_excess(int Z, int N)
Given Z and N, return the mass excess in MeV.
o2scl::nucmass_gen::get_string
virtual double get_string(int Z, int N, std::string column)
Given Z and N, return the mass excess in MeV.
o2scl::nucmass_gen::data
o2scl::table data
The o2scl::table object containing the data.
Definition: nucmass_gen.h:79
o2scl::nucmass_gen::mex_col_ix
size_t mex_col_ix
Column which refers to the mass excess.
Definition: nucmass_gen.h:82
o2scl::nucmass_gen::type
virtual const char * type()
Return the type, "nucmass_gen".
Definition: nucmass_gen.h:55
o2scl::nucmass_gen::load_be
int load_be(std::string fname, std::string be_col, double be_units, bool external=false)
Load a file with binding energies.
o2scl::nucmass_table
Tabulated nuclear masses [abstract base].
Definition: nucmass.h:330

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