21#ifndef PYNE_52BMSKGZ3FHG3NQI566D4I2ZLY
22#define PYNE_52BMSKGZ3FHG3NQI566D4I2ZLY
24#define PYNE_IS_AMALGAMATED
79#ifndef PYNE_KMMHYNANYFF5BFMEYIP7TUNLHA
80#define PYNE_KMMHYNANYFF5BFMEYIP7TUNLHA
102 #define isnan(x) __isnand((double)x)
106 #define isnan(x) ((x) != (x))
109#ifndef JSON_IS_AMALGAMATION
110 #define JSON_IS_AMALGAMATION
124 static std::string
digits =
"0123456789";
126 static std::string
alphabet =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
128 static std::string
words =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
133 std::string
to_str(
int t);
134 std::string
to_str(
unsigned int t);
135 std::string
to_str(
double t);
136 std::string
to_str(
bool t);
139 int to_int(std::string s);
141 double to_dbl(std::string s);
147 extern double (*
endftod)(
char * s);
152 std::string
to_upper(std::string s);
155 std::string
to_lower(std::string s);
164 std::string
get_flag(
char line[],
int max_l);
194 double slope (
double x2,
double y2,
double x1,
double y1);
198 double solve_line (
double x,
double x2,
double y2,
double x1,
double y1);
200 double tanh(
double x);
201 double coth(
double x);
235 virtual const char*
what()
const throw()
237 std::string FNFstr (
"File not found: ");
238 if (!filename.empty())
241 return (
const char *) FNFstr.c_str();
245 std::string filename;
266#if !defined(_XDRESS_EXTRA_TYPES_)
267#define _XDRESS_EXTRA_TYPES_
269#if defined(__cplusplus)
292 T * defnew(){
return new T();};
298 T * renew(
void * ptr){
return new (ptr) T();};
302 void deall(T * ptr){
delete ptr;};
308#elif defined(__STDC__)
336#ifndef PYNE_MRNAFG5GNZDNPCRPX3UCBZ5MFE
337#define PYNE_MRNAFG5GNZDNPCRPX3UCBZ5MFE
351#ifndef PYNE_IS_AMALGAMATED
352#include "extra_types.h"
362 virtual const char* what()
const throw()
364 return "Index of point is out of bounds. Cannot handle in HDF5 file.";
387 virtual const char*
what()
const throw()
389 std::string FNH5str (
"Not a valid HDF5 file: ");
390 if (!filename.empty())
393 return (
const char *) FNH5str.c_str();
397 std::string filename;
419 virtual const char*
what()
const throw()
421 std::string msg (
"the group ");
423 msg +=
" not found in the file ";
425 return (
const char *) msg.c_str();
429 std::string filename;
430 std::string groupname;
452 virtual const char*
what()
const throw()
454 std::string msg (
"the path ");
456 msg +=
" was not found in the HDF5 file ";
458 return (
const char *) msg.c_str();
462 std::string filename;
472 template <
typename T>
475 hsize_t count [1] = {1};
476 hsize_t offset [1] = {
static_cast<hsize_t
>(n)};
478 hid_t dspace = H5Dget_space(dset);
479 hsize_t npoints = H5Sget_simple_extent_npoints(dspace);
483 offset[0] = offset[0] + npoints;
486 if (npoints <= offset[0])
489 H5Sselect_hyperslab(dspace, H5S_SELECT_SET, offset, NULL, count, NULL);
492 hsize_t dimsm[1] = {1};
493 hid_t memspace = H5Screate_simple(1, dimsm, NULL);
495 hsize_t count_out [1] = {1};
496 hsize_t offset_out [1] = {0};
498 H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL,
502 H5Dread(dset, dtype, memspace, dspace, H5P_DEFAULT, data_out);
516 template <
typename T>
519 std::set<T> cpp_set = std::set<T>();
521 hid_t dset = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
524 hid_t arr_space = H5Dget_space(dset);
525 int arr_dim = H5Sget_simple_extent_dims(arr_space, arr_len, NULL);
528 T * mem_arr =
new T [arr_len[0]];
529 H5Dread(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, mem_arr);
532 cpp_set.insert(&mem_arr[0], &mem_arr[arr_len[0]]);
547 template <
typename T>
549 hid_t dtype=H5T_NATIVE_DOUBLE)
551 std::vector<T> cpp_vec;
552 hsize_t arr_dims [1];
553 hid_t dset = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
556 hid_t arr_space = H5Dget_space(dset);
557 int arr_ndim = H5Sget_simple_extent_dims(arr_space, arr_dims, NULL);
560 T mem_arr [arr_dims[0]];
561 H5Dread(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, mem_arr);
564 cpp_vec.assign(mem_arr, mem_arr+arr_dims[0]);
577 template <
typename T>
579 hid_t dtype=H5T_NATIVE_DOUBLE)
581 hsize_t arr_dims [2];
582 hid_t dset = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
585 hid_t arr_space = H5Dget_space(dset);
586 int arr_ndim = H5Sget_simple_extent_dims(arr_space, arr_dims, NULL);
591 T mem_arr [arr_dims[0] * arr_dims[1]];
592 H5Dread(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, mem_arr);
595 std::vector< std::vector<T> > cpp_vec (arr_dims[0], std::vector<T>(arr_dims[1]));
596 for(
int i = 0; i < arr_dims[0]; i++)
598 cpp_vec[i].assign(mem_arr+(i*arr_dims[1]), mem_arr+((i+1)*arr_dims[1]));
612 template <
typename T>
614 std::string data_path,
615 hid_t dtype=H5T_NATIVE_DOUBLE)
617 hsize_t arr_dims [3];
618 hid_t dset = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
621 hid_t arr_space = H5Dget_space(dset);
622 int arr_ndim = H5Sget_simple_extent_dims(arr_space, arr_dims, NULL);
627 T mem_arr [arr_dims[0] * arr_dims[1] * arr_dims[2]];
628 H5Dread(dset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, mem_arr);
631 std::vector< std::vector< std::vector<T> > > cpp_vec (arr_dims[0], std::vector< std::vector<T> >(arr_dims[1], std::vector<T>(arr_dims[2])));
632 for(
int i = 0; i < arr_dims[0]; i++)
634 for(
int j = 0; j < arr_dims[1]; j++)
636 cpp_vec[i][j].assign(mem_arr+((i*arr_dims[1]*arr_dims[2]) + (j*arr_dims[2])), mem_arr+((i*arr_dims[1]*arr_dims[2]) + ((j+1)*arr_dims[2])));
649 template <
typename T>
667 hid_t h5_set = H5Dopen2(h5file, data_path.c_str(), H5P_DEFAULT);
668 hid_t h5_space = H5Dget_space(h5_set);
669 hid_t h5_type = H5Dget_type(h5_set);
675 shape[0] = H5Sget_simple_extent_npoints(h5_space);
676 shape[1] = H5Tget_nmembers(h5_type);
679 std::string * cols_buf =
new std::string [
shape[1]];
680 for(
int n = 0; n <
shape[1]; n++)
681 cols_buf[n] = H5Tget_member_name(h5_type, n);
682 cols.assign(cols_buf, cols_buf+
shape[1]);
686 T * col_buf =
new T [
shape[0]];
689 for(
int n = 0; n <
shape[1]; n++)
692 col_type = H5Tcreate(H5T_COMPOUND,
sizeof(T));
693 H5Tinsert(col_type,
cols[n].c_str(), 0, dtype);
696 H5Dread(h5_set, col_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, col_buf);
709 std::map<std::string, std::vector<T> >
data;
717 return data[col_name];
723 std::map<std::string, T> row = std::map<std::string, T>();
725 for(
int n = 0; n <
shape[1]; n++)
737 hid_t ct = H5Tcreate(H5T_COMPOUND,
sizeof(
xd_complex_t));
738 H5Tinsert(ct,
"r", HOFFSET(
xd_complex_t, re), H5T_NATIVE_DOUBLE);
739 H5Tinsert(ct,
"i", HOFFSET(
xd_complex_t, im), H5T_NATIVE_DOUBLE);
754 hid_t ds = H5Dopen2(h5file, path.c_str(), H5P_DEFAULT);
762 hid_t grp = H5Gopen2(h5file, path.c_str(), H5P_DEFAULT);
789#ifndef PYNE_D35WIXV5DZAA5LLOWBY2BL2DPA
790#define PYNE_D35WIXV5DZAA5LLOWBY2BL2DPA
799#ifndef PYNE_IS_AMALGAMATED
916 virtual const char*
what()
const throw()
918 std::string NaNEstr (
"Not a Nuclide! ");
927 return (
const char *) NaNEstr.c_str();
984 virtual const char*
what()
const throw()
986 std::string INFEstr (
"Indeterminate nuclide form: ");
995 return (
const char *) INFEstr.c_str();
1054 int id(
const char * nuc);
1055 int id(std::string nuc);
1071 std::string
name(
int nuc);
1072 std::string
name(
const char * nuc);
1073 std::string
name(std::string nuc);
1083 int znum(
const char * nuc);
1084 int znum(std::string nuc);
1094 int anum(
const char * nuc);
1095 int anum(std::string nuc);
1106 int snum(
const char * nuc);
1107 int snum(std::string nuc);
1120 int zzaaam(
const char * nuc);
1121 int zzaaam(std::string nuc);
1145 int zzzaaa(
const char * nuc);
1146 int zzzaaa(std::string nuc);
1171 std::string
zzllaaam(
const char * nuc);
1172 std::string
zzllaaam(std::string nuc);
1198 int mcnp(
const char * nuc);
1199 int mcnp(std::string nuc);
1222 std::string
fluka(
int nuc);
1245 std::string
serpent(
const char * nuc);
1246 std::string
serpent(std::string nuc);
1268 std::string
nist(
int nuc);
1269 std::string
nist(
const char * nuc);
1270 std::string
nist(std::string nuc);
1293 int cinder(
const char * nuc);
1294 int cinder(std::string nuc);
1315 std::string
alara(
int nuc);
1316 std::string
alara(
const char * nuc);
1317 std::string
alara(std::string nuc);
1342 int sza(
const char * nuc);
1343 int sza(std::string nuc);
1402#ifndef PYNE_7DOEB2PKSBEFFIA3Q2NARI3KFY
1403#define PYNE_7DOEB2PKSBEFFIA3Q2NARI3KFY
1413#ifndef PYNE_IS_AMALGAMATED
1419#define NUM_RX_NAMES 572
1428 extern std::set<std::string>
names;
1430 extern std::map<unsigned int, std::string>
id_name;
1432 extern std::map<std::string, unsigned int>
name_id;
1434 extern std::map<std::string, unsigned int>
altnames;
1436 extern std::map<unsigned int, unsigned int>
id_mt;
1438 extern std::map<unsigned int, unsigned int>
mt_id;
1440 extern std::map<unsigned int, std::string>
labels;
1442 extern std::map<unsigned int, std::string>
docs;
1445 extern std::map<std::pair<std::string, int>,
unsigned int>
offset_id;
1448 extern std::map<std::pair<std::string, unsigned int>,
int>
id_offset;
1455 inline int offset(
int dz,
int da,
int ds=0) {
return dz*10000000 + da*10000 + ds;}
1462 unsigned int hash(std::string s);
1463 unsigned int hash(
const char * s);
1477 std::string
name(
int n);
1478 std::string
name(
unsigned int n);
1479 std::string
name(
char * s);
1480 std::string
name(std::string s);
1481 std::string
name(
int from_nuc,
int to_nuc, std::string z=
"n");
1482 std::string
name(
int from_nuc, std::string to_nuc, std::string z=
"n");
1483 std::string
name(std::string from_nuc,
int to_nuc, std::string z=
"n");
1484 std::string
name(std::string from_nuc, std::string to_nuc, std::string z=
"n");
1499 unsigned int id(
int x);
1500 unsigned int id(
unsigned int x);
1501 unsigned int id(
const char * x);
1502 unsigned int id(std::string x);
1503 unsigned int id(
int from_nuc,
int to_nuc, std::string z=
"n");
1504 unsigned int id(
int from_nuc, std::string to_nuc, std::string z=
"n");
1505 unsigned int id(std::string from_nuc,
int to_nuc, std::string z=
"n");
1506 unsigned int id(std::string from_nuc, std::string to_nuc, std::string z=
"n");
1520 unsigned int mt(
int x);
1521 unsigned int mt(
unsigned int x);
1522 unsigned int mt(
char * x);
1523 unsigned int mt(std::string x);
1524 unsigned int mt(
int from_nuc,
int to_nuc, std::string z=
"n");
1525 unsigned int mt(
int from_nuc, std::string to_nuc, std::string z=
"n");
1526 unsigned int mt(std::string from_nuc,
int to_nuc, std::string z=
"n");
1527 unsigned int mt(std::string from_nuc, std::string to_nuc, std::string z=
"n");
1541 std::string
label(
int x);
1542 std::string
label(
unsigned int x);
1543 std::string
label(
char * x);
1544 std::string
label(std::string x);
1545 std::string
label(
int from_nuc,
int to_nuc, std::string z=
"n");
1546 std::string
label(
int from_nuc, std::string to_nuc, std::string z=
"n");
1547 std::string
label(std::string from_nuc,
int to_nuc, std::string z=
"n");
1548 std::string
label(std::string from_nuc, std::string to_nuc, std::string z=
"n");
1562 std::string
doc(
int x);
1563 std::string
doc(
unsigned int x);
1564 std::string
doc(
char * x);
1565 std::string
doc(std::string x);
1566 std::string
doc(
int from_nuc,
int to_nuc, std::string z=
"n");
1567 std::string
doc(
int from_nuc, std::string to_nuc, std::string z=
"n");
1568 std::string
doc(std::string from_nuc,
int to_nuc, std::string z=
"n");
1569 std::string
doc(std::string from_nuc, std::string to_nuc, std::string z=
"n");
1581 int parent(
int nuc,
unsigned int rx, std::string z=
"n");
1582 int parent(
int nuc, std::string rx, std::string z=
"n");
1583 int parent(std::string nuc,
unsigned int rx, std::string z=
"n");
1584 int parent(std::string nuc, std::string rx, std::string z=
"n");
1596 int child(
int nuc,
unsigned int rx, std::string z=
"n");
1597 int child(
int nuc, std::string rx, std::string z=
"n");
1598 int child(std::string nuc,
unsigned int rx, std::string z=
"n");
1599 int child(std::string nuc, std::string rx, std::string z=
"n");
1670 virtual const char*
what()
const throw()
1672 std::string narxstr (
"Not a reaction! ");
1681 return (
const char *) narxstr.c_str();
1735 virtual const char*
what()
const throw()
1737 std::string INFEstr (
"Indeterminate reaction form: ");
1746 return (
const char *) INFEstr.c_str();
1808#ifndef PYNE_TEWK4A7VOFFLHDDXD5ZZ7KPXEQ
1809#define PYNE_TEWK4A7VOFFLHDDXD5ZZ7KPXEQ
1825#ifndef PYNE_IS_AMALGAMATED
1827#include "extra_types.h"
1837 extern const double pi;
1838 extern const double N_A;
1931 double q_val(
int nuc);
1932 double q_val(
const char * nuc);
1933 double q_val(std::string nuc);
1962 void _load_dose_map(std::map<int, dose>& dm, std::string source_path);
1982 double dose_ratio(
const char * nuc,
int source);
1983 double dose_ratio(std::string nuc,
int source);
2002 extern std::map<int, double>
b_map;
2042 double b(
char * nuc);
2044 double b(std::string nuc);
2100 double fpyield(std::pair<int, int> from_to,
int source,
bool get_error);
2102 double fpyield(
int from_nuc,
int to_nuc,
int source,
bool get_error);
2104 double fpyield(
char * from_nuc,
char * to_nuc,
int source,
bool get_error);
2106 double fpyield(std::string from_nuc, std::string to_nuc,
int source,
bool get_error);
2120 bool operator()(
const std::pair<int, double>& lhs,
2121 const std::pair<int, double>& rhs)
const;
2127 template<
typename T,
typename U> std::vector<T>
data_access(
double emin,
2128 double emax,
size_t valoffset, std::map<std::pair<int, double>, U> &data);
2132 template<
typename T,
typename U> std::vector<T>
data_access(
int parent,
2133 double min,
double max,
size_t valoffset,
2134 std::map<std::pair<int, double>, U> &data);
2138 template<
typename T,
typename U> T
data_access(std::pair<int, int> from_to,
2139 size_t valoffset, std::map<std::pair<int, int>, U> &data);
2143 template<
typename T,
typename U> std::vector<T>
data_access(
int parent,
2144 size_t valoffset, std::map<std::pair<int, int>, U> &data);
2145 template<
typename T,
typename U> std::vector<T>
data_access(
int parent,
2146 size_t valoffset, std::map<std::pair<int, unsigned int>, U> &data);
2150 template<
typename U>
double data_access(
int parent,
2151 size_t valoffset, std::map<int, U> &data);
2190 std::vector<std::pair<double, double> >
2217 int id_from_level(
int nuc,
double level, std::string special);
2259 double branch_ratio(std::string from_nuc, std::string to_nuc);
2346 std::vector<std::pair<double, double> >
gamma_energy(
int parent);
2347 std::vector<std::pair<double, double> >
gamma_energy(
double energy,
2358 std::vector<std::pair<int, int> >
gamma_from_to(
int parent);
2360 std::vector<std::pair<int, int> >
gamma_from_to(
double energy,
double error);
2364 std::vector<int>
gamma_parent(
double energy,
double error);
2366 std::vector<int>
gamma_child(
double energy,
double error);
2371 std::vector<std::pair<double, double> >
gamma_xrays(
int parent);
2374 std::vector<std::pair<double, double> >
gammas(
int parent_state_id);
2375 std::vector<std::pair<double, double> >
alphas(
int parent_state_id);
2376 std::vector<std::pair<double, double> >
betas(
int parent_state_id);
2377 std::vector<std::pair<double, double> >
xrays(
int parent);
2398 std::vector<int>
alpha_parent(
double energy,
double error);
2400 std::vector<int>
alpha_child(
double energy,
double error);
2425 std::vector<int>
beta_parent(
double energy,
double error);
2427 std::vector<int>
beta_child(
double energy,
double error);
2463 std::vector<int>
ecbp_parent(
double energy,
double error);
2466 std::vector<int>
ecbp_child(
double energy,
double error);
2472 std::vector<std::pair<double, double> >
ecbp_xrays(
int parent);
2476 extern std::map<std::string, std::map<int, std::map<int, double> > >
2483 double simple_xs(
int nuc,
int rx, std::string energy);
2488 double simple_xs(
int nuc, std::string rx, std::string energy);
2493 double simple_xs(std::string nuc,
int rx, std::string energy);
2498 double simple_xs(std::string nuc, std::string rx, std::string energy);
2508 virtual const char*
what()
const throw() {
2509 return msg_.c_str();
2599#ifdef PYNE_IS_AMALGAMATED
2600 #if !defined(JSON_IS_AMALGAMATION)
2601 #define JSON_IS_AMALGAMATION
2606#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED
2607# define JSON_FORWARD_AMALGATED_H_INCLUDED
2610#define JSON_IS_AMALGATED
2621#ifndef JSON_CONFIG_H_INCLUDED
2622# define JSON_CONFIG_H_INCLUDED
2644# define JSON_USE_EXCEPTION 1
2652# ifdef JSON_IN_CPPTL
2653# include <cpptl/config.h>
2654# ifndef JSON_USE_CPPTL
2655# define JSON_USE_CPPTL 1
2659# ifdef JSON_IN_CPPTL
2660# define JSON_API CPPTL_API
2661# elif defined(JSON_DLL_BUILD)
2662# define JSON_API __declspec(dllexport)
2663# elif defined(JSON_DLL)
2664# define JSON_API __declspec(dllimport)
2673#if defined(_MSC_VER) && _MSC_VER <= 1200
2676#define JSON_USE_INT64_DOUBLE_CONVERSION 1
2679#if defined(_MSC_VER) && _MSC_VER >= 1500
2681# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
2684#if !defined(JSONCPP_DEPRECATED)
2685# define JSONCPP_DEPRECATED(message)
2691# if defined(JSON_NO_INT64)
2694# undef JSON_HAS_INT64
2697# if defined(_MSC_VER)
2698 typedef __int64
Int64;
2699 typedef unsigned __int64
UInt64;
2706# define JSON_HAS_INT64
2731#ifndef JSON_FORWARDS_H_INCLUDED
2732# define JSON_FORWARDS_H_INCLUDED
2734#if !defined(JSON_IS_AMALGAMATION)
2759#ifdef JSON_VALUE_USE_INTERNAL_MAP
2760 class ValueMapAllocator;
2761 class ValueInternalLink;
2762 class ValueInternalArray;
2763 class ValueInternalMap;
2858#ifdef PYNE_IS_AMALGAMATED
2859 #if !defined(JSON_IS_AMALGAMATION)
2860 #define JSON_IS_AMALGAMATION
2866#ifndef JSON_AMALGATED_H_INCLUDED
2867# define JSON_AMALGATED_H_INCLUDED
2870#define JSON_IS_AMALGATED
2881#ifndef JSON_CONFIG_H_INCLUDED
2882# define JSON_CONFIG_H_INCLUDED
2904# define JSON_USE_EXCEPTION 1
2912# ifdef JSON_IN_CPPTL
2913# include <cpptl/config.h>
2914# ifndef JSON_USE_CPPTL
2915# define JSON_USE_CPPTL 1
2919# ifdef JSON_IN_CPPTL
2920# define JSON_API CPPTL_API
2921# elif defined(JSON_DLL_BUILD)
2922# define JSON_API __declspec(dllexport)
2923# elif defined(JSON_DLL)
2924# define JSON_API __declspec(dllimport)
2933#if defined(_MSC_VER) && _MSC_VER <= 1200
2936#define JSON_USE_INT64_DOUBLE_CONVERSION 1
2939#if defined(_MSC_VER) && _MSC_VER >= 1500
2941# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
2944#if !defined(JSONCPP_DEPRECATED)
2945# define JSONCPP_DEPRECATED(message)
2950 typedef unsigned int UInt;
2951# if defined(JSON_NO_INT64)
2954# undef JSON_HAS_INT64
2957# if defined(_MSC_VER)
2958 typedef __int64
Int64;
2959 typedef unsigned __int64
UInt64;
2961 typedef long long int Int64;
2962 typedef unsigned long long int UInt64;
2966# define JSON_HAS_INT64
2991#ifndef JSON_FORWARDS_H_INCLUDED
2992# define JSON_FORWARDS_H_INCLUDED
2994#if !defined(JSON_IS_AMALGAMATION)
3016 class ValueIteratorBase;
3017 class ValueIterator;
3018 class ValueConstIterator;
3019#ifdef JSON_VALUE_USE_INTERNAL_MAP
3020 class ValueMapAllocator;
3021 class ValueInternalLink;
3022 class ValueInternalArray;
3023 class ValueInternalMap;
3049#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
3050# define CPPTL_JSON_FEATURES_H_INCLUDED
3052#if !defined(JSON_IS_AMALGAMATION)
3053# include "forwards.h"
3112#ifndef CPPTL_JSON_H_INCLUDED
3113# define CPPTL_JSON_H_INCLUDED
3115#if !defined(JSON_IS_AMALGAMATION)
3116# include "forwards.h"
3121# ifndef JSON_USE_CPPTL_SMALLMAP
3124# include <cpptl/smallmap.h>
3126# ifdef JSON_USE_CPPTL
3127# include <cpptl/forwards.h>
3183 operator const char *()
const
3227# ifdef JSON_VALUE_USE_INTERNAL_MAP
3228 friend class ValueInternalLink;
3229 friend class ValueInternalMap;
3237# if defined(JSON_HAS_INT64)
3268#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
3269# ifndef JSON_VALUE_USE_INTERNAL_MAP
3273 enum DuplicationPolicy
3280 CZString(
const char *cstr, DuplicationPolicy allocate );
3281 CZString(
const CZString &other );
3283 CZString &operator =(
const CZString &other );
3284 bool operator<(
const CZString &other )
const;
3285 bool operator==(
const CZString &other )
const;
3287 const char *c_str()
const;
3288 bool isStaticString()
const;
3290 void swap( CZString &other );
3296# ifndef JSON_USE_CPPTL_SMALLMAP
3323#if defined(JSON_HAS_INT64)
3327 Value(
double value );
3328 Value(
const char *value );
3329 Value(
const char *beginValue,
const char *endValue );
3341 Value(
const std::string &value );
3342# ifdef JSON_USE_CPPTL
3343 Value(
const CppTL::ConstString &value );
3345 Value(
bool value );
3353 void swap(
Value &other );
3357 bool operator <(
const Value &other )
const;
3358 bool operator <=(
const Value &other )
const;
3359 bool operator >=(
const Value &other )
const;
3360 bool operator >(
const Value &other )
const;
3362 bool operator ==(
const Value &other )
const;
3363 bool operator !=(
const Value &other )
const;
3365 int compare(
const Value &other )
const;
3367 const char *asCString()
const;
3368 std::string asString()
const;
3369# ifdef JSON_USE_CPPTL
3370 CppTL::ConstString asConstString()
const;
3373 UInt asUInt()
const;
3374 Int64 asInt64()
const;
3378 float asFloat()
const;
3379 double asDouble()
const;
3380 bool asBool()
const;
3382 bool isNull()
const;
3383 bool isBool()
const;
3385 bool isUInt()
const;
3386 bool isIntegral()
const;
3387 bool isDouble()
const;
3388 bool isNumeric()
const;
3389 bool isString()
const;
3390 bool isArray()
const;
3391 bool isObject()
const;
3393 bool isConvertibleTo(
ValueType other )
const;
3403 bool operator!()
const;
3429 Value &operator[](
int index );
3439 const Value &operator[](
int index )
const;
3444 const Value &defaultValue )
const;
3453 Value &operator[](
const char *key );
3455 const Value &operator[](
const char *key )
const;
3457 Value &operator[](
const std::string &key );
3459 const Value &operator[](
const std::string &key )
const;
3472# ifdef JSON_USE_CPPTL
3474 Value &operator[](
const CppTL::ConstString &key );
3476 const Value &operator[](
const CppTL::ConstString &key )
const;
3479 Value get(
const char *key,
3480 const Value &defaultValue )
const;
3482 Value get(
const std::string &key,
3483 const Value &defaultValue )
const;
3484# ifdef JSON_USE_CPPTL
3486 Value get(
const CppTL::ConstString &key,
3487 const Value &defaultValue )
const;
3495 Value removeMember(
const char* key );
3497 Value removeMember(
const std::string &key );
3500 bool isMember(
const char *key )
const;
3502 bool isMember(
const std::string &key )
const;
3503# ifdef JSON_USE_CPPTL
3505 bool isMember(
const CppTL::ConstString &key )
const;
3513 Members getMemberNames()
const;
3521 void setComment(
const char *comment,
3524 void setComment(
const std::string &comment,
3530 std::string toStyledString()
const;
3539 Value &resolveReference(
const char *key,
3542# ifdef JSON_VALUE_USE_INTERNAL_MAP
3543 inline bool isItemAvailable()
const
3545 return itemIsUsed_ == 0;
3548 inline void setItemUsed(
bool isUsed =
true )
3550 itemIsUsed_ = isUsed ? 1 : 0;
3553 inline bool isMemberNameStatic()
const
3555 return memberNameIsStatic_ == 0;
3558 inline void setMemberNameIsStatic(
bool isStatic )
3560 memberNameIsStatic_ = isStatic ? 1 : 0;
3570 void setComment(
const char *text );
3591# ifdef JSON_VALUE_USE_INTERNAL_MAP
3592 ValueInternalArray *array_;
3593 ValueInternalMap *map_;
3600# ifdef JSON_VALUE_USE_INTERNAL_MAP
3601 unsigned int itemIsUsed_ : 1;
3602 int memberNameIsStatic_ : 1;
3604 CommentInfo *comments_;
3646 Path(
const std::string &path,
3655 const Value &defaultValue )
const;
3660 typedef std::vector<const PathArgument *> InArgs;
3661 typedef std::vector<PathArgument> Args;
3663 void makePath(
const std::string &path,
3665 void addPathInArg(
const std::string &path,
3667 InArgs::const_iterator &itInArg,
3668 PathArgument::Kind kind );
3669 void invalidPath(
const std::string &path,
3677#ifdef JSON_VALUE_USE_INTERNAL_MAP
3725 virtual ~ValueMapAllocator();
3726 virtual ValueInternalMap *newMap() = 0;
3727 virtual ValueInternalMap *newMapCopy(
const ValueInternalMap &other ) = 0;
3728 virtual void destructMap( ValueInternalMap *map ) = 0;
3729 virtual ValueInternalLink *allocateMapBuckets(
unsigned int size ) = 0;
3730 virtual void releaseMapBuckets( ValueInternalLink *links ) = 0;
3731 virtual ValueInternalLink *allocateMapLink() = 0;
3732 virtual void releaseMapLink( ValueInternalLink *link ) = 0;
3741 enum { itemPerLink = 6 };
3742 enum InternalFlags {
3747 ValueInternalLink();
3749 ~ValueInternalLink();
3751 Value items_[itemPerLink];
3752 char *keys_[itemPerLink];
3753 ValueInternalLink *previous_;
3754 ValueInternalLink *next_;
3772 friend class ValueIteratorBase;
3775 typedef unsigned int HashKey;
3776 typedef unsigned int BucketIndex;
3778# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
3779 struct IteratorState
3788 ValueInternalMap *map_;
3789 ValueInternalLink *link_;
3790 BucketIndex itemIndex_;
3791 BucketIndex bucketIndex_;
3796 ValueInternalMap(
const ValueInternalMap &other );
3797 ValueInternalMap &operator =(
const ValueInternalMap &other );
3798 ~ValueInternalMap();
3800 void swap( ValueInternalMap &other );
3802 BucketIndex size()
const;
3806 bool reserveDelta( BucketIndex growth );
3808 bool reserve( BucketIndex newItemCount );
3810 const Value *find(
const char *key )
const;
3812 Value *find(
const char *key );
3814 Value &resolveReference(
const char *key,
3817 void remove(
const char *key );
3819 void doActualRemove( ValueInternalLink *link,
3821 BucketIndex bucketIndex );
3823 ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex );
3825 Value &setNewItem(
const char *key,
3827 ValueInternalLink *link,
3828 BucketIndex index );
3830 Value &unsafeAdd(
const char *key,
3832 HashKey hashedKey );
3834 HashKey
hash(
const char *key )
const;
3836 int compare(
const ValueInternalMap &other )
const;
3839 void makeBeginIterator( IteratorState &it )
const;
3840 void makeEndIterator( IteratorState &it )
const;
3841 static bool equals(
const IteratorState &x,
const IteratorState &other );
3842 static void increment( IteratorState &iterator );
3843 static void incrementBucket( IteratorState &iterator );
3844 static void decrement( IteratorState &iterator );
3845 static const char *key(
const IteratorState &iterator );
3846 static const char *key(
const IteratorState &iterator,
bool &isStatic );
3847 static Value &value(
const IteratorState &iterator );
3848 static int distance(
const IteratorState &x,
const IteratorState &y );
3851 ValueInternalLink *buckets_;
3852 ValueInternalLink *tailLink_;
3853 BucketIndex bucketsSize_;
3854 BucketIndex itemCount_;
3871 friend class ValueIteratorBase;
3873 enum { itemsPerPage = 8 };
3875 typedef unsigned int PageIndex;
3877# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
3878 struct IteratorState
3882 , currentPageIndex_(0)
3883 , currentItemIndex_(0)
3886 ValueInternalArray *array_;
3887 Value **currentPageIndex_;
3888 unsigned int currentItemIndex_;
3892 ValueInternalArray();
3893 ValueInternalArray(
const ValueInternalArray &other );
3894 ValueInternalArray &operator =(
const ValueInternalArray &other );
3895 ~ValueInternalArray();
3896 void swap( ValueInternalArray &other );
3899 void resize( ArrayIndex newSize );
3901 Value &resolveReference( ArrayIndex index );
3903 Value *find( ArrayIndex index )
const;
3907 int compare(
const ValueInternalArray &other )
const;
3910 static bool equals(
const IteratorState &x,
const IteratorState &other );
3911 static void increment( IteratorState &iterator );
3912 static void decrement( IteratorState &iterator );
3913 static Value &dereference(
const IteratorState &iterator );
3914 static Value &unsafeDereference(
const IteratorState &iterator );
3915 static int distance(
const IteratorState &x,
const IteratorState &y );
3916 static ArrayIndex indexOf(
const IteratorState &iterator );
3917 void makeBeginIterator( IteratorState &it )
const;
3918 void makeEndIterator( IteratorState &it )
const;
3919 void makeIterator( IteratorState &it, ArrayIndex index )
const;
3921 void makeIndexValid( ArrayIndex index );
3925 PageIndex pageCount_;
3990 virtual ~ValueArrayAllocator();
3991 virtual ValueInternalArray *newArray() = 0;
3992 virtual ValueInternalArray *newArrayCopy(
const ValueInternalArray &other ) = 0;
3993 virtual void destructArray( ValueInternalArray *array ) = 0;
4005 virtual void reallocateArrayPageIndex( Value **&indexes,
4006 ValueInternalArray::PageIndex &indexCount,
4007 ValueInternalArray::PageIndex minNewIndexCount ) = 0;
4008 virtual void releaseArrayPageIndex( Value **indexes,
4009 ValueInternalArray::PageIndex indexCount ) = 0;
4010 virtual Value *allocateArrayPage() = 0;
4011 virtual void releaseArrayPage( Value *value ) = 0;
4027#ifndef JSON_VALUE_USE_INTERNAL_MAP
4072#ifndef JSON_VALUE_USE_INTERNAL_MAP
4073 Value::ObjectValues::iterator current_;
4079 ValueInternalArray::IteratorState array_;
4080 ValueInternalMap::IteratorState map_;
4103#ifndef JSON_VALUE_USE_INTERNAL_MAP
4163#ifndef JSON_VALUE_USE_INTERNAL_MAP
4164 explicit ValueIterator(
const Value::ObjectValues::iterator ¤t );
4166 ValueIterator(
const ValueInternalArray::IteratorState &state );
4167 ValueIterator(
const ValueInternalMap::IteratorState &state );
4229#ifndef CPPTL_JSON_READER_H_INCLUDED
4230# define CPPTL_JSON_READER_H_INCLUDED
4232#if !defined(JSON_IS_AMALGAMATION)
4233# include "features.h"
4272 bool parse(
const std::string &document,
4274 bool collectComments =
true );
4288 bool parse(
const char *beginDoc,
const char *endDoc,
4290 bool collectComments =
true );
4294 bool parse( std::istream &is,
4296 bool collectComments =
true );
4305 std::
string getFormatedErrorMessages() const;
4312 std::
string getFormattedErrorMessages() const;
4317 tokenEndOfStream = 0,
4327 tokenArraySeparator,
4328 tokenMemberSeparator,
4345 std::string message_;
4349 typedef std::deque<ErrorInfo> Errors;
4351 bool expectToken( TokenType type, Token &token,
const char *message );
4352 bool readToken( Token &token );
4354 bool match( Location pattern,
4355 int patternLength );
4357 bool readCStyleComment();
4358 bool readCppStyleComment();
4362 bool readObject( Token &token );
4363 bool readArray( Token &token );
4364 bool decodeNumber( Token &token );
4365 bool decodeString( Token &token );
4366 bool decodeString( Token &token, std::string &decoded );
4367 bool decodeDouble( Token &token );
4368 bool decodeUnicodeCodePoint( Token &token,
4371 unsigned int &unicode );
4372 bool decodeUnicodeEscapeSequence( Token &token,
4375 unsigned int &unicode );
4376 bool addError(
const std::string &message,
4378 Location extra = 0 );
4379 bool recoverFromError( TokenType skipUntilToken );
4380 bool addErrorAndRecover(
const std::string &message,
4382 TokenType skipUntilToken );
4383 void skipUntilSpace();
4384 Value ¤tValue();
4386 void getLocationLineAndColumn( Location location,
4388 int &column )
const;
4389 std::string getLocationLineAndColumn( Location location )
const;
4390 void addComment( Location begin,
4392 CommentPlacement placement );
4393 void skipCommentTokens( Token &token );
4395 typedef std::stack<Value *> Nodes;
4398 std::string document_;
4402 Location lastValueEnd_;
4404 std::string commentsBefore_;
4406 bool collectComments_;
4433 std::istream&
operator>>( std::istream&, Value& );
4457#ifndef JSON_WRITER_H_INCLUDED
4458# define JSON_WRITER_H_INCLUDED
4460#if !defined(JSON_IS_AMALGAMATION)
4493 void enableYAMLCompatibility();
4496 virtual std::string write(
const Value &root );
4499 void writeValue(
const Value &value );
4501 std::string document_;
4502 bool yamlCompatiblityEnabled_;
4534 virtual std::string write(
const Value &root );
4537 void writeValue(
const Value &value );
4538 void writeArrayValue(
const Value &value );
4539 bool isMultineArray(
const Value &value );
4540 void pushValue(
const std::string &value );
4542 void writeWithIndent(
const std::string &value );
4545 void writeCommentBeforeValue(
const Value &root );
4546 void writeCommentAfterValueOnSameLine(
const Value &root );
4547 bool hasCommentForValue(
const Value &value );
4548 static std::string normalizeEOL(
const std::string &text );
4550 typedef std::vector<std::string> ChildValues;
4552 ChildValues childValues_;
4553 std::string document_;
4554 std::string indentString_;
4557 bool addChildValues_;
4592 void write( std::ostream &out,
const Value &root );
4595 void writeValue(
const Value &value );
4596 void writeArrayValue(
const Value &value );
4597 bool isMultineArray(
const Value &value );
4598 void pushValue(
const std::string &value );
4600 void writeWithIndent(
const std::string &value );
4603 void writeCommentBeforeValue(
const Value &root );
4604 void writeCommentAfterValueOnSameLine(
const Value &root );
4605 bool hasCommentForValue(
const Value &value );
4606 static std::string normalizeEOL(
const std::string &text );
4608 typedef std::vector<std::string> ChildValues;
4610 ChildValues childValues_;
4611 std::ostream* document_;
4612 std::string indentString_;
4614 std::string indentation_;
4615 bool addChildValues_;
4618# if defined(JSON_HAS_INT64)
4630 std::ostream&
operator<<( std::ostream&,
const Value &root );
4680#ifndef PYNE_46Z7LQYFI5HZNASIPCWHVX3X5E
4681#define PYNE_46Z7LQYFI5HZNASIPCWHVX3X5E
4700 std::string closecurly =
"}",
4701 std::string opensquare =
"[",
4702 std::string closesquare =
"]",
4703 std::string colon =
":",
4704 std::string comma =
",",
4705 std::string indent =
" ",
4710 virtual std::string write(
const Value &root );
4713 void writeValue(
const Value &value, std::string &doc,
bool forceSingleLine );
4714 bool isMultiline(
const Value &value );
4718 std::string document_;
4719 std::string indentString_;
4720 std::string opencurly_;
4721 std::string closecurly_;
4722 std::string opensquare_;
4723 std::string closesquare_;
4726 std::string indent_;
4747#ifndef PYNE_MR34UE5INRGMZK2QYRDWICFHVM
4748#define PYNE_MR34UE5INRGMZK2QYRDWICFHVM
4759#if !defined(JSON_IS_AMALGAMATION)
4760 #define JSON_IS_AMALGAMATION
4763#ifndef PYNE_IS_AMALGAMATED
4764#include "json-forwards.h"
4779 #ifdef PYNE_IS_AMALGAMATED
4780 namespace decayers {
4789 "BLCKHOLE",
"VACUUM",
"HYDROGEN",
"HELIUM",
"BERYLLIU",
"CARBON",
4790 "NITROGEN",
"OXYGEN",
"MAGNESIU",
"ALUMINUM",
"IRON",
"COPPER",
4791 "SILVER",
"SILICON",
"GOLD",
"MERCURY",
"LEAD",
"TANTALUM",
4792 "SODIUM",
"ARGON",
"CALCIUM",
"TIN",
"TUNGSTEN",
"TITANIUM",
4793 "NICKEL",
"WATER",
"POLYSTYR",
"PLASCINT",
"PMMA",
"BONECOMP",
4794 "BONECORT",
"MUSCLESK",
"MUSCLEST",
"ADTISSUE",
"KAPTON",
"POLYETHY",
"AIR"
4832 Material(
char * filename,
double m=-1.0,
double d=-1.0,
double apm=-1.0,
4846 Material(std::string filename,
double m=-1.0,
double d=-1.0,
double apm=-1.0,
4874 void from_hdf5(
char * filename,
char * datapath,
int row=-1,
int protocol=1);
4881 void from_hdf5(std::string filename, std::string datapath=
"/material",
4882 int row=-1,
int protocol=1);
4893 void write_hdf5(
char * filename,
char * datapath,
char * nucpath,
float row=-0.0,
4904 void write_hdf5(std::string filename, std::string datapath=
"/material",
4905 std::string nucpath=
"/nucid",
float row=-0.0,
int chunksize=100);
4908 std::string
mcnp(std::string frac_type =
"mass");
4911 std::string
fluka(
int id, std::string frac_type =
"mass");
4918 std::string fluka_name);
4921 int fid, std::string fluka_name);
5001 double mass_density(
double num_dens=-1.0,
double apm=-1.0);
5069 std::vector<std::pair<double, double> >
gammas();
5072 std::vector<std::pair<double, double> >
xrays();
5075 std::vector<std::pair<double, double> >
photons(
bool norm);
5079 std::vector<std::pair<double, double> > unnormed);
5112 virtual const char* what()
const throw()
5114 return "Invalid loading protocol number; please use 0 or 1.";
5132#ifndef PYNE_3QGDWZMLZBHDHI424JL52SQHN4
5133#define PYNE_3QGDWZMLZBHDHI424JL52SQHN4
5135#ifndef PYNE_IS_AMALGAMATED
5147namespace enrichment {
5208#ifndef PYNE_B3ANNCKDQ5HEJLI33RPZPDNX6A
5209#define PYNE_B3ANNCKDQ5HEJLI33RPZPDNX6A
5211#ifndef PYNE_IS_AMALGAMATED
5212#include "enrichment_symbolic.h"
5221namespace enrichment {
5230 double feed_per_prod(
double x_feed,
double x_prod,
double x_tail);
5233 double feed_per_tail(
double x_feed,
double x_prod,
double x_tail);
5236 double prod_per_feed(
double x_feed,
double x_prod,
double x_tail);
5239 double prod_per_tail(
double x_feed,
double x_prod,
double x_tail);
5242 double tail_per_feed(
double x_feed,
double x_prod,
double x_tail);
5245 double tail_per_prod(
double x_feed,
double x_prod,
double x_tail);
5250 double swu_per_feed(
double x_feed,
double x_prod,
double x_tail);
5253 double swu_per_prod(
double x_feed,
double x_prod,
double x_tail);
5256 double swu_per_tail(
double x_feed,
double x_prod,
double x_tail);
5273 Cascade
solve_numeric(Cascade & orig_casc,
double tolerance=1.0E-7,
5278 void _recompute_nm(Cascade & casc,
double tolerance=1.0E-7);
5295 Cascade
_norm_comp_secant(Cascade & casc,
double tolerance=1.0E-7,
int max_iter=100);
5320 double tolerance=1.0E-7,
int max_iter=100);
5321 Cascade
multicomponent(Cascade & orig_casc, std::string solver=
"symbolic",
5322 double tolerance=1.0E-7,
int max_iter=100);
5329 virtual const char* what()
const throw()
5331 return "Inifinite loop found while calculating enrichment cascade.";
5340 virtual const char* what()
const throw()
5342 return "Iteration limit hit durring enrichment calculation.";
5350 virtual const char* what()
const throw()
5352 return "Iteration has hit a point where some values are not-a-number.";
5383#ifndef PYNE_OU4PO4TJDBDM5PY4VKAVL7JCSM
5384#define PYNE_OU4PO4TJDBDM5PY4VKAVL7JCSM
5388#ifndef PYNE_IS_AMALGAMATED
5389#include "enrichment_cascade.h"
5393namespace enrichment {
5416#ifdef PYNE_DECAY_IS_DUMMY
5417#ifndef PYNE_GEUP5PGEJBFGNHGI36TRBB4WGM
5418#define PYNE_GEUP5PGEJBFGNHGI36TRBB4WGM
5432#ifndef PYNE_IS_AMALGAMATED
5442std::map<int, double>
decay(std::map<int, double> comp,
double t);
Writes a Value in JSON format with custom formatting.
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. Default: false.
bool allowComments_
true if comments are allowed. Default: true.
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.
Lightweight wrapper to tag static string.
const char * c_str() const
StaticString(const char *czstring)
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string.
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. "" if it is not an objectValue.
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)
std::map< CZString, Value > ObjectValues
Json::ArrayIndex ArrayIndex
Json::LargestInt LargestInt
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Json::LargestUInt LargestUInt
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
static const Int64 minInt64
Minimum signed 64 bits int value that can be stored in a Json::Value.
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.
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
std::vector< std::string > Members
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
ValueConstIterator const_iterator
Abstract class for writers.
virtual std::string write(const Value &root)=0
Custom exception for when an existing file is not in a valid HDF5 format.
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
Custom exception for when a group cannot be found in an HDF5 file.
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.
A class representing a high-level table contruct whose columns all have the same type T in C/C++ (and...
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::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.
Custom exception for when a path is not found in an HDF5 file.
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
Custom exception to be thrown in the event that a required file is not able to be found.
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.
Custom exception for declaring a simple_xs request invalid.
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,...
A set of physical parameters used to specify an enrichment cascade.
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.
Custom expection for declaring that a value does not follow a recognizable nuclide naming convention.
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.
Custom exception for declaring a value not to be a valid reaction.
~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.
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
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::map< int, double > atomic_mass_error_map
Mapping from nuclides in id form to the associated error in abdundance.
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, 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