A basic data structure for nuclei, class o2scl::nucleus, is implemented as a child of of o2scl::part.
Nuclear masses are given as children of o2scl::nucmass and are generally of two types: tables of masses (children of o2scl::nucmass_table) or formulas which generate masses from a set of parameters and can be fit to data (o2scl::nucmass_fit).
There are eleven mass table types currently included.
The mass formulas which can be fit to data are
In order to create a set of nuclei stored in a std::vector
object, one can use o2scl_part::nucdist_set().
Nuclear mass fit example
#include <iostream>
#include <o2scl/test_mgr.h>
#include <o2scl/nucmass_fit.h>
#ifdef O2SCL_HDF
#include <o2scl/hdf_file.h>
#include <o2scl/hdf_nucmass_io.h>
#endif
using namespace std;
int main(void) {
cout.setf(ios::scientific);
#ifdef O2SCL_HDF
double res;
cout << sem.
B <<
" " << sem.
Sv <<
" " << sem.
Ss <<
" " << sem.
Ec <<
" " << sem.
Epair << endl;
cout << res << endl;
#else
cout << "No fitting was performed because O2scl appears not to have been "
<< "compiled with HDF support." << endl;
#endif
return 0;
}
Nuclear mass example
#include <iostream>
#include <o2scl/test_mgr.h>
#include <o2scl/table_units.h>
#include <o2scl/hdf_file.h>
#include <o2scl/hdf_io.h>
#include <o2scl/hdf_nucmass_io.h>
#include <o2scl/nucmass.h>
#include <o2scl/nucdist.h>
#include <o2scl/nucmass_fit.h>
#include <o2scl/nucmass_dz.h>
#include <o2scl/nucmass_hfb.h>
#include <o2scl/nucmass_wlw.h>
#include <o2scl/nucmass_ktuy.h>
using namespace std;
int main(void) {
cout.setf(ios::scientific);
static const size_t n_tables=11;
nucmass *massp[n_tables]={&se,&mnmsk,&hfb14,&hfb21,&hfb27,
&ame03,&dz,&ktuy05,&dvi,&ws32,&ws36};
vector<nucleus> ame_dist;
static const size_t n_fits=2;
double res;
for(size_t i=0;i<n_fits;i++) {
}
"hfb27 ame03 dz96 ktuy05 dvi ws32 ws36");
for(size_t i=0;i<ame_dist.size();i++) {
line.push_back(ame_dist[i].Z);
line.push_back(ame_dist[i].N);
double ame_mass=ame.
mass_excess(ame_dist[i].Z,ame_dist[i].N);
line.push_back(ame_mass);
for(size_t j=0;j<n_tables;j++) {
if (massp[j]->is_included(ame_dist[i].Z,ame_dist[i].N)) {
double val=ame_mass-
line.push_back(val);
} else {
line.push_back(0.0);
}
}
}
return 0;
}