I am running a stochastic volume calculation on a hexagonal lattice with a universe of concentric rings containing individual materials inside each ring of the lattice. When it calculates the volume, it prints a list of volumes corresponding to each material ID. My question is, can this list be multiplied by another list of corresponding densities in order to calculate the mass of each material in the lattice?
Welcome to the forum @mfredd. The values that you get here are all in cm³, so all you need to do is get the density of each material in g/cm³ and then multiply them to get the mass in g. This could be done with something like
masses = {}
for mat in materials:
density = mat.get_mass_density() # density in g/cm³
volume = vol_calc.volumes[mat.id]
masses[mat.id] = density * volume
which would give you a dictionary that maps the material ID to the mass of the corresponding material.