Right now the Results
class doesn’t provide any methods that give that information in an easy way. What I would recommend is to export your results to a new Materials
object and then use methods on the Material
class. This would look something like:
# Export materials from the last timestep
materials = results.export_to_materials(-1)
# materials is a list of Material objects, so you'll need to get the right index
# for the material of interest
material = materials[index]
# Get number of atoms
atoms = material.get_nuclide_atoms()
# Get total activity and activity by nuclide
activity = material.activity
activity_by_nuclide = material.get_nuclide_activity()
Note that the ability to get activity was just recently merged in OpenMC and will be part of our next release.