Salome HOME
d24d7c3c0cae85bc7da3a76aedf44ac98cd2a225
[modules/smesh.git] / doc / salome / gui / SMESH / input / creating_groups.rst
1 .. _creating_groups_page:
2
3 ***************
4 Creating groups
5 ***************
6
7 In MESH you can create a :ref:`grouping_elements_page` of elements of a certain type. The main way to create a group, is to
8 select in the **Mesh** menu **Create Group** item (also available in the context menu of the mesh).
9 To create a group you should define the following: 
10
11 * **Mesh** - the mesh whose elements will form your group. You can select your mesh in the Objet Browser or in the 3D viewer.
12 * **Elements Type** - set of radio buttons allows to select the type of elements which will form your group:
13         * **Nodes**
14         * **0D Element**
15         * **Ball**
16         * **Edges**
17         * **Faces**
18         * **Volumes**
19 * **Name** field allows to enter the name of your new group.
20 * **Color** - allows to assign to the group a certain color. The chosen color is used to display the elements of the group. Activation of **Auto Color** item in mesh context menu switches on a random choice of a color for a new group.
21
22 Mesh module distinguishes between the three Group types:
23 **Standalone Group**, **Group on Geometry** and **Group on Filter**.
24
25
26 .. _standalone_group:
27
28 "Standalone Group"
29 ##################
30
31 **Standalone Group** contains a list of mesh elements, which you can define in
32 the following ways:
33
34 * By adding all entities of the chosen type existing in the mesh. For this, turn on the **Select All** check-box. In this mode all controls, which allow selecting the entities, are disabled.
35 * By choosing entities manually with the mouse in the 3D Viewer. For this, turn on the **Enable manual edition** check box. You can click on an element in the 3D viewer and it will be highlighted. After that click the **Add** button and the ID of this element will be added to the list. The **Set filter** button allows to define the filter for selection of the elements for your group. See more about filters on the :ref:`selection_filter_library_page` "Selection filter library" page. 
36 * By adding entities from either a sub-mesh or another group. For this, turn on the **Enable manual edition** check box. **Select from** fields group allows to select a sub-mesh or a group of the appropriate type and to **Add** their elements to the group.
37
38 In the **manual edition** mode you can
39
40 * click the **Remove** button to remove the selected items from the list.
41 * click the **Sort List** button to sort the list of IDs of mesh elements.
42
43 .. image:: ../images/creategroup.png
44         :align: center
45
46 For example, to create a new group containing all faces of an existing group and some other faces selected in the viewer:
47
48 * Select the **Face** type of entities and input the name of the new group.
49 * Check the **Group** checkbox in **Select From** group.
50 * Select the existing group of faces in the object browser or in the viewer.
51 * Click **Add** in **Content** group. **Id Elements** list will be filled with IDs of faces belonging to the selected group.
52 * Select other faces in the viewer.
53 * Click **Add** in **Content** group.
54 * Click **Apply** button to create the new group.
55
56
57 Please note that the new group does not have references to the source group. It contains only the list of face IDs. So if the source group is changed, the new one is not updated accordingly.
58
59 .. image:: ../images/image130.gif
60         :align: center
61
62 .. centered::
63         In this picture the brown cells belong to a group defined manually.
64
65 **See Also** a sample TUI Script of a :ref:`tui_create_standalone_group` operation.  
66
67
68 .. _group_on_geom:
69
70 "Group on Geometry"
71 ###################
72
73 To create a group on geometry check **Group on geometry** in the **Group** **type** field. The group on geometry contains the elements of a certain type generated on the selected geometrical object. Group contents are dynamically updated if the mesh is modified. The group on geometry can be created only if the mesh is based on geometry.
74
75 To define a group, click the *Selection* button and choose
76
77 * **Direct geometry selection** to select a shape in the Object Browser or in the Viewer;
78 * **Find geometry by mesh element selection** to activate a dialog which retrieves a shape by the selected element generated on this shape.
79
80 .. note:: 
81         that this choice is available only if the mesh elements are already generated.
82
83 .. image:: ../images/a-creategroup.png
84         :align: center
85
86 After confirmation of the operation a new group of mesh elements will be created.
87
88 .. image:: ../images/image132.gif
89         :align: center
90
91 In this picture the cells which belong to a certain geometrical face are selected in green.
92
93 **See Also** a sample TUI Script of a  :ref:`tui_create_group_on_geometry` operation.
94
95
96 .. _group_on_filter:
97
98 "Group on Filter"
99 #################
100
101 To create a group on filter check **Group on filter** in the **Group type** field. 
102 The group on filter contains the elements of a certain type satisfying the defined filter. 
103 Group contents are dynamically updated if the mesh is modified.
104
105 To define a group, click the **Set filter** button and define criteria of the filter in the opened dialog. After the operation is confirmed, a new group of mesh elements will be created. See more about filters on the :ref:`selection_filter_library_page` page. 
106
107         .. image:: ../images/creategroup_on_filter.png
108                 :align: center
109
110 **See Also** a sample TUI Script of a :ref:`tui_create_group_on_filter` operation.
111
112