3 \page smesh_migration_page Modifing Mesh Python scripts from SALOME 6 and before
5 \n In SALOME 7.2, the Python interface for %Mesh has been slightly modified to offer new functionality:
8 <li>\subpage tui_execution_distribution_page</li>
9 <li>\subpage tui_auto_completion_documentation_page</li>
12 \n Scripts generated for SALOME 6 and older versions must be adapted to work in SALOME 7.2 with full functionality.
13 \n The compatibility mode allows old scripts to work in almost all cases, but with a warning.
15 See also \subpage geompy_migration_page
17 <b>Salome initialisation must always be done as shown below</b>
18 \n (<em>salome_init()</em> can be invoked safely several times):
24 <b>smesh initialisation is modified.</b>
25 \n the old mode (from dump):
27 import smesh, SMESH, SALOMEDS
28 smesh.SetCurrentStudy(theStudy)
32 import SMESH, SALOMEDS
33 from salome.smesh import smeshBuilder
34 smesh = smeshBuilder.New(salome.myStudy)
38 <b> Of course, <em>from smesh import *</em> is no more possible.</b>
39 \n You have to explicitely write <em>smesh.some_method()</em>.
41 <b>All algorithms have been transferred from the namespace <em>smesh</em> to the namespace <em>smeshBuilder</em>.</b>
44 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_1)
48 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1)
50 \n StdMeshers algoritms concerned are <em>REGULAR, PYTHON, COMPOSITE, MEFISTO, Hexa, QUADRANGLE, RADIAL_QUAD</em>.
51 \n SMESH Plugins provide such algorithms as: <em> NETGEN, NETGEN_FULL, FULL_NETGEN, NETGEN_1D2D3D, NETGEN_1D2D, NETGEN_2D, NETGEN_3D</em>.
52 \n If you use DISTENE plugins, you also have <em>BLSURF, GHS3D, GHS3DPRL, Hexotic</em>.
54 <b>Some variables were available in both namespaces <em>smesh</em> and <em>SMESH</em>.
55 Now they are available only in namespace <em>SMESH</em></b>.
56 \n The dump function used only the namespace <em>SMESH</em>,
57 so, if your script was built with the help of the dump function, it should be already OK in this respect.
59 The most used variables concerned are:
60 \n <em>NODE, EDGE, FACE, VOLUME, ALL.</em>
61 \n <em>FT_xxx, geom_xxx, ADD_xxx...</em>
65 srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", smesh.FACE )
66 mesh.MakeGroup("Tetras",smesh.VOLUME,smesh.FT_ElemGeomType,"=",smesh.Geom_TETRA)
67 filter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 6.5)
71 srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", SMESH.FACE )
72 mesh.MakeGroup("Tetras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_TETRA)
73 filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, 6.5)
77 <b>The namespace <em>smesh.smesh</em> does not exist any more, use <em>smesh</em> instead.</b>
80 Compound1 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
84 Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
87 <b>If you need to import a %SMESH Plugin explicitely, keep in mind that they are now located in separate namespaces.</b>
98 from salome.StdMeshers import StdMeshersBuilder
99 from salome.NETGENPlugin import NETGENPluginBuilder
100 from salome.BLSURFPlugin import BLSURFPluginBuilder
101 from salomeGHS3DPlugin .import GHS3DPluginBuilder
102 from salome.HexoticPLUGIN import HexoticPLUGINBuilder