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 coordinates for a 3D pattern.
18 Note, that node coordinates of a 3D pattern can be defined only by
19 relative values in range [0;1].
20 -# The key-points line contains the indices of the nodes to be mapped on geometrical
21 vertices (for a 2D pattern only). Index n refers to the node described
22 on the n-th line of section 2. The index of the first node is
23 zero. For a 3D pattern the key points are not specified.
24 -# The remaining lines describe nodal connectivity of elements, one line
25 for each element. Each line holds indices of nodes forming an element.
26 Index n refers to the node described on the n-th line of section 2.
27 The first node index is zero. There must be 3 or 4 indices on each
28 line for a 2D pattern (only liner 2d elements are allowed) and 4, 5, 6 or 8
29 indices for a 3D pattern (only linear 3d elements are allowed).
31 A 2D pattern must contain at least one element and at least one
32 key-point. All key-points must lie on boundaries.
34 A 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 the above 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 or mesh elements:</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 will appear:
104 \n For a <b>2D pattern</b>
106 \image html patternmapping1.png
108 In this dialog you should specify:
111 <li> \b Pattern, which can be loaded from .smp pattern file previously
112 created manually or generated automatically from an existing mesh or
114 <li> \b Face with the number of vertices equal to the number of
115 key-points in the pattern; the number of key-points on internal
116 boundaries of the pattern must also be equal to the number of vertices
117 on internal boundaries of the face;</li>
118 <li> \b Vertex to which the first key-point should be mapped;</li>
121 Alternatively, it is possible to select <b>Refine selected mesh elements</b>
122 check-box and apply the pattern to <ul>
123 <li> <b>Mesh Face</b> instead of a geometric Face</li>
124 <li> and select \b Node instead of vertex.</li>
127 Additionally it is possible to: <ul>
128 <li> <b>Reverse the order of key-points</b>. By default, the vertices of
129 a face are ordered counterclockwise.</li>
130 <li> Enable to <b> Create polygons near boundary</b> </li>
131 <li> and <b>Create polyhedrons near boundary</b></li>
134 \n For a <b>3D pattern</b>
136 \image html patternmapping2.png
138 In this dialog you should specify:
140 <li> \b Pattern, which can be loaded from .smp pattern file previously
141 created manually or generated automatically from an existing mesh or
143 <li> A 3D block (Solid) object.</li>
144 <li> Two vertices that specify the order of nodes in the resulting
148 Alternatively, it is possible to select <b>Refine selected mesh elements</b>
149 check-box and apply the pattern to
151 <li> One or several <b>Mesh volumes</b> instead of a geometric 3D object</li>
152 <li> and select two \b Nodes instead of vertices.</li>
154 Additionally it is possible to:
156 <li> Enable to <b> Create polygons near boundary</b> </li>
157 <li> and <b>Create polyhedrons near boundary</b></li>
161 <h3> Automatic Pattern Generation</h3>
163 To generate a pattern automatically from an existing mesh or sub-mesh,
166 The following dialog box will appear:
168 \image html a-patterntype1.png
170 In this dialog you should specify:
173 <li> <b>Mesh or Sub-mesh</b>, which is a meshed geometrical face (for a
174 2D pattern) or a meshed solid block (for a 3D pattern). Mesh nodes lying on
175 the face vertices become key-points of the pattern. </li>
176 <li> A custom <b>Pattern Name </b> </li>
177 <li>Additionally, for a 2D pattern you may choose to
178 <b>Project nodes on the face</b> to get node coordinates instead of using
179 "positions on face" generated by the mesher (if there is any). The faces
180 having a seam edge cannot be used for automatic pattern creation.</li>
183 When a pattern is created from an existing mesh, two cases are possible:
185 - A sub-mesh on a face/solid is selected. The pattern is created from the 2d/3d
186 elements bound to the face/solid by the mesher. For a 2D pattern, the node coordinates are either
187 "positions on face" computed by the mesher, or coordinates got by node
188 projection on a geometrical surface, according to the user choice. For
189 a 3D pattern, the node coordinates correspond to the nodes computed by
191 - A mesh, where the main shape is a face/solid, is selected. The pattern is
192 created from all 2d/3d elements in a mesh. In addition, if all mesh
193 elements of a 2D pattern are built by the mesher, the user can select
194 how to get node coordinates, otherwise all nodes are projected on
198 <br><h2>Mapping algorithm</h2>
200 The mapping algorithm for a 2D case is as follows:
202 - The key-points are set counterclockwise in the order corresponding
203 to their location on the pattern boundary. The first key-point is preserved.
204 - The geometrical vertices corresponding to the key-points are found
205 on face boundary. Here, "Reverse order of key-points" flag is set.
206 \image html image95.gif
207 - The boundary nodes of the pattern are mapped onto the edges of the face: a
208 node located between two key-points on the pattern boundary is
209 mapped on the geometrical edge limited by the corresponding geometrical
210 vertices. The node position on the edge depends on its distance from the
212 \image html image96.gif
213 - The coordinates of a non-boundary node in the parametric space of the face
214 are defined in the following way. In the parametric space of the
215 pattern, the node lies at the intersection of two iso-lines. Both
216 of them intersect the pattern boundary at two
217 points at least. If the mapped positions of boundary nodes are known, it is
218 possible to find, where the points at the intersection of iso-lines
219 and boundaries are mapped. Then it is possible to find
220 the direction of mapped iso-line section and, finally, the positions of
221 two nodes on two mapped isolines. The eventual mapped
222 position of the node is found as an average of the positions on mapped
224 \image html image97.gif
226 The 3D algorithm is similar.
228 <b>See Also</b> a sample TUI Script of a
229 \ref tui_pattern_mapping "Pattern Mapping" operation.