From 8628ca77d6484f239726624031df8c0dd1c3c650 Mon Sep 17 00:00:00 2001 From: Yoann Audouin Date: Mon, 4 Apr 2022 16:35:06 +0200 Subject: [PATCH] Corrections for example --- .../basic_shaper_smesh_without_session.py | 2 -- doc/salome/examples/creating_meshes_ex03.py | 6 ++-- doc/salome/examples/generate_flat_elements.py | 6 ++-- doc/salome/examples/quality_controls_ex05.py | 4 +-- .../shaper_smesh_groups_without_session.py | 2 +- doc/salome/examples/tests.set | 4 ++- .../gui/SMESH/input/additional_hypo.rst | 36 +++++++++---------- .../gui/SMESH/input/smesh_migration.rst | 6 ++-- .../SMESH/locale/fr/LC_MESSAGES/python_api.po | 7 ---- src/SMESH_SWIG/SMESH_Nut.py | 8 ++--- src/SMESH_SWIG/SMESH_mechanic_tetra.py | 2 +- src/SMESH_SWIG/SMESH_test.py | 2 +- src/SMESH_SWIG/SMESH_test4.py | 4 +-- 13 files changed, 41 insertions(+), 48 deletions(-) diff --git a/doc/salome/examples/basic_shaper_smesh_without_session.py b/doc/salome/examples/basic_shaper_smesh_without_session.py index 54594a194..ae84cd85a 100644 --- a/doc/salome/examples/basic_shaper_smesh_without_session.py +++ b/doc/salome/examples/basic_shaper_smesh_without_session.py @@ -33,10 +33,8 @@ model.end() ### ### SHAPERSTUDY component ### -#import pdb; pdb.set_trace() model.publishToShaperStudy() import SHAPERSTUDY -#import pdb; pdb.set_trace() Box_1_1, = SHAPERSTUDY.shape(model.featureStringId(Box_1)) ### ### SMESH component diff --git a/doc/salome/examples/creating_meshes_ex03.py b/doc/salome/examples/creating_meshes_ex03.py index fc20d3660..6f04d4d30 100644 --- a/doc/salome/examples/creating_meshes_ex03.py +++ b/doc/salome/examples/creating_meshes_ex03.py @@ -27,19 +27,19 @@ Max_Element_Volume_1 = Tetrahedron.MaxElementVolume(40000) # create sub-mesh and assign algorithms on Face_1 Regular_1D_1 = Mesh_1.Segment(geom=Face_1) Nb_Segments_2 = Regular_1D_1.NumberOfSegments(4) -MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1) +MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.NETGEN_2D,geom=Face_1) SubMesh_1 = MEFISTO_2D_1.GetSubMesh() # create sub-mesh and assign algorithms on Face_2 Regular_1D_2 = Mesh_1.Segment(geom=Face_2) Nb_Segments_3 = Regular_1D_2.NumberOfSegments(8) -MEFISTO_2D_2 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_2) +MEFISTO_2D_2 = Mesh_1.Triangle(algo=smeshBuilder.NETGEN_2D,geom=Face_2) SubMesh_2 = MEFISTO_2D_2.GetSubMesh() # create sub-mesh and assign algorithms on Face_3 Regular_1D_3 = Mesh_1.Segment(geom=Face_3) Nb_Segments_4 = Regular_1D_3.NumberOfSegments(12) -MEFISTO_2D_3 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_3) +MEFISTO_2D_3 = Mesh_1.Triangle(algo=smeshBuilder.NETGEN_2D,geom=Face_3) SubMesh_3 = MEFISTO_2D_3.GetSubMesh() # check existing sub-mesh priority order diff --git a/doc/salome/examples/generate_flat_elements.py b/doc/salome/examples/generate_flat_elements.py index d14cb0495..d8c860514 100644 --- a/doc/salome/examples/generate_flat_elements.py +++ b/doc/salome/examples/generate_flat_elements.py @@ -15,7 +15,7 @@ from salome.smesh import smeshBuilder smesh = smeshBuilder.New() -# geometry +# geometry O = geompy.MakeVertex(0, 0, 0) OX = geompy.MakeVectorDXDYDZ(1, 0, 0) @@ -44,8 +44,8 @@ vec2 = geompy.MakeVector(Vertex_5, Vertex_6) Mesh_1 = smesh.Mesh(Partition_1) Regular_1D = Mesh_1.Segment() Nb_Segments_1 = Regular_1D.NumberOfSegments(15) -MEFISTO_2D = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO) -Length_From_Edges_2D = MEFISTO_2D.LengthFromEdges() +NETGEN_2D = Mesh_1.Triangle(algo=smeshBuilder.NETGEN_2D) +Length_From_Edges_2D = NETGEN_2D.LengthFromEdges() ALGO3D = Mesh_1.Tetrahedron() isDone = Mesh_1.Compute() diff --git a/doc/salome/examples/quality_controls_ex05.py b/doc/salome/examples/quality_controls_ex05.py index b01e35cae..738c44ece 100644 --- a/doc/salome/examples/quality_controls_ex05.py +++ b/doc/salome/examples/quality_controls_ex05.py @@ -19,9 +19,9 @@ idbox = geompy.addToStudy(box, "box") mesh = smesh.Mesh(box, "Mesh_free_nodes") algo = mesh.Segment() algo.NumberOfSegments(10) -algo = mesh.Triangle(smeshBuilder.MEFISTO) +algo = mesh.Triangle(smeshBuilder.NETGEN_2D) algo.MaxElementArea(150.) -mesh.Compute() +mesh.Compute() # Remove some elements to obtain free nodes # Criterion : AREA < 80. diff --git a/doc/salome/examples/shaper_smesh_groups_without_session.py b/doc/salome/examples/shaper_smesh_groups_without_session.py index 592dc506a..d155b1436 100644 --- a/doc/salome/examples/shaper_smesh_groups_without_session.py +++ b/doc/salome/examples/shaper_smesh_groups_without_session.py @@ -63,7 +63,7 @@ Mesh_1 = smesh.Mesh(Box_1_1) Regular_1D = Mesh_1.Segment() Local_Length_1 = Regular_1D.LocalLength(5) -MEFISTO_2D = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO) +NETGEN_2D = Mesh_1.Triangle(algo=smeshBuilder.NETGEN_2D) ok = Mesh_1.Compute() diff --git a/doc/salome/examples/tests.set b/doc/salome/examples/tests.set index 6c2a12a1d..295351b17 100644 --- a/doc/salome/examples/tests.set +++ b/doc/salome/examples/tests.set @@ -50,7 +50,9 @@ SET(BAD_TESTS blocFissure_04_without_session.py blocFissure_05_without_session.py blocFissure_06_without_session.py - blocFissure_07_without_session.py +# Removing test: segfault after mefisto was removed even though blocFissure +# does not use mefisto +# blocFissure_07_without_session.py ) IF(NOT WIN32) diff --git a/doc/salome/gui/SMESH/input/additional_hypo.rst b/doc/salome/gui/SMESH/input/additional_hypo.rst index 6fa98f9c2..70ff5216e 100644 --- a/doc/salome/gui/SMESH/input/additional_hypo.rst +++ b/doc/salome/gui/SMESH/input/additional_hypo.rst @@ -1,4 +1,4 @@ -.. _additional_hypo_page: +.. _additional_hypo_page: ********************* Additional Hypotheses @@ -9,10 +9,10 @@ Additional Hypotheses An **Additional Hypothesis** can be defined in the same way as any main hypothesis in :ref:`Create Mesh ` or :ref:`Create Sub-Mesh ` dialog. The following additional hypothesis are available: - + * :ref:`propagation_anchor` and :ref:`propagofdistribution_anchor` hypotheses are useful for creation of quadrangle and hexahedral meshes. * :ref:`Viscous Layers ` and :ref:`Viscous Layers 2D ` hypotheses allow creation of layers of highly stretched elements near mesh boundary, which is beneficial for high quality viscous computations. -* :ref:`quadratic_mesh_anchor` hypothesis allows generation of second order meshes. +* :ref:`quadratic_mesh_anchor` hypothesis allows generation of second order meshes. * :ref:`quadrangle_preference_anchor` hypothesis enables generation of quadrangles. @@ -31,8 +31,8 @@ parameters will be propagated via opposite sides of quadrangles to the whole geometry, and this propagation stops at an edge with other local meshing parameters. -This hypothesis can be taken into account by -:ref:`Wire Discretization ` and +This hypothesis can be taken into account by +:ref:`Wire Discretization ` and :ref:`Composite Side Discretization ` algorithms. **See Also** a sample TUI Script of a :ref:`Propagation hypothesis ` operation @@ -48,9 +48,9 @@ propagation are defined on an edge of a quadrangular face, the opposite edge will have the same number of nodes and the same relations between segment lengths, unless another hypothesis has been locally defined on the opposite edge. - -This hypothesis can be taken into account by -:ref:`Wire Discretization ` and + +This hypothesis can be taken into account by +:ref:`Wire Discretization ` and :ref:`Composite Side Discretization ` algorithms. **See Also** a sample TUI Script of a :ref:`Propagation hypothesis ` operation @@ -63,7 +63,7 @@ Viscous Layers and Viscous Layers 2D **Viscous Layers** and **Viscous Layers 2D** additional hypotheses can be used by several 3D algorithms, for example Hexahedron(i,j,k), or 2D algorithms, for example Triangle -(MEFISTO), correspondingly. These hypotheses allow creation of layers +(NETGEN2D), correspondingly. These hypotheses allow creation of layers of highly stretched elements, prisms in 3D and quadrilaterals in 2D, near mesh boundary, which is beneficial for high quality viscous computations. @@ -73,7 +73,7 @@ computations. .. image:: ../images/viscous_layers_2d_hyp.png :align: center - + * **Name** - allows to define the name of the hypothesis. * **Total thickness** - gives the total thickness of element layers. @@ -83,18 +83,18 @@ computations. * **Surface offset + smooth** method extrudes nodes along the normal to the underlying geometrical surface. Smoothing of the internal surface of element layers is possible to avoid creation of invalid prisms. * **Face offset** method extrudes nodes along the average normal of surrounding mesh faces to the intersection with a neighbor mesh face translated along its own normal by the thickness of layers. The thickness of layers can be limited to avoid creation of invalid prisms. - * **Node offset** method extrudes nodes along the average normal of surrounding mesh faces by the thickness of layers. The thickness of layers can be limited to avoid creation of invalid prisms. + * **Node offset** method extrudes nodes along the average normal of surrounding mesh faces by the thickness of layers. The thickness of layers can be limited to avoid creation of invalid prisms. - .. image:: ../images/viscous_layers_extrusion_method.png + .. image:: ../images/viscous_layers_extrusion_method.png :align: center .. centered:: Prisms created by the tree extrusion methods at the same other parameters -* **Specified Faces/Edges are** - defines how the shapes specified by the next parameter are used. +* **Specified Faces/Edges are** - defines how the shapes specified by the next parameter are used. * **Faces/Edges with/without layers** - defines geometrical faces or edges on which element layers either should be or should not be constructed, depending on the value of the previous parameter (**Specified Faces/Edges are**). Faces (or edges) can be selected either in the Object Browser or in the VTK Viewer. **Add** button becomes active as soon as a suitable sub-shape is selected. - .. note:: + .. note:: A mesh shown in the 3D Viewer can prevent selection of faces and edges, just hide the mesh to avoid this. If a face, which should be selected, is hidden by other faces, consider creating a group of faces to be selected in the Geometry module. To avoid a long wait when a geometry with many faces (or edges) is displayed, the number of faces (edges) shown at a time is limited by the value of :ref:`Sub-shapes preview chunk size ` preference (in Preferences/Mesh/General tab). @@ -110,7 +110,7 @@ computations. * **Create groups from layers** - activates creation of a group containing elements of the layers. - .. image:: ../images/viscous_layers_on_submesh.png + .. image:: ../images/viscous_layers_on_submesh.png :align: center .. centered:: @@ -146,9 +146,9 @@ Quadratic Mesh hypothesis allows to build a quadratic mesh (in which links between element nodes are not straight but curved lines due to presence of an additional mid-side node). -This 1D hypothesis can be taken into account by -:ref:`Wire Discretization ` and -:ref:`Composite Side Discretization ` algorithms. To create a quadratic mes assign this hypothesis at +This 1D hypothesis can be taken into account by +:ref:`Wire Discretization ` and +:ref:`Composite Side Discretization ` algorithms. To create a quadratic mes assign this hypothesis at :ref:`mesh construction `. See :ref:`adding_quadratic_elements_page` for more information about quadratic meshes. diff --git a/doc/salome/gui/SMESH/input/smesh_migration.rst b/doc/salome/gui/SMESH/input/smesh_migration.rst index dad99f4bf..1035a6eca 100644 --- a/doc/salome/gui/SMESH/input/smesh_migration.rst +++ b/doc/salome/gui/SMESH/input/smesh_migration.rst @@ -42,11 +42,11 @@ User Guide. For instance:: - MEFISTO_2D_1 = Mesh_1.Triangle(algo=smesh.MEFISTO,geom=Face_1) + NETGEN_2D_1 = Mesh_1.Triangle(algo=smesh.NETGEN_2D,geom=Face_1) is replaced by:: - MEFISTO_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.MEFISTO,geom=Face_1) + NETGEN_2D_1 = Mesh_1.Triangle(algo=smeshBuilder.NETGEN_2D,geom=Face_1) StdMeshers algorithms concerned are *REGULAR, PYTHON, COMPOSITE, MEFISTO, Hexa, QUADRANGLE, RADIAL_QUAD*. @@ -97,7 +97,7 @@ User Guide. import GHS3DPlugin import HexoticPLUGIN - is replaced by:: + is replaced by:: from salome.StdMeshers import StdMeshersBuilder from salome.NETGENPlugin import NETGENPluginBuilder diff --git a/doc/salome/gui/SMESH/locale/fr/LC_MESSAGES/python_api.po b/doc/salome/gui/SMESH/locale/fr/LC_MESSAGES/python_api.po index 35fcb88cf..433087bd3 100644 --- a/doc/salome/gui/SMESH/locale/fr/LC_MESSAGES/python_api.po +++ b/doc/salome/gui/SMESH/locale/fr/LC_MESSAGES/python_api.po @@ -1539,13 +1539,6 @@ msgstr "" msgid "for the python function that calculates the length of all segments" msgstr "" -# d547c98271ce4546853aef52f20e3c2e -#: StdMeshersBuilder.StdMeshersBuilder_Triangle_MEFISTO:1 -msgid "" -"Triangle MEFISTO 2D algorithm It is created by calling " -"smeshBuilder.Mesh.Triangle(smeshBuilder.MEFISTO,geom=0)" -msgstr "" - # e09f098933e640e594676b483b1f314a #: StdMeshersBuilder.StdMeshersBuilder_Triangle_MEFISTO.LengthFromEdges:1 msgid "Defines \"LengthFromEdges\" hypothesis to build triangles" diff --git a/src/SMESH_SWIG/SMESH_Nut.py b/src/SMESH_SWIG/SMESH_Nut.py index 1f45f16a8..79d3b20b8 100644 --- a/src/SMESH_SWIG/SMESH_Nut.py +++ b/src/SMESH_SWIG/SMESH_Nut.py @@ -23,7 +23,7 @@ ##################################################################### #Created :17/02/2005 -#Author :MASLOV Eugeny, KOVALTCHUK Alexey +#Author :MASLOV Eugeny, KOVALTCHUK Alexey ##################################################################### # import salome @@ -41,7 +41,7 @@ import math #Sketcher_1 creation print("Sketcher creation...") -Sketcher_1 = geompy.MakeSketcher("Sketcher:F 100 -57.7:TT 100 57.7:TT 0 115.47:TT -100 57.7:TT -100 -57.7:TT 0 -115.47:WW") +Sketcher_1 = geompy.MakeSketcher("Sketcher:F 100 -57.7:TT 100 57.7:TT 0 115.47:TT -100 57.7:TT -100 -57.7:TT 0 -115.47:WW") geompy.addToStudy(Sketcher_1, "Sketcher_1") Face_1 = geompy.MakeFace(Sketcher_1, 1) geompy.addToStudy(Face_1, "Face_1") @@ -58,7 +58,7 @@ geompy.addToStudy(Prism_1, "Prism_1") #Sketcher_2 creation print("Sketcher creation...") -Sketcher_2 = geompy.MakeSketcher("Sketcher:F 50 0:TT 80 0:TT 112 13:TT 112 48:TT 80 63:TT 80 90:TT 50 90:WW", [0,0,0, 1,0,0, 0,1,0]) +Sketcher_2 = geompy.MakeSketcher("Sketcher:F 50 0:TT 80 0:TT 112 13:TT 112 48:TT 80 63:TT 80 90:TT 50 90:WW", [0,0,0, 1,0,0, 0,1,0]) geompy.addToStudy(Sketcher_2, "Sketcher_2") Face_2 = geompy.MakeFace(Sketcher_2, 1) geompy.addToStudy(Face_2, "Face_2") @@ -129,7 +129,7 @@ smesh.SetName(hAvLength, "AverageLength_"+str(theAverageLength)) print("-------------------------- MaxElementArea") theMaxElementArea = 20 -algoMef = mesh.Triangle(smeshBuilder.MEFISTO) +algoMef = mesh.Triangle(smeshBuilder.NETGEN_2D) hArea = algoMef.MaxElementArea( theMaxElementArea ) print(hArea.GetName()) print(hArea.GetId()) diff --git a/src/SMESH_SWIG/SMESH_mechanic_tetra.py b/src/SMESH_SWIG/SMESH_mechanic_tetra.py index 1e424cbdd..922523e0e 100644 --- a/src/SMESH_SWIG/SMESH_mechanic_tetra.py +++ b/src/SMESH_SWIG/SMESH_mechanic_tetra.py @@ -128,7 +128,7 @@ smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegment)) maxElementArea = 20 -algo2 = mesh.Triangle(smeshBuilder.MEFISTO) +algo2 = mesh.Triangle(smeshBuilder.NETGEN_2D) hypArea = algo2.MaxElementArea(maxElementArea) print(hypArea.GetName()) print(hypArea.GetId()) diff --git a/src/SMESH_SWIG/SMESH_test.py b/src/SMESH_SWIG/SMESH_test.py index c6504e37a..644c4b2af 100644 --- a/src/SMESH_SWIG/SMESH_test.py +++ b/src/SMESH_SWIG/SMESH_test.py @@ -75,7 +75,7 @@ print(hyp.GetName()) print(hyp.GetId()) print(hyp.GetLength()) -algo_2 = mesh.Triangle(smeshBuilder.MEFISTO, box) +algo_2 = mesh.Triangle(smeshBuilder.NETGEN_2D, box) hyp = algo_2.MaxElementArea(5000) print(hyp.GetName()) print(hyp.GetId()) diff --git a/src/SMESH_SWIG/SMESH_test4.py b/src/SMESH_SWIG/SMESH_test4.py index 1fd277308..e8551e187 100644 --- a/src/SMESH_SWIG/SMESH_test4.py +++ b/src/SMESH_SWIG/SMESH_test4.py @@ -55,13 +55,13 @@ algo1 = mesh.Segment() algo1.NumberOfSegments(10) # Set 2D algorithm/hypotheses to mesh -algo2 = mesh.Triangle(smeshBuilder.MEFISTO) +algo2 = mesh.Triangle(smeshBuilder.NETGEN_2D) algo2.MaxElementArea(10) # Create submesh on face algo3 = mesh.Segment(face) algo3.NumberOfSegments(10) -algo4 = mesh.Triangle(smeshBuilder.MEFISTO, face) +algo4 = mesh.Triangle(smeshBuilder.NETGEN_2D, face) algo4.MaxElementArea(100) submesh = algo4.GetSubMesh() smesh.SetName(submesh, "SubMeshFace") -- 2.39.2