8 #ifndef PYNE_MR34UE5INRGMZK2QYRDWICFHVM 9 #define PYNE_MR34UE5INRGMZK2QYRDWICFHVM 20 #if !defined(JSON_IS_AMALGAMATION) 21 #define JSON_IS_AMALGAMATION 24 #ifndef PYNE_IS_AMALGAMATED 26 #include "json-forwards.h" 35 #define DEFAULT_MAT_CHUNKSIZE 100 43 #ifdef PYNE_IS_AMALGAMATED 45 extern comp_map
decay(comp_map,
double);
59 static std::string fluka_mat_strings[] = {
60 "BLCKHOLE",
"VACUUM",
"HYDROGEN",
"HELIUM",
"BERYLLIU",
"CARBON",
61 "NITROGEN",
"OXYGEN",
"MAGNESIU",
"ALUMINUM",
"IRON",
"COPPER",
62 "SILVER",
"SILICON",
"GOLD",
"MERCURY",
"LEAD",
"TANTALUM",
63 "SODIUM",
"ARGON",
"CALCIUM",
"TIN",
"TUNGSTEN",
"TITANIUM",
64 "NICKEL",
"WATER",
"POLYSTYR",
"PLASCINT",
"PMMA",
"BONECOMP",
65 "BONECORT",
"MUSCLESK",
"MUSCLEST",
"ADTISSUE",
"KAPTON",
"POLYETHY",
"AIR" 68 static int FLUKA_MAT_NUM = 37;
76 double get_comp_sum ();
82 Material(comp_map cm,
double m=-1.0,
double d=-1.0,
double apm=-1.0,
103 Material(
char * filename,
double m=-1.0,
double d=-1.0,
double apm=-1.0,
117 Material(std::string filename,
double m=-1.0,
double d=-1.0,
double apm=-1.0,
131 void _load_comp_protocol0(hid_t db, std::string datapath,
int row);
138 void _load_comp_protocol1(hid_t db, std::string datapath,
int row);
146 void _load_comp_protocol1(hid_t db, std::string datapath, std::string nucpath,
int row);
153 void from_hdf5(
char * filename,
char * datapath,
int row=-1,
int protocol=1);
160 void from_hdf5(std::string filename, std::string datapath=
"/mat_name",
161 int row=-1,
int protocol=1);
173 int detect_hdf5_layout(hid_t db, std::string datapath);
175 enum prot1_layout {path_donotexists=-1, unknown, old_layout, new_layout};
188 void write_hdf5(std::string filename, std::string datapath=
"/mat_name",
189 float row=-0.0,
int chunksize=DEFAULT_MAT_CHUNKSIZE);
197 std::vector<int> write_hdf5_nucpath(hid_t db, std::string nucpath);
210 void write_hdf5_datapath(hid_t db, std::string datapath,
float row,
int chunksize,
211 std::vector<int> nuclides);
225 void deprecated_write_hdf5(
char * filename,
char * datapath,
char * nucpath,
float row=-0.0,
226 int chunksize=DEFAULT_MAT_CHUNKSIZE);
240 void deprecated_write_hdf5(hid_t db, std::string datapath, std::string nucpath,
float row=-0.0,
241 int chunksize=DEFAULT_MAT_CHUNKSIZE);
251 void deprecated_write_hdf5(std::string filename, std::string datapath,
252 std::string nucpath,
float row=-0.0,
int chunksize=DEFAULT_MAT_CHUNKSIZE);
254 std::string openmc(std::string fact_type =
"mass");
257 std::string mcnp(std::string frac_type =
"mass",
bool mult_den =
true);
259 std::string phits(std::string frac_type =
"mass",
bool mult_den =
true);
261 std::string mcnp_frac(std::map<int, double> fracs, std::string frac_type =
"");
264 std::string get_uwuw_name();
267 std::string fluka(
int id, std::string frac_type =
"mass");
269 bool not_fluka_builtin(std::string fluka_name);
271 std::string fluka_material_str(
int id);
273 std::string fluka_material_component(
int fid,
int nucid,
274 std::string fluka_name);
276 std::string fluka_material_line(
int znum,
double atomic_mass,
277 int fid, std::string fluka_name);
279 std::string fluka_format_field(
float field);
282 std::string fluka_compound_str(
int id, std::string frac_type =
"mass");
285 void from_text(
char * filename);
287 void from_text(std::string filename);
290 void write_text(
char * filename);
292 void write_text(std::string filename);
295 void load_json(Json::Value);
297 Json::Value dump_json();
299 void from_json(
char * filename);
301 void from_json(std::string filname);
303 void write_json(
char * filename);
305 void write_json(std::string filename);
313 Json::Value metadata;
318 comp_map mult_by_mass();
326 double molecular_mass(
double apm=-1.0);
333 comp_map decay_heat();
343 comp_map dose_per_g(std::string dose_type,
int source=0);
346 Material expand_elements(std::set<int> exception_ids);
348 Material expand_elements(
int **int_ptr_arry = NULL);
351 Material collapse_elements(std::set<int> exception_znum);
353 Material collapse_elements(
int **int_ptr_arry);
359 double mass_density(
double num_dens=-1.0,
double apm=-1.0);
364 std::map<int, double> get_density_frac(std::string frac_type=
"atom",
bool mult_den=
true);
370 double number_density(
double mass_dens=-1.0,
double apm=-1.0);
375 Material sub_mat(std::set<int> nucset);
378 Material sub_mat(std::set<std::string> nucset);
383 Material set_mat(std::set<int> nucset,
double value);
386 Material set_mat(std::set<std::string> nucset,
double value);
390 Material del_mat(std::set<int> nucset);
393 Material del_mat(std::set<std::string> nucset);
396 Material sub_range(
int lower=0,
int upper=10000000);
399 Material set_range(
int lower=0,
int upper=10000000,
double value=0.0);
401 Material del_range(
int lower=0,
int upper=10000000);
420 std::map<int, double> to_atom_frac();
423 void from_atom_frac(std::map<int, double> atom_fracs);
427 std::map<int, double> to_atom_dens();
432 std::vector<std::pair<double, double> >
gammas();
435 std::vector<std::pair<double, double> > xrays();
438 std::vector<std::pair<double, double> > photons(
bool norm);
441 std::vector<std::pair<double, double> > normalize_radioactivity(
442 std::vector<std::pair<double, double> > unnormed);
445 void from_activity(std::map<int, double> activities);
456 Material cram(std::vector<double> A,
const int order=14);
486 virtual const char* what()
const throw()
488 return "Invalid loading protocol number; please use 0 or 1.";
495 #endif // PYNE_MR34UE5INRGMZK2QYRDWICFHVM comp_map::iterator comp_iter
Nuclide-mass composition iter type.
Definition: material.h:41
struct pyne::material_data material_data
comp_map comp
composition, maps nuclides in id form to normalized mass weights.
Definition: material.h:309
Material composed of nuclides.
Definition: material.h:71
double density
density (in arbitrary units) of the Material.
Definition: material.h:311
object value (collection of name/value pairs).
Definition: json.h:358
Implements basic nuclear data functions.
Definition: material.h:475
double density
material density
Definition: material.h:477
std::map< int, double > comp_map
Nuclide-mass composition map type.
Definition: material.h:40
double atoms_per_molecule
Definition: material.h:312
double mass
material mass
Definition: material.h:476
struct pyne::decay decay
a struct matching the '/decay/decays' table in nuc_data.h5.
Provides some HDF5 helper functionality in its own namespace.
double atoms_per_mol
material atoms per mole
Definition: material.h:478
bool detect_nuclidelist(hid_t dataset, std::string &nucpath)
Definition: material.cpp:2095
std::ostream & operator<<(std::ostream &os, Material mat)
Definition: material.cpp:1446
std::vector< std::pair< double, double > > gammas(int parent_state_id)
Returns a list of energies and intensities normalized to branching ratios.
Definition: data.cpp:2362
Custom exception for invalid HDF5 protocol numbers.
Definition: material.h:483
A container representing enrichment cascades.
Definition: _atomic_data.h:16
double atomic_mass(int nuc)
Returns the atomic mass of a nuclide nuc.
Definition: data.cpp:95
double mass
mass (in arbitrary units) of the Material.
Definition: material.h:310