From: eap Date: Fri, 12 Oct 2018 14:25:16 +0000 (+0300) Subject: 23586: [EDF] HYDRO: Copy mesh to new geometry X-Git-Tag: V9_2_0a2~9^2 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=6c8b26afa5259e7809faf52f488c5f9daae4d1bb 23586: [EDF] HYDRO: Copy mesh to new geometry Add a sample script + remove line numbers from codes in docs --- diff --git a/doc/salome/examples/creating_meshes_ex08.py b/doc/salome/examples/creating_meshes_ex08.py index 7fa7a7dcf..ff41f09c6 100644 --- a/doc/salome/examples/creating_meshes_ex08.py +++ b/doc/salome/examples/creating_meshes_ex08.py @@ -15,9 +15,12 @@ box = geompy.MakeBoxDXDYDZ(100,100,100) face = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0] # generate a prismatic 3D mesh -mesh = smesh.Mesh(box) +mesh = smesh.Mesh(box, "box") localAlgo = mesh.Triangle(face) -mesh.AutomaticHexahedralization() +mesh.Segment().NumberOfSegments( 3 ) +mesh.Quadrangle() +mesh.Prism() +mesh.Compute() # objects to copy fGroup = mesh.GroupOnGeom( face, "2D on face") @@ -45,3 +48,12 @@ newMesh = smesh.CopyMesh( mesh.GetIDSource( nodeIds, SMESH.NODE), "some nodes co # 6. copy a sub-mesh newMesh = smesh.CopyMesh( subMesh, "sub-mesh copy" ) + + +# make a new mesh with same hypotheses on a modified geometry + +smallBox = geompy.MakeScaleAlongAxes( box, None, 1, 0.5, 0.5 ) +cutBox = geompy.MakeCut( box, smallBox, theName="box - smallBox" ) + +ok, newMesh, groups, submehses, hyps, invIDs = smesh.CopyMeshWithGeom( mesh, cutBox, "cutBox" ) +newMesh.Compute() diff --git a/doc/salome/gui/SMESH/input/smeshpy_interface.rst b/doc/salome/gui/SMESH/input/smeshpy_interface.rst index ce80d7411..922a1e2b7 100644 --- a/doc/salome/gui/SMESH/input/smeshpy_interface.rst +++ b/doc/salome/gui/SMESH/input/smeshpy_interface.rst @@ -29,7 +29,6 @@ A usual workflow to generate a mesh on geometry is following: #. Create an instance of :class:`smeshBuilder.smeshBuilder`: .. code-block:: python - :linenos: from salome.smesh import smeshBuilder smesh = smeshBuilder.New() @@ -37,13 +36,11 @@ A usual workflow to generate a mesh on geometry is following: #. Create a :class:`smeshBuilder.Mesh` object: .. code-block:: python - :linenos: mesh = smesh.Mesh( geometry ) #. Create and assign :ref:`algorithms ` by calling corresponding methods of the mesh. If a sub-shape is provided as an argument, a :ref:`sub-mesh ` is implicitly created on this sub-shape: .. code-block:: python - :linenos: regular1D = mesh.Segment() mefisto = mesh.Triangle( smeshBuilder.MEFISTO ) @@ -52,7 +49,6 @@ A usual workflow to generate a mesh on geometry is following: #. Create and assign :ref:`hypotheses ` by calling corresponding methods of algorithms: .. code-block:: python - :linenos: segLen10 = regular1D.LocalLength( 10. ) maxArea = mefisto.LocalLength( 100. ) @@ -61,7 +57,6 @@ A usual workflow to generate a mesh on geometry is following: #. :ref:`compute_anchor` the mesh (generate mesh nodes and elements): .. code-block:: python - :linenos: mesh.Compute() @@ -82,7 +77,6 @@ Example of 3d mesh generation: ############################## .. literalinclude:: ../../../examples/3dmesh.py - :linenos: :language: python :download:`Download this script <../../../examples/3dmesh.py>` diff --git a/doc/salome/gui/SMESH/input/tui_creating_meshes.rst b/doc/salome/gui/SMESH/input/tui_creating_meshes.rst index 46b4f9ff4..d4c1c8f9a 100644 --- a/doc/salome/gui/SMESH/input/tui_creating_meshes.rst +++ b/doc/salome/gui/SMESH/input/tui_creating_meshes.rst @@ -16,7 +16,6 @@ Construction of a mesh ====================== .. literalinclude:: ../../../examples/creating_meshes_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/creating_meshes_ex01.py>` @@ -27,7 +26,6 @@ Construction of a sub-mesh ========================== .. literalinclude:: ../../../examples/creating_meshes_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/creating_meshes_ex02.py>` @@ -38,7 +36,6 @@ Change priority of sub-meshes in mesh ===================================== .. literalinclude:: ../../../examples/creating_meshes_ex03.py - :linenos: :language: python :download:`Download this script <../../../examples/creating_meshes_ex03.py>` @@ -49,7 +46,6 @@ Intermediate edition while meshing ================================== .. literalinclude:: ../../../examples/a3DmeshOnModified2Dmesh.py - :linenos: :language: python :download:`Download this script <../../../examples/a3DmeshOnModified2Dmesh.py>` @@ -60,7 +56,6 @@ Editing a mesh (i.e. changing hypotheses) ========================================= .. literalinclude:: ../../../examples/creating_meshes_ex04.py - :linenos: :language: python :download:`Download this script <../../../examples/creating_meshes_ex04.py>` @@ -71,7 +66,6 @@ Export of a Mesh ================ .. literalinclude:: ../../../examples/creating_meshes_ex05.py - :linenos: :language: python :download:`Download this script <../../../examples/creating_meshes_ex05.py>` @@ -85,7 +79,6 @@ The next script creates a hexahedral mesh on a cylinder. A picture below the scr demonstrates the resulting mesh. .. literalinclude:: ../../../examples/creating_meshes_ex06.py - :linenos: :language: python :download:`Download this script <../../../examples/creating_meshes_ex06.py>` @@ -100,7 +93,6 @@ Building a compound of meshes ============================= .. literalinclude:: ../../../examples/creating_meshes_ex07.py - :linenos: :language: python :download:`Download this script <../../../examples/creating_meshes_ex07.py>` @@ -111,7 +103,6 @@ Mesh Copying ============ .. literalinclude:: ../../../examples/creating_meshes_ex08.py - :linenos: :language: python :download:`Download this script <../../../examples/creating_meshes_ex08.py>` diff --git a/doc/salome/gui/SMESH/input/tui_defining_hypotheses.rst b/doc/salome/gui/SMESH/input/tui_defining_hypotheses.rst index c839e94b9..facc0fdc1 100644 --- a/doc/salome/gui/SMESH/input/tui_defining_hypotheses.rst +++ b/doc/salome/gui/SMESH/input/tui_defining_hypotheses.rst @@ -53,7 +53,6 @@ Arithmetic Progression and Geometric Progression ================================================ .. literalinclude:: ../../../examples/defining_hypotheses_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex01.py>` @@ -64,7 +63,6 @@ Adaptive ======== .. literalinclude:: ../../../examples/defining_hypotheses_adaptive1d.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_adaptive1d.py>` @@ -76,7 +74,6 @@ Deflection and Number of Segments ================================= .. literalinclude:: ../../../examples/defining_hypotheses_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex02.py>` @@ -88,7 +85,6 @@ Start and End Length ==================== .. literalinclude:: ../../../examples/defining_hypotheses_ex03.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex03.py>` @@ -100,7 +96,6 @@ Local Length ============ .. literalinclude:: ../../../examples/defining_hypotheses_ex04.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex04.py>` @@ -115,7 +110,6 @@ Maximum Element Area ==================== .. literalinclude:: ../../../examples/defining_hypotheses_ex05.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex05.py>` @@ -127,7 +121,6 @@ Maximum Element Volume ====================== .. literalinclude:: ../../../examples/defining_hypotheses_ex06.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex06.py>` @@ -139,7 +132,6 @@ Length from Edges ================= .. literalinclude:: ../../../examples/defining_hypotheses_ex07.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex07.py>` @@ -153,7 +145,6 @@ Propagation =========== .. literalinclude:: ../../../examples/defining_hypotheses_ex08.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex08.py>` @@ -165,7 +156,6 @@ Defining Meshing Algorithms ########################### .. literalinclude:: ../../../examples/defining_hypotheses_ex09.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex09.py>` @@ -177,7 +167,6 @@ Projection Algorithms ===================== .. literalinclude:: ../../../examples/defining_hypotheses_ex10.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex10.py>` @@ -186,7 +175,6 @@ Projection 1D2D =============== .. literalinclude:: ../../../examples/defining_hypotheses_ex11.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex11.py>` @@ -197,7 +185,6 @@ Projection 1D2D ################################# .. literalinclude:: ../../../examples/defining_hypotheses_ex12.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex12.py>` @@ -208,7 +195,6 @@ Radial Quadrangle 1D-2D example ############################### .. literalinclude:: ../../../examples/defining_hypotheses_ex13.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex13.py>` @@ -219,7 +205,6 @@ Quadrangle Parameters example 1 (meshing a face with 3 edges) ############################################################## .. literalinclude:: ../../../examples/defining_hypotheses_ex14.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex14.py>` @@ -228,7 +213,6 @@ Quadrangle Parameters example 2 (using different types) ####################################################### .. literalinclude:: ../../../examples/defining_hypotheses_ex15.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex15.py>` @@ -239,7 +223,6 @@ Quadrangle Parameters example 2 (using different types) ################################################# .. literalinclude:: ../../../examples/defining_hypotheses_ex16.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex16.py>` @@ -250,7 +233,6 @@ Viscous layers construction ########################### .. literalinclude:: ../../../examples/defining_hypotheses_ex17.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_ex17.py>` @@ -261,7 +243,6 @@ Radial Prism example #################### .. literalinclude:: ../../../examples/radial_prism_3d_algo.py - :linenos: :language: python :download:`Download this script <../../../examples/radial_prism_3d_algo.py>` @@ -272,7 +253,6 @@ Usage of Body Fitting algorithm ############################### .. literalinclude:: ../../../examples/cartesian_algo.py - :linenos: :language: python :download:`Download this script <../../../examples/cartesian_algo.py>` @@ -287,7 +267,6 @@ which is actually just a stub allowing to use your own 2D algorithm implemented in Python. .. literalinclude:: ../../../examples/use_existing_faces.py - :linenos: :language: python :download:`Download this script <../../../examples/use_existing_faces.py>` @@ -304,7 +283,6 @@ Usage of Extrusion 3D meshing algorithm ######################################## .. literalinclude:: ../../../examples/prism_3d_algo.py - :linenos: :language: python :download:`Download this script <../../../examples/prism_3d_algo.py>` @@ -321,7 +299,6 @@ Usage of Medial Axis Projection algorithm ######################################### .. literalinclude:: ../../../examples/quad_medial_axis_algo.py - :linenos: :language: python :download:`Download this script <../../../examples/quad_medial_axis_algo.py>` @@ -333,7 +310,6 @@ Usage of Segments around Vertex algorithm ######################################### .. literalinclude:: ../../../examples/defining_hypotheses_len_near_vertex.py - :linenos: :language: python :download:`Download this script <../../../examples/defining_hypotheses_len_near_vertex.py>` diff --git a/doc/salome/gui/SMESH/input/tui_filters.rst b/doc/salome/gui/SMESH/input/tui_filters.rst index 1e64974d9..35ecd8c70 100644 --- a/doc/salome/gui/SMESH/input/tui_filters.rst +++ b/doc/salome/gui/SMESH/input/tui_filters.rst @@ -37,7 +37,6 @@ filters 2D mesh elements (faces) according to the aspect ratio value: * threshold is floating point value (aspect ratio) .. literalinclude:: ../../../examples/filters_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex01.py>` @@ -56,7 +55,6 @@ filters 3D mesh elements (volumes) according to the aspect ratio value: * threshold is floating point value (aspect ratio) .. literalinclude:: ../../../examples/filters_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex02.py>` @@ -75,7 +73,6 @@ filters 2D mesh elements (faces) according to the warping angle value: * threshold is floating point value (warping angle) .. literalinclude:: ../../../examples/filters_ex03.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex03.py>` @@ -94,7 +91,6 @@ filters 2D mesh elements (faces) according to the minimum angle value: * threshold is floating point value (minimum angle) .. literalinclude:: ../../../examples/filters_ex04.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex04.py>` @@ -113,7 +109,6 @@ filters 2D mesh elements (faces) according to the taper value: * threshold is floating point value (taper) .. literalinclude:: ../../../examples/filters_ex05.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex05.py>` @@ -132,7 +127,6 @@ filters 2D mesh elements (faces) according to the skew value: * threshold is floating point value (skew) .. literalinclude:: ../../../examples/filters_ex06.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex06.py>` @@ -151,7 +145,6 @@ filters 2D mesh elements (faces) according to the area value: * threshold is floating point value (area) .. literalinclude:: ../../../examples/filters_ex07.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex07.py>` @@ -170,7 +163,6 @@ filters 3D mesh elements (volumes) according to the volume value: * threshold is floating point value (volume) .. literalinclude:: ../../../examples/filters_ex08.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex08.py>` @@ -189,7 +181,6 @@ filters 1D mesh elements (edges) which represent free borders of a mesh: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex09.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex09.py>` @@ -209,7 +200,6 @@ nodes, not mesh segments) belonging to one face of mesh only: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex10.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex10.py>` @@ -228,7 +218,6 @@ filters free nodes: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex11.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex11.py>` @@ -247,7 +236,6 @@ filters free faces: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex12.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex12.py>` @@ -266,7 +254,6 @@ filters faces with bare borders: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex13.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex13.py>` @@ -286,7 +273,6 @@ filters coplanar faces: * tolerance is in degrees .. literalinclude:: ../../../examples/filters_ex14.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex14.py>` @@ -303,7 +289,6 @@ filters over-constrained faces: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex15.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex15.py>` @@ -322,7 +307,6 @@ filters mesh elements basing on the same set of nodes: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex16.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex16.py>` @@ -340,7 +324,6 @@ filters mesh nodes which are coincident with other nodes (within a given toleran * default tolerance is 1.0e-7 .. literalinclude:: ../../../examples/filters_ex17.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex17.py>` @@ -357,7 +340,6 @@ filters nodes according to a number of elements of highest dimension connected t * threshold is an integer value (number of elements) .. literalinclude:: ../../../examples/filters_node_nb_conn.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_node_nb_conn.py>` @@ -375,7 +357,6 @@ connections (faces and volumes on whose border the segment lies): * threshold is integer value (number of connections) .. literalinclude:: ../../../examples/filters_ex18.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex18.py>` @@ -395,7 +376,6 @@ faces connected to a border (link between nodes, not mesh segment): * threshold is integer value (number of connections) .. literalinclude:: ../../../examples/filters_ex19.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex19.py>` @@ -414,7 +394,6 @@ filters 1D mesh elements (edges) according to the edge length value: * threshold is floating point value (length) .. literalinclude:: ../../../examples/filters_ex20.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex20.py>` @@ -434,7 +413,6 @@ edges (links between nodes): * threshold is floating point value (edge length) .. literalinclude:: ../../../examples/filters_ex21.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex21.py>` @@ -454,7 +432,6 @@ of its edges and diagonals: * threshold is floating point value (length) .. literalinclude:: ../../../examples/filters_ex22.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex22.py>` @@ -474,7 +451,6 @@ of its edges and diagonals: * threshold is floating point value (edge/diagonal length) .. literalinclude:: ../../../examples/filters_ex23.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex23.py>` @@ -494,7 +470,6 @@ shared with other volumes and without a face on it: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex24.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex24.py>` @@ -513,7 +488,6 @@ filters over-constrained volumes, whose all nodes are on the mesh boundary: * threshold value is not required .. literalinclude:: ../../../examples/filters_ex25.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex25.py>` @@ -533,7 +507,6 @@ defined by threshold value: * threshold is mesh group object .. literalinclude:: ../../../examples/filters_belong2group.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_belong2group.py>` @@ -552,7 +525,6 @@ shape defined by threshold value: * tolerance is a distance between a node and the geometrical object; it is used if an node is not associated to any geometry. .. literalinclude:: ../../../examples/filters_ex26.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex26.py>` @@ -573,7 +545,6 @@ shape defined by threshold value: it is used if an node is not associated to any geometry. .. literalinclude:: ../../../examples/filters_ex27.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex27.py>` @@ -592,7 +563,6 @@ plane defined by threshold value with the given tolerance: * default tolerance is 1.0e-7 .. literalinclude:: ../../../examples/filters_ex28.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex28.py>` @@ -611,7 +581,6 @@ cylindrical face defined by threshold value with the given tolerance: * default tolerance is 1.0e-7 .. literalinclude:: ../../../examples/filters_ex29.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex29.py>` @@ -630,7 +599,6 @@ arbitrary surface defined by threshold value with the given tolerance: * default tolerance is 1.0e-7 .. literalinclude:: ../../../examples/filters_ex30.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex30.py>` @@ -648,7 +616,6 @@ specified identifiers range: * threshold is string listing required IDs and/or ranges of IDs, e.g."1,2,3,50-60,63,67,70-78" .. literalinclude:: ../../../examples/filters_ex31.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex31.py>` @@ -666,7 +633,6 @@ the point of view of MED convention. * threshold is not required .. literalinclude:: ../../../examples/filters_ex32.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex32.py>` @@ -684,7 +650,6 @@ filters linear / quadratic mesh elements: * if unary operator is set to SMESH.FT_LogicalNOT, the quadratic elements are selected, otherwise (by default) linear elements are selected .. literalinclude:: ../../../examples/filters_ex33.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex33.py>` @@ -701,7 +666,6 @@ filters mesh entities, belonging to the group with the color defined by the thre * threshold should be of SALOMEDS.Color type .. literalinclude:: ../../../examples/filters_ex34.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex34.py>` @@ -720,7 +684,6 @@ entity type. * threshold is either of smesh.GeometryType values. Type *SMESH.GeometryType._items* in the Python Console to see all geometric types. .. literalinclude:: ../../../examples/filters_ex35.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex35.py>` @@ -737,7 +700,6 @@ filters mesh elements by the geometric type and number of nodes. * threshold is either of SMESH.EntityType values. Type *SMESH.EntityType._items* in the Python Console to see all entity types. .. literalinclude:: ../../../examples/filters_ex37.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex37.py>` @@ -754,7 +716,6 @@ filters ball elements by diameter. * threshold is floating point value (ball diameter) .. literalinclude:: ../../../examples/filters_ex38.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex38.py>` @@ -771,7 +732,6 @@ filters elements of a specified domain. * threshold is either (1) node ID or (2) geometrical vertex or (3) 3 coordinates of a point. .. literalinclude:: ../../../examples/filters_ex39.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex39.py>` @@ -784,7 +744,6 @@ How to combine several criteria into a filter? Several criteria can be combined into a filter. .. literalinclude:: ../../../examples/filters_ex36.py - :linenos: :language: python :download:`Download this script <../../../examples/filters_ex36.py>` diff --git a/doc/salome/gui/SMESH/input/tui_grouping_elements.rst b/doc/salome/gui/SMESH/input/tui_grouping_elements.rst index 1f4dffe2e..45e8dcdbf 100644 --- a/doc/salome/gui/SMESH/input/tui_grouping_elements.rst +++ b/doc/salome/gui/SMESH/input/tui_grouping_elements.rst @@ -13,7 +13,6 @@ Create a Standalone Group ========================= .. literalinclude:: ../../../examples/grouping_elements_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/grouping_elements_ex01.py>` @@ -28,7 +27,6 @@ Create a Group on Geometry ========================== .. literalinclude:: ../../../examples/grouping_elements_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/grouping_elements_ex02.py>` @@ -39,7 +37,6 @@ Create a Group on Filter ======================== .. literalinclude:: ../../../examples/grouping_elements_ex03.py - :linenos: :language: python :download:`Download this script <../../../examples/grouping_elements_ex03.py>` @@ -50,7 +47,6 @@ Edit a Group ============ .. literalinclude:: ../../../examples/grouping_elements_ex04.py - :linenos: :language: python :download:`Download this script <../../../examples/grouping_elements_ex04.py>` @@ -65,7 +61,6 @@ Union of groups =============== .. literalinclude:: ../../../examples/grouping_elements_ex05.py - :linenos: :language: python :download:`Download this script <../../../examples/grouping_elements_ex05.py>` @@ -80,7 +75,6 @@ Intersection of groups ====================== .. literalinclude:: ../../../examples/grouping_elements_ex06.py - :linenos: :language: python :download:`Download this script <../../../examples/grouping_elements_ex06.py>` @@ -95,7 +89,6 @@ Cut of groups ============= .. literalinclude:: ../../../examples/grouping_elements_ex07.py - :linenos: :language: python :download:`Download this script <../../../examples/grouping_elements_ex07.py>` @@ -110,7 +103,6 @@ Creating groups of entities basing on nodes of other groups =========================================================== .. literalinclude:: ../../../examples/grouping_elements_ex08.py - :linenos: :language: python :download:`Download this script <../../../examples/grouping_elements_ex08.py>` diff --git a/doc/salome/gui/SMESH/input/tui_measurements.rst b/doc/salome/gui/SMESH/input/tui_measurements.rst index 06eb255b0..b3f596450 100644 --- a/doc/salome/gui/SMESH/input/tui_measurements.rst +++ b/doc/salome/gui/SMESH/input/tui_measurements.rst @@ -10,7 +10,6 @@ Minimum Distance ================ .. literalinclude:: ../../../examples/measurements_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/measurements_ex01.py>` @@ -21,7 +20,6 @@ Bounding Box ============ .. literalinclude:: ../../../examples/measurements_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/measurements_ex02.py>` @@ -32,7 +30,6 @@ Basic Properties ================ .. literalinclude:: ../../../examples/measurements_ex03.py - :linenos: :language: python :download:`Download this script <../../../examples/measurements_ex03.py>` diff --git a/doc/salome/gui/SMESH/input/tui_modifying_meshes.rst b/doc/salome/gui/SMESH/input/tui_modifying_meshes.rst index e90ba3726..0981dd7af 100644 --- a/doc/salome/gui/SMESH/input/tui_modifying_meshes.rst +++ b/doc/salome/gui/SMESH/input/tui_modifying_meshes.rst @@ -18,7 +18,6 @@ Add Node ******** .. literalinclude:: ../../../examples/modifying_meshes_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex01.py>` @@ -29,7 +28,6 @@ Add 0D Element ************** .. literalinclude:: ../../../examples/modifying_meshes_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex02.py>` @@ -40,7 +38,6 @@ Add 0D Element on Element Nodes ******************************* .. literalinclude:: ../../../examples/modifying_meshes_ex03.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex03.py>` @@ -51,7 +48,6 @@ Add Edge ******** .. literalinclude:: ../../../examples/modifying_meshes_ex04.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex04.py>` @@ -62,7 +58,6 @@ Add Triangle ************ .. literalinclude:: ../../../examples/modifying_meshes_ex05.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex05.py>` @@ -73,7 +68,6 @@ Add Quadrangle ************** .. literalinclude:: ../../../examples/modifying_meshes_ex06.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex06.py>` @@ -84,7 +78,6 @@ Add Tetrahedron *************** .. literalinclude:: ../../../examples/modifying_meshes_ex07.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex07.py>` @@ -95,7 +88,6 @@ Add Hexahedron ************** .. literalinclude:: ../../../examples/modifying_meshes_ex08.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex08.py>` @@ -106,7 +98,6 @@ Add Polygon *********** .. literalinclude:: ../../../examples/modifying_meshes_ex09.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex09.py>` @@ -117,7 +108,6 @@ Add Polyhedron ************** .. literalinclude:: ../../../examples/modifying_meshes_ex10.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex10.py>` @@ -133,7 +123,6 @@ Removing Nodes ************** .. literalinclude:: ../../../examples/modifying_meshes_ex11.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex11.py>` @@ -144,7 +133,6 @@ Removing Elements ***************** .. literalinclude:: ../../../examples/modifying_meshes_ex12.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex12.py>` @@ -155,7 +143,6 @@ Removing Orphan Nodes ********************* .. literalinclude:: ../../../examples/modifying_meshes_ex13.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex13.py>` @@ -166,7 +153,6 @@ Moving Nodes ============ .. literalinclude:: ../../../examples/modifying_meshes_ex15.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex15.py>` @@ -177,7 +163,6 @@ Diagonal Inversion ================== .. literalinclude:: ../../../examples/modifying_meshes_ex16.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex16.py>` @@ -188,7 +173,6 @@ Uniting two Triangles ===================== .. literalinclude:: ../../../examples/modifying_meshes_ex17.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex17.py>` @@ -199,7 +183,6 @@ Uniting a Set of Triangles ========================== .. literalinclude:: ../../../examples/modifying_meshes_ex18.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex18.py>` @@ -210,7 +193,6 @@ Orientation =========== .. literalinclude:: ../../../examples/modifying_meshes_ex19.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex19.py>` @@ -221,7 +203,6 @@ Cutting Quadrangles =================== .. literalinclude:: ../../../examples/modifying_meshes_ex20.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex20.py>` @@ -232,7 +213,6 @@ Split Volumes into Tetrahedra ============================= .. literalinclude:: ../../../examples/modifying_meshes_split_vol.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_split_vol.py>` @@ -243,7 +223,6 @@ Smoothing ========= .. literalinclude:: ../../../examples/modifying_meshes_ex21.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex21.py>` @@ -254,7 +233,6 @@ Extrusion ========= .. literalinclude:: ../../../examples/modifying_meshes_ex22.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex22.py>` @@ -265,7 +243,6 @@ Extrusion along a Path ====================== .. literalinclude:: ../../../examples/modifying_meshes_ex23.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex23.py>` @@ -276,7 +253,6 @@ Revolution ========== .. literalinclude:: ../../../examples/modifying_meshes_ex24.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex24.py>` @@ -287,7 +263,6 @@ Pattern Mapping =============== .. literalinclude:: ../../../examples/modifying_meshes_ex25.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex25.py>` @@ -298,7 +273,6 @@ Convert mesh to/from quadratic ============================== .. literalinclude:: ../../../examples/modifying_meshes_ex26.py - :linenos: :language: python :download:`Download this script <../../../examples/modifying_meshes_ex26.py>` @@ -309,7 +283,6 @@ Split bi-quadratic into linear ============================== .. literalinclude:: ../../../examples/split_biquad.py - :linenos: :language: python :download:`Download this script <../../../examples/split_biquad.py>` @@ -339,7 +312,6 @@ This example represents an iron cable (a thin cylinder) in a concrete bloc (a bi The big cylinder is defined by two geometric volumes. .. literalinclude:: ../../../examples/generate_flat_elements.py - :linenos: :language: python :download:`Download this script <../../../examples/generate_flat_elements.py>` diff --git a/doc/salome/gui/SMESH/input/tui_notebook_smesh.rst b/doc/salome/gui/SMESH/input/tui_notebook_smesh.rst index 9a0fc2f91..e05865b47 100644 --- a/doc/salome/gui/SMESH/input/tui_notebook_smesh.rst +++ b/doc/salome/gui/SMESH/input/tui_notebook_smesh.rst @@ -11,7 +11,6 @@ Notebook Smesh ============== .. literalinclude:: ../../../examples/notebook_smesh.py - :linenos: :language: python :download:`Download this script <../../../examples/notebook_smesh.py>` diff --git a/doc/salome/gui/SMESH/input/tui_quality_controls.rst b/doc/salome/gui/SMESH/input/tui_quality_controls.rst index 9563bdb96..566d69bac 100644 --- a/doc/salome/gui/SMESH/input/tui_quality_controls.rst +++ b/doc/salome/gui/SMESH/input/tui_quality_controls.rst @@ -13,7 +13,6 @@ Free Borders ============ .. literalinclude:: ../../../examples/quality_controls_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex01.py>` @@ -25,7 +24,6 @@ Borders at Multiconnection ========================== .. literalinclude:: ../../../examples/quality_controls_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex02.py>` @@ -37,7 +35,6 @@ Length 1D ========= .. literalinclude:: ../../../examples/quality_controls_ex03.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex03.py>` @@ -48,7 +45,6 @@ Free Edges ========== .. literalinclude:: ../../../examples/quality_controls_ex04.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex04.py>` @@ -59,7 +55,6 @@ Free Nodes ========== .. literalinclude:: ../../../examples/quality_controls_ex05.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex05.py>` @@ -70,7 +65,6 @@ Free Faces ========== .. literalinclude:: ../../../examples/quality_controls_ex06.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex06.py>` @@ -81,7 +75,6 @@ Bare border faces ================= .. literalinclude:: ../../../examples/quality_controls_ex07.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex07.py>` @@ -92,7 +85,6 @@ Bare border volumes =================== .. literalinclude:: ../../../examples/quality_controls_ex08.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex08.py>` @@ -103,7 +95,6 @@ Over-constrained faces ====================== .. literalinclude:: ../../../examples/quality_controls_ex09.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex09.py>` @@ -114,7 +105,6 @@ Over-constrained volumes ======================== .. literalinclude:: ../../../examples/quality_controls_ex10.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex10.py>` @@ -125,7 +115,6 @@ Length 2D ========= .. literalinclude:: ../../../examples/quality_controls_ex11.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex11.py>` @@ -137,7 +126,6 @@ Borders at Multiconnection 2D ============================= .. literalinclude:: ../../../examples/quality_controls_ex12.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex12.py>` @@ -148,7 +136,6 @@ Area ==== .. literalinclude:: ../../../examples/quality_controls_ex13.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex13.py>` @@ -159,7 +146,6 @@ Taper ===== .. literalinclude:: ../../../examples/quality_controls_ex14.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex14.py>` @@ -170,7 +156,6 @@ Aspect Ratio ============ .. literalinclude:: ../../../examples/quality_controls_ex15.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex15.py>` @@ -181,7 +166,6 @@ Minimum Angle ============= .. literalinclude:: ../../../examples/quality_controls_ex16.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex16.py>` @@ -192,7 +176,6 @@ Warping ======= .. literalinclude:: ../../../examples/quality_controls_ex17.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex17.py>` @@ -203,7 +186,6 @@ Skew ==== .. literalinclude:: ../../../examples/quality_controls_ex18.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex18.py>` @@ -214,7 +196,6 @@ Element Diameter 2D =================== .. literalinclude:: ../../../examples/quality_controls_ex19.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex19.py>` @@ -225,7 +206,6 @@ Aspect Ratio 3D =============== .. literalinclude:: ../../../examples/quality_controls_ex20.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex20.py>` @@ -236,7 +216,6 @@ Volume ====== .. literalinclude:: ../../../examples/quality_controls_ex21.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex21.py>` @@ -247,7 +226,6 @@ Element Diameter 3D =================== .. literalinclude:: ../../../examples/quality_controls_ex22.py - :linenos: :language: python :download:`Download this script <../../../examples/quality_controls_ex22.py>` diff --git a/doc/salome/gui/SMESH/input/tui_transforming_meshes.rst b/doc/salome/gui/SMESH/input/tui_transforming_meshes.rst index 0be8e0a6d..23b755f80 100644 --- a/doc/salome/gui/SMESH/input/tui_transforming_meshes.rst +++ b/doc/salome/gui/SMESH/input/tui_transforming_meshes.rst @@ -13,7 +13,6 @@ Translation =========== .. literalinclude:: ../../../examples/transforming_meshes_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex01.py>` @@ -24,7 +23,6 @@ Rotation ======== .. literalinclude:: ../../../examples/transforming_meshes_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex02.py>` @@ -35,7 +33,6 @@ Scale ===== .. literalinclude:: ../../../examples/transforming_meshes_ex03.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex03.py>` @@ -46,7 +43,6 @@ Symmetry ======== .. literalinclude:: ../../../examples/transforming_meshes_ex04.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex04.py>` @@ -57,7 +53,6 @@ Merging Nodes ============= .. literalinclude:: ../../../examples/transforming_meshes_ex05.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex05.py>` @@ -68,7 +63,6 @@ Merging Elements ================ .. literalinclude:: ../../../examples/transforming_meshes_ex06.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex06.py>` @@ -79,7 +73,6 @@ Sew Meshes Border to Side ========================= .. literalinclude:: ../../../examples/transforming_meshes_ex07.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex07.py>` @@ -90,7 +83,6 @@ Sew Conform Free Borders ======================== .. literalinclude:: ../../../examples/transforming_meshes_ex08.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex08.py>` @@ -101,7 +93,6 @@ Sew Free Borders ================ .. literalinclude:: ../../../examples/transforming_meshes_ex09.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex09.py>` @@ -112,7 +103,6 @@ Sew Side Elements ================= .. literalinclude:: ../../../examples/transforming_meshes_ex10.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex10.py>` @@ -123,7 +113,6 @@ Duplicate nodes or/and elements =============================== .. literalinclude:: ../../../examples/transforming_meshes_ex11.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex11.py>` @@ -134,7 +123,6 @@ Create boundary elements ======================== .. literalinclude:: ../../../examples/transforming_meshes_ex12.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex12.py>` @@ -145,7 +133,6 @@ Reorient faces ============== .. literalinclude:: ../../../examples/transforming_meshes_ex13.py - :linenos: :language: python :download:`Download this script <../../../examples/transforming_meshes_ex13.py>` diff --git a/doc/salome/gui/SMESH/input/tui_viewing_meshes.rst b/doc/salome/gui/SMESH/input/tui_viewing_meshes.rst index c1c3bfd2e..d1320ec87 100644 --- a/doc/salome/gui/SMESH/input/tui_viewing_meshes.rst +++ b/doc/salome/gui/SMESH/input/tui_viewing_meshes.rst @@ -11,7 +11,6 @@ Viewing Mesh Infos ################## .. literalinclude:: ../../../examples/viewing_meshes_ex01.py - :linenos: :language: python :download:`Download this script <../../../examples/viewing_meshes_ex01.py>` @@ -23,7 +22,6 @@ Find Element by Point ##################### .. literalinclude:: ../../../examples/viewing_meshes_ex02.py - :linenos: :language: python :download:`Download this script <../../../examples/viewing_meshes_ex02.py>` diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index c383a29fc..ffab1b056 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -3780,11 +3780,13 @@ throw ( SALOME::SALOME_Exception ) } // loop on groups // set mesh name - SALOMEDS::SObject_wrap soNew = ObjectToSObject( theNewMesh ); - SALOMEDS::SObject_wrap soOld = ObjectToSObject( theSourceMesh ); - CORBA::String_var oldName = soOld->GetName(); - SetName( soNew, oldName.in(), "Mesh" ); - + if ( !theMeshName || !theMeshName[0] ) + { + SALOMEDS::SObject_wrap soNew = ObjectToSObject( theNewMesh ); + SALOMEDS::SObject_wrap soOld = ObjectToSObject( theSourceMesh ); + CORBA::String_var oldName = soOld->GetName(); + SetName( soNew, oldName.in(), "Mesh" ); + } // mark invalid objects shapeMapper.GetInvalid( theInvalidEntries, invalidSObjects ); diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index a93d9f732..1a39b452b 100755 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -6196,7 +6196,7 @@ class Mesh(metaclass = MeshMeta): nodes must be the same. Use :meth:`FindFreeBorders` to get nodes of holes. groupName (string): name of a group to add new faces Returns: - a :class:`group ` containing the new faces; or :code:`None` if :option:`groupName` == "" + a :class:`group ` containing the new faces; or :code:`None` if `groupName` == "" """