Salome HOME
Modifications to properly handle parallel compute for 2D
[modules/smesh.git] / doc / examples / creating_parallel_2D_mesh.py
index a351bfc779bd07a30719ef4ed731e7fa2753a157..2515543aafbac5a51c3a6696be161a2569b0f34b 100644 (file)
@@ -45,8 +45,8 @@ boxes = []
 
 #             boxes.append(box)
 
-#With 6 boxes works 
-#But simplify for 2 boxes to also Test possibility of rewritting the 
+#With 6 boxes works
+#But simplify for 2 boxes to also Test possibility of rewritting the
 # input mesh from other parallel tests. In that case this test will break
 # because the input mesh will not match the exported/imported box geometry.
 for i in range(nbox):
@@ -78,12 +78,19 @@ all_boxes = geompy.MakeGlueFaces(all_boxes, 1e-07)
 geompy.addToStudy(all_boxes, 'Glued_Faces_1')
 
 rubik_cube = geompy.MakeGlueEdges(all_boxes, 1e-07)
-geompy.addToStudy(all_boxes, 'rubik_cube')
+geompy.addToStudy(rubik_cube, 'rubik_cube')
 
 
 smesh = smeshBuilder.New()
 print("Creating Parallel Mesh")
-par_mesh = smesh.ParallelMesh(rubik_cube, name="par_mesh", mesher2D="NETGEN_2D_Remote")
+par_mesh = smesh.ParallelMesh(rubik_cube, name="par_mesh")
+
+print("Creating hypoehtesis for netgen")
+NETGEN_2D_Parameters_1 = smesh.CreateHypothesisByAverageLength( 'NETGEN_Parameters_2D',
+                                         'NETGENEngine', 34.641, 0 )
+
+print("Adding hypothesis")
+par_mesh.Add2DGlobalHypothesis(NETGEN_2D_Parameters_1)
 
 print("Setting parallelism method")
 par_mesh.SetParallelismMethod(smeshBuilder.MULTITHREAD)