CYCLUS
|
#include <pyne.h>
Public Member Functions | |
void | _load_comp_protocol0 (hid_t db, std::string datapath, int row) |
void | _load_comp_protocol1 (hid_t db, std::string datapath, int row) |
comp_map | activity () |
Material | collapse_elements (int **int_ptr_arry) |
Material | collapse_elements (std::set< int > exception_znum) |
Material | decay (double t) |
comp_map | decay_heat () |
Material | del_mat (std::set< int > nucset) |
Material | del_mat (std::set< std::string > nucset) |
Material | del_range (int lower=0, int upper=10000000) |
comp_map | dose_per_g (std::string dose_type, int source=0) |
Json::Value | dump_json () |
Material | expand_elements () |
std::string | fluka (int id, std::string frac_type="mass") |
std::string | fluka_compound_str (int id, std::string frac_type="mass") |
std::string | fluka_format_field (float field) |
std::string | fluka_material_component (int fid, int nucid, std::string fluka_name) |
std::string | fluka_material_line (int znum, double atomic_mass, int fid, std::string fluka_name) |
std::string | fluka_material_str (int id) |
void | from_atom_frac (std::map< int, double > atom_fracs) |
void | from_hdf5 (char *filename, char *datapath, int row=-1, int protocol=1) |
void | from_hdf5 (std::string filename, std::string datapath="/material", int row=-1, int protocol=1) |
void | from_json (char *filename) |
void | from_json (std::string filname) |
void | from_text (char *filename) |
void | from_text (std::string filename) |
std::vector< std::pair< double, double > > | gammas () |
void | load_json (Json::Value) |
double | mass_density (double num_dens=-1.0, double apm=-1.0) |
Material () | |
Material (char *filename, double m=-1.0, double d=-1.0, double apm=-1.0, Json::Value attributes=Json::Value(Json::objectValue)) | |
Material (comp_map cm, double m=-1.0, double d=-1.0, double apm=-1.0, Json::Value attributes=Json::Value(Json::objectValue)) | |
Material (std::string filename, double m=-1.0, double d=-1.0, double apm=-1.0, Json::Value attributes=Json::Value(Json::objectValue)) | |
std::string | mcnp (std::string frac_type="mass") |
double | molecular_mass (double apm=-1.0) |
comp_map | mult_by_mass () |
void | norm_comp () |
void | normalize () |
std::vector< std::pair< double, double > > | normalize_radioactivity (std::vector< std::pair< double, double > > unnormed) |
bool | not_fluka_builtin (std::string fluka_name) |
double | number_density (double mass_dens=-1.0, double apm=-1.0) |
Material | operator* (double) |
Material | operator+ (double) |
Material | operator+ (Material) |
Material | operator/ (double) |
std::vector< std::pair< double, double > > | photons (bool norm) |
Material | set_mat (std::set< int > nucset, double value) |
Material | set_mat (std::set< std::string > nucset, double value) |
Material | set_range (int lower=0, int upper=10000000, double value=0.0) |
Material | sub_act () |
Material | sub_elem (int element) |
Material | sub_fp () |
Material | sub_lan () |
Material | sub_ma () |
Material | sub_mat (std::set< int > nucset) |
Material | sub_mat (std::set< std::string > nucset) |
Material | sub_range (int lower=0, int upper=10000000) |
Material | sub_tru () |
std::map< int, double > | to_atom_dens () |
std::map< int, double > | to_atom_frac () |
void | write_hdf5 (char *filename, char *datapath, char *nucpath, float row=-0.0, int chunksize=100) |
void | write_hdf5 (std::string filename, std::string datapath="/material", std::string nucpath="/nucid", float row=-0.0, int chunksize=100) |
void | write_json (char *filename) |
void | write_json (std::string filename) |
void | write_text (char *filename) |
void | write_text (std::string filename) |
std::vector< std::pair< double, double > > | xrays () |
~Material () | |
Public Attributes | |
double | atoms_per_molecule |
comp_map | comp |
double | density |
double | mass |
Json::Value | metadata |
Protected Member Functions | |
double | get_comp_sum () |
pyne::Material::Material | ( | pyne::comp_map | cm, |
double | m = -1.0, | ||
double | d = -1.0, | ||
double | apm = -1.0, | ||
Json::Value | attributes = Json::Value(Json::objectValue) ) |
pyne::Material::Material | ( | char * | filename, |
double | m = -1.0, | ||
double | d = -1.0, | ||
double | apm = -1.0, | ||
Json::Value | attributes = Json::Value(Json::objectValue) ) |
Constructor from file.
filename | path to file on disk, this file may be either in plaintext or HDF5 format. |
m | mass value, the mass is set to the sum of the values in the composition if m is negative, may be overridden by the value from disk. |
d | density value, may be overridden by the value from disk. |
apm | atoms per mole, may be overridden by the value from disk. |
attributes | initial metadata, may be overridden by the value from disk. |
pyne::Material::Material | ( | std::string | filename, |
double | m = -1.0, | ||
double | d = -1.0, | ||
double | apm = -1.0, | ||
Json::Value | attributes = Json::Value(Json::objectValue) ) |
Constructor from file.
filename | path to file on disk, this file may be either in plaintext or HDF5 format. |
m | mass value, the mass is set to the sum of the values in the composition if m is negative, may be overridden by the value from disk. |
d | density value, may be overridden by the value from disk. |
apm | atoms per mole, may be overridden by the value from disk. |
attributes | initial metadata, may be overridden by the value from disk. |
void pyne::Material::_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.
This protocol is depratacted.
db | HDF5 id for the open HDF5 file. |
datapath | Path to the base node for the material in db. |
row | The index to read out, may be negative. |
void pyne::Material::_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.
This protocol should be used in favor of protocol 0.
db | HDF5 id for the open HDF5 file. |
datapath | Path to the base node for the material in db. |
row | The index to read out, may be negative. |
pyne::comp_map pyne::Material::activity | ( | ) |
pyne::Material pyne::Material::collapse_elements | ( | int ** | int_ptr_arry | ) |
pyne::Material pyne::Material::collapse_elements | ( | std::set< int > | exception_znum | ) |
pyne::Material pyne::Material::decay | ( | double | t | ) |
pyne::comp_map pyne::Material::decay_heat | ( | ) |
pyne::Material pyne::Material::del_mat | ( | std::set< int > | nucset | ) |
pyne::Material pyne::Material::del_mat | ( | std::set< std::string > | nucset | ) |
pyne::Material pyne::Material::del_range | ( | int | lower = 0, |
int | upper = 10000000 ) |
pyne::comp_map pyne::Material::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, and the source for dose factors dose_type is one of: ext_air – returns mrem/h per g per m^3 ext_soil – returns mrem/h per g per m^2 ingest – returns mrem per g inhale – returns mrem per g source is: {EPA=0, DOE=1, GENII=2}, default is EPA.
Json::Value pyne::Material::dump_json | ( | ) |
pyne::Material pyne::Material::expand_elements | ( | ) |
std::string pyne::Material::fluka | ( | int | id, |
std::string | frac_type = "mass" ) |
std::string pyne::Material::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 the components.
------------------------------------------------------------------------—// fluka_compound_str ------------------------------------------------------------------------—// Returns – MATERIAL line for compound – COMPOUND lines
std::string pyne::Material::fluka_format_field | ( | float | field | ) |
Convenience function to format a single fluka field.
------------------------------------------------------------------------—// fluka_format_field ------------------------------------------------------------------------—// Convenience function that returns a 10-character formatted string 999 -> 999.
999.12 -> 999.12 999.123 -> 999.123 999.1234 -> 999.123
std::string pyne::Material::fluka_material_component | ( | int | fid, |
int | nucid, | ||
std::string | fluka_name ) |
Intermediate level call to prepare final info and call material_line(..)
------------------------------------------------------------------------—// fluka_material_component ------------------------------------------------------------------------—// Material has only one component, Density is either object density or it is ignored ==> use object density This function is not called for a compound, but it is called on the material-ized components of compounds
std::string pyne::Material::fluka_material_line | ( | int | znum, |
double | atomic_mass, | ||
int | fid, | ||
std::string | fluka_name ) |
Format information into a FLUKA material card.
------------------------------------------------------------------------—// fluka_material_line ------------------------------------------------------------------------—// Given all the info, return the Material string
std::string pyne::Material::fluka_material_str | ( | int | id | ) |
High level call to get details and call material_component(..)
------------------------------------------------------------------------—// fluka_material_str ------------------------------------------------------------------------—//
Requirement: the material upon which this function is called has exactly one nucid component, i.e. it is elemental Do not assume fluka_name is defined in the metadata. This function may be called from a user-defined material, i.e. on that is not read out of a UW^2-tagged geometry file, and thus does not have certain metadata.
void pyne::Material::from_atom_frac | ( | std::map< int, double > | atom_fracs | ) |
void pyne::Material::from_hdf5 | ( | char * | filename, |
char * | datapath, | ||
int | row = -1, | ||
int | protocol = 1 ) |
void pyne::Material::from_hdf5 | ( | std::string | filename, |
std::string | datapath = "/material", | ||
int | row = -1, | ||
int | protocol = 1 ) |
void pyne::Material::from_json | ( | char * | filename | ) |
void pyne::Material::from_json | ( | std::string | filname | ) |
void pyne::Material::from_text | ( | char * | filename | ) |
void pyne::Material::from_text | ( | std::string | filename | ) |
std::vector< std::pair< double, double > > pyne::Material::gammas | ( | ) |
|
protected |
void pyne::Material::load_json | ( | Json::Value | json | ) |
double pyne::Material::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.
If num_dens is negative, this simply returns the current value of the density member variable. You may also use / set the atoms per molecule (atoms_per_molecule) in this function using apm.
std::string pyne::Material::mcnp | ( | std::string | frac_type = "mass" | ) |
double pyne::Material::molecular_mass | ( | double | apm = -1.0 | ) |
Calculates the atomic weight of this material based on the composition and the number of atoms per mol.
If apm is non-negative then it is used (and stored on the instance) as the atoms_per_molecule for this calculation. If apm and atoms_per_molecule on this instance are both negative, then the best guess value calculated from the normailized composition is used here.
pyne::comp_map pyne::Material::mult_by_mass | ( | ) |
void pyne::Material::norm_comp | ( | ) |
std::vector< std::pair< double, double > > pyne::Material::normalize_radioactivity | ( | std::vector< std::pair< double, double > > | unnormed | ) |
bool pyne::Material::not_fluka_builtin | ( | std::string | fluka_name | ) |
Convenience function to tell whether a given name needs a material card.
------------------------------------------------------------------------—// not_fluka_builtin ------------------------------------------------------------------------—// Convenience function This is written as a negative because that is what we care about
double pyne::Material::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 greater than or equal to zero.
If mass_dens is negative, the denisty member variable is used instead. You may also use / set the atoms per molecule (atoms_per_molecule) in this function using apm.
pyne::Material pyne::Material::operator* | ( | double | y | ) |
pyne::Material pyne::Material::operator+ | ( | double | y | ) |
pyne::Material pyne::Material::operator+ | ( | Material | y | ) |
pyne::Material pyne::Material::operator/ | ( | double | y | ) |
std::vector< std::pair< double, double > > pyne::Material::photons | ( | bool | norm | ) |
pyne::Material pyne::Material::set_mat | ( | std::set< int > | nucset, |
double | value ) |
pyne::Material pyne::Material::set_mat | ( | std::set< std::string > | nucset, |
double | value ) |
pyne::Material pyne::Material::set_range | ( | int | lower = 0, |
int | upper = 10000000, | ||
double | value = 0.0 ) |
pyne::Material pyne::Material::sub_act | ( | ) |
pyne::Material pyne::Material::sub_elem | ( | int | element | ) |
pyne::Material pyne::Material::sub_fp | ( | ) |
pyne::Material pyne::Material::sub_lan | ( | ) |
pyne::Material pyne::Material::sub_ma | ( | ) |
pyne::Material pyne::Material::sub_mat | ( | std::set< int > | nucset | ) |
pyne::Material pyne::Material::sub_mat | ( | std::set< std::string > | nucset | ) |
pyne::Material pyne::Material::sub_range | ( | int | lower = 0, |
int | upper = 10000000 ) |
pyne::Material pyne::Material::sub_tru | ( | ) |
std::map< int, double > pyne::Material::to_atom_dens | ( | ) |
std::map< int, double > pyne::Material::to_atom_frac | ( | ) |
void pyne::Material::write_hdf5 | ( | char * | filename, |
char * | datapath, | ||
char * | nucpath, | ||
float | row = -0.0, | ||
int | chunksize = 100 ) |
Writes this material out to an HDF5 file.
This happens according to protocol 1.
filename | Path on disk to the HDF5 file. |
datapath | Path to the the material in the file. |
nucpath | Path to the nuclides set in the file. |
row | The index to read out, may be negative. Also note that this is a float. A value of -0.0 indicates that the material should be appended to the end of the dataset. |
chunksize | The chunksize for all material data on disk. |
void pyne::Material::write_hdf5 | ( | std::string | filename, |
std::string | datapath = "/material", | ||
std::string | nucpath = "/nucid", | ||
float | row = -0.0, | ||
int | chunksize = 100 ) |
Writes this material out to an HDF5 file.
This happens according to protocol 1.
filename | Path on disk to the HDF5 file. |
datapath | Path to the the material in the file. |
nucpath | Path to the nuclides set in the file. |
row | The index to read out, may be negative. Also note that this is a float. A value of -0.0 indicates that the material should be appended to the end of the dataset. |
chunksize | The chunksize for all material data on disk. |
void pyne::Material::write_json | ( | char * | filename | ) |
void pyne::Material::write_json | ( | std::string | filename | ) |
void pyne::Material::write_text | ( | char * | filename | ) |
Writes the Material out to a simple plaintext file readable by from_text().
void pyne::Material::write_text | ( | std::string | filename | ) |
Writes the Material out to a simple plaintext file readable by from_text().
std::vector< std::pair< double, double > > pyne::Material::xrays | ( | ) |
double pyne::Material::atoms_per_molecule |
comp_map pyne::Material::comp |
double pyne::Material::density |
double pyne::Material::mass |
Json::Value pyne::Material::metadata |