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. 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.
13 The smp file contains 4 sections:
15 -# The first line holds the total number of the pattern nodes (N).
16 -# The next N lines describe nodes coordinates. Each line holds 2
17 coordinates of a node for 2D pattern or 3 cordinates for 3D pattern.
18 Note, that for 3D pattern only relateive values in range [0;1] are
19 valid for coordinates of the nodes.
20 -# A key-points line: indices of nodes to be mapped on geometrical
21 vertices (for 2D pattern only). An index n refers to a node described
22 on an n-th line of section 2. The first node index is zero. For 3D
23 pattern key points are not specified.
24 -# 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 for 2D pattern (only 2d elements are allowed) and 4, 5, 6 or 8
29 indices for 3D pattern (only 3d elements are allowed).
31 The 2D pattern must contain at least one element and at least one
32 key-point. All key-points must lay on boundaries.
34 The 3D pattern must contain at least one element.
36 An example of a simple 2D pattern smp file:
39 !!! SALOME 2D mesh pattern file
52 !!! Indices of 4 key-points
54 !!! Indices of points of 6 elements
63 The image below provides a preview of above described pattern:
65 \image html pattern2d.png
67 An example of a simple 3D pattern smp file:
70 !!! SALOME 3D mesh pattern file
83 !!! Indices of points of 6 elements:
92 <br><h2>Application of pattern mapping</h2>
94 <em>To apply pattern mapping to a geometrical object:</em>
96 From the \b Modification menu choose the <b>Pattern Mapping</b> item or click
97 <em>"Pattern mapping"</em> button in the toolbar.
99 \image html image98.png
100 <center><em>"Pattern mapping" button</em></center>
102 The following dialog box shall appear:
104 \image html patternmapping1.png
106 <center><b> 2D Pattern Mapping dialog box</b></center>
108 \image html patternmapping2.png
110 <center><b> 3D Pattern Mapping dialog box</b></center>
112 To apply a pattern to a geometrical object, you should specify:
115 - A face having the number of vertices equal to the number of
116 key-points in the pattern; the number of key-points on internal
117 boundaries of a pattern must also be equal to the number of vertices
118 on internal boundaries of a face;
119 - A vertex to which the first key-point should be mapped;
120 - Reverse or not the order of key-points. (The order of vertices of
121 a face is counterclockwise looking from outside).
123 - 3D block (Solid) object;
124 - Two vertices that specify the order of nodes in the resulting
127 Then you either load a .smp pattern file previously created manually
128 by clicking on the <em>"Load pattern"</em> button, or click on the \b
129 New button for automatic generation of the pattern.
131 For an automatic generation you just specify a geometrical face (for
132 2D) or solid (for 3d) having a mesh built on it. Mesh nodes lying on
133 face vertices become key-points of 2D pattern. Additionally, for 2D
134 pattern you may choose the way of getting nodes coordinates by
135 <b>projecting nodes on the face</b> instead of using
136 "positions on face" generated by mesher (if there is any). Faces
137 having a seam edge can't be used for automatic pattern creation.
139 When creating a pattern from an existing mesh, there are two possible
142 - A sub-mesh on face/solid is selected. A pattern is created from the 2d/3d
143 elements bound to a face/solid by mesher. For 2D pattern, node coordinates are either
144 "positions on face" computed by mesher, or coordinates got by node
145 projection on a geometrical surface, according to the user choice. For
146 3D pattern, nodes coordinates correspond to the nodes computed by mesher.
147 - A mesh where the main shape is a face/solid, is selected. A pattern is
148 created from all the 2d/3d elements in a mesh. In addition, for 2D
149 pattern, if all mesh elements are build by mesher, the user can select
150 the way of getting nodes coordinates, else all nodes are projected on
153 \image html a-patterntype.png
155 <center><b> 2D Pattern Creation dialog box</b></center>
157 \image html a-patterntype1.png
159 <center><b> 3D Pattern Creation dialog box</b></center>
161 <br><h2>Mapping algorithm</h2>
163 The mapping algorithm for 2D case is as follows:
165 - Key-points are set in the order that they are encountered when
166 walking along a pattern boundary so that elements are on the left. The
167 first key-point is preserved.
168 - Find geometrical vertices corresponding to key-points by vertices
169 order in a face boundary; here, "Reverse order of key-points" flag is
170 taken into account. \image html image95.gif
171 - Boundary nodes of a pattern are mapped onto edges of a face: a
172 node located between certain key-points on a pattern boundary is
173 mapped on a geometrical edge limited by corresponding geometrical
174 vertices. Node position on an edge reflects its distance from two
175 key-points. \image html image96.gif
176 - Coordinates of a non-boundary node in a parametric space of a face
177 are defined as following. In a parametric space of a pattern, a node
178 lays at the intersection of two iso-lines, each of which intersects a
179 pattern boundary at least at two points. Knowing mapped positions of
180 boundary nodes, we find where isoline-boundary intersection points are
181 mapped to, and hence we can find mapped isolines direction and then,
182 two node positions on two mapped isolines. The eventual mapped
183 position of a node is found as an average of positions on mapped
184 isolines. \image html image97.gif
186 For 3D case the algorithm is similar.
188 <b>See Also</b> a sample TUI Script of a
189 \ref tui_pattern_mapping "Pattern Mapping" operation.