Salome HOME
updated copyright message
[tools/medcoupling.git] / src / RENUMBER_Swig / UsersGuideExamplesTest.py
index d61b6746f564e7e6dbff757d9bab0f44b969d401..257ad2ec50ba822c8d24f802b2009bcf801c5f22 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2023  CEA, EDF
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-from MEDCoupling import *
+import sys
+
+from medcoupling import *
+
 from math import pi, sqrt
 
-import MEDCoupling
+if sys.platform == "win32":
+    import MEDCouplingCompat as MEDCoupling
+else:
+    import MEDCoupling
+    
+def build2DTargetMesh_1():
+    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=MEDCouplingUMesh.New();
+    targetMesh.setMeshDimension(2);
+    targetMesh.allocateCells(5);
+    targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[0:4]);
+    targetMesh.insertNextCell(NORM_TRI3,3,targetConn[4:7]);
+    targetMesh.insertNextCell(NORM_TRI3,3,targetConn[7:10]);
+    targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[10:14]);
+    targetMesh.insertNextCell(NORM_QUAD4,4,targetConn[14:18]);
+    targetMesh.finishInsertingCells();
+    myCoords=DataArrayDouble.New();
+    myCoords.setValues(targetCoords,9,2);
+    targetMesh.setCoords(myCoords);
+    return targetMesh;
 
-from MEDCouplingDataForTest import MEDCouplingDataForTest
-m=MEDCouplingDataForTest.build2DTargetMesh_1();
+    
+m=build2DTargetMesh_1()
 #! [UG_Optimization_0]
 from MEDRenumber import RenumberingFactory
 ren=RenumberingFactory("BOOST")
@@ -34,7 +57,6 @@ mrenum=m[n2o]
 #! [UG_Optimization_0]
 
 #! [UG_Optimization_1]
-from MEDCoupling import MEDCouplingSkyLineArray
 import MEDPartitioner
 # prepare a MEDPartitioner
 a,b=m.computeNeighborsOfCells()