PyNE C++
|
Public Types | |
typedef mat_map::iterator | iterator |
typedef mat_map::const_iterator | const_iterator |
Public Member Functions | |
MaterialLibrary (const std::string &fname, const std::string &datapath) | |
Constructor from file. More... | |
void | from_hdf5 (const std::string &filename, const std::string &datapath) |
loads the pyne materials in map of name vs Material More... | |
void | from_json (const std::string &filename) |
loads the pyne materials in map of name vs Material / More... | |
void | load_json (Json::Value json) |
Json::Value | dump_json () |
void | write_json (const std::string &filename) |
void | write_hdf5 (const std::string &filename, const std::string &datapath="/materials", bool h5_overwrite=false) const |
Writes MaterialLibrary out to an HDF5 file. This happens according to protocol 1. Writting in a file already containing This might cause issue to read material already present in the datapath, and for the new materials if written in the same datapath. More... | |
void | write_hdf5_nucpath (hid_t db, std::string nucpath) const |
Writes this nucpath to an HDF5 file. This happens according to protocol 1. More... | |
void | merge (const pyne::MaterialLibrary &mat_lib) |
Merge a material library into the current one. More... | |
void | merge (pyne::MaterialLibrary *mat_lib) |
Merge a material library into the current one. More... | |
void | add_material (pyne::Material mat) |
Add a material to the library. More... | |
void | add_material (const std::string &mat_name, const pyne::Material &mat) |
Add a material to the library. More... | |
void | del_material (const std::string &mat_name) |
remove a material of the Library by name More... | |
pyne::Material | get_material (const std::string &mat_name) const |
remove a material of the Library by name More... | |
pyne::shr_mat_ptr | get_material_ptr (const std::string &mat_name) const |
Get a material of the Library by name. More... | |
std::string | ensure_material_name_and_number (pyne::Material &mat) const |
Return a material material number, ensure it exist if it does not exist build it using the material number, if material number is not defined, define it accordingly to the material library. More... | |
int | ensure_material_number (pyne::Material &mat) const |
Return a material material number, ensure it exist as an int, if it exist as a string convert it into int and update the material. More... | |
pyne::mat_map | get_mat_library () const |
Get the material library itself. More... | |
pyne::matname_set | get_keylist () const |
Get the list of materials in the Library. More... | |
pyne::nuc_set | get_nuclist () const |
Get the list of nuclides in the Library. More... | |
iterator | begin () |
iterator | end () |
const_iterator | cbegin () const |
const_iterator | cend () const |
std::size_t | size () const |
bool | emtpy () const |
std::size_t | count (std::string mat_name) const |
std::shared_ptr< Material > & | operator[] (const std::string &k) |
std::shared_ptr< Material > & | operator[] (std::string &&k) |
typedef mat_map::iterator pyne::MaterialLibrary::iterator |
Set of method allowing MaterialLibrary to behave like a undordered_map, pointing directly to the nested material_library
pyne::MaterialLibrary::MaterialLibrary | ( | const std::string & | fname, |
const std::string & | datapath | ||
) |
Constructor from file.
filename | path to file on disk, this file may be either in plaintext or HDF5 format. |
datapath | Path to the materials in the file. |
void pyne::MaterialLibrary::add_material | ( | pyne::Material | mat | ) |
Add a material to the library.
mat | material to add |
void pyne::MaterialLibrary::add_material | ( | const std::string & | mat_name, |
const pyne::Material & | mat | ||
) |
Add a material to the library.
mat_name | name of the material to add(will overwrite material name if it already has one) |
mat | material to add |
void pyne::MaterialLibrary::del_material | ( | const std::string & | mat_name | ) |
remove a material of the Library by name
mat_name | name of the material to remove |
std::string pyne::MaterialLibrary::ensure_material_name_and_number | ( | pyne::Material & | mat | ) | const |
Return a material material number, ensure it exist if it does not exist build it using the material number, if material number is not defined, define it accordingly to the material library.
mat | material to check |
int pyne::MaterialLibrary::ensure_material_number | ( | pyne::Material & | mat | ) | const |
Return a material material number, ensure it exist as an int, if it exist as a string convert it into int and update the material.
mat | material to check |
void pyne::MaterialLibrary::from_hdf5 | ( | const std::string & | filename, |
const std::string & | datapath | ||
) |
loads the pyne materials in map of name vs Material
filename | Path on disk to the HDF5 file. |
datapath | Path to the materials in the file. |
protocol | Flag for layout of material on disk. |
void pyne::MaterialLibrary::from_json | ( | const std::string & | filename | ) |
loads the pyne materials in map of name vs Material /
filename | Path on disk to the json file. |
|
inline |
Get the list of materials in the Library.
|
inline |
Get the material library itself.
pyne::Material pyne::MaterialLibrary::get_material | ( | const std::string & | mat_name | ) | const |
remove a material of the Library by name
mat_name | name of the material to remove |
pyne::shr_mat_ptr pyne::MaterialLibrary::get_material_ptr | ( | const std::string & | mat_name | ) | const |
Get a material of the Library by name.
mat_name | name of the material to return |
|
inline |
Get the list of nuclides in the Library.
void pyne::MaterialLibrary::merge | ( | const pyne::MaterialLibrary & | mat_lib | ) |
Merge a material library into the current one.
mat_library | pyne material library to merge |
void pyne::MaterialLibrary::merge | ( | pyne::MaterialLibrary * | mat_lib | ) |
Merge a material library into the current one.
mat_library | pointer to the pyne material library to merge |
void pyne::MaterialLibrary::write_hdf5 | ( | const std::string & | filename, |
const std::string & | datapath = "/materials" , |
||
bool | h5_overwrite = false |
||
) | const |
Writes MaterialLibrary out to an HDF5 file. This happens according to protocol 1. Writting in a file already containing This might cause issue to read material already present in the datapath, and for the new materials if written in the same datapath.
filename | Path on disk to the HDF5 file. |
datapath | Path to the the material in the file. |
h5_overwrite | bool to decide if existing path should be overwritten |
void pyne::MaterialLibrary::write_hdf5_nucpath | ( | hid_t | db, |
std::string | nucpath | ||
) | const |
Writes this nucpath to an HDF5 file. This happens according to protocol 1.
db | HDF5 id for the open HDF5 file. |
nucpath | Path to the nuclides list in the file. |