Hi everyone,
My desired PR correction is to toggled changing the default Isotopic compositions between IUPAC-2009 and IUPAC-2013. This toggle should be selectable in the API interface and then steer the API to which abundance data to use.
The IUPAC-2013 data should use IUPAC-2013 column 9 and when column 9 is an interval it should use the mean of the given interval NOT the value from IUPAC-2013 column 6. This data differs from what is currently in OpenMC main.
I am sure that IUPAC-2013 will be the default data.
Here is what I have so far with my brain storming on how to accomplish this and want a second opinion on it.
Explanation of my code: I am trying to make a python api function for the material.xml creation of Material.version(). I then place this into the material.xml file. Then this is read by the C++ code materials.cpp and materials.h . My dilemma is how to get the version material.cpp object variable to the data.py and what is the order by which the code is read. I don’t want just to cython a variable over if the data.py is already compiled without the version variable not implemented yet.
openmc/openmc/data/data.py
Insert following at line 114
NATURAL_ABUNDANCE_2009 = {…} //Hard coded data like for NATURAL_ABUNDANCE
openmc/openmc/material.py
Replace the following at line 113
def init(self, material_id=None, name=‘’, temperature=None, version=2013):
Insert the following at line 127
self._version = version
Instert following at line 236
@property
def version(self) → Optional[int]:
return self._version
Insert following at line 269
@version.setter
def version(self, version: Optional[int]):
if version is 2009:
cv.check_type(‘version for Material ID=“{}”’.format(self._id), version, int)
self._version = version
else:
self._version = 2013
Insert following at line 1337
if self.version is 2013:
element.set("version", str(self.version))
openmc/include/ompenmc/material.h
Insert the following at line 164
//! Get the version of the abundance data
//! \return version of the abundance data
int version() const { return version_; }
//! Set the version of the abundance data
//! \param[in] version version of the abundance data
void set_version(int version) { version_ = version; }
Insert the following at line 212
//verions for abundance data
int version_;
openmc/src/material.cpp
Insert the following at line 119
if (check_for_node(material_node, “version”)) {
this->set_version(std::stoi(get_node_value(material_node, “version”)));
}
Insert the following at line 375
mat->version_ = version_;
Your suggestions and thoughts are most appreciated.