Salome HOME
Correction for dual mesh + improve test to check more options
authorYOANN AUDOUIN <B61570@dsp1062659>
Tue, 27 Jun 2023 09:29:53 +0000 (11:29 +0200)
committerYOANN AUDOUIN <B61570@dsp1062659>
Tue, 27 Jun 2023 09:29:53 +0000 (11:29 +0200)
doc/examples/create_dual_mesh.py
src/SMESH_SWIG/smesh_tools.py

index d65e9bd16f1273ab759c4a1f572f065ef538d4f8..97d827a9a7d78c1d2af027cc47e4662a4cef2ec0 100644 (file)
@@ -48,11 +48,17 @@ isDone = Mesh_1.Compute()
 if not isDone:
   raise Exception("Error when computing Mesh")
 
-# Creating Dual mesh
+# Creating Dual mesh with projection on shape
 dual_Mesh_1 = smesh.CreateDualMesh( Mesh_1, 'dual_Mesh_1', True)
 
 assert(dual_Mesh_1.NbPolyhedrons() > 0)
 assert(dual_Mesh_1.NbTetras() == 0)
 
+# Creating Dual mesh withour projection on shape
+dual_Mesh_2 = smesh.CreateDualMesh( Mesh_1, 'dual_Mesh_2', False)
+
+assert(dual_Mesh_2.NbPolyhedrons() > 0)
+assert(dual_Mesh_2.NbTetras() == 0)
+
 if salome.sg.hasDesktop():
   salome.sg.updateObjBrowser()
index 19d9fb6fdc735ad532d1c164f6fb15167bd4afba..b964f55eabbac9e79592727ae2ea2fb3c13fc1cd 100644 (file)
@@ -195,7 +195,7 @@ def smesh_create_dual_mesh(mesh_ior, output_file, adapt_to_shape=True,
         id_grp_poly, nodes_added_on_tri = \
             __getIdsGrpDualFromOrig(mc_mesh_file, grp_name, mesh2d, -1)
 
-        if id_grp_poly is not None and grp_name[:4] == __prefix:
+        if id_grp_poly is not None and grp_name[:4] == __prefix and adapt_to_shape:
             # This group is on a specific geom face
             face_id = grp_name.split("_")[-1]
             face_id = int(face_id)