From: eap Date: Tue, 28 May 2013 16:39:28 +0000 (+0000) Subject: 0022108: EDF 2547 SMESH: Duplicate elements only X-Git-Tag: V7_3_0a1~396 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=13b8c96957cd060f6e76f73c9248b941beff0d6d 0022108: EDF 2547 SMESH: Duplicate elements only --- diff --git a/doc/salome/examples/transforming_meshes_ex11.py b/doc/salome/examples/transforming_meshes_ex11.py index 0c3bee898..de98b27bb 100644 --- a/doc/salome/examples/transforming_meshes_ex11.py +++ b/doc/salome/examples/transforming_meshes_ex11.py @@ -1,13 +1,14 @@ -# Duplicate nodes +# Duplicate nodes or/and elements import salome salome.salome_init() + import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) -import SMESH, SALOMEDS +import SMESH from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) @@ -24,7 +25,7 @@ mesh.Hexahedron() # Compute mesh mesh.Compute() -# Without the duplication of border elements +# Duplicate nodes only # Nodes to duplicate nodes1 = mesh.CreateEmptyGroup( SMESH.NODE, 'nodes1' ) @@ -48,7 +49,7 @@ print "Nodes : ", mesh.NbNodes() print "Edges : ", mesh.NbEdges() print "Quadrangles : ", mesh.NbQuadrangles() -# With the duplication of border elements +# Duplicate nodes and border elements # Edges to duplicate edges = mesh.CreateEmptyGroup( SMESH.EDGE, 'edges' ) @@ -76,6 +77,19 @@ print "Nodes : ", mesh.NbNodes() print "Edges : ", mesh.NbEdges() print "Quadrangles : ", mesh.NbQuadrangles() + +# Duplicate elements only + +# Duplicate all faces and make a group of new faces. +# If a mesh is given to DoubleElements(), all elements of the greatest dimension are duplicated +newFacesGroup = mesh.DoubleElements( mesh, "newFacesGroup" ) + +# Duplicate edges contained in the group "edges" and add new edges to this group +mesh.DoubleElements( edges, edges.GetName() ) + +# Duplicate two first edges of the mesh +mesh.DoubleElements([ 1, 2 ]) + # Update object browser if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(0) diff --git a/doc/salome/gui/SMESH/images/crack_emulation_double_nodes.png b/doc/salome/gui/SMESH/images/crack_emulation_double_nodes.png new file mode 100644 index 000000000..032d9d6df Binary files /dev/null and b/doc/salome/gui/SMESH/images/crack_emulation_double_nodes.png differ diff --git a/doc/salome/gui/SMESH/images/crack_emulation_double_nodes_with_elems.png b/doc/salome/gui/SMESH/images/crack_emulation_double_nodes_with_elems.png new file mode 100644 index 000000000..9a0fd5e25 Binary files /dev/null and b/doc/salome/gui/SMESH/images/crack_emulation_double_nodes_with_elems.png differ diff --git a/doc/salome/gui/SMESH/images/duplicate01.png b/doc/salome/gui/SMESH/images/duplicate01.png index 80a4a2ba9..02938fa41 100644 Binary files a/doc/salome/gui/SMESH/images/duplicate01.png and b/doc/salome/gui/SMESH/images/duplicate01.png differ diff --git a/doc/salome/gui/SMESH/images/duplicate02.png b/doc/salome/gui/SMESH/images/duplicate02.png index 0e5014125..9653a3ea0 100644 Binary files a/doc/salome/gui/SMESH/images/duplicate02.png and b/doc/salome/gui/SMESH/images/duplicate02.png differ diff --git a/doc/salome/gui/SMESH/images/duplicate03.png b/doc/salome/gui/SMESH/images/duplicate03.png new file mode 100644 index 000000000..72b2a7a80 Binary files /dev/null and b/doc/salome/gui/SMESH/images/duplicate03.png differ diff --git a/doc/salome/gui/SMESH/input/double_nodes_page.doc b/doc/salome/gui/SMESH/input/double_nodes_page.doc index a8a93d1f9..0c4c1eb2c 100644 --- a/doc/salome/gui/SMESH/input/double_nodes_page.doc +++ b/doc/salome/gui/SMESH/input/double_nodes_page.doc @@ -1,36 +1,37 @@ /*! -\page double_nodes_page Duplicate Nodes +\page double_nodes_page Duplicate Nodes or/and Elements -\n This operation allows to duplicate nodes of your mesh, which can be -useful to emulate a crack in the model. -Duplication consists in replacement of an existing mesh element by another one. -Lower level elements of the duplicated ones are cloned automatically. +\n This operation allows to duplicate nodes or/and elements of your mesh. +Duplication of nodes can be useful to emulate a crack in the model. +Duplication consists in creation of mesh element "equal" to existing ones. -To duplicate nodes: +To duplicate nodes or/and elements:
    -
  1. From the \b Modification menu choose \b Transformation -> \b Duplicate -\b Nodes item or click "Duplicate Nodes" button in the toolbar. +
  2. From the \b Modification menu choose \b Transformation -> Duplicate + Nodes or/and Elements item or click "Duplicate Nodes or/and + Elements" button in the toolbar.
    -\image html duplicate_nodes.png "Duplicate Nodes button" +\image html duplicate_nodes.png "Duplicate Nodes or/and Elements button"
  3. -
  4. Check in the dialog box one of two radio buttons corresponding to -the type of nodes duplication operation you would like to perform.
  5. -
  6. Fill the other fields available in the dialog box (depends on the chosen - operation mode).
  7. -
  8. Click the \b Apply or Apply and Close button to perform the operation of nodes - duplication.
  9. +
  10. Check in the dialog box one of three radio buttons corresponding to + the type of duplication operation you would like to perform.
  11. +
  12. Fill the other fields available in the dialog box (depending on + the chosen operation mode).
  13. +
  14. Click the \b Apply or Apply and Close button to perform the + operation of duplication.
-\n "Duplicate Nodes" dialog has two working modes: +\n "Duplicate Nodes or/and Elements" dialog has three working modes:
\anchor mode_without_elem_anchor -

Without duplication of border elements

+

Duplicate nodes only

In this mode the dialog looks like: @@ -38,16 +39,29 @@ In this mode the dialog looks like: Parameters to be defined in this mode: +A schema below explains the crack emulation using the node duplication. +\image html crack_emulation_double_nodes.png "Crack emulation" +This schema shows a virtual crack in a 2D mesh created using this duplication +mode. In this schema: +- Black balls are nodes to duplicate. +- Red balls are new nodes. +- Elements to replace nodes with new ones are marked with green. + +Note that in reality nodes to duplicate coincide with new nodes. +
\anchor mode_with_elem_anchor -

With duplication of border elements

+

Duplicate nodes and border elements

In this mode the dialog looks like: @@ -55,18 +69,62 @@ In this mode the dialog looks like: Parameters to be defined in this mode: + +A schema below explains the crack emulation using the node duplication +with border elements. +\image html crack_emulation_double_nodes_with_elems.png "Crack emulation" +This schema shows a virtual crack in a 2D mesh created using this duplication +mode. In this schema: +- Black segments are elements to duplicate (edges in 2D case). +- Black balls (except the lowest one) are nodes of elements to + duplicate that are duplicated. +- The lowest black ball is a node not to duplicate. +- Red balls are creates nodes. +- Red segments are created elements (edges). +- Elements to replace nodes with new ones are marked with green. + +Note that in reality nodes to duplicate coincide with new nodes. +
+In a 3D case, where elements to duplicate are faces, the edges +located at the "crack" (if any) are cloned automatically. + +
+\anchor mode_elem_only_anchor +

Duplicate elements only

+ +This mode just duplicates given elements, i.e. creates new elements on +the same nodes as the given elements. +
+In this mode the dialog looks like: + +\image html duplicate03.png + +Parameters to be defined in this mode: + -
See Also a sample TUI Script of a \ref tui_duplicate_nodes "Duplicate nodes" operation. +
See Also a sample TUI Script of a + \ref tui_duplicate_nodes "Duplicate nodes or/and elements" operation. */ diff --git a/doc/salome/gui/SMESH/input/modifying_meshes.doc b/doc/salome/gui/SMESH/input/modifying_meshes.doc index 36c4e0abb..b7b7e2e64 100644 --- a/doc/salome/gui/SMESH/input/modifying_meshes.doc +++ b/doc/salome/gui/SMESH/input/modifying_meshes.doc @@ -22,7 +22,8 @@ the mesh or some of its elements. elements.
  • \subpage symmetry_page "Mirror" the mesh through a point or a vector of symmetry.
  • -
  • \subpage double_nodes_page "Duplicate nodes" to emulate a crack in the model.
  • +
  • \subpage double_nodes_page "Duplicate nodes or/and + Elements". Duplication of nodes can be useful to emulate a crack in the model.
  • Unite meshes by \subpage sewing_meshes_page "sewing" free borders, conform free borders, border to side or side elements.
  • \subpage merging_nodes_page "Merge Nodes", considered coincident diff --git a/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc b/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc index 303b7cec4..d3ad4de47 100644 --- a/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc +++ b/doc/salome/gui/SMESH/input/tui_transforming_meshes.doc @@ -58,7 +58,7 @@
    \anchor tui_duplicate_nodes -

    Duplicate nodes

    +

    Duplicate nodes or/and elements

    \tui_script{transforming_meshes_ex11.py}
    diff --git a/resources/Makefile.am b/resources/Makefile.am index 62cb2827e..fa9b24036 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -200,6 +200,7 @@ dist_salomeres_DATA = \ split_into_tetra.png \ mesh_duplicate_nodes.png \ mesh_duplicate_nodes_with_elem.png \ + mesh_duplicate_elem_only.png \ mesh_bounding_box.png \ mesh_hypo_viscous_layers.png \ mesh_tree_hypo_viscous_layers.png \ diff --git a/resources/mesh_duplicate_elem_only.png b/resources/mesh_duplicate_elem_only.png new file mode 100644 index 000000000..c34edc39d Binary files /dev/null and b/resources/mesh_duplicate_elem_only.png differ