Salome HOME
0022108: EDF 2547 SMESH: Duplicate elements only
authoreap <eap@opencascade.com>
Tue, 28 May 2013 16:39:28 +0000 (16:39 +0000)
committereap <eap@opencascade.com>
Tue, 28 May 2013 16:39:28 +0000 (16:39 +0000)
doc/salome/examples/transforming_meshes_ex11.py
doc/salome/gui/SMESH/images/crack_emulation_double_nodes.png [new file with mode: 0644]
doc/salome/gui/SMESH/images/crack_emulation_double_nodes_with_elems.png [new file with mode: 0644]
doc/salome/gui/SMESH/images/duplicate01.png
doc/salome/gui/SMESH/images/duplicate02.png
doc/salome/gui/SMESH/images/duplicate03.png [new file with mode: 0644]
doc/salome/gui/SMESH/input/double_nodes_page.doc
doc/salome/gui/SMESH/input/modifying_meshes.doc
doc/salome/gui/SMESH/input/tui_transforming_meshes.doc
resources/Makefile.am
resources/mesh_duplicate_elem_only.png [new file with mode: 0644]

index 0c3bee898a13099c343063bf4a2144d65d50a4a5..de98b27bb2bd361856f195f69a9d999ae100913c 100644 (file)
@@ -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 (file)
index 0000000..032d9d6
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 (file)
index 0000000..9a0fd5e
Binary files /dev/null and b/doc/salome/gui/SMESH/images/crack_emulation_double_nodes_with_elems.png differ
index 80a4a2ba9692cc277f28217906b340a421c09470..02938fa41019a144ee84a1c6cf1a3b6b59691360 100644 (file)
Binary files a/doc/salome/gui/SMESH/images/duplicate01.png and b/doc/salome/gui/SMESH/images/duplicate01.png differ
index 0e501412539a1f79c17ede8fc4730506219c9430..9653a3ea08806a2adc752317825b8e5da455c3f9 100644 (file)
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 (file)
index 0000000..72b2a7a
Binary files /dev/null and b/doc/salome/gui/SMESH/images/duplicate03.png differ
index a8a93d1f94190d39c78ff91586e7b0bd15ad711f..0c4c1eb2c28fc9edd638a557269c8ad4c0769f04 100644 (file)
@@ -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.
 
-<em>To duplicate nodes:</em>
+<em>To duplicate nodes or/and elements:</em>
 <ol>
-<li>From the \b Modification menu choose \b Transformation -> \b Duplicate
-\b Nodes item or click <em>"Duplicate Nodes"</em> button in the toolbar.
+<li>From the \b Modification menu choose \b Transformation -> <b> Duplicate
+ Nodes or/and Elements </b> item or click <em>"Duplicate Nodes or/and
+ Elements"</em> button in the toolbar.
 <br>
-\image html duplicate_nodes.png "Duplicate Nodes button"
+\image html duplicate_nodes.png "Duplicate Nodes or/and Elements button"
 </li>
-<li>Check in the dialog box one of two radio buttons corresponding to
-the type of nodes duplication operation you would like to perform.</li>
-<li>Fill the other fields available in the dialog box (depends on the chosen
- operation mode).</li>
-<li>Click the \b Apply or <b>Apply and Close</b> button to perform the operation of nodes
- duplication.</li>
+<li>Check in the dialog box one of three radio buttons corresponding to
+  the type of duplication operation you would like to perform.</li>
+<li>Fill the other fields available in the dialog box (depending on
 the chosen operation mode).</li>
+<li>Click the \b Apply or <b>Apply and Close</b> button to perform the
+  operation of duplication.</li> 
 </ol>
 
-\n "Duplicate Nodes" dialog has two working modes:
+\n "Duplicate Nodes or/and Elements" dialog has three working modes:
 <ul>
-<li>\ref mode_without_elem_anchor "Without the duplication of border elements"</li>
-<li>\ref mode_with_elem_anchor "With the duplication of border elements"</li>
+<li>\ref mode_without_elem_anchor "Duplicate nodes only"</li>
+<li>\ref mode_with_elem_anchor "Duplicate nodes and border elements"</li>
+<li>\ref mode_elem_only_anchor "Duplicate elements only"</li>
 </ul>
 
 <br>
 \anchor mode_without_elem_anchor
-<h2>Without duplication of border elements</h2>
+<h2>Duplicate nodes only</h2>
 
 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:
 <ul>
-<li><b>Group of nodes to duplicate</b> (<em>mandatory</em>): these nodes will be duplicated.</li>
-<li><b>Group of elements to replace nodes with new ones</b> (<em>optional</em>): the duplicated nodes
- will be associated with these elements.</li>
-<li><b>Construct group with newly created nodes</b> option (<em>checked by default</em>): 
- if checked - the group with just created nodes will be built.</li>
+<li><b>Group of nodes to duplicate</b> (<em>mandatory</em>): these
+  nodes will be duplicated.</li>
+<li><b>Group of elements to replace nodes with new ones</b>
+  (<em>optional</em>): the new nodes will replace the nodes to
+  duplicate within these elements.</li> 
+<li><b>Construct group with newly created nodes</b> option
+  (<em>checked by default</em>): if checked - the group with just
+  created nodes will be built.</li> 
 </ul>
+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 <b>nodes to duplicate</b>.
+- Red balls are <b>new nodes</b>.
+- <b>Elements to replace nodes with new ones</b> are marked with green.
+
+Note that in reality <b>nodes to duplicate</b> coincide with <b>new nodes</b>.
+
 
 <br>
 \anchor mode_with_elem_anchor
-<h2>With duplication of border elements</h2>
+<h2>Duplicate nodes and border elements</h2>
 
 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:
 <ul>
-<li><b>Group of elements to duplicate</b> (<em>mandatory</em>): these elements will be duplicated.</li>
-<li><b>Group of nodes at not to duplicate</b> (<em>optional</em>): group of nodes at crack bottom
- which will not be duplicated.</li>
-<li><b>Group of elements to replace nodes with new ones</b> (<em>mandatory</em>): the duplicated nodes
- will be associated with these elements.</li>
-<li><b>Construct group with newly created elements</b> option (<em>checked by default</em>): 
- if checked - the group of just created elements will be built.</li>
-<li><b>Construct group with newly created nodes</b> option (<em>checked by default</em>): 
- if checked - the group of just created nodes will be built.</li>
+<li><b>Group of elements to duplicate</b> (<em>mandatory</em>): these
+  elements will be duplicated.</li> 
+<li><b>Group of nodes not to duplicate</b> (<em>optional</em>):
+  group of nodes at crack bottom which will not be duplicated.</li>
+<li><b>Group of elements to replace nodes with new ones</b>
+  (<em>mandatory</em>): the new nodes will replace the nodes to
+  duplicate within these elements.</li> 
+<li><b>Construct group with newly created elements</b> option
+ (<em>checked by default</em>): if checked - the group of just created
+ elements will be built.</li>
+<li><b>Construct group with newly created nodes</b> option
+  (<em>checked by default</em>): if checked - the group of just
+  created nodes will be built.</li>
+</ul>
+
+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 <b>elements to duplicate</b> (edges in 2D case).
+- Black balls (except the lowest one) are nodes of <b>elements to
+  duplicate</b> that are duplicated.
+- The lowest black ball is a <b>node not to duplicate</b>.
+- Red balls are <b>creates nodes</b>.
+- Red segments are <b>created elements</b> (edges).
+- <b>Elements to replace nodes with new ones</b> are marked with green.
+
+Note that in reality <b>nodes to duplicate</b> coincide with <b>new nodes</b>.
+<br>
+In a 3D case, where <b>elements to duplicate</b> are faces, the edges
+located at the "crack" (if any) are cloned automatically.
+
+<br>
+\anchor mode_elem_only_anchor
+<h2>Duplicate elements only</h2>
+
+This mode just duplicates given elements, i.e. creates new elements on
+the same nodes as the given elements.
+<br>
+In this mode the dialog looks like:
+
+\image html duplicate03.png
+
+Parameters to be defined in this mode:
+<ul>
+<li><b>Group of elements to duplicate</b> (<em>mandatory</em>): these
+  elements will be duplicated.</li> 
+<li><b>Construct group with newly created elements</b> option
+  (<em>checked by default</em>): if checked - the group of just created
+  elements will be built. A name of the created group starts from
+  "DoubleElements".</li>
 </ul>
 
 
-<br><b>See Also</b> a sample TUI Script of a \ref tui_duplicate_nodes "Duplicate nodes" operation.
+<br><b>See Also</b> a sample TUI Script of a
+ \ref tui_duplicate_nodes "Duplicate nodes or/and elements" operation.
 
 */
index 36c4e0abbae041ef649ee5bea334385cb76eac68..b7b7e2e646050fdd1ab262c3b5f9be5701237586 100644 (file)
@@ -22,7 +22,8 @@ the mesh or some of its elements.</li>
 elements.</li>
 <li>\subpage symmetry_page "Mirror" the mesh
 through a point or a vector of symmetry.</li>
-<li>\subpage double_nodes_page "Duplicate nodes" to emulate a crack in the model.</li>
+<li>\subpage double_nodes_page "Duplicate nodes or/and
+  Elements". Duplication of nodes can be useful to emulate a crack in the model.</li>
 <li>Unite meshes by \subpage sewing_meshes_page "sewing" free borders,
 conform free borders, border to side or side elements.</li>
 <li>\subpage merging_nodes_page "Merge Nodes", considered coincident
index 303b7cec4a7d07797a9be1e330f612c39df00ab7..d3ad4de47db317e10870302aeb4220b943532fdf 100644 (file)
@@ -58,7 +58,7 @@
 
 <br>
 \anchor tui_duplicate_nodes
-<h3>Duplicate nodes</h3>
+<h3>Duplicate nodes or/and elements</h3>
 \tui_script{transforming_meshes_ex11.py}
 
 <br>
index 62cb2827e61f4e111d105f6ba332ae01e720c5a9..fa9b24036d6e47a27d149392ab5ec48f70979b0d 100644 (file)
@@ -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 (file)
index 0000000..c34edc3
Binary files /dev/null and b/resources/mesh_duplicate_elem_only.png differ