Question about “percent_type” argument of the new method “add_elements_from_formula()” introduced in version 0.12

I am also keen to see the ability to use add_elements_from_formula with different formulas in the same material. In my case I’m keen to make concrete with some aggregate and the material spec sheet has many compounds like Fe3O4 and Al2O3 all with different weight percents.

Just to confirm adding the same nuclides twice does appear to make new entries in the material and resulting XML file.

import openmc
a=openmc.Material()
a.add_element(‘Li’, 0.1)
a.add_element(‘Li’, 0.2)
b=openmc.Materials([a])
b.export_to_xml()

cat material.xml
```bash

Material
ID = 1
Name =
Temperature = None
Density = None [sum]
Volume = None [cm^3]
Depletable = False
S(a,b) Tables
Nuclides
Li6 = 0.007589 [ao]
Li7 = 0.09241100000000001 [ao]
Li6 = 0.015178 [ao]
Li7 = 0.18482200000000001 [ao]
```

It would be interesting to squash this down into a single entry for each isotope

Perhaps better to squash them when adding the nuclides. They other material functions (that assume there is a single entry for each nuclide) benefit.

However I think this is tricky as the units ‘ao’ or ‘wo’ could be different.

So perhaps best to do a squash of dissimilar units when exporting to xml. the export to xml function could even ask users if they prefer wo or ao units in the xml

A squash of nuclides with the same percent_type could be done when adding a nuclide.