Use medloader to delete and rename mesh into med file

I’m working on a FSI study and have to share med file between Code aster and Code Saturne. The work consists in determining water pressure on a monolith fixed in a water tank . The result is called maillage_bassin. Med and contains (the mesh bassin, and data informations such as velocity and so on) . Then calculate the monolith deformation using code aster and generate the new mesh linked to the water tank (Mesh_1). At least replace in the maillage_bassin.med file the mesh file called « bassin » with the deformed one « Mesh_1 » and rename it bassin

I have worked on medloader and medcoupling library and succeed in writing Mesh_1 into the original med file but i don’t manage to delete bassin mesh (i have tried destroyMeshAtPos()) and don’t manage to rename Mesh₁

Here my script :


importMEDLoader
m=ReadMeshFromFile(“/home/vesvard211/bassin.med”,“Mesh_1”)
WriteMesh(“/home/vesvard211/maillage_bassin.med”,m,False)
meshNames = MEDLoader.GetMeshNames(“/home/vesvard211/maillage_bassin.med”)
m=meshNames[0]
m2=meshNames[1]
print(meshNames[1])

bassin
print(meshNames[0])
Mesh_1

If someone can help me it will be great thanks