Salome HOME
Merge 'master' branch into 'V9_dev' branch.
[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 In SALOME 7.2, the Python interface for %Mesh has been slightly modified to offer new functionality:
6
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.
9
10 See also \subpage geompy_migration_page
11
12 <b>Salome initialisation must always be done as shown below</b>
13 \n (<em>salome_init()</em> can be invoked safely several times):
14 \code
15 import salome
16 salome.salome_init()
17 \endcode
18
19 <b>smesh initialisation is modified.</b>
20 \n the old mode (from dump):
21 \code
22 import smesh, SMESH, SALOMEDS
23 smesh.UpdateStudy()
24 \endcode
25 \n the new mode:
26 \code
27 import SMESH, SALOMEDS
28 from salome.smesh import smeshBuilder
29 smesh =  smeshBuilder.New()
30 \endcode
31
32
33 <b> Of course, <em>from smesh import *</em> is no more possible.</b>
34 \n You have to explicitly write <em>smesh.some_method()</em>.
35
36 <b>All algorithms have been transferred from the namespace <em>smesh</em> to the namespace <em>smeshBuilder</em>.</b>
37 \n For instance:
38 \code
39 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_1)
40 \endcode
41 is replaced by:
42 \code
43 MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1)
44 \endcode
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>.
48
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.
53
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>
57
58 \n For instance:
59 \code
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)
63 \endcode
64 is replaced by:
65 \code
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)
69 \endcode
70
71
72 <b>The namespace <em>smesh.smesh</em> does not exist any more, use <em>smesh</em> instead.</b>
73 \n For instance:
74 \code
75 Compound1 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
76 \endcode
77 is replaced by:
78 \code
79 Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
80 \endcode
81
82 <b>If you need to import a %SMESH Plugin explicitly, keep in mind that they are now located in separate namespaces.</b>
83 \n For instance:
84 \code
85 import StdMeshers
86 import NETGENPlugin
87 import BLSURFPlugin
88 import GHS3DPlugin
89 import HexoticPLUGIN
90 \endcode
91 is replaced by:
92 \code
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
98 \endcode
99
100 */