Salome HOME
fix: replace unordered_set/map with set/map
[tools/medcoupling.git] / src / MEDCoupling_Swig / UsersGuideExamplesTest.py
index adbab4748fbcce93c53601f495c0ef6113d2286d..7d9cc06888f9c8584c988f0bb5378047f2eccd0d 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2024  CEA, EDF
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,9 @@
 # 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
 
 # ! [PySnippetUMeshStdBuild1_1]
@@ -470,6 +472,19 @@ vec=[0,0,-1]
 skin.orientCorrectly2DCells(vec,False)
 #! [UG_CommonHandlingMesh_11]
 
+#! [UG_CommonHandlingMesh_11_1]
+skin.orientCorrectly2DCells( None )
+#! [UG_CommonHandlingMesh_11_1]
+
+#! [UG_CommonHandlingMesh_11_2]
+refCells = [ 0,2,4 ]
+objCells = [ 1,3,5,6,7,8, 20 ]
+refGroup = skin.buildPartOfMySelf( refCells )
+objGroup = skin.buildPartOfMySelf( objCells )
+objGroup.orientCorrectly2DCells( refGroup )
+skin.setPartOfMySelf( objCells, objGroup )
+#! [UG_CommonHandlingMesh_11_2]
+
 #! [UG_CommonHandlingMesh_12]
 m3.orientCorrectlyPolyhedrons()
 #! [UG_CommonHandlingMesh_12]
@@ -574,43 +589,3 @@ rem.setMinDotBtwPlane3DSurfIntersect( 0.8 )
 rem.prepare(src,tgt,"P0P0")
 print(rem.getCrudeMatrix())
 #! [UG_Projection_10]
-
-from MEDCouplingDataForTest import MEDCouplingDataForTest
-m=MEDCouplingDataForTest.build2DTargetMesh_1();
-#! [UG_Optimization_0]
-from MEDRenumber import RenumberingFactory
-ren=RenumberingFactory("BOOST")
-a,b=m.computeNeighborsOfCells()
-n2o,_=ren.renumber(a,b)
-mrenum=m[n2o]
-#! [UG_Optimization_0]
-
-#! [UG_Optimization_1]
-from MEDCoupling import MEDCouplingSkyLineArray
-import MEDPartitioner
-# prepare a MEDPartitioner
-a,b=m.computeNeighborsOfCells()
-sk=MEDCouplingSkyLineArray(b,a)
-g=MEDPartitioner.MEDPartitioner.Graph(sk)
-# compute partitioning into 4 parts
-g.partGraph(4)
-# get the 1st of parts of m
-procIdOnCells=g.getPartition().getValuesArray()
-p0=procIdOnCells.findIdsEqual(0)
-part0=m[p0]
-#! [UG_Optimization_1]
-#! [UG_Optimization_2]
-boundary_nodes_part0=part0.findBoundaryNodes()
-boundary_cells_part0=p0[part0.getCellIdsLyingOnNodes(boundary_nodes_part0,False)]
-# starting from knowledge of neighborhood it s possible to know the neighbors of boundary_cells_part0
-neighbors_boundary_cells_part0=MEDCouplingUMesh.ExtractFromIndexedArrays(boundary_cells_part0,a,b)[0]
-neighbors_boundary_cells_part0.sort()
-neighbors_boundary_cells_part0=neighbors_boundary_cells_part0.buildUnique()
-#
-layer_of_part0=neighbors_boundary_cells_part0.buildSubstraction(p0)
-#
-whole_part_with_layer=DataArrayInt.Aggregate([p0,layer_of_part0])
-whole_part_with_layer.sort()
-part0_with_layer=m[whole_part_with_layer]
-#! [UG_Optimization_2]
-