2 .. _python_testMEDCouplingRead_solution:
9 from MEDCoupling import *
10 from MEDLoader import *
13 medFileName = "MEDCoupling_cube3D.med"
16 Field2DName = "fieldBottomFace"
19 mesh3D = MEDLoader.ReadUMeshFromFile(medFileName,MeshName,0)
20 mesh2D = MEDLoader.ReadUMeshFromFile(medFileName,MeshName,-1)
23 f = MEDLoader.ReadFieldCell(medFileName,mesh3D.getName(),0,FieldName,-1,-1)
24 f2 = MEDLoader.ReadFieldCell(medFileName,mesh2D.getName(),-1,Field2DName,-1,-1)
26 # Retrieving Coords Mesh
27 Coords3D = mesh3D.getCoords()
28 Values = Coords3D.getValuesAsTuple()
30 # Retrieving field value on 0 tuple
34 # Verify if value is OK
35 bar = mesh3D.computeCellCenterOfMass()
44 if abs(res[0]-sinus)<1.e-5: