]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Fix for Windows (thanks to Nabil) cbr/fix_dual_mesh_projection
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Mon, 21 Nov 2022 13:26:17 +0000 (14:26 +0100)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Mon, 21 Nov 2022 13:26:17 +0000 (14:26 +0100)
src/SMESH_I/SMESH_Gen_i.cxx
test/SMESH_create_dual_mesh_adapt.py
test/SMESH_create_dual_mesh_tpipe.py

index ffb72b1cd035565aad35ff68192363ffac148082..d76169d0c1a2ab06ea43456e6be344fb6e8bde5d 100644 (file)
@@ -2861,14 +2861,15 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateDualMesh(SMESH::SMESH_IDSource_ptr mesh
     ats = "False";
 
   std::string cmd="import salome.smesh.smesh_tools as smt\n";
-  cmd +="smt.smesh_create_dual_mesh(\"" + mesh_ior + "\", \"" +
+  cmd +="smt.smesh_create_dual_mesh(\"" + mesh_ior + "\", r\"" +
         dual_mesh_file.string() + "\", mesh_name=\"" + mesh_name + "\", adapt_to_shape=" + ats + ")";
   MESSAGE(cmd);
 
   PyObject *py_main = PyImport_AddModule("__main__");
   PyObject *py_dict = PyModule_GetDict(py_main);
+  PyObject *local_dict = PyDict_New();
 
-  PyRun_String(cmd.c_str(), Py_file_input, py_dict, py_dict);
+  PyRun_String(cmd.c_str(), Py_file_input, py_dict, local_dict);
 
   if (PyErr_Occurred()) {
     // Restrieving python error
index ccabb5aa52469791a9e11f98fb5d885bc8239d71..e24cafbde4a13e564ac6713e6067785a06a2fe0a 100644 (file)
@@ -85,6 +85,8 @@ dual_Mesh_1 = smesh.CreateDualMesh(Mesh_1, 'dual_Mesh_1', True)
 #Comparing volumes
 dual_volume = dual_Mesh_1.GetVolume()
 dual_raw_volume = dual_Mesh_raw_1.GetVolume()
+tetra_volume = Mesh_1.GetVolume()
+print("tetra_volume: ", tetra_volume)
 print("dual_volume: ", dual_volume)
 print("dual_raw_volume: ", dual_raw_volume)
 
index 3e57e86b16e680ab740f0712890cd187d09e5ea3..28bc26a4fa8fb60196c79bb95bfa637700d0b91d 100644 (file)
@@ -106,7 +106,7 @@ assert dual_Mesh_raw_1.NbPolyhedrons() == dual_Mesh_raw_1.NbVolumes()
 
 # Check dual mesh volume
 dual_raw_volume = dual_Mesh_raw_1.GetVolume()
-assert abs(dual_raw_volume-shape_volume)/shape_volume < 0.12
+assert abs(dual_raw_volume-shape_volume)/shape_volume < 0.14
 
 # Check groups
 dual_Mesh_raw_groups = dual_Mesh_raw_1.GetGroups()
@@ -125,7 +125,7 @@ print("dual_volume: ", dual_volume)
 print("dual_raw_volume: ", dual_raw_volume)
 assert (dual_volume >= dual_raw_volume)
 
-assert abs(dual_volume-shape_volume)/shape_volume < 0.12
+assert abs(dual_volume-shape_volume)/shape_volume < 0.14
 
 # Check groups
 dual_Mesh_groups = dual_Mesh_1.GetGroups()