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:
7 \n Scripts generated for SALOME 6 and older versions must be adapted to work in SALOME 7.2 with full functionality.
8 \n The compatibility mode allows old scripts to work in almost all cases, but with a warning.
10 See also \subpage geompy_migration_page
12 <b>Salome initialisation must always be done as shown below</b>
13 \n (<em>salome_init()</em> can be invoked safely several times):
19 <b>smesh initialisation is modified.</b>
20 \n the old mode (from dump):
22 import smesh, SMESH, SALOMEDS
27 import SMESH, SALOMEDS
28 from salome.smesh import smeshBuilder
29 smesh = smeshBuilder.New()
33 <b> Of course, <em>from smesh import *</em> is no more possible.</b>
34 \n You have to explicitely write <em>smesh.some_method()</em>.
36 <b>All algorithms have been transferred from the namespace <em>smesh</em> to the namespace <em>smeshBuilder</em>.</b>
39 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_1)
43 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1)
45 \n StdMeshers algorithms concerned are <em>REGULAR, PYTHON, COMPOSITE, MEFISTO, Hexa, QUADRANGLE, RADIAL_QUAD</em>.
46 \n SMESH Plugins provide such algorithms as: <em> NETGEN, NETGEN_FULL, FULL_NETGEN, NETGEN_1D2D3D, NETGEN_1D2D, NETGEN_2D, NETGEN_3D</em>.
47 \n If you use DISTENE plugins, you also have <em>BLSURF, GHS3D, GHS3DPRL, Hexotic</em>.
49 <b>Some variables were available in both namespaces <em>smesh</em> and <em>SMESH</em>.
50 Now they are available only in namespace <em>SMESH</em></b>.
51 \n The dump function used only the namespace <em>SMESH</em>,
52 so, if your script was built with the help of the dump function, it should be already OK in this respect.
54 The most used variables concerned are:
55 \n <em>NODE, EDGE, FACE, VOLUME, ALL.</em>
56 \n <em>FT_xxx, geom_xxx, ADD_xxx...</em>
60 srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", smesh.FACE )
61 mesh.MakeGroup("Tetras",smesh.VOLUME,smesh.FT_ElemGeomType,"=",smesh.Geom_TETRA)
62 filter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 6.5)
66 srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", SMESH.FACE )
67 mesh.MakeGroup("Tetras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_TETRA)
68 filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, 6.5)
72 <b>The namespace <em>smesh.smesh</em> does not exist any more, use <em>smesh</em> instead.</b>
75 Compound1 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
79 Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
82 <b>If you need to import a %SMESH Plugin explicitely, keep in mind that they are now located in separate namespaces.</b>
93 from salome.StdMeshers import StdMeshersBuilder
94 from salome.NETGENPlugin import NETGENPluginBuilder
95 from salome.BLSURFPlugin import BLSURFPluginBuilder
96 from salome.GHS3DPlugin import GHS3DPluginBuilder
97 from salome.HexoticPLUGIN import HexoticPLUGINBuilder