I was playing a bit with the grouping functionality in Salome which allows one to group similar elements and nodes into families. AFAIK, this more or less corresponds to the mat_id associated with the elements in SfePy. However, I couldn't find a way to explicitly specify the numbering, and the implicit numbering by Salome appears to write meshes with negative integers for the mat_id.
Are negative mat_ids allowed in SfePy? If not, I'll submit a patch for the MED format read code. Otherwise, we should correct the mat_ids in the comsol format write code, since negative domain numbers do not seem to be allowed there.