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 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 or mesh elements:</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:
102 \n For a <b>2D pattern</b>
104 \image html patternmapping1.png
106 In this dialog you should specify:
109 <li> \b Pattern, which can be loaded from .smp pattern file previously
110 created manually or generated automatically from an existing mesh or submesh.</li>
111 <li> \b Face with the number of vertices equal to the number of
112 key-points in the pattern; the number of key-points on internal
113 boundaries of the pattern must also be equal to the number of vertices
114 on internal boundaries of the face;</li>
115 <li> \b Vertex to which the first key-point should be mapped;</li>
117 Alternatively, it is possible to select <b>Refine selected mesh elements</b>
118 check-box and apply the pattern to <ul>
119 <li> <b>Mesh Face</b> instead of a geometric Face</li>
120 <li> and select \b Node instead of vertex.</li>
122 Additionally it is possible to: <ul>
123 <li> <b>Reverse the order of key-points</b>. By default, the vertices of
124 a face are ordered counterclockwise.</li>
125 <li> Enable to <b> Create polygons near boundary</b> </li>
126 <li> and <b>Create polyhedrons near boundary</b></li>
129 \n For a <b>3D pattern</b>
131 \image html patternmapping2.png
133 In this dialog you should specify:
135 <li> \b Pattern, which can be loaded from .smp pattern file previously
136 created manually or generated automatically from an existing mesh or submesh.</li>
137 <li> A 3D block (Solid) object.</li>
138 <li> Two vertices that specify the order of nodes in the resulting
141 Alternatively, it is possible to select <b>Refine selected mesh elements</b>
142 checkbox and apply the pattern to
144 <li> One or several <b>Mesh volumes</b> instead of a geometric 3D
146 <li> and select two /b Nodes instead of vertices.</li>
148 Additionally it is possible to:
150 <li> Enable to <b> Create polygons near boundary</b> </li>
151 <li> and <b>Create polyhedrons near boundary</b></li>
155 <h3> Automatic Generation </h3>
157 To generate a pattern automatically from an existing mesh or sub-mesh,
160 The following dialog box will appear:
162 \image html a-patterntype1.png
164 In this dialog you should specify:
167 <li> <b>Mesh or Submesh</b>, which is a meshed geometrical face (for a
168 2D pattern) or a meshed solid (for a 3D pattern). Mesh nodes lying on
169 the face vertices become key-points of the pattern. </li>
170 <li> A custom <b>Pattern Name </b> </li>
171 <li>Additionally, for a 2D pattern you may choose to
172 <b>Project nodes on the face</b> to get node coordinates instead of using
173 "positions on face" generated by the mesher (if there is any). The faces
174 having a seam edge cannot be used for automatic pattern creation.</li>
177 When a pattern is created from an existing mesh, two cases are possible:
179 - A sub-mesh on a face/solid is selected. The pattern is created from the 2d/3d
180 elements bound to the face/solid by the mesher. For a 2D pattern, the node coordinates are either
181 "positions on face" computed by the mesher, or coordinates got by node
182 projection on a geometrical surface, according to the user choice. For
183 a 3D pattern, the node coordinates correspond to the nodes computed by
185 - A mesh, where the main shape is a face/solid, is selected. The pattern is
186 created from all 2d/3d elements in a mesh. In addition, if all mesh
187 elements of a 2D pattern are built by the mesher, the user can select
188 how to get node coordinates, otherwise all nodes are projected on
192 <br><h2>Mapping algorithm</h2>
194 The mapping algorithm for a 2D case is as follows:
196 - The key-points are set counterclockwise in the order corresponding
197 to their location on the pattern boundary. The first key-point is preserved.
198 - The geometrical vertices corresponding to the key-points are found
199 on face boundary. Here, "Reverse order of key-points" flag is set.
200 \image html image95.gif
201 - The boundary nodes of the pattern are mapped onto the edges of the face: a
202 node located between two key-points on the pattern boundary is
203 mapped on the geometrical edge limited by the corresponding geometrical
204 vertices. The node position on the edge depends on its distance from the
206 \image html image96.gif
207 - The cordinates of a non-boundary node in the parametric space of the face
208 are defined in the following way. In the parametric space of the
209 pattern, the node lies at the intersection of two iso-lines. Both
210 of them intersect the pattern boundary at two
211 points at least. If the mapped positions of boundary nodes are known, it is
212 possible to find, where the points at the intersection of isolines
213 and boundaries are mapped. Then it is possible to find
214 the direction of mapped isolinesection and, filally, the poitions of
215 two nodes on two mapped isolines. The eventual mapped
216 position of the node is found as an average of the positions on mapped
218 \image html image97.gif
220 The 3D algorithm is similar.
222 <b>See Also</b> a sample TUI Script of a
223 \ref tui_pattern_mapping "Pattern Mapping" operation.