21#ifndef PYNE_52BMSKGZ3FHG3NQI566D4I2ZLY
22#define PYNE_52BMSKGZ3FHG3NQI566D4I2ZLY
24#define PYNE_IS_AMALGAMATED
82#ifndef PYNE_KMMHYNANYFF5BFMEYIP7TUNLHA
83#define PYNE_KMMHYNANYFF5BFMEYIP7TUNLHA
105#define isnan(x) __isnand((double)x)
109#define isnan(x) ((x) != (x))
112#ifndef JSON_IS_AMALGAMATION
113#define JSON_IS_AMALGAMATION
129static std::string
alphabet =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
133 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
139std::string
to_str(
unsigned int t);
140std::string
to_str(
double t);
141std::string
to_str(
bool t);
172std::string
get_flag(
char line[],
int max_l);
202double slope(
double x2,
double y2,
double x1,
double y1);
206double solve_line(
double x,
double x2,
double y2,
double x1,
double y1);
208double tanh(
double x);
209double coth(
double x);
237 virtual const char *
what()
const throw() {
238 std::string FNFstr(
"File not found: ");
239 if (!filename.empty()) FNFstr += filename;
241 return (
const char *)FNFstr.c_str();
245 std::string filename;
264#if !defined(_XDRESS_EXTRA_TYPES_)
265#define _XDRESS_EXTRA_TYPES_
267#if defined(__cplusplus)
268namespace extra_types {
279template <
class T>
class MemoryKnight {
287 T *defnew() {
return new T(); };
293 T *renew(
void *ptr) {
return new (ptr) T(); };
297 void deall(T *ptr) {
delete ptr; };
303#elif defined(__STDC__)
329#ifndef PYNE_MRNAFG5GNZDNPCRPX3UCBZ5MFE
330#define PYNE_MRNAFG5GNZDNPCRPX3UCBZ5MFE
344#ifndef PYNE_IS_AMALGAMATED
345#include "extra_types.h"
353 virtual const char *what()
const throw() {
354 return "Index of point is out of bounds. Cannot handle in HDF5 file.";
371 virtual const char *
what()
const throw() {
372 std::string FNH5str(
"Not a valid HDF5 file: ");
373 if (!filename.empty()) FNH5str += filename;
375 return (
const char *)FNH5str.c_str();
379 std::string filename;
395 virtual const char *
what()
const throw() {
396 std::string msg(
"the group ");
398 msg +=
" not found in the file ";
400 return (
const char *)msg.c_str();
404 std::string filename;
405 std::string groupname;
424 virtual const char *
what()
const throw() {
425 std::string msg(
"the path ");
427 msg +=
" was not found in the HDF5 file ";
429 return (
const char *)msg.c_str();
433 std::string filename;
443 hsize_t count[1] = {1};
444 hsize_t offset[1] = {
static_cast<hsize_t
>(n)};
446 hid_t dspace = H5Dget_space(dset);
447 hsize_t npoints = H5Sget_simple_extent_npoints(dspace);
450 if (n < 0) offset[0] = offset[0] + npoints;
455 H5Sselect_hyperslab(dspace, H5S_SELECT_SET, offset, NULL, count, NULL);
458 hsize_t dimsm[1] = {1};
459 hid_t memspace = H5Screate_simple(1, dimsm, NULL);
461 hsize_t count_out[1] = {1};
462 hsize_t offset_out[1] = {0};
464 H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL, count_out,
468 H5Dread(dset, dtype, memspace, dspace, H5P_DEFAULT, data_out);
483 hid_t dtype = H5T_NATIVE_DOUBLE) {
484 std::set<T> cpp_set = std::set<T>();
486 hid_t dset = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
489 hid_t arr_space = H5Dget_space(dset);
490 int arr_dim = H5Sget_simple_extent_dims(arr_space, arr_len, NULL);
493 T *mem_arr =
new T[arr_len[0]];
494 H5Dread(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, mem_arr);
497 cpp_set.insert(&mem_arr[0], &mem_arr[arr_len[0]]);
511 hid_t dtype = H5T_NATIVE_DOUBLE) {
512 std::vector<T> cpp_vec;
514 hid_t dset = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
517 hid_t arr_space = H5Dget_space(dset);
518 int arr_ndim = H5Sget_simple_extent_dims(arr_space, arr_dims, NULL);
521 T mem_arr[arr_dims[0]];
522 H5Dread(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, mem_arr);
525 cpp_vec.assign(mem_arr, mem_arr + arr_dims[0]);
537 hid_t h5file, std::string data_path, hid_t dtype = H5T_NATIVE_DOUBLE) {
539 hid_t dset = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
542 hid_t arr_space = H5Dget_space(dset);
543 int arr_ndim = H5Sget_simple_extent_dims(arr_space, arr_dims, NULL);
548 T mem_arr[arr_dims[0] * arr_dims[1]];
549 H5Dread(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, mem_arr);
552 std::vector<std::vector<T>> cpp_vec(arr_dims[0], std::vector<T>(arr_dims[1]));
553 for (
int i = 0; i < arr_dims[0]; i++) {
554 cpp_vec[i].assign(mem_arr + (i * arr_dims[1]),
555 mem_arr + ((i + 1) * arr_dims[1]));
568 hid_t h5file, std::string data_path, hid_t dtype = H5T_NATIVE_DOUBLE) {
570 hid_t dset = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
573 hid_t arr_space = H5Dget_space(dset);
574 int arr_ndim = H5Sget_simple_extent_dims(arr_space, arr_dims, NULL);
579 T mem_arr[arr_dims[0] * arr_dims[1] * arr_dims[2]];
580 H5Dread(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, mem_arr);
584 std::vector<std::vector<std::vector<T>>> cpp_vec(
586 std::vector<std::vector<T>>(arr_dims[1], std::vector<T>(arr_dims[2])));
587 for (
int i = 0; i < arr_dims[0]; i++) {
588 for (
int j = 0; j < arr_dims[1]; j++) {
589 cpp_vec[i][j].assign(
590 mem_arr + ((i * arr_dims[1] * arr_dims[2]) + (j * arr_dims[2])),
592 ((i * arr_dims[1] * arr_dims[2]) + ((j + 1) * arr_dims[2])));
617 hid_t dtype = H5T_NATIVE_DOUBLE) {
618 hid_t h5_set = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
619 hid_t h5_space = H5Dget_space(h5_set);
620 hid_t h5_type = H5Dget_type(h5_set);
626 shape[0] = H5Sget_simple_extent_npoints(h5_space);
627 shape[1] = H5Tget_nmembers(h5_type);
630 std::string *cols_buf =
new std::string[
shape[1]];
631 for (
int n = 0; n <
shape[1]; n++)
632 cols_buf[n] = H5Tget_member_name(h5_type, n);
633 cols.assign(cols_buf, cols_buf +
shape[1]);
637 T *col_buf =
new T[
shape[0]];
640 for (
int n = 0; n <
shape[1]; n++) {
642 col_type = H5Tcreate(H5T_COMPOUND,
sizeof(T));
643 H5Tinsert(col_type,
cols[n].c_str(), 0, dtype);
646 H5Dread(h5_set, col_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, col_buf);
659 std::map<std::string, std::vector<T>>
data;
669 std::map<std::string, T> row = std::map<std::string, T>();
680 hid_t ct = H5Tcreate(H5T_COMPOUND,
sizeof(
xd_complex_t));
681 H5Tinsert(ct,
"r", HOFFSET(
xd_complex_t, re), H5T_NATIVE_DOUBLE);
682 H5Tinsert(ct,
"i", HOFFSET(
xd_complex_t, im), H5T_NATIVE_DOUBLE);
695 hid_t ds = H5Dopen2(h5file, path.c_str(), H5P_DEFAULT);
700 hid_t grp = H5Gopen2(h5file, path.c_str(), H5P_DEFAULT);
722#ifndef PYNE_D35WIXV5DZAA5LLOWBY2BL2DPA
723#define PYNE_D35WIXV5DZAA5LLOWBY2BL2DPA
732#ifndef PYNE_IS_AMALGAMATED
841 virtual const char *
what()
const throw() {
842 std::string NaNEstr(
"Not a Nuclide! ");
843 if (!nucwas.empty()) NaNEstr += nucwas;
845 if (!nucnow.empty()) {
849 return (
const char *)NaNEstr.c_str();
901 virtual const char *
what()
const throw() {
902 std::string INFEstr(
"Indeterminate nuclide form: ");
903 if (!nucwas.empty()) INFEstr += nucwas;
905 if (!nucnow.empty()) {
909 return (
const char *)INFEstr.c_str();
968int id(
const char *nuc);
969int id(std::string nuc);
984std::string
name(
int nuc);
985std::string
name(
const char *nuc);
986std::string
name(std::string nuc);
996int znum(
const char *nuc);
997int znum(std::string nuc);
1007int anum(
const char *nuc);
1008int anum(std::string nuc);
1019int snum(
const char *nuc);
1020int snum(std::string nuc);
1033int zzaaam(
const char *nuc);
1034int zzaaam(std::string nuc);
1057int zzzaaa(
const char *nuc);
1058int zzzaaa(std::string nuc);
1081std::string
zzllaaam(
const char *nuc);
1082std::string
zzllaaam(std::string nuc);
1105int mcnp(
const char *nuc);
1106int mcnp(std::string nuc);
1129std::string
fluka(
int nuc);
1151std::string
serpent(
const char *nuc);
1152std::string
serpent(std::string nuc);
1173std::string
nist(
int nuc);
1174std::string
nist(
const char *nuc);
1175std::string
nist(std::string nuc);
1198int cinder(
const char *nuc);
1199int cinder(std::string nuc);
1220std::string
alara(
int nuc);
1221std::string
alara(
const char *nuc);
1222std::string
alara(std::string nuc);
1247int sza(
const char *nuc);
1248int sza(std::string nuc);
1270 return (
id(nuc) / 10000) * 10000;
1312#ifndef PYNE_7DOEB2PKSBEFFIA3Q2NARI3KFY
1313#define PYNE_7DOEB2PKSBEFFIA3Q2NARI3KFY
1323#ifndef PYNE_IS_AMALGAMATED
1329#define NUM_RX_NAMES 572
1336extern std::set<std::string>
names;
1338extern std::map<unsigned int, std::string>
id_name;
1340extern std::map<std::string, unsigned int>
name_id;
1342extern std::map<std::string, unsigned int>
altnames;
1344extern std::map<unsigned int, unsigned int>
id_mt;
1346extern std::map<unsigned int, unsigned int>
mt_id;
1348extern std::map<unsigned int, std::string>
labels;
1350extern std::map<unsigned int, std::string>
docs;
1353extern std::map<std::pair<std::string, int>,
unsigned int>
offset_id;
1356extern std::map<std::pair<std::string, unsigned int>,
int>
id_offset;
1363inline int offset(
int dz,
int da,
int ds = 0) {
1364 return dz * 10000000 + da * 10000 + ds;
1372unsigned int hash(std::string s);
1373unsigned int hash(
const char *s);
1389std::string
name(
int n);
1390std::string
name(
unsigned int n);
1391std::string
name(
char *s);
1392std::string
name(std::string s);
1393std::string
name(
int from_nuc,
int to_nuc, std::string z =
"n");
1394std::string
name(
int from_nuc, std::string to_nuc, std::string z =
"n");
1395std::string
name(std::string from_nuc,
int to_nuc, std::string z =
"n");
1396std::string
name(std::string from_nuc, std::string to_nuc, std::string z =
"n");
1414unsigned int id(
int x);
1415unsigned int id(
unsigned int x);
1416unsigned int id(
const char *x);
1417unsigned int id(std::string x);
1418unsigned int id(
int from_nuc,
int to_nuc, std::string z =
"n");
1419unsigned int id(
int from_nuc, std::string to_nuc, std::string z =
"n");
1420unsigned int id(std::string from_nuc,
int to_nuc, std::string z =
"n");
1421unsigned int id(std::string from_nuc, std::string to_nuc, std::string z =
"n");
1438unsigned int mt(
int x);
1439unsigned int mt(
unsigned int x);
1440unsigned int mt(
char *x);
1441unsigned int mt(std::string x);
1442unsigned int mt(
int from_nuc,
int to_nuc, std::string z =
"n");
1443unsigned int mt(
int from_nuc, std::string to_nuc, std::string z =
"n");
1444unsigned int mt(std::string from_nuc,
int to_nuc, std::string z =
"n");
1445unsigned int mt(std::string from_nuc, std::string to_nuc, std::string z =
"n");
1462std::string
label(
int x);
1463std::string
label(
unsigned int x);
1464std::string
label(
char *x);
1465std::string
label(std::string x);
1466std::string
label(
int from_nuc,
int to_nuc, std::string z =
"n");
1467std::string
label(
int from_nuc, std::string to_nuc, std::string z =
"n");
1468std::string
label(std::string from_nuc,
int to_nuc, std::string z =
"n");
1469std::string
label(std::string from_nuc, std::string to_nuc,
1470 std::string z =
"n");
1487std::string
doc(
int x);
1488std::string
doc(
unsigned int x);
1489std::string
doc(
char *x);
1490std::string
doc(std::string x);
1491std::string
doc(
int from_nuc,
int to_nuc, std::string z =
"n");
1492std::string
doc(
int from_nuc, std::string to_nuc, std::string z =
"n");
1493std::string
doc(std::string from_nuc,
int to_nuc, std::string z =
"n");
1494std::string
doc(std::string from_nuc, std::string to_nuc, std::string z =
"n");
1508int parent(
int nuc,
unsigned int rx, std::string z =
"n");
1509int parent(
int nuc, std::string rx, std::string z =
"n");
1510int parent(std::string nuc,
unsigned int rx, std::string z =
"n");
1511int parent(std::string nuc, std::string rx, std::string z =
"n");
1525int child(
int nuc,
unsigned int rx, std::string z =
"n");
1526int child(
int nuc, std::string rx, std::string z =
"n");
1527int child(std::string nuc,
unsigned int rx, std::string z =
"n");
1528int child(std::string nuc, std::string rx, std::string z =
"n");
1591 virtual const char *
what()
const throw() {
1592 std::string narxstr(
"Not a reaction! ");
1593 if (!rxwas.empty()) narxstr += rxwas;
1595 if (!rxnow.empty()) {
1599 return (
const char *)narxstr.c_str();
1646 virtual const char *
what()
const throw() {
1647 std::string INFEstr(
"Indeterminate reaction form: ");
1648 if (!rxwas.empty()) INFEstr += rxwas;
1650 if (!rxnow.empty()) {
1654 return (
const char *)INFEstr.c_str();
1713#ifndef PYNE_TEWK4A7VOFFLHDDXD5ZZ7KPXEQ
1714#define PYNE_TEWK4A7VOFFLHDDXD5ZZ7KPXEQ
1730#ifndef PYNE_IS_AMALGAMATED
1732#include "extra_types.h"
1741extern const double pi;
1742extern const double N_A;
1833double q_val(
int nuc);
1834double q_val(
const char *nuc);
1835double q_val(std::string nuc);
1865void _load_dose_map(std::map<int, dose> &dm, std::string source_path);
1885double dose_ratio(
const char *nuc,
int source);
1886double dose_ratio(std::string nuc,
int source);
1903extern std::map<int, double>
b_map;
1948double b(std::string nuc);
2004double fpyield(std::pair<int, int> from_to,
int source,
bool get_error);
2006double fpyield(
int from_nuc,
int to_nuc,
int source,
bool get_error);
2008double fpyield(
char *from_nuc,
char *to_nuc,
int source,
bool get_error);
2010double fpyield(std::string from_nuc, std::string to_nuc,
int source,
2024 bool operator()(
const std::pair<int, double> &lhs,
2025 const std::pair<int, double> &rhs)
const;
2031template <
typename T,
typename U>
2032std::vector<T>
data_access(
double emin,
double emax,
size_t valoffset,
2033 std::map<std::pair<int, double>, U> &data);
2037template <
typename T,
typename U>
2038std::vector<T>
data_access(
int parent,
double min,
double max,
size_t valoffset,
2039 std::map<std::pair<int, double>, U> &data);
2043template <
typename T,
typename U>
2044T
data_access(std::pair<int, int> from_to,
size_t valoffset,
2045 std::map<std::pair<int, int>, U> &data);
2049template <
typename T,
typename U>
2050std::vector<T>
data_access(
int parent,
size_t valoffset,
2051 std::map<std::pair<int, int>, U> &data);
2052template <
typename T,
typename U>
2053std::vector<T>
data_access(
int parent,
size_t valoffset,
2054 std::map<std::pair<int, unsigned int>, U> &data);
2058template <
typename U>
2059double data_access(
int parent,
size_t valoffset, std::map<int, U> &data);
2124int id_from_level(
int nuc,
double level, std::string special);
2167double branch_ratio(std::string from_nuc, std::string to_nuc);
2253std::vector<std::pair<double, double>>
gamma_energy(
int parent);
2254std::vector<std::pair<double, double>>
gamma_energy(
double energy,
2268std::vector<std::pair<int, int>>
gamma_from_to(
double energy,
double error);
2273std::vector<int>
gamma_parent(
double energy,
double error);
2275std::vector<int>
gamma_child(
double energy,
double error);
2280std::vector<std::pair<double, double>>
gamma_xrays(
int parent);
2283std::vector<std::pair<double, double>>
gammas(
int parent_state_id);
2284std::vector<std::pair<double, double>>
alphas(
int parent_state_id);
2285std::vector<std::pair<double, double>>
betas(
int parent_state_id);
2286std::vector<std::pair<double, double>>
xrays(
int parent);
2307std::vector<int>
alpha_parent(
double energy,
double error);
2309std::vector<int>
alpha_child(
double energy,
double error);
2334std::vector<int>
beta_parent(
double energy,
double error);
2336std::vector<int>
beta_child(
double energy,
double error);
2372std::vector<int>
ecbp_parent(
double energy,
double error);
2375std::vector<int>
ecbp_child(
double energy,
double error);
2381std::vector<std::pair<double, double>>
ecbp_xrays(
int parent);
2385extern std::map<std::string, std::map<int, std::map<int, double>>>
2392double simple_xs(
int nuc,
int rx, std::string energy);
2397double simple_xs(
int nuc, std::string rx, std::string energy);
2402double simple_xs(std::string nuc,
int rx, std::string energy);
2407double simple_xs(std::string nuc, std::string rx, std::string energy);
2417 virtual const char *
what()
const throw() {
return msg_.c_str(); };
2504#ifdef PYNE_IS_AMALGAMATED
2505#if !defined(JSON_IS_AMALGAMATION)
2506#define JSON_IS_AMALGAMATION
2510#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED
2511#define JSON_FORWARD_AMALGATED_H_INCLUDED
2514#define JSON_IS_AMALGATED
2525#ifndef JSON_CONFIG_H_INCLUDED
2526#define JSON_CONFIG_H_INCLUDED
2549#define JSON_USE_EXCEPTION 1
2557#include <cpptl/config.h>
2558#ifndef JSON_USE_CPPTL
2559#define JSON_USE_CPPTL 1
2564#define JSON_API CPPTL_API
2565#elif defined(JSON_DLL_BUILD)
2566#define JSON_API __declspec(dllexport)
2567#elif defined(JSON_DLL)
2568#define JSON_API __declspec(dllimport)
2577#if defined(_MSC_VER) && _MSC_VER <= 1200
2580#define JSON_USE_INT64_DOUBLE_CONVERSION 1
2583#if defined(_MSC_VER) && _MSC_VER >= 1500
2585#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
2588#if !defined(JSONCPP_DEPRECATED)
2589#define JSONCPP_DEPRECATED(message)
2595#if defined(JSON_NO_INT64)
2598#undef JSON_HAS_INT64
2601#if defined(_MSC_VER)
2602typedef __int64
Int64;
2603typedef unsigned __int64
UInt64;
2610#define JSON_HAS_INT64
2629#ifndef JSON_FORWARDS_H_INCLUDED
2630#define JSON_FORWARDS_H_INCLUDED
2632#if !defined(JSON_IS_AMALGAMATION)
2657#ifdef JSON_VALUE_USE_INTERNAL_MAP
2658class ValueMapAllocator;
2659class ValueInternalLink;
2660class ValueInternalArray;
2661class ValueInternalMap;
2750#ifdef PYNE_IS_AMALGAMATED
2751#if !defined(JSON_IS_AMALGAMATION)
2752#define JSON_IS_AMALGAMATION
2756#ifndef JSON_AMALGATED_H_INCLUDED
2757#define JSON_AMALGATED_H_INCLUDED
2760#define JSON_IS_AMALGATED
2771#ifndef JSON_CONFIG_H_INCLUDED
2772#define JSON_CONFIG_H_INCLUDED
2795#define JSON_USE_EXCEPTION 1
2803#include <cpptl/config.h>
2804#ifndef JSON_USE_CPPTL
2805#define JSON_USE_CPPTL 1
2810#define JSON_API CPPTL_API
2811#elif defined(JSON_DLL_BUILD)
2812#define JSON_API __declspec(dllexport)
2813#elif defined(JSON_DLL)
2814#define JSON_API __declspec(dllimport)
2823#if defined(_MSC_VER) && _MSC_VER <= 1200
2826#define JSON_USE_INT64_DOUBLE_CONVERSION 1
2829#if defined(_MSC_VER) && _MSC_VER >= 1500
2831#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
2834#if !defined(JSONCPP_DEPRECATED)
2835#define JSONCPP_DEPRECATED(message)
2840typedef unsigned int UInt;
2841#if defined(JSON_NO_INT64)
2844#undef JSON_HAS_INT64
2847#if defined(_MSC_VER)
2848typedef __int64
Int64;
2849typedef unsigned __int64
UInt64;
2851typedef long long int Int64;
2852typedef unsigned long long int UInt64;
2856#define JSON_HAS_INT64
2875#ifndef JSON_FORWARDS_H_INCLUDED
2876#define JSON_FORWARDS_H_INCLUDED
2878#if !defined(JSON_IS_AMALGAMATION)
2903#ifdef JSON_VALUE_USE_INTERNAL_MAP
2904class ValueMapAllocator;
2905class ValueInternalLink;
2906class ValueInternalArray;
2907class ValueInternalMap;
2927#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
2928#define CPPTL_JSON_FEATURES_H_INCLUDED
2930#if !defined(JSON_IS_AMALGAMATION)
2931#include "forwards.h"
2987#ifndef CPPTL_JSON_H_INCLUDED
2988#define CPPTL_JSON_H_INCLUDED
2990#if !defined(JSON_IS_AMALGAMATION)
2991#include "forwards.h"
2996#ifndef JSON_USE_CPPTL_SMALLMAP
2999#include <cpptl/smallmap.h>
3001#ifdef JSON_USE_CPPTL
3002#include <cpptl/forwards.h>
3053 operator const char *()
const {
return str_; }
3055 const char *
c_str()
const {
return str_; }
3090#ifdef JSON_VALUE_USE_INTERNAL_MAP
3091 friend class ValueInternalLink;
3092 friend class ValueInternalMap;
3100#if defined(JSON_HAS_INT64)
3131#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
3132#ifndef JSON_VALUE_USE_INTERNAL_MAP
3135 enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy };
3137 CZString(
const char *cstr, DuplicationPolicy allocate);
3138 CZString(
const CZString &other);
3140 CZString &
operator=(
const CZString &other);
3141 bool operator<(
const CZString &other)
const;
3142 bool operator==(
const CZString &other)
const;
3144 const char *c_str()
const;
3145 bool isStaticString()
const;
3148 void swap(CZString &other);
3154#ifndef JSON_USE_CPPTL_SMALLMAP
3181#if defined(JSON_HAS_INT64)
3185 Value(
double value);
3186 Value(
const char *value);
3187 Value(
const char *beginValue,
const char *endValue);
3199 Value(
const std::string &value);
3200#ifdef JSON_USE_CPPTL
3201 Value(
const CppTL::ConstString &value);
3227#ifdef JSON_USE_CPPTL
3228 CppTL::ConstString asConstString()
const;
3332#ifdef JSON_USE_CPPTL
3340 Value get(
const char *key,
const Value &defaultValue)
const;
3342 Value get(
const std::string &key,
const Value &defaultValue)
const;
3343#ifdef JSON_USE_CPPTL
3345 Value get(
const CppTL::ConstString &key,
const Value &defaultValue)
const;
3358 bool isMember(
const char *key)
const;
3360 bool isMember(
const std::string &key)
const;
3361#ifdef JSON_USE_CPPTL
3363 bool isMember(
const CppTL::ConstString &key)
const;
3395 Value &resolveReference(
const char *key,
bool isStatic);
3397#ifdef JSON_VALUE_USE_INTERNAL_MAP
3398 inline bool isItemAvailable()
const {
return itemIsUsed_ == 0; }
3400 inline void setItemUsed(
bool isUsed =
true) { itemIsUsed_ = isUsed ? 1 : 0; }
3402 inline bool isMemberNameStatic()
const {
return memberNameIsStatic_ == 0; }
3404 inline void setMemberNameIsStatic(
bool isStatic) {
3405 memberNameIsStatic_ = isStatic ? 1 : 0;
3410 struct CommentInfo {
3414 void setComment(
const char *text);
3434#ifdef JSON_VALUE_USE_INTERNAL_MAP
3435 ValueInternalArray *array_;
3436 ValueInternalMap *map_;
3443#ifdef JSON_VALUE_USE_INTERNAL_MAP
3444 unsigned int itemIsUsed_ : 1;
3445 int memberNameIsStatic_ : 1;
3447 CommentInfo *comments_;
3463 enum Kind { kindNone = 0, kindIndex, kindKey };
3482 Path(
const std::string &path,
3496 typedef std::vector<const PathArgument *> InArgs;
3497 typedef std::vector<PathArgument> Args;
3499 void makePath(
const std::string &path,
const InArgs &
in);
3500 void addPathInArg(
const std::string &path,
3502 InArgs::const_iterator &itInArg,
3503 PathArgument::Kind kind);
3504 void invalidPath(
const std::string &path,
int location);
3509#ifdef JSON_VALUE_USE_INTERNAL_MAP
3557 virtual ~ValueMapAllocator();
3558 virtual ValueInternalMap *newMap() = 0;
3559 virtual ValueInternalMap *newMapCopy(
const ValueInternalMap &other) = 0;
3560 virtual void destructMap(ValueInternalMap *map) = 0;
3561 virtual ValueInternalLink *allocateMapBuckets(
unsigned int size) = 0;
3562 virtual void releaseMapBuckets(ValueInternalLink *links) = 0;
3563 virtual ValueInternalLink *allocateMapLink() = 0;
3564 virtual void releaseMapLink(ValueInternalLink *link) = 0;
3575 enum InternalFlags { flagAvailable = 0, flagUsed = 1 };
3577 ValueInternalLink();
3579 ~ValueInternalLink();
3581 Value items_[itemPerLink];
3582 char *keys_[itemPerLink];
3583 ValueInternalLink *previous_;
3584 ValueInternalLink *next_;
3602 friend class ValueIteratorBase;
3606 typedef unsigned int HashKey;
3607 typedef unsigned int BucketIndex;
3609#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
3610 struct IteratorState {
3611 IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {}
3612 ValueInternalMap *map_;
3613 ValueInternalLink *link_;
3614 BucketIndex itemIndex_;
3615 BucketIndex bucketIndex_;
3620 ValueInternalMap(
const ValueInternalMap &other);
3621 ValueInternalMap &operator=(
const ValueInternalMap &other);
3622 ~ValueInternalMap();
3624 void swap(ValueInternalMap &other);
3626 BucketIndex size()
const;
3630 bool reserveDelta(BucketIndex growth);
3632 bool reserve(BucketIndex newItemCount);
3634 const Value *find(
const char *key)
const;
3636 Value *find(
const char *key);
3638 Value &resolveReference(
const char *key,
bool isStatic);
3640 void remove(
const char *key);
3642 void doActualRemove(ValueInternalLink *link,
3644 BucketIndex bucketIndex);
3646 ValueInternalLink *&getLastLinkInBucket(BucketIndex bucketIndex);
3648 Value &setNewItem(
const char *key,
3650 ValueInternalLink *link,
3653 Value &unsafeAdd(
const char *key,
bool isStatic, HashKey hashedKey);
3655 HashKey
hash(
const char *key)
const;
3657 int compare(
const ValueInternalMap &other)
const;
3660 void makeBeginIterator(IteratorState &it)
const;
3661 void makeEndIterator(IteratorState &it)
const;
3662 static bool equals(
const IteratorState &x,
const IteratorState &other);
3663 static void increment(IteratorState &iterator);
3664 static void incrementBucket(IteratorState &iterator);
3665 static void decrement(IteratorState &iterator);
3666 static const char *key(
const IteratorState &iterator);
3667 static const char *key(
const IteratorState &iterator,
bool &isStatic);
3668 static Value &value(
const IteratorState &iterator);
3669 static int distance(
const IteratorState &x,
const IteratorState &y);
3672 ValueInternalLink *buckets_;
3673 ValueInternalLink *tailLink_;
3674 BucketIndex bucketsSize_;
3675 BucketIndex itemCount_;
3691 friend class ValueIteratorBase;
3698 typedef unsigned int PageIndex;
3700#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
3701 struct IteratorState
3703 IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {}
3704 ValueInternalArray *array_;
3705 Value **currentPageIndex_;
3706 unsigned int currentItemIndex_;
3710 ValueInternalArray();
3711 ValueInternalArray(
const ValueInternalArray &other);
3712 ValueInternalArray &operator=(
const ValueInternalArray &other);
3713 ~ValueInternalArray();
3714 void swap(ValueInternalArray &other);
3717 void resize(ArrayIndex newSize);
3719 Value &resolveReference(ArrayIndex index);
3721 Value *find(ArrayIndex index)
const;
3725 int compare(
const ValueInternalArray &other)
const;
3728 static bool equals(
const IteratorState &x,
const IteratorState &other);
3729 static void increment(IteratorState &iterator);
3730 static void decrement(IteratorState &iterator);
3731 static Value &dereference(
const IteratorState &iterator);
3732 static Value &unsafeDereference(
const IteratorState &iterator);
3733 static int distance(
const IteratorState &x,
const IteratorState &y);
3734 static ArrayIndex indexOf(
const IteratorState &iterator);
3735 void makeBeginIterator(IteratorState &it)
const;
3736 void makeEndIterator(IteratorState &it)
const;
3737 void makeIterator(IteratorState &it, ArrayIndex index)
const;
3739 void makeIndexValid(ArrayIndex index);
3743 PageIndex pageCount_;
3807class JSON_API ValueArrayAllocator {
3809 virtual ~ValueArrayAllocator();
3810 virtual ValueInternalArray *newArray() = 0;
3811 virtual ValueInternalArray *newArrayCopy(
const ValueInternalArray &other) = 0;
3812 virtual void destructArray(ValueInternalArray *array) = 0;
3824 virtual void reallocateArrayPageIndex(
3826 ValueInternalArray::PageIndex &indexCount,
3827 ValueInternalArray::PageIndex minNewIndexCount) = 0;
3828 virtual void releaseArrayPageIndex(
3829 Value **indexes, ValueInternalArray::PageIndex indexCount) = 0;
3830 virtual Value *allocateArrayPage() = 0;
3831 virtual void releaseArrayPage(Value *value) = 0;
3845#ifndef JSON_VALUE_USE_INTERNAL_MAP
3885#ifndef JSON_VALUE_USE_INTERNAL_MAP
3886 Value::ObjectValues::iterator current_;
3891 ValueInternalArray::IteratorState array_;
3892 ValueInternalMap::IteratorState map_;
3916#ifndef JSON_VALUE_USE_INTERNAL_MAP
3969#ifndef JSON_VALUE_USE_INTERNAL_MAP
3970 explicit ValueIterator(
const Value::ObjectValues::iterator ¤t);
3972 ValueIterator(
const ValueInternalArray::IteratorState &state);
3973 ValueIterator(
const ValueInternalMap::IteratorState &state);
4020#ifndef CPPTL_JSON_READER_H_INCLUDED
4021#define CPPTL_JSON_READER_H_INCLUDED
4023#if !defined(JSON_IS_AMALGAMATION)
4024#include "features.h"
4062 bool parse(
const std::string &document,
4064 bool collectComments =
true);
4083 bool parse(
const char *beginDoc,
const char *endDoc,
Value &root,
4084 bool collectComments =
true);
4088 bool parse(std::istream &is,
Value &root,
bool collectComments =
true);
4108 tokenEndOfStream = 0,
4118 tokenArraySeparator,
4119 tokenMemberSeparator,
4134 std::string message_;
4138 typedef std::deque<ErrorInfo> Errors;
4140 bool expectToken(TokenType type, Token &token,
const char *message);
4141 bool readToken(Token &token);
4143 bool match(Location pattern,
int patternLength);
4145 bool readCStyleComment();
4146 bool readCppStyleComment();
4150 bool readObject(Token &token);
4151 bool readArray(Token &token);
4152 bool decodeNumber(Token &token);
4153 bool decodeString(Token &token);
4154 bool decodeString(Token &token, std::string &decoded);
4155 bool decodeDouble(Token &token);
4156 bool decodeUnicodeCodePoint(Token &token,
4159 unsigned int &unicode);
4160 bool decodeUnicodeEscapeSequence(Token &token,
4163 unsigned int &unicode);
4164 bool addError(
const std::string &message, Token &token, Location extra = 0);
4165 bool recoverFromError(TokenType skipUntilToken);
4166 bool addErrorAndRecover(
const std::string &message,
4168 TokenType skipUntilToken);
4169 void skipUntilSpace();
4170 Value ¤tValue();
4172 void getLocationLineAndColumn(Location location,
4175 std::string getLocationLineAndColumn(Location location)
const;
4176 void addComment(Location begin, Location end, CommentPlacement placement);
4177 void skipCommentTokens(Token &token);
4179 typedef std::stack<Value *> Nodes;
4182 std::string document_;
4186 Location lastValueEnd_;
4188 std::string commentsBefore_;
4190 bool collectComments_;
4236#ifndef JSON_WRITER_H_INCLUDED
4237#define JSON_WRITER_H_INCLUDED
4239#if !defined(JSON_IS_AMALGAMATION)
4271 void enableYAMLCompatibility();
4274 virtual std::string write(
const Value &root);
4277 void writeValue(
const Value &value);
4279 std::string document_;
4280 bool yamlCompatiblityEnabled_;
4314 virtual std::string write(
const Value &root);
4317 void writeValue(
const Value &value);
4318 void writeArrayValue(
const Value &value);
4319 bool isMultineArray(
const Value &value);
4320 void pushValue(
const std::string &value);
4322 void writeWithIndent(
const std::string &value);
4325 void writeCommentBeforeValue(
const Value &root);
4326 void writeCommentAfterValueOnSameLine(
const Value &root);
4327 bool hasCommentForValue(
const Value &value);
4328 static std::string normalizeEOL(
const std::string &text);
4330 typedef std::vector<std::string> ChildValues;
4332 ChildValues childValues_;
4333 std::string document_;
4334 std::string indentString_;
4337 bool addChildValues_;
4376 void write(std::ostream &out,
const Value &root);
4379 void writeValue(
const Value &value);
4380 void writeArrayValue(
const Value &value);
4381 bool isMultineArray(
const Value &value);
4382 void pushValue(
const std::string &value);
4384 void writeWithIndent(
const std::string &value);
4387 void writeCommentBeforeValue(
const Value &root);
4388 void writeCommentAfterValueOnSameLine(
const Value &root);
4389 bool hasCommentForValue(
const Value &value);
4390 static std::string normalizeEOL(
const std::string &text);
4392 typedef std::vector<std::string> ChildValues;
4394 ChildValues childValues_;
4395 std::ostream *document_;
4396 std::string indentString_;
4398 std::string indentation_;
4399 bool addChildValues_;
4402#if defined(JSON_HAS_INT64)
4414std::ostream &
operator<<(std::ostream &,
const Value &root);
4457#ifndef PYNE_46Z7LQYFI5HZNASIPCWHVX3X5E
4458#define PYNE_46Z7LQYFI5HZNASIPCWHVX3X5E
4478 std::string closecurly =
"}",
4479 std::string opensquare =
"[",
4480 std::string closesquare =
"]",
4481 std::string colon =
":",
4482 std::string comma =
",",
4483 std::string indent =
" ",
4488 virtual std::string write(
const Value &root);
4491 void writeValue(
const Value &value, std::string &doc,
bool forceSingleLine);
4492 bool isMultiline(
const Value &value);
4496 std::string document_;
4497 std::string indentString_;
4498 std::string opencurly_;
4499 std::string closecurly_;
4500 std::string opensquare_;
4501 std::string closesquare_;
4504 std::string indent_;
4524#ifndef PYNE_MR34UE5INRGMZK2QYRDWICFHVM
4525#define PYNE_MR34UE5INRGMZK2QYRDWICFHVM
4536#if !defined(JSON_IS_AMALGAMATION)
4537#define JSON_IS_AMALGAMATION
4540#ifndef PYNE_IS_AMALGAMATED
4541#include "json-forwards.h"
4555#ifdef PYNE_IS_AMALGAMATED
4564 "BLCKHOLE",
"VACUUM",
"HYDROGEN",
"HELIUM",
"BERYLLIU",
"CARBON",
4565 "NITROGEN",
"OXYGEN",
"MAGNESIU",
"ALUMINUM",
"IRON",
"COPPER",
4566 "SILVER",
"SILICON",
"GOLD",
"MERCURY",
"LEAD",
"TANTALUM",
4567 "SODIUM",
"ARGON",
"CALCIUM",
"TIN",
"TUNGSTEN",
"TITANIUM",
4568 "NICKEL",
"WATER",
"POLYSTYR",
"PLASCINT",
"PMMA",
"BONECOMP",
4569 "BONECORT",
"MUSCLESK",
"MUSCLEST",
"ADTISSUE",
"KAPTON",
"POLYETHY",
4604 Material(
char *filename,
double m = -1.0,
double d = -1.0,
double apm = -1.0,
4618 Material(std::string filename,
double m = -1.0,
double d = -1.0,
4647 void from_hdf5(
char *filename,
char *datapath,
int row = -1,
4655 void from_hdf5(std::string filename, std::string datapath =
"/material",
4656 int row = -1,
int protocol = 1);
4668 void write_hdf5(
char *filename,
char *datapath,
char *nucpath,
4669 float row = -0.0,
int chunksize = 100);
4680 void write_hdf5(std::string filename, std::string datapath =
"/material",
4681 std::string nucpath =
"/nucid",
float row = -0.0,
4682 int chunksize = 100);
4685 std::string
mcnp(std::string frac_type =
"mass");
4688 std::string
fluka(
int id, std::string frac_type =
"mass");
4695 std::string fluka_name);
4698 std::string fluka_name);
4784 double mass_density(
double num_dens = -1.0,
double apm = -1.0);
4790 double number_density(
double mass_dens = -1.0,
double apm = -1.0);
4854 std::vector<std::pair<double, double>>
gammas();
4857 std::vector<std::pair<double, double>>
xrays();
4860 std::vector<std::pair<double, double>>
photons(
bool norm);
4864 std::vector<std::pair<double, double>> unnormed);
4896 virtual const char *what()
const throw() {
4897 return "Invalid loading protocol number; please use 0 or 1.";
4914#ifndef PYNE_3QGDWZMLZBHDHI424JL52SQHN4
4915#define PYNE_3QGDWZMLZBHDHI424JL52SQHN4
4917#ifndef PYNE_IS_AMALGAMATED
4985#ifndef PYNE_B3ANNCKDQ5HEJLI33RPZPDNX6A
4986#define PYNE_B3ANNCKDQ5HEJLI33RPZPDNX6A
4988#ifndef PYNE_IS_AMALGAMATED
4989#include "enrichment_symbolic.h"
4998namespace enrichment {
5007double feed_per_prod(
double x_feed,
double x_prod,
double x_tail);
5010double feed_per_tail(
double x_feed,
double x_prod,
double x_tail);
5013double prod_per_feed(
double x_feed,
double x_prod,
double x_tail);
5016double prod_per_tail(
double x_feed,
double x_prod,
double x_tail);
5019double tail_per_feed(
double x_feed,
double x_prod,
double x_tail);
5022double tail_per_prod(
double x_feed,
double x_prod,
double x_tail);
5027double swu_per_feed(
double x_feed,
double x_prod,
double x_tail);
5030double swu_per_prod(
double x_feed,
double x_prod,
double x_tail);
5033double swu_per_tail(
double x_feed,
double x_prod,
double x_tail);
5050Cascade
solve_numeric(Cascade &orig_casc,
double tolerance = 1.0E-7,
5051 int max_iter = 100);
5055void _recompute_nm(Cascade &casc,
double tolerance = 1.0E-7);
5072 int max_iter = 100);
5096 double tolerance = 1.0E-7,
int max_iter = 100);
5097Cascade
multicomponent(Cascade &orig_casc, std::string solver =
"symbolic",
5098 double tolerance = 1.0E-7,
int max_iter = 100);
5104 virtual const char *what()
const throw() {
5105 return "Inifinite loop found while calculating enrichment cascade.";
5113 virtual const char *what()
const throw() {
5114 return "Iteration limit hit durring enrichment calculation.";
5121 virtual const char *what()
const throw() {
5122 return "Iteration has hit a point where some values are not-a-number.";
5152#ifndef PYNE_OU4PO4TJDBDM5PY4VKAVL7JCSM
5153#define PYNE_OU4PO4TJDBDM5PY4VKAVL7JCSM
5157#ifndef PYNE_IS_AMALGAMATED
5158#include "enrichment_cascade.h"
5162namespace enrichment {
5184#ifdef PYNE_DECAY_IS_DUMMY
5185#ifndef PYNE_GEUP5PGEJBFGNHGI36TRBB4WGM
5186#define PYNE_GEUP5PGEJBFGNHGI36TRBB4WGM
5200#ifndef PYNE_IS_AMALGAMATED
5210std::map<int, double>
decay(std::map<int, double> comp,
double t);
CustomWriter(std::string opencurly="{", std::string closecurly="}", std::string opensquare="[", std::string closesquare="]", std::string colon=":", std::string comma=",", std::string indent=" ", int maxWidth=74)
Outputs a Value in JSON format without formatting (not human friendly).
Configuration passed to reader and writer.
bool strictRoot_
true if root must be either an array or an object value.
bool allowComments_
true if comments are allowed. Default: true.
static Features all()
A configuration that allows all features and assumes all strings are UTF-8.
Features()
Initialize the configuration like JsonConfig::allFeatures;.
static Features strictMode()
A configuration that is strictly compatible with the JSON specification.
Experimental and untested: represents an element of the "path" to access a node.
Experimental and untested: represents a "path" to access a node.
Value & make(Value &root) const
Creates the "path" to access the specified node and returns a reference on the node.
Path(const std::string &path, const PathArgument &a1=PathArgument(), const PathArgument &a2=PathArgument(), const PathArgument &a3=PathArgument(), const PathArgument &a4=PathArgument(), const PathArgument &a5=PathArgument())
const Value & resolve(const Value &root) const
Unserialize a JSON document into a Value.
Reader()
Constructs a Reader allowing all features for parsing.
std::string getFormatedErrorMessages() const
Returns a user friendly string that list errors in the parsed document.
std::string getFormattedErrorMessages() const
Returns a user friendly string that list errors in the parsed document.
bool parse(const std::string &document, Value &root, bool collectComments=true)
Read a Value from a JSON document.
Lightweight wrapper to tag static string.
const char * c_str() const
StaticString(const char *czstring)
StyledStreamWriter(std::string indentation="\t")
Writes a Value in JSON format in a human friendly way.
const iterator for object and array value.
ValueConstIterator SelfType
SelfType & operator=(const ValueIteratorBase &other)
reference operator*() const
base class for Value iterators.
bool isEqual(const SelfType &other) const
bool operator==(const SelfType &other) const
Value key() const
Return either the index or the member name of the referenced value as a Value.
void copy(const SelfType &other)
UInt index() const
Return the index of the referenced Value. -1 if it is not an arrayValue.
const char * memberName() const
Return the member name of the referenced Value.
difference_type operator-(const SelfType &other) const
ValueIteratorBase SelfType
bool operator!=(const SelfType &other) const
difference_type computeDistance(const SelfType &other) const
Iterator for object and array value.
reference operator*() const
SelfType & operator=(const SelfType &other)
const_iterator begin() const
Value get(ArrayIndex index, const Value &defaultValue) const
If the array contains at least index+1 elements, returns the element value, otherwise returns default...
bool empty() const
Return true if empty array, empty object, or null; otherwise, false.
std::map< CZString, Value > ObjectValues
ArrayIndex size() const
Number of values in array or object.
const char * asCString() const
bool operator==(const Value &other) const
Json::ArrayIndex ArrayIndex
Json::LargestInt LargestInt
void setComment(const char *comment, CommentPlacement placement)
Comments must be //... or /* ... */.
std::string toStyledString() const
const_iterator end() const
bool operator<=(const Value &other) const
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
bool operator>(const Value &other) const
void clear()
Remove all object members and array elements.
bool hasComment(CommentPlacement placement) const
Json::LargestUInt LargestUInt
bool operator!() const
Return isNull()
Members getMemberNames() const
Return a list of the member names.
Value & operator[](ArrayIndex index)
Access an array element (zero based index ).
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Value & append(const Value &value)
Append value to array at the end.
static const Int64 minInt64
Minimum signed 64 bits int value that can be stored in a Json::Value.
bool operator!=(const Value &other) const
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
std::string getComment(CommentPlacement placement) const
Include delimiters and embedded newlines.
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
void resize(ArrayIndex size)
Resize the array to size elements.
Value removeMember(const char *key)
Remove and return the named member.
void swap(Value &other)
Swap values.
bool operator<(const Value &other) const
std::string asString() const
LargestInt asLargestInt() const
bool isValidIndex(ArrayIndex index) const
Return true if index < size().
std::vector< std::string > Members
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
friend class ValueIteratorBase
LargestUInt asLargestUInt() const
bool isMember(const char *key) const
Return true if the object has a member named key.
Value(ValueType type=nullValue)
Create a default Value of the given type.
Value & operator=(const Value &other)
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
int compare(const Value &other) const
bool isConvertibleTo(ValueType other) const
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
ValueConstIterator const_iterator
bool operator>=(const Value &other) const
Abstract class for writers.
virtual std::string write(const Value &root)=0
virtual const char * what() const
helpful error message that includes the filename
FileNotHDF5()
default constructor
~FileNotHDF5()
default destructor
FileNotHDF5(std::string fname)
constructor with the filename
virtual const char * what() const
helpful error message that includes the filename and the groupname
GroupNotFound(std::string fname, std::string gname)
constructor with the filename and the groupname
~GroupNotFound()
default destructor
GroupNotFound()
default constructor
Custom exception for HDF5 indexing errors.
std::map< std::string, std::vector< T > > data
mapping from column names to column data
HomogenousTypeTable(hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
Constructor to load in data upon initialization.
HomogenousTypeTable()
default constructor
std::map< std::string, T > operator[](int m)
index into the table by row
std::string path
path in file to the data
std::vector< std::string > cols
column names
std::vector< T > operator[](std::string col_name)
index into the table by column name (string)
~HomogenousTypeTable()
default destructor
int shape[2]
table shape, rows x columns.
PathNotFound()
default constructor
virtual const char * what() const
helpful error message that includes the filename and the pathname
PathNotFound(std::string fname, std::string pname)
constructor with the filename and the pathname
~PathNotFound()
default destructor
FileNotFound(std::string fname)
constructor with the filename fname.
FileNotFound()
default constructor
~FileNotFound()
default destructor
virtual const char * what() const
Creates a helpful error message.
virtual const char * what() const
Exception returns the string passed when thrown.
InvalidSimpleXS(std::string msg)
Exception thrown if energy group or rxname are invalid.
Custom exception for invalid HDF5 protocol numbers.
Material composed of nuclides.
Material expand_elements()
Returns a copy of the current material where all natural elements in the composition are expanded to ...
std::vector< std::pair< double, double > > normalize_radioactivity(std::vector< std::pair< double, double > > unnormed)
Takes a list of photon energies and intensities and normalizes them so the sum of the intensities is ...
Material set_mat(std::set< int > nucset, double value)
Creates a new Material with the mass weights for all nuclides in nucset set to value.
void norm_comp()
Normalizes the mass values in the composition.
std::vector< std::pair< double, double > > xrays()
Returns a list of x-rays average energies in keV and intensities in decays/s material unnormalized.
double number_density(double mass_dens=-1.0, double apm=-1.0)
Computes and returns the number density of the material using the mass density if mass_dens is greate...
std::string fluka_material_line(int znum, double atomic_mass, int fid, std::string fluka_name)
Format information into a FLUKA material card.
void from_text(char *filename)
Reads data from a plaintext file at filename into this Material instance.
comp_map comp
composition, maps nuclides in id form to normalized mass weights.
void from_atom_frac(std::map< int, double > atom_fracs)
Sets the composition, mass, and atoms_per_molecule of this material to those calculated from atom_fra...
std::vector< std::pair< double, double > > gammas()
Returns a list of gamma-rays energies in keV and intensities in decays/s/atom material unnormalized.
Material del_range(int lower=0, int upper=10000000)
Creates a new Material with the all nuclides in the id range removed.
Material del_mat(std::set< int > nucset)
Creates a new Material with the all nuclides in nucset removed.
std::vector< std::pair< double, double > > photons(bool norm)
Returns a list of photon energies in keV and intensities in decays/s/atom material unnormalized.
std::string fluka_material_component(int fid, int nucid, std::string fluka_name)
Intermediate level call to prepare final info and call material_line(..)
std::string fluka_compound_str(int id, std::string frac_type="mass")
Return FLUKA compound card and the material card for the named compound but not the material cards of...
void load_json(Json::Value)
Loads a JSON instance tree into this Material.
Material sub_mat(std::set< int > nucset)
Creates a sub-Material with only the nuclides present in nucset.
Material sub_fp()
Creates a sub-Material of only fission products.
void _load_comp_protocol0(hid_t db, std::string datapath, int row)
Loads the matrial composition from an HDF5 file according to the layout defined by protocol 0.
double molecular_mass(double apm=-1.0)
Calculates the atomic weight of this material based on the composition and the number of atoms per mo...
Material operator*(double)
Multiplies a material's mass.
std::string fluka(int id, std::string frac_type="mass")
Return a fluka input deck MATERIAL card as a string.
double get_comp_sum()
Computes the total mass stored in the composition.
void write_text(char *filename)
Writes the Material out to a simple plaintext file readable by from_text().
double mass
mass (in arbitrary units) of the Material.
void from_json(char *filename)
Reads data from a JSON file at filename into this Material instance.
double atoms_per_molecule
The number of atoms per molecule.
Material collapse_elements(std::set< int > exception_znum)
std::map< int, double > to_atom_frac()
Returns a mapping of the nuclides in this material to their atom fractions.
comp_map dose_per_g(std::string dose_type, int source=0)
Caclulates the dose per gram using the composition of the the material, the dose type desired,...
void _load_comp_protocol1(hid_t db, std::string datapath, int row)
Loads the matrial composition from an HDF5 file according to the layout defined by protocol 1.
void from_hdf5(char *filename, char *datapath, int row=-1, int protocol=1)
Loads a material from an HDF5 file into this object.
double density
density (in arbitrary units) of the Material.
bool not_fluka_builtin(std::string fluka_name)
Convenience function to tell whether a given name needs a material card.
Material operator+(double)
Adds mass to a material instance.
Material sub_ma()
Creates a sub-Material of only minor actinides.
Material sub_elem(int element)
Creates a sub-Material of only the given element.
comp_map activity()
Calculates the activity of a material based on the composition and each nuclide's mass,...
Material sub_tru()
Creates a sub-Material of only transuranics.
void write_json(char *filename)
Writes the Material out to a JSON file.
std::string fluka_format_field(float field)
Convenience function to format a single fluka field.
std::string mcnp(std::string frac_type="mass")
Return an mcnp input deck record as a string.
double mass_density(double num_dens=-1.0, double apm=-1.0)
Computes, sets, and returns the mass density when num_dens is greater than or equal zero.
Material operator/(double)
Divides a material's mass.
void normalize()
Normalizes the mass.
comp_map mult_by_mass()
Returns a composition map that has been unnormalized by multiplying each mass weight by the actual ma...
Material sub_lan()
Creates a sub-Material of only lanthanides.
Material sub_act()
Creates a sub-Material of only actinides.
void write_hdf5(char *filename, char *datapath, char *nucpath, float row=-0.0, int chunksize=100)
Writes this material out to an HDF5 file.
std::map< int, double > to_atom_dens()
Returns a mapping of the nuclides in this material to their atom densities.
~Material()
default destructor
Material sub_range(int lower=0, int upper=10000000)
Creates a sub-Material based on a range of id-form integers.
Json::Value metadata
container for arbitrary metadata, following the JSON rules.
std::string fluka_material_str(int id)
High level call to get details and call material_component(..)
Json::Value dump_json()
Dumps the Material out to a JSON instance tree.
Material set_range(int lower=0, int upper=10000000, double value=0.0)
Creates a new Material with the mass weights for all nuclides in the id range set to value.
Material()
empty constructor
comp_map decay_heat()
Calculates the decay heat of a material based on the composition and each nuclide's mass,...
double swu_per_feed
This is the SWU for 1 kg of Feed material.
double l_t_per_feed
Total flow rate per feed rate.
~Cascade()
default destructor
pyne::Material mat_tail
tails material
int j
Component to enrich (U-235), id form.
double x_feed_j
enrichment of the j-th isotope in the feed stream
double x_tail_j
enrichment of the j-th isotope in the tails stream
double alpha
stage separation factor
void _reset_xjs()
Sets x_feed_j to j-th value of mat_feed.
double N
number of enriching stages
Cascade()
default constructors
double M
number of stripping stages
double Mstar
mass separation factor
double swu_per_prod
This is the SWU for 1 kg of Product material.
int k
Component to de-enrich, or strip (U-238), id form.
pyne::Material mat_feed
feed material
pyne::Material mat_prod
product material
double x_prod_j
enrichment of the j-th isotope in the product stream
Custom exception for when an enrichment solver has entered an infinite loop.
Custom exception for when an enrichment solver has reached its maximum number of iterations.
Custom exception for when an enrichment solver iteration has produced a NaN.
NotANuclide(std::string wasptr, int nowptr)
Constructor given previous and current state of nulide name.
~NotANuclide()
default destructor
NotANuclide(std::string wasptr, std::string nowptr)
Constructor given previous and current state of nulide name.
NotANuclide()
default constructor
NotANuclide(int wasptr, int nowptr)
Constructor given previous and current state of nulide name.
virtual const char * what() const
Generates an informational message for the exception.
NotANuclide(int wasptr, std::string nowptr)
Constructor given previous and current state of nulide name.
~NotAReaction()
default destructor
NotAReaction(std::string wasptr, int nowptr)
Constructor using original reaction (wasptr) and the eventual state that PyNE calculated (nowptr).
NotAReaction(std::string wasptr, std::string nowptr)
Constructor using original reaction (wasptr) and the eventual state that PyNE calculated (nowptr).
NotAReaction(unsigned int wasptr, unsigned int nowptr)
Constructor using original reaction (wasptr) and the eventual state that PyNE calculated (nowptr).
NotAReaction(int wasptr, std::string nowptr)
Constructor using original reaction (wasptr) and the eventual state that PyNE calculated (nowptr).
NotAReaction(int wasptr, int nowptr)
Constructor using original reaction (wasptr) and the eventual state that PyNE calculated (nowptr).
NotAReaction(std::string wasptr, unsigned int nowptr)
Constructor using original reaction (wasptr) and the eventual state that PyNE calculated (nowptr).
NotAReaction(unsigned int wasptr, std::string nowptr)
Constructor using original reaction (wasptr) and the eventual state that PyNE calculated (nowptr).
NotAReaction()
default constructor
virtual const char * what() const
Returns a helpful error message containing prior and current reaction state.
bool operator()(const std::pair< int, double > &lhs, const std::pair< int, double > &rhs) const
This operator compares the second item in a pair first.
JSON (JavaScript Object Notation).
unsigned long long int UInt64
std::istream & operator>>(std::istream &sin, Value &root)
Read from 'sin' into 'root'.
@ commentAfterOnSameLine
a comment just after a value on the same line
@ commentBefore
a comment placed on the line before a value
@ numberOfCommentPlacement
@ commentAfter
a comment on the line after a value (only make sense for root value)
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
ValueType
Type of the value held by a Value object.
@ stringValue
UTF-8 string value.
@ arrayValue
array value (ordered list)
@ intValue
signed integer value
@ objectValue
object value (collection of name/value pairs).
@ uintValue
unsigned integer value
std::ostream & operator<<(std::ostream &sout, const Value &root)
Output using the StyledStreamWriter.
std::string valueToString(LargestInt value)
std::string valueToQuotedString(const char *value)
Wrapper for standard HDF5 operations.
std::vector< std::vector< T > > h5_array_to_cpp_vector_2d(hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
Reads in data from an HDF5 file as a 2 dimiensional vector.
hid_t _get_PYTABLES_COMPLEX128()
Create an HDF5 data type for complex 128 bit data, which happens to match the complex data type that ...
std::vector< std::vector< std::vector< T > > > h5_array_to_cpp_vector_3d(hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
Reads in data from an HDF5 file as a 3 dimiensional vector.
static hid_t PYTABLES_COMPLEX128
The HDF5 id for a complex data type compatible with PyTables generated data.
T get_array_index(hid_t dset, int n, hid_t dtype=H5T_NATIVE_DOUBLE)
Retrieves the nth index out of the dataset dset (which has an HDF5 datatype dtype).
std::vector< T > h5_array_to_cpp_vector_1d(hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
Reads in data from an HDF5 file as a 1 dimiensional vector.
std::set< T > h5_array_to_cpp_set(hid_t h5file, std::string data_path, hid_t dtype=H5T_NATIVE_DOUBLE)
Reads in data from an HDF5 file as a C++ set.
bool path_exists(hid_t h5file, std::string path)
Determines if a path exists in an hdf5 file.
Enrichment Component Class and Functions.
void _recompute_nm(Cascade &casc, double tolerance=1.0E-7)
So,ves for valid stage numbers N &nd M of a casc.
Cascade multicomponent(Cascade &orig_casc, char *solver, double tolerance=1.0E-7, int max_iter=100)
double prod_per_tail(double x_feed, double x_prod, double x_tail)
Computes the product per tails mass ratio for feed, product, and tails enrichments x_feed,...
Cascade _norm_comp_secant(Cascade &casc, double tolerance=1.0E-7, int max_iter=100)
This function solves the whole system of equations.
double tail_per_prod(double x_feed, double x_prod, double x_tail)
Computes the tails per product mass ratio for feed, product, and tails enrichments x_feed,...
double feed_per_prod(double x_feed, double x_prod, double x_tail)
Computes the feed per product mass ratio for feed, product, and tails enrichments x_feed,...
double swu_per_prod(double x_feed, double x_prod, double x_tail)
Computes the swu per product ratio for feed, product, and tails enrichments x_feed,...
double swu_per_tail(double x_feed, double x_prod, double x_tail)
Computes the swu per tails ratio for feed, product, and tails enrichments x_feed, x_prod,...
Cascade solve_numeric(Cascade &orig_casc, double tolerance=1.0E-7, int max_iter=100)
Finds the total flow rate (L) over the feed flow rate (F), the number of enriching stages (N),...
Cascade default_uranium_cascade
a cascade instance with default values for a uranium enrichment.
double swu_per_feed(double x_feed, double x_prod, double x_tail)
Computes the swu per feed ratio for feed, product, and tails enrichments x_feed, x_prod,...
double value_func(double x)
Computes the value or separation potential of an assay x.
double tail_per_feed(double x_feed, double x_prod, double x_tail)
Computes the tails per feed mass ratio for feed, product, and tails enrichments x_feed,...
double _deltaU_i_OverG(Cascade &casc, int i)
Solves for a stage separative power relevant to the ith component per unit of flow G.
double feed_per_tail(double x_feed, double x_prod, double x_tail)
Computes the feed per tails mass ratio for feed, product, and tails enrichments x_feed,...
double alphastar_i(double alpha, double Mstar, double M_i)
Computes the nuclide-specific stage separation factor from the overall stage separation factor alpha,...
void _recompute_prod_tail_mats(Cascade &casc)
This function takes a given initial guess number of enriching and stripping stages for a given compos...
double prod_per_feed(double x_feed, double x_prod, double x_tail)
Computes the product per feed mass ratio for feed, product, and tails enrichments x_feed,...
Cascade solve_symbolic(Cascade &orig_casc)
A multicomponent enrichment cascade solver using a symbolic solution to the mass flow rate equations.
Cascade _fill_default_uranium_cascade()
Greates a cascade instance with default values for a uranium enrichment.
name_t LAN_array[15]
array of lanthanide names
zz_group name_to_zz_group(name_group eg)
Converts a name group to a Z number group.
zzname_t get_zz_fluka()
Creates standard nucid to fluka-name mapping.
int alara_to_id(const char *nuc)
std::map< int, int > state_id_map
name_zz_t get_fluka_zz()
Creates standard fluka-name to nucid mapping.
name_t MA_array[10]
array of minor actinide names
std::set< zz_t > zz_group
Z number grouping type (for testing containment)
name_group LAN
lanthanide name group
name_group MA
minor actinide name group
zz_group act
actinide Z number group
int nist_to_id(const char *nuc)
name_group ACT
actinide name group
zzname_t::iterator zzname_iter
Z num to name iter type.
name_t FP_array[88]
array of fission product names
zz_group lan
lanthanide Z number group
std::map< name_t, zz_t > name_zz_t
name and Z num map type
name_t ACT_array[15]
array of actinide names
int cinder_to_id(int nuc)
std::string alara(int nuc)
zzname_t zz_fluka
nucid to fluka-name map
int zzzaaa_to_id(int nuc)
zzname_t zz_name
Z num to name map.
std::string name(int nuc)
name_zz_t fluka_zz
fluka-name to nucid map
name_group::iterator name_group_iter
name grouping iter type
std::set< name_t > name_group
name grouping type (for testing containment)
name_zz_t name_zz
name to Z num map
name_zz_t get_name_zz()
Creates standard name to Z number mapping.
int zzaaam_to_id(int nuc)
int state_id_to_id(int state)
bool isnuclide(std::string nuc)
int fluka_to_id(std::string name)
bool iselement(std::string nuc)
int serpent_to_id(const char *nuc)
zz_group::iterator zz_group_iter
Z number grouping iter.
int id_to_state_id(int nuc_id)
std::string zzllaaam(int nuc)
name_t TRU_array[22]
array of transuranic names
std::string nist(int nuc)
name_group FP
fission product name group
std::string fluka(int nuc)
zz_group ma
minor actinide Z number group
int zzllaaam_to_id(const char *nuc)
std::map< zz_t, name_t > zzname_t
Z num to name map type.
std::string serpent(int nuc)
int ensdf_to_id(const char *nuc)
name_group TRU
transuranic name group
name_zz_t::iterator name_zz_iter
name and Z num iter type
std::string name_t
name type
zzname_t get_zz_name()
Creates standard Z number to name mapping.
zz_group tru
transuranic Z number group
zz_group fp
fission product Z number group
Converts between naming conventions for reaction channels.
std::map< unsigned int, std::string > labels
Mapping from reaction ids to labels (short descriptions).
std::map< unsigned int, std::string > docs
Mapping from reaction ids to documentation strings (long descriptions).
std::set< std::string > names
Set of reaction names, must be valid variable names.
std::map< unsigned int, std::string > id_name
Mapping from reaction ids to reaction names.
int child(int nuc, unsigned int rx, std::string z="n")
int offset(int dz, int da, int ds=0)
A helper function to compute nuclide id offsets from z-, a-, and s- deltas.
void * _fill_maps()
A helper function to set the contents of the variables in this library.
std::map< std::string, unsigned int > name_id
Mapping from reaction names to reaction ids.
std::map< std::pair< std::string, int >, unsigned int > offset_id
Mapping from particle type and offset pairs to reaction ids.
std::map< std::string, unsigned int > altnames
Mapping between alternative names for reactions and the reaction id.
std::string _names[NUM_RX_NAMES]
Raw array of reaction names.
unsigned int hash(std::string s)
std::map< unsigned int, unsigned int > id_mt
Mapping from reaction ids to MT numbers.
int parent(int nuc, unsigned int rx, std::string z="n")
void * _
A dummy variable used when calling _fill_maps().
std::map< unsigned int, unsigned int > mt_id
Mapping from MT numbers to reaction names.
std::map< std::pair< std::string, unsigned int >, int > id_offset
Mapping from particle type and reaction ids to offsets.
The 'pyne' namespace all PyNE functionality is included in.
std::vector< double > ecbp_endpoint_energy(int parent)
returns a list of electron capture/ beta plus decay endpoint energies from input parent nuclide
double ext_air_dose(int nuc, int source)
Returns the dose factors of a nuclide.
std::vector< int > ecbp_parent(double energy, double error)
double coth(double x)
The hyperbolic cotangent function.
std::vector< std::pair< double, double > > gamma_xrays(int parent)
std::map< std::pair< int, int >, ndsfpysub > ndsfpy_data
std::string to_str(int t)
std::vector< int > beta_child(double energy, double error)
std::vector< std::pair< double, double > > gamma_energy(int parent)
const double cm2_per_barn
cm^2 per barn
void _load_data< decay >()
Loads the decay data from the nuc_data.h5 file into memory.
std::vector< std::pair< double, double > > xrays(int parent)
std::map< std::string, std::string > data_checksums
Mapping from nodes in nuc_data.h5 to hashes of nodes.
double ext_soil_dose(int nuc, int source)
Function for External Soil Dose Factors.
std::vector< std::pair< double, double > > decay_half_lifes(int)
int id_from_level(int nuc, double level)
Returns the nuc_id of an energy level.
struct pyne::decay decay
a struct matching the '/decay/decays' table in nuc_data.h5.
std::map< int, xd_complex_t > b_incoherent_map
Mapping from nuclides in id form to their incoherent scattering length.
double b(int nuc)
Computes the scattering length [cm] from the coherent and incoherent components.
std::vector< double > decay_branch_ratios(int parent)
double endftod_f(char *s)
Converts a string from ENDF format to a float.
void _load_atomic_mass_map_memory()
main function to be called when you whish to load the nuclide data into memory
std::string replace_all_substrings(std::string s, std::string substr, std::string repstr)
Replaces all instance of substr in s with repstr.
std::vector< double > beta_endpoint_energy(int parent)
void _load_data< atomic >()
std::map< std::pair< int, int >, double > wimsdfpy_data
Mapping from nuclides in id form to their scattering length.
std::vector< std::pair< double, double > > ecbp_xrays(int parent)
std::map< int, double > atomic_mass_error_map
Mapping from nuclides in id form to the associated error in abdundance.
std::map< int, xd_complex_t > b_coherent_map
Mapping from nuclides in id form to their coherent scattering length.
std::pair< double, double > decay_beta_branch_ratio(std::pair< int, int >)
int metastable_id(int nuc, int m)
Returns the nuc_id of a metastable state.
xd_complex_t b_incoherent(int nuc)
Finds the incoherent scattering length [cm] for a nuclide nuc.
void _load_wimsdfpy()
Loads the WIMSD fission product yield data from the nuc_data.h5 file into memory.
std::vector< int > alpha_parent(double energy, double error)
std::pair< double, double > decay_branch_ratio(std::pair< int, int >)
const double sec_per_day
seconds per day
void pyne_start()
Initializes PyNE based on environment.
struct pyne::scattering_lengths scattering_lengths
a struct matching the '/neutron/scattering_lengths' table in nuc_data.h5.
const double pi
pi = 3.14159265359
const double Bq_per_Ci
Becquerel per Curie.
std::map< std::pair< int, double >, ecbp > ecbp_data
A vector of structs containing ecbp data for access in memory.
const double N_A
Avogadro's Number.
double endftod_cpp(char *s)
Converts a string from ENDF format to a float.
double dose_ratio(int nuc, int source)
Dose Ratio.
void _load_q_val_map()
Loads the q_value data from the nuc_data.h5 file into memory.
static std::string digits
string of digit characters
std::vector< int > decay_data_children(int parent)
std::vector< int > beta_parent(double energy, double error)
std::pair< double, double > decay_photon_branch_ratio(std::pair< int, int >)
std::map< std::pair< int, double >, alpha > alpha_data
A vector of structs containing alpha data for access in memory.
struct pyne::ecbp ecbp
A struct matching the '/decay/ecbp' table in nuc_data.h5.
static std::string alphabet
uppercase alphabetical characters
struct pyne::ndsfpy ndsfpy
a struct matching the '/neutron/nds_fission_product' table in nuc_data.h5
std::vector< std::pair< double, double > > decay_photon_branch_ratios(int parent)
void _load_scattering_lengths()
Loads the scattering length data from the nuc_data.h5 file into memory.
std::map< std::pair< int, double >, gamma > gamma_data
double tanh(double x)
The hyperbolic tangent function.
std::map< std::pair< int, double >, beta > beta_data
A vector of structs containing beta data for access in memory.
bool ternary_ge(int a, int b, int c)
Returns true if a <= b <= c and flase otherwise.
struct pyne::atomic_mass_data atomic_mass_data
a struct matching the atomic_mass table in nuc_data.h5.
void _load_dose_map(std::map< int, dose > &dm, std::string source_path)
Loads the dose factor data from the nuc_data.h5 file into memory according to the user-input source.
double to_dbl(std::string s)
Converts a valid string to a float using atof().
void _load_data< alpha >()
Loads the alpha decay data from the nuc_data.h5 file into memory.
void _insert_abund_map()
function to create mapping from nuclides in id form to their natural abundances
double decay_const(int nuc)
Returns the decay constant for a nuclide nuc.
bool toggle_warnings()
Toggles warnings on and off.
std::map< std::string, std::map< int, std::map< int, double > > > simple_xs_map
map<energy, map<nuclide, map<rx, xs> > >
struct pyne::q_val_data q_val_data
a struct matching the q_value table in nuc_data.h5.
struct pyne::wimsdfpy wimsdfpy
a struct matching the '/neutron/wimsd_fission_product' table in nuc_data.h5.
std::string PYNE_DATA
Path to the directory containing the PyNE data.
void _insert_atomic_mass_map()
function to create mapping from nuclides in id form to their atomic masses
std::map< std::string, std::string > get_data_checksums()
struct pyne::material_data material_data
A stuct for reprensenting fundemental data in a material.
std::vector< double > beta_intensity(int parent)
std::map< int, double > comp_map
Nuclide-mass composition map type.
std::string capitalize(std::string s)
Returns a capitalized copy of the string.
double ingest_dose(int nuc, int source)
Functions for Ingestion Dose Factors and Fraction of activity that is absorbed by body fluids.
std::vector< std::pair< double, double > > gammas(int parent_state_id)
Returns a list of energies and intensities normalized to branching ratios.
std::map< int, dose > doe_dose_map
std::vector< double > alpha_intensity(int parent)
const double MeV_per_MJ
MeV per MJ.
static std::string words
string of all valid word characters for variable names in programing languages.
double solve_line(double x, double x2, double y2, double x1, double y1)
Solves the equation for the line y = mx + b, given x and the points that form the line: (x1,...
xd_complex_t b_coherent(int nuc)
Finds the coherent scattering length [cm] for a nuclide nuc.
std::vector< int > gamma_parent(double energy, double error)
std::string last_char(std::string s)
Returns the last character in a string.
std::map< int, dose > genii_dose_map
std::set< int > decay_children(int nuc)
Returns a set of decay children of a nuc.
double slope(double x2, double y2, double x1, double y1)
Finds the slope of a line from the points (x1, y1) and (x2, y2).
double half_life(int nuc)
Returns the half life for a nuclide nuc.
double dose_fluid_frac(int nuc, int source)
Fluid Fraction.
std::vector< double > alpha_energy(int parent)
double q_val(int nuc)
Returns the q_value of a nuclide nuc.
struct pyne::gamma gamma
a struct matching the '/decay/gammas' table in nuc_data.h5.
std::string to_upper(std::string s)
switches endftod to fast cpp version
void _load_data< ecbp >()
Loads the electron capture and beta plus decay data from the nuc_data.h5 file into memory.
std::vector< T > data_access(double emin, double emax, size_t valoffset, std::map< std::pair< int, double >, U > &data)
Access data in a std::map<std::pair<int, double> for a range of values of the second member of the pa...
std::string natural_naming(std::string name)
Calculates a version of the string name that is also a valid variable name.
double natural_abund(int nuc)
Returns the natural abundance of a nuclide nuc.
std::map< int, double > natural_abund_map
Mapping from nuclides in id form to their natural abundances.
std::map< std::pair< int, double >, level_data > level_data_lvl_map
Mapping from nuclides in id form to a struct containing data associated with that level.
std::map< int, double > gamma_frac_map
double(* endftod)(char *s)
endftod function pointer. defaults to fortran
struct pyne::beta beta
a struct matching the '/decay/betas' table in nuc_data.h5.
double atomic_mass(int nuc)
Returns the atomic mass of a nuclide nuc.
struct pyne::ndsfpysub ndsfpysub
a struct for the nds data for fpyield
bool contains_substring(std::string s, std::string substr)
Returns true if substr is in s.
std::vector< double > ecbp_average_energy(int parent)
double inhale_dose(int nuc, int source)
Functions for Inhalation Dose Factors and Lung Model used to obtain dose factors.
std::vector< double > beta_average_energy(int parent)
std::map< int, double > b_map
Mapping from nuclides in id form to their scattering length.
std::vector< std::pair< int, int > > gamma_parent_child(double energy, double error)
std::ostream & operator<<(std::ostream &os, Material mat)
Converts a Material to a string stream representation for canonical writing.
std::vector< std::pair< int, int > > gamma_from_to(int parent)
std::string get_flag(char line[], int max_l)
Finds and returns the first white-space delimited token of a line.
void warning(std::string s)
Prints a warning message.
std::string slice_from_end(std::string s, int n=-1, int l=1)
Returns the slice of a string s using the negative index n and the length of the slice l.
void _load_data< beta >()
Loads the beta decay data from the nuc_data.h5 file into memory.
int to_int(std::string s)
Converts a string of digits to an int using atoi().
std::string NUC_DATA_PATH
Path to the nuc_data.h5 file.
std::map< int, atomic > atomic_data_map
std::vector< int > ecbp_child(double energy, double error)
std::map< std::pair< int, int >, decay > decay_data
Mapping from a pair of nuclides in id form to a struct containing data associated with the decay from...
std::vector< int > gamma_child(double energy, double error)
std::vector< double > ec_intensity(int parent)
std::pair< double, double > decay_half_life(std::pair< int, int >)
void _load_data< level_data >()
std::map< int, dose > epa_dose_map
Mapping from int to dose for 3 sources.
const double barns_per_cm2
barns per cm^2
bool file_exists(std::string strfilename)
Returns true if the file can be found.
std::map< int, double > atomic_mass_map
Mapping from nuclides in id form to their atomic masses.
std::vector< int > alpha_child(double energy, double error)
std::string to_lower(std::string s)
Returns an all lower case copy of the string.
struct pyne::level_data level_data
a struct matching the '/decay/level_list' table in nuc_data.h5.
struct pyne::dose dose
A struct matching the dose factor table in nuc_data.h5.
struct pyne::alpha alpha
a struct matching the '/decay/alphas' table in nuc_data.h5.
double state_energy(int nuc)
Returns the excitation energy [MeV] of a nuc in a given state.
struct pyne::atomic atomic
Structure for atomic data.
std::string remove_substring(std::string s, std::string substr)
Creates a copy of s with all instances of substr taken out.
std::map< std::pair< int, unsigned int >, level_data > level_data_rx_map
std::string remove_characters(std::string s, std::string chars)
Removes all characters in the string chars from s.
std::vector< double > bp_intensity(int parent)
std::vector< std::pair< double, double > > gamma_conversion_intensity(int parent)
double gamma_frac(int nuc)
std::vector< std::pair< double, double > > decay_beta_branch_ratios(int parent)
std::string dose_lung_model(int nuc, int source)
Lung Model.
std::vector< std::pair< double, double > > gamma_total_intensity(int parent)
std::vector< std::pair< double, double > > betas(int parent_state_id)
comp_map::iterator comp_iter
Nuclide-mass composition iter type.
void _load_data< gamma >()
Loads the gamma ray data from the nuc_data.h5 file into memory.
static std::string fluka_mat_strings[]
const double MeV_per_K
MeV per Kelvin.
double branch_ratio(std::pair< int, int > from_to)
Returns the branch ratio for a parent/child nuclide pair.
std::vector< std::pair< double, double > > gamma_photon_intensity(int parent)
const double Ci_per_Bq
Curies per Becquerel.
std::map< int, double > q_val_map
Mapping from nuclides in id form to their q_values and the fraction of Q that comes from gammas.
void _load_ndsfpy()
Loads the NDS fission product yield data from the nuc_data.h5 file into memory.
std::vector< std::pair< double, double > > alphas(int parent_state_id)
std::vector< std::pair< double, double > > calculate_xray_data(int z, double k_conv, double l_conv)
void _load_atomic_mass_map()
Loads the atomic mass and natural abundance data from the nuc_data.h5 file into memory.
double fpyield(std::pair< int, int > from_to, int source, bool get_error)
Returns the fission product yield for a parent/child nuclide pair.
struct simple_xs simple_xs
#define JSON_API
If defined, indicates that the source file is amalgated to prevent private header inclusion.
#define NUM_RX_NAMES
Number of reactions supported by default.
#define JSONCPP_DEPRECATED(message)
a struct matching the '/decay/alphas' table in nuc_data.h5.
double intensity
intensity of alpha decay
double energy
energy of alpha
int to_nuc
state id of child nuclide
int from_nuc
state id of parent nuclide
a struct matching the atomic_mass table in nuc_data.h5.
double mass
nuclide atomic mass [amu]
double error
error in atomic mass [amu]
double abund
natural abundance of nuclide [atom fraction]
int nuc
nuclide in id form
Structure for atomic data.
double prob
probability K shell hole is filled by L shell [fraction]
double ka1_x_ray_en
Ka1 X-ray energy [keV].
double mi_shell_be_err
M-shell binding energy error [fraction].
int z
number of protons [int]
double l_x_ray_en
L X-ray energy [keV].
double li_shell_be
L-shell binding energy [fraction].
double l_shell_fluor_error
L-shell fluorescence error [fraction].
double ni_shell_be
N-shell binding energy [fraction].
double ka2_to_ka1_err
Ka2 to Ka1 fluorescence error [fraction].
double l_shell_fluor
L-shell fluorescence [fraction].
double ka2_x_ray_en
Ka2 X-ray energy [keV].
double k_shell_be_err
K-shell binding energy error [fraction].
double kb_to_ka
ratio of Kb to Ka fluorescence [fraction]
double ka1_x_ray_en_err
Ka1 X-ray energy error [keV].
double k_shell_fluor
K-shell fluorescence [fraction].
double k_shell_be
K-shell binding energy [fraction].
double li_shell_be_err
L-shell binding energy error [fraction].
double kb_x_ray_en
Kb X-ray energy [keV].
double ka2_x_ray_en_err
Ka2 X-ray energy error [keV].
double ni_shell_be_err
N-shell binding energy error [fraction].
double ka2_to_ka1
Ka2 to Ka1 fluorescence ratio [fraction].
double l_auger
Auger electrons from l shell holes [fraction].
double mi_shell_be
M-shell binding energy [fraction].
double k_shell_fluor_error
K-shell fluorescence error [fraction].
double k_auger
Auger electrons from k shell holes [fraction].
double kb_to_ka_err
error in ratio of Kb to Ka fluorescence [fraction]
a struct matching the '/decay/betas' table in nuc_data.h5.
double endpoint_energy
beta decay endpoint energy
int to_nuc
state id of child nuclide
double intensity
beta intensity
int from_nuc
state id of parent nuclide
double avg_energy
beta decay average energy
a struct matching the '/decay/decays' table in nuc_data.h5.
double branch_ratio
branching ratio of this decay [fraction]
int parent
state id of decay parent
double photon_branch_ratio_error
photon branching ratio error of this decay [fraction]
double beta_branch_ratio
beta branching ratio of this decay [fraction]
double branch_ratio_error
branching ratio of this decay [fraction]
double photon_branch_ratio
photon branching ratio of this decay [fraction]
double half_life_error
half life error of the decay [s]
int child
state id of decay child
unsigned int decay
rx id of decay
double beta_branch_ratio_error
beta branching ratio error of this decay [fraction]
double half_life
half life of the decay [s]
A struct matching the dose factor table in nuc_data.h5.
double ingest_dose
nuclide dose factor due to ingestion [mrem/pCi]
double ratio
ratio of external air dose factor to dose factor due to inhalation
double ext_soil_dose
nuclide ext_soil dose factor [mrem/h per Ci/m^2]
double fluid_frac
fraction of activity abosorbed in body fluids
double inhale_dose
nuclide dose factor due to inhalation [mrem/pCi]
int nuc
nuclide in id form
double ext_air_dose
nuclide ext_air dose factor [mrem/h per Ci/m^3]
char lung_mod
model of lung used (time of biological half life– D, W, or Y)
A struct matching the '/decay/ecbp' table in nuc_data.h5.
int from_nuc
state id of parent nuclide
double avg_energy
beta decay average energy
double k_conv_e
k conversion electron fraction
double l_conv_e
l conversion electron fraction
double ec_intensity
intensity of electron capture
int to_nuc
state id of child nuclide
double endpoint_energy
beta decay endpoint energy
double beta_plus_intensity
intensity of beta plus decay
double m_conv_e
m conversion electron fraction
a struct matching the '/decay/gammas' table in nuc_data.h5.
int from_nuc
state id of starting level
double photon_intensity_err
photon intensity error
double conv_intensity_err
conversion intensity error
double total_intensity
total decay intensity
double photon_intensity
photon intensity
double m_conv_e
m conversion electron fraction
double conv_intensity
conversion intensity
double energy
energy of the photon [keV]
double total_intensity_err
total decay intensity error
int parent_nuc
state id of the primary decaying nucleus
double energy_err
energy error of the photon [keV]
int child_nuc
stateless id of the child nucleus
double k_conv_e
k conversion electron fraction
double l_conv_e
l conversion electron fraction
int to_nuc
state id of final level
a struct matching the '/decay/level_list' table in nuc_data.h5.
double half_life
half life [seconds]
unsigned int rx_id
rx id of reaction, 0 for basic level data
double branch_ratio
branch ratio [fraction]
int metastable
metastable level [int]
char special
special high-spin state [character]
int nuc_id
state id of nuclide
double level
level energy [keV]
A stuct for reprensenting fundemental data in a material.
double atoms_per_mol
material atoms per mole
double comp[1]
array of material composition mass weights.
double density
material density
a struct matching the '/neutron/nds_fission_product' table in nuc_data.h5
double yield_fast_err
fast yield error [fraction]
double yield_14MeV_err
14 MeV yield error [fraction]
double yield_14MeV
14 MeV yield [fraction]
double yield_thermal
thermal yield [fraction]
int from_nuc
id of fissioning nuclide
double yield_fast
fast yield [fraction]
int to_nuc
id of fission product
double yield_thermal_err
thermal yield error [fraction]
a struct for the nds data for fpyield
double yield_14MeV_err
14 MeV yield error [fraction]
double yield_thermal
thermal yield [fraction]
double yield_thermal_err
thermal yield error [fraction]
double yield_fast_err
fast yield error [fraction]
double yield_fast
fast yield [fraction]
double yield_14MeV
14 MeV yield [fraction]
a struct matching the q_value table in nuc_data.h5.
int nuc
nuclide in id form
double gamma_frac
fraction of q that comes from gammas
double q_val
nuclide q_value [MeV/fission]
a struct matching the '/neutron/scattering_lengths' table in nuc_data.h5.
int nuc
nuclide in id form
xd_complex_t b_coherent
coherent scattering length [cm]
xd_complex_t b_incoherent
incoherent scattering length [cm]
double xs_coherent
coherent scattering cross section
double xs
scattering cross section
double xs_incoherent
incoherent scattering cross section
a struct matching the '/neutron/wimsd_fission_product' table in nuc_data.h5.
double yields
fission product yield, fraction [unitless]
int to_nuc
from nuclide in id form
int from_nuc
from nuclide in id form
complex type struct, matching PyTables definition