3 \page pattern_mapping_page Pattern mapping
5 <br><h2>About patterns</h2>
7 The pattern describes a mesh to generate: positions of nodes within a
8 geometrical domain and nodal connectivity of elements. A
9 pattern also specifies the so-called key-points, i.e. the nodes that will be
10 located at geometrical vertices. The pattern description is stored in
11 \<pattern_name\>.smp file.
13 The smp file contains 4 sections:
15 -# The first line indicates the total number of pattern nodes (N).
16 -# The next N lines describe nodes coordinates. Each line contains 2
17 node coordinates for a 2D pattern or 3 node cordinates for a 3D pattern.
18 Note, that node coordinates of a 3D pattern can be defined only by relative values in range [0;1].
19 -# The key-points line contains the indices of the nodes to be mapped on geometrical
20 vertices (for a 2D pattern only). Index n refers to the node described
21 on the n-th line of section 2. The index of the first node zero. For a 3D pattern the key points are not specified.
22 -# The remaining lines describe nodal connectivity of elements, one line
23 for each element. Each line holds indices of nodes forming an element.
24 Index n refers to the node described on the n-th line of section 2.
25 The first node index is zero. There must be 3 or 4 indices on each
26 line for a 2D pattern (only 2d elements are allowed) and 4, 5, 6 or 8
27 indices for a 3D pattern (only 3d elements are allowed).
29 A 2D pattern must contain at least one element and at least one
30 key-point. All key-points must lie on boundaries.
32 A 3D pattern must contain at least one element.
34 An example of a simple 2D pattern smp file:
37 !!! SALOME 2D mesh pattern file
50 !!! Indices of 4 key-points
52 !!! Indices of points of 6 elements
61 The image below provides a preview of the above pattern:
63 \image html pattern2d.png
65 An example of a simple 3D pattern smp file:
68 !!! SALOME 3D mesh pattern file
81 !!! Indices of points of 6 elements:
90 <br><h2>Application of pattern mapping</h2>
92 <em>To apply pattern mapping to a geometrical object:</em>
94 From the \b Modification menu choose the <b>Pattern Mapping</b> item or click
95 <em>"Pattern mapping"</em> button in the toolbar.
97 \image html image98.png
98 <center><em>"Pattern mapping" button</em></center>
100 The following dialog box will appear:
104 \image html patternmapping1.png
106 In this dialog you should specify:
109 <li> A face with the number of vertices equal to the number of
110 key-points in the pattern; the number of key-points on internal
111 boundaries of the pattern must also be equal to the number of vertices
112 on internal boundaries of the face;</li>
113 <li> A vertex to which the first key-point should be mapped;</li>
114 <li> If the order of key-points is reversed or not. (The order of vertices of
115 a face is counterclockwise looking from the outside).</li>
120 \image html patternmapping2.png
122 In this dialog you should specify:
124 <li> A 3D block (Solid) object;</li>
125 <li> Two vertices that specify the order of nodes in the resulting mesh.</li>
128 Then you either load a .smp pattern file previously created manually
129 by clicking on the <em>"Load pattern"</em> button, or click on the \b
130 New button for automatic generation of the pattern.
132 For automatic generation you should specify a geometrical face (for a
133 2D pattern) or a solid (for a 3D pattern) with a mesh built on it. Mesh nodes lying on
134 face vertices become key-points of the pattern. Additionally, for a 2D
135 pattern you may choose the way of getting nodes coordinates by
136 <b>projecting nodes on the face</b> instead of using
137 "positions on face" generated by mesher (if there is any). Faces
138 having a seam edge can't be used for automatic pattern creation.
140 When creating a pattern from an existing mesh, there are two possible
143 - A sub-mesh on face/solid is selected. A pattern is created from the 2d/3d
144 elements bound to a face/solid by mesher. For 2D pattern, node coordinates are either
145 "positions on face" computed by mesher, or coordinates got by node
146 projection on a geometrical surface, according to the user choice. For
147 3D pattern, nodes coordinates correspond to the nodes computed by mesher.
148 - A mesh where the main shape is a face/solid, is selected. A pattern is
149 created from all the 2d/3d elements in a mesh. In addition, for 2D
150 pattern, if all mesh elements are build by mesher, the user can select
151 the way of getting nodes coordinates, else all nodes are projected on
154 \image html a-patterntype.png
156 <center><b> 2D Pattern Creation dialog box</b></center>
158 \image html a-patterntype1.png
160 <center><b> 3D Pattern Creation dialog box</b></center>
162 <br><h2>Mapping algorithm</h2>
164 The mapping algorithm for 2D case is as follows:
166 - Key-points are set in the order that they are encountered when
167 walking along a pattern boundary so that elements are on the left. The
168 first key-point is preserved.
169 - Find geometrical vertices corresponding to key-points by vertices
170 order in a face boundary; here, "Reverse order of key-points" flag is
171 taken into account. \image html image95.gif
172 - Boundary nodes of a pattern are mapped onto edges of a face: a
173 node located between certain key-points on a pattern boundary is
174 mapped on a geometrical edge limited by corresponding geometrical
175 vertices. Node position on an edge reflects its distance from two
176 key-points. \image html image96.gif
177 - Coordinates of a non-boundary node in a parametric space of a face
178 are defined as following. In a parametric space of a pattern, a node
179 lays at the intersection of two iso-lines, each of which intersects a
180 pattern boundary at least at two points. Knowing mapped positions of
181 boundary nodes, we find where isoline-boundary intersection points are
182 mapped to, and hence we can find mapped isolines direction and then,
183 two node positions on two mapped isolines. The eventual mapped
184 position of a node is found as an average of positions on mapped
185 isolines. \image html image97.gif
187 For 3D case the algorithm is similar.
189 <b>See Also</b> a sample TUI Script of a
190 \ref tui_pattern_mapping "Pattern Mapping" operation.