Salome HOME
Merge from V5_1_main 14/05/2010
[modules/smesh.git] / doc / salome / gui / SMESH / input / pattern_mapping.doc
1 /*!
2
3 \page pattern_mapping_page Pattern mapping
4
5 <br><h2>About patterns</h2>
6
7 The pattern describes a mesh to generate: positions of nodes within a
8 geometrical domain and nodal connectivity of elements. As well, a
9 pattern specifies the so-called key-points, i.e. nodes that will be
10 located at geometrical vertices. Pattern description is stored in
11 \<pattern_name\>.smp file.
12
13 The smp file contains 4 sections:
14 <ol>
15 <li>The first line holds the number of nodes (N).</li>
16
17 <li>The next N lines describe nodes coordinates. Each line holds 2
18 coordinates of a node.</li>
19
20 <li>A key-points line: indices of nodes to be mapped on geometrical
21 vertices. An index n refers to a node described on an n-th line of
22 section 2. The first node index is zero.</li>
23
24 <li>The rest lines describe nodal connectivity of elements, one line
25 for an element. A line holds indices of nodes forming an element. An
26 index n refers to a node described on an n-th line of the section
27 2. The first node index is zero. There must be 3 or 4 indices on a
28 line: only 2d elements are allowed.</li>
29 </ol>
30
31 The 2D pattern must contain at least one element and at least one
32 key-point. All key-points must lay on boundaries.
33
34 An example of a simple smp file and a preview of a pattern described
35 in this file:
36
37 \image html image94.gif
38
39 <br><h2>Application of pattern mapping</h2>
40
41 <em>To apply pattern mapping to a geometrical object:</em>
42
43 From the \b Modification menu choose the <b>Pattern Mapping</b> item or click 
44 <em>"Pattern mapping"</em> button in the toolbar.
45
46 \image html image98.png
47 <center><em>"Pattern mapping" button</em></center>
48
49 The following dialog box shall appear:
50
51 \image html patternmapping1.png
52
53 \image html patternmapping2.png
54
55 To apply a pattern to a geometrical object, you should specify:
56 <ul>
57 <li>a face having the number of vertices equal to the number of
58 key-points in the pattern; the number of key-points on internal
59 boundaries of a pattern must also be equal to the number of vertices
60 on internal boundaries of a face;</li>
61 <li>a vertex to which the first key-point should be mapped;</li>
62 <li>reverse or not the order of key-points. (The order of vertices of
63 a face is counterclockwise looking from outside).</li>
64 </ul>
65
66 Then you either load a .smp pattern file previously created manually
67 by clicking on the <em>"Load pattern"</em> button, or click on the \b
68 New button for automatic generation.
69 \n For an automatic generation you just specify a geometrical face
70 having a mesh built on it. Mesh nodes lying on face vertices become
71 key-points. Additionally, you may choose the way of getting nodes
72 coordinates by <b>projecting nodes on the face</b> instead of using
73 "positions on face" generated by mesher (if there is any). Faces
74 having a seam edge can't be used for automatic pattern creation.
75
76 When creating a pattern from an existing mesh, there are two possible
77 cases:
78 <ol>
79 <li>A sub-mesh on face is selected. A pattern is created from the 2d
80 elements bound to a face by mesher. Node coordinates are either
81 "positions on face" computed by mesher, or coordinates got by node
82 projection on a geometrical surface, according to your choice.</li>
83 <li>A mesh where the main shape is a face, is selected. A pattern is
84 created from all the 2d elements in a mesh. If all mesh elements are
85 build by mesher, the user can select the way of getting nodes
86 coordinates, else all nodes are projected on a face surface.</li>
87 </ol>
88
89 \image html a-patterntype.png
90
91 \image html a-patterntype1.png
92
93 <br><h2>Mapping algorithm</h2>
94
95 The mapping algorithm is as follows:
96 <ol>
97 <li>Key-points are set in the order that they are encountered when
98 walking along a pattern boundary so that elements are on the left. The
99 first key-point is preserved.
100 </li>
101
102 <li>Find geometrical vertices corresponding to key-points by vertices
103 order in a face boundary; here, "Reverse order of key-points" flag is
104 taken into account.
105
106 \image html image95.gif
107 </li>
108
109 <li>Boundary nodes of a pattern are mapped onto edges of a face: a
110 node located between certain key-points on a pattern boundary is
111 mapped on a geometrical edge limited by corresponding geometrical
112 vertices. Node position on an edge reflects its distance from two
113 key-points.
114
115 \image html image96.gif
116 </li>
117
118 <li>Coordinates of a non-boundary node in a parametric space of a face
119 are defined as following. In a parametric space of a pattern, a node
120 lays at the intersection of two iso-lines, each of which intersects a
121 pattern boundary at least at two points. Knowing mapped positions of
122 boundary nodes, we find where isoline-boundary intersection points are
123 mapped to, and hence we can find mapped isolines direction and then,
124 two node positions on two mapped isolines. The eventual mapped
125 position of a node is found as an average of positions on mapped
126 isolines.
127
128 \image html image97.gif
129 </li>
130 </ol>
131
132 <br><b>See Also</b> a sample TUI Script of a 
133 \ref tui_pattern_mapping "Pattern Mapping" operation.
134
135 */