Compile a simple program using TkN
tkn-exec.cpp
provides a simple example program using TkN to print the ground state spin parity of the Carbon isotopic chain.
To compile this example, use :
g++ tkn-exec.cpp -o tkn-exec `tkn-config --cflags --linklibs`
Source code :
#include "tkmanager.h"
using namespace std;
int main()
{
cout << "**************************************************" << endl;
cout << "* Ground state spin parity in C isotopic chain *" << endl;
cout << "**************************************************" << endl;
cout<<endl;
for(const auto &nuc : gmanager->get_nuclei([](auto nuc) {return (nuc->get_z()==6);})) {
auto lvls =nuc->get_level_scheme()->get_levels([](auto lvl) {return (lvl->get_energy()==0);});
cout << setw(5) << left << nuc->get_symbol();
if(!lvls.empty()) cout << lvls.at(0)->get_spin_parity()->get_jpi_str();
cout << endl;
}
return EXIT_SUCCESS;
}