MEDCouplingFieldDouble: field descriptions not stored in saved files

Hi everybody,

I’m trying to use field descriptions, and I noticed that the descriptions are not stored in fields when they are printed on file.
After reading a field from file, an empty string is returned as a result of field.getDescrption().
Is this a bug or is there a way to change this behavior?

I hope to hear more about it,
Thank you
Roberto

Hi,
I confirm that the field description is not persistent if the field is saved to a med file and read again. In addition h5dump and mdump do not show the field description in the generated med file.
running the small bottom example reproduces the reported issue. Let’s raise this issue to MEDCOUPLING developers.
Regards.

import medcoupling as mc
targetCoords = [-0.3,-0.3, 0.2,-0.3, 0.7,-0.3, -0.3,0.2, 0.2,0.2, 0.7,0.2, -0.3,0.7, 0.2,0.7, 0.7,0.7 ]
targetConn = [0,3,4,1, 1,4,2, 4,5,2, 6,7,4,3, 7,8,5,4]
targetMesh = mc.MEDCouplingUMesh("MyMesh",2)
targetMesh.allocateCells(5)
targetMesh.insertNextCell(mc.NORM_TRI3,3,targetConn[4:7])
targetMesh.insertNextCell(mc.NORM_TRI3,3,targetConn[7:10])
targetMesh.insertNextCell(mc.NORM_QUAD4,4,targetConn[0:4])
targetMesh.insertNextCell(mc.NORM_QUAD4,4,targetConn[10:14])
targetMesh.insertNextCell(mc.NORM_QUAD4,4,targetConn[14:18])
myCoords = mc.DataArrayDouble(targetCoords,9,2)
myCoords.setInfoOnComponents(["X [km]","YY [mm]"])
targetMesh.setCoords(myCoords)
mc.WriteUMesh("TargetMesh.med",targetMesh,True)  # True means 'from scratch'
f = mc.MEDCouplingFieldDouble.New(mc.ON_CELLS, mc.ONE_TIME)
f.setTime(5.6,7,8)                              # Declare the timestep associated to the field
f.setArray(targetMesh.computeCellCenterOfMass())
f.setMesh(targetMesh)
f.setName("AFieldName")
f.setDescription('blabla')
mc.WriteField("MyFirstField.med",f,True)
f2 = mc.ReadFieldCell("MyFirstField.med", f.getMesh().getName(), 0, f.getName(), 7, 8)
assert f.getDescription() == f2.getDescription()