X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=doc%2Fsalome%2Fgui%2FSMESH%2Finput%2Fsmesh_migration.rst;h=dad99f4bf571f2ccb255e506c847bb26631f851a;hb=d9f4b53e489dd5857db264ede6acded7b076c9f1;hp=30993717d00cec20776ee9ce5d066e0180345127;hpb=f0f67c0b47e58361bc50c7169734da604fbfca01;p=modules%2Fsmesh.git diff --git a/doc/salome/gui/SMESH/input/smesh_migration.rst b/doc/salome/gui/SMESH/input/smesh_migration.rst index 30993717d..dad99f4bf 100644 --- a/doc/salome/gui/SMESH/input/smesh_migration.rst +++ b/doc/salome/gui/SMESH/input/smesh_migration.rst @@ -1,104 +1,95 @@ .. _smesh_migration_page: -***************************************************** -Modifing Mesh Python scripts from SALOME 6 and before -***************************************************** +****************************************************** +Modifying Mesh Python scripts from SALOME 6 and before +****************************************************** In SALOME 7.2, the Python interface for Mesh has been slightly modified to offer new functionality: Scripts generated for SALOME 6 and older versions must be adapted to work in SALOME 7.2 with full functionality. - The compatibility mode allows old scripts to work in almost all cases, but with a warning. -See also :ref:`geompy_migration_page` +See also *"Modifying Geometry Python scripts from SALOME 6 and before"* page in the Geometry module's +User Guide. -**Salome initialisation must always be done as shown below** +* **Salome initialisation** must always be done as shown below. -*salome_init()* can be invoked safely several times): -:: + (*salome_init()* can be invoked safely several times):: import salome salome.salome_init() -**smesh initialisation is modified.** -the old mode (from dump): -:: +* **smesh initialisation** is modified. + + The old mode (from dump):: import smesh, SMESH, SALOMEDS smesh.SetCurrentStudy(salome.myStudy) -the new mode: -:: + The new mode:: import SMESH, SALOMEDS from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(salome.myStudy) + smesh = smeshBuilder.New() -**Of course,** from smesh import ***is no more possible.** +* Of course, **from smesh import** * is **no more possible.** -You have to explicitely write **smesh.some_method()**. + You have to explicitly write *smesh.some_method()*. -**All algorithms have been transferred from the namespace **smesh** to the namespace **smeshBuilder**.** +* All **algorithms** have been transferred from the namespace *smesh* to the namespace *smeshBuilder*. -For instance: -:: + For instance:: MEFISTO_2D_1 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_1) -is replaced by: -:: + is replaced by:: MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1) -StdMeshers algorithms concerned are **REGULAR, PYTHON, COMPOSITE, MEFISTO, Hexa, QUADRANGLE, RADIAL_QUAD**. + StdMeshers algorithms concerned are *REGULAR, PYTHON, COMPOSITE, MEFISTO, Hexa, QUADRANGLE, RADIAL_QUAD*. -SMESH Plugins provide such algorithms as: **NETGEN, NETGEN_FULL, FULL_NETGEN, NETGEN_1D2D3D, NETGEN_1D2D, NETGEN_2D, NETGEN_3D**. + SMESH Plugins provide such algorithms as: *NETGEN, NETGEN_FULL, FULL_NETGEN, NETGEN_1D2D3D, NETGEN_1D2D, NETGEN_2D, NETGEN_3D*. -If you use DISTENE plugins, you also have **BLSURF, GHS3D, GHS3DPRL, Hexotic**. + If you use DISTENE plugins, you also have *BLSURF, GHS3D, GHS3DPRL, Hexotic*. -**Some variables were available in both namespaces **smesh** and **SMESH**. +* Some **variables** were available in both namespaces *smesh* and *SMESH*. Now they are available only in namespace *SMESH*. -Now they are available only in namespace **SMESH****. + The dump function used only the namespace *SMESH*, + so, if your script was built with the help of the dump function, it should be already OK in this respect. -The dump function used only the namespace **SMESH**, -so, if your script was built with the help of the dump function, it should be already OK in this respect. + The most used variables concerned are: -The most used variables concerned are: - **NODE, EDGE, FACE, VOLUME, ALL.** - **FT_xxx, geom_xxx, ADD_xxx...** + * *NODE, EDGE, FACE, VOLUME, ALL.* + * *FT_xxx, geom_xxx, ADD_xxx...* -For instance: -:: + For instance:: srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", smesh.FACE ) mesh.MakeGroup("Tetras",smesh.VOLUME,smesh.FT_ElemGeomType,"=",smesh.Geom_TETRA) filter = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 6.5) -is replaced by: -:: + is replaced by:: srcFaceGroup = srcMesh.GroupOnGeom( midFace0, "src faces", SMESH.FACE ) mesh.MakeGroup("Tetras",SMESH.VOLUME,SMESH.FT_ElemGeomType,"=",SMESH.Geom_TETRA) filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_AspectRatio, SMESH.FT_MoreThan, 6.5) -**The namespace **smesh.smesh** does not exist any more, use **smesh** instead.** -For instance: -:: +* The namespace **smesh.smesh** does not exist any more, use **smesh** instead. + + For instance:: Compound1 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05) -is replaced by: -:: + is replaced by:: Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05) -**If you need to import a %SMESH Plugin explicitely, keep in mind that they are now located in separate namespaces.** +* If you need to **import a SMESH Plugin** explicitly, keep in mind that they are now located in separate namespaces. -For instance: -:: + For instance:: import StdMeshers import NETGENPlugin @@ -106,8 +97,7 @@ For instance: import GHS3DPlugin import HexoticPLUGIN -is replaced by: -:: + is replaced by:: from salome.StdMeshers import StdMeshersBuilder from salome.NETGENPlugin import NETGENPluginBuilder