Hi, in the method AddElement and AddMaterial of the G4Material class, fMassOfMolecule is not calculated. I guess it should be calculated exactly the same way as in the G4Material::AddElement(G4Element* element, G4int nAtoms) method, i.e. "fMassOfMolecule = Amol/Avogadro;" just before "ComputeDerivedQuantities();"
Sorry for the very long silence and thank you for the report. In the material class it is mentioned: G4double fMassOfMolecule; // for materials built by atoms count When building by fraction of mass, the molecule concept might not apply as a material may be a mixture of several molecule species. When built by atoms count, we can assign the numbers to a molecule type. In other words, when doing a material construction by fraction of mass, the material is assumed to be a mixture of several molecules. I still need to further verify, but your report will likely be considered as invalid.
Bug is considered as invalid, given the molecule masses are calculated only when adding elements by atoms count. Computing the molecule masses in general would mean considering any material mixture as made of a single molecule type.