Salome HOME
5349eb65fc110d9b8388325617821807e8f876a9
[modules/smesh.git] / doc / salome / gui / SMESH / input / smesh_migration.doc
1 /*!
2
3 \page smesh_migration_page Modifying Mesh Python scripts from SALOME 6 and before
4
5 \n With SALOME 7.2, the Python interface for %Mesh has been slightly modified to offer new functionality:
6
7 <ul>
8   <li>\subpage tui_execution_distribution_page</li>
9   <li>\subpage tui_auto_completion_documentation_page</li>
10 </ul>
11
12 \n Scripts generated for SALOME 6 and older versions must be adapted to work in SALOME 7.2 with all functionality.
13 \n A compatibility mode allows old scripts to work in almost all cases, but with a warning.
14
15 See also <li>\subpage geompy_migration_page</li>
16
17 <b>Salome initialisation must always be done as shown below</b>
18 \n (<em>salome_init()</em> can be invoked safely several times):
19 \code
20 import salome
21 salome.salome_init()
22 \endcode
23
24 <b>smesh initialisation is modified.</b>
25 \n old mode (from dump):
26 \code
27 import smesh, SMESH, SALOMEDS
28 smesh.SetCurrentStudy(theStudy)
29 \endcode
30 new mode:
31 \code
32 import SMESH, SALOMEDS
33 from salome.smesh import smeshBuilder
34 smesh =  smeshBuilder.New(salome.myStudy)
35 \endcode
36
37
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>.
40
41 <b>algorithms are no longer in the namespace <em>smesh</em> but in <em>smeshBuilder</em>.</b>
42 \n For instance:
43 \code
44 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_1)
45 \endcode
46 is replaced by:
47 \code
48 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1)
49 \endcode
50 \n StdMeshers algoritms concerned are <em>REGULAR, PYTHON, COMPOSITE, MEFISTO, Hexa, QUADRANGLE, RADIAL_QUAD</em>.
51 \n SMESH Plugins provides algorithms such 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>.
53
54 <b>Some variables where at the same time in namespaces <em>smesh</em> and <em>SMESH</em>.
55 They are now only in namespace <em>SMESH</em>.</b>.
56 \n The dump function was already using the namespace <em>SMESH</em>,
57 so, if your script was built with the help of dump function, it should be already OK for that part.
58
59 The more used variables concerned are:
60 \n <em>NODE, EDGE, FACE, VOLUME, ALL.<em>
61 \n <em>FT_xxx, geom_xxx, ADD_xxx...<em>
62
63 \n For instance:
64 \code
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)
68 \endcode
69 is replaced by:
70 \code
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)
74 \endcode
75
76
77 <b>The namespace <em>smesh.smesh</em> does not exist any more, use <em>smesh</em> instead.</b>
78 \n For instance:
79 \code
80 Compound1 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
81 \endcode
82 is replaced by:
83 \code
84 Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
85 \endcode
86
87 <b>If you need to import explicitely an %SMESH Plugin, they are now in separate namespaces.</b>
88 \n For instance:
89 \code
90 import StdMeshers
91 import NETGENPlugin
92 import BLSURFPlugin
93 import GHS3DPlugin
94 import HexoticPLUGIN
95 \endcode
96 is replaced by:
97 \code
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
103 \endcode
104
105 */