def get_element_mass(self, element): """ Determine the mass of the specified elements in the package. :returns: Masses. [kg] """ result = numpy.zeros(1) for compound in self.material.compounds: result += self.get_compound_mass(compound) *\ stoich.element_mass_fractions(compound, [element]) return result[0]
def get_element_masses(self, elements=None): """ Determine the masses of elements in the package. :returns: Array of element masses. [kg] """ if elements is None: elements = self.material.elements result = numpy.zeros(len(elements)) for compound in self.material.compounds: result += self.get_compound_mass(compound) *\ stoich.element_mass_fractions(compound, elements) return result