def METHOD_NAME(self, mat, elem):
    subm = self.material_database.FindOrBuildMaterial(elem.name)
    elems = subm.GetElementVector()
    i = 0
    for el in elems:
        elf = subm.GetElementFraction(i)
        f = elf * elem.f
        name = str(el.GetName())
        b = self.material_database.FindOrBuildElement(name)
        mat.AddElementByMassFraction(b, f)
        i += 1