Salome HOME
94c1697bf1890a2fe699aa05e414222b89758158
[modules/smesh.git] / doc / salome / gui / SMESH / input / blsurf_hypo.doc
1 /*!
2
3 \page blsurf_hypo_page BLSURF Parameters hypothesis
4
5 \anchor blsurf_top
6 \n BLSURF Parameters hypothesis works only with <b>BLSURF</b> 2d
7 algorithm. This algorithm is a commercial software.
8 \n To get a licence, visit http://www.distene.com/corp/eval-distene.html
9
10 <ol>
11 <li>\ref blsurf_general_parameters "General parameters"</li>
12 <li>\ref blsurf_advanced_parameters "Advanced parameters"</li>
13 <li>\ref blsurf_local_size "Local size"</li>
14 <ol>
15 <li type="a">\ref blsurf_sizemap_computation "Computation of the physical size"</li>
16 <li type="a">\ref blsurf_attractor "Advanced maps"</li>
17 <li type="a">\ref blsurf_attractor_computation "Computation of attractors"</li>
18 </ol>
19 <li>\ref blsurf_enforced_elements "Enforced vertices"</li>
20 <li>\ref blsurf_limitations "Limitations"</li>
21 </ol>
22
23 \anchor blsurf_general_parameters
24 <h1>General parameters</h1>
25
26 \image html blsurf_parameters.png
27
28 <ul>
29 <li><b>Name</b> - allows defining the name of the hypothesis (BLSURF
30 Parameters_n by default).</li>
31
32 <li><b>Physical Mesh</b> - can be set to None, Custom or Size Map
33  <ul>
34   <li>if set to "Custom", allows user input in the
35 in <b>User size</b>, <b>Max Physical Size</b> and <b>Min Physical
36 Size</b> fields.</li>
37   <li>if set to "Size Map", behaves like "Custom" mode and takes into account the custom elements sizes given in the Size Map tab.</li>
38 </ul>
39 </li>
40
41 <li><b>User size</b> - defines the size of the generated mesh elements. </li>
42
43 <li><b>Max Physical Size</b> - defines the upper limit of mesh element size. </li>
44
45 <li><b>Min Physical Size</b> - defines the lower limit of mesh element size. </li>
46
47 <li><b>Geometrical mesh</b> - if set to "Custom", allows user input in
48  <b>Angle Mesh S</b>, <b>Angle Mesh C</b> and
49 <b>Gradation</b> fields. These fields control
50 computation of the element size, so called <i>geometrical size</i>, conform to
51 the surface geometry considering local curvatures. \n
52 If both the <b>User size</b> and the <i>geometrical size</i> are defined, the
53  eventual element size correspond to the least of the two. </li>
54
55 <li><b>Angle Mesh S</b> - maximum angle between the mesh face and the
56 tangent to the geometrical surface at each mesh node, in degrees. </li>
57
58 <li><b>Angle Mesh C</b> - maximum angle between the mesh edge and the
59 tangent to the geometrical curve at each mesh node, in degrees. </li>
60
61 <li><b>Max Geometrical Size</b> - defines the upper limit of the <i>geometrical size</i>.</li>
62
63 <li><b>Min Geometrical Size</b> - defines the lower limit of the <i>geometrical size</i>.</li>
64
65 <li><b>Gradation</b> - maximum ratio between the lengths of
66 two adjacent edges. </li>
67
68 <li><b>Allow Quadrangles</b> - if checked, allows the creation of quadrilateral elements.</li>
69
70 <li><b>Patch independent</b> - if checked, geometrical
71 edges are not respected and all geometrical faces are meshed as one
72 hyper-face.</li>
73 </ul>
74
75 \ref blsurf_top "Back to top"
76
77 \anchor blsurf_advanced_parameters
78 <h1>Advanced parameters</h1>
79
80 The notion of <i>diag</i> used in the descriptions means the diagonal of the bounding box of the 
81 geometrical object to mesh.
82
83 \image html blsurf_parameters_advanced.png
84
85 <li><b>Verbosity level</b> - Defines the percentage of "verbosity" of
86 BLSURF [0-100].</li>
87
88 <li><b>Topology</b> - allows creation of a conform mesh on a shell of
89 not sewed faces. 
90 <ul>
91   <li>"From CAD" means that mesh conformity is assured by conformity
92   of a shape.</li>
93   <li>"Pre-process" and "Pre-process++" allow the BLSURF software to
94   pre-process the geometrical model to eventually produce a conform
95   mesh. </li>
96   <li>"PreCAD" is an auxiliary CAD pre-processing module which has 
97   two main goals:
98   <ul>
99     <li> Complete missing or inadequate CAD descriptions.</li>
100     <li> Perform topology reconstruction and specific geometry 
101     enhancement for mesh generation.</li>
102   </ul>
103   This module requires a specific licence.
104   \n
105   The following PreCAD options are the most significant and important ones:
106   <ul>
107   <li><b>Merge Edges</b> - allows PreCAD to optimize the geometry by merging some
108   edges. This option is 0 by default.</li>
109   <li><b>Remove nano edges</b> - allows PreCAD to optimize the geometry by removing 
110   the nano edges whenever possible. This option is 0 by default.</li>
111   <li><b>Nano edge length</b> - gives the length below which an edge is considered as nano 
112   for the topology processing. See also the \b remove_nano_edges option. If unset, PreCAD
113   default value is \f$\mathrm{diag} \times 10^{-5}\f$.</li>
114   <li><b>Discard input topology</b> - computes the CAD topology from scratch, 
115   without considering the toplogical information contained in the original CAD
116   (Useful for iges files). This option is 0 by default.</li>
117   </ul>
118   </li>
119 </ul>
120
121 <li><b>ExportGMF</b> - saves the computed mesh into a GMF file (.mesh or .meshb).</li>
122
123 <li><b>Add option</b> - provides the choice of multiple PreCAD and BLSURF 
124 advanced options, which appear, if selected, in a table where it is 
125 possible to input the value of the option and to edit it later.</li>
126
127 <li><b>Clear option</b> - removes the option selected in the table.</li>
128
129 </ul>
130
131 \n
132 The following BLSURF options are commonly usable.
133
134 <ul>
135 <li>\b topo_eps1 (real) - is the tolerance level inside a CAD
136 patch. By default is equal to \f$\mathrm{diag} \times 10^{-4}\f$. This tolerance is used to
137 identify nodes to merge within one geometrical face when \b Topology
138 option is to pre-process.</li>
139
140 <li>\b topo_eps2 (real) - is the tolerance level between two CAD
141 patches. By default is equal to \f$\mathrm{diag} \times 10^{-4}\f$. This tolerance is used to
142 identify nodes to merge over different geometrical faces when
143 \b Topology option is to pre-process.</li>
144
145 <li>\b LSS (real) - is an abbreviation for "length of sub-segment". It is
146 a maximal allowed length of a mesh edge. Default is \f$0.5\f$.</li>
147
148 <li>\b frontal (integer)
149 <ul>
150 <li> 1 - the mesh generator inserts points with an advancing front method.</li>
151 <li> 0 - it inserts them with an algebraic method (on internal edges). This method is
152 slightly faster but generates less regular meshes. </li>
153 </ul>
154 Default is 0.</li>
155
156 \anchor blsurf_hinterpol_flag
157 <li>\b hinterpol_flag (integer) - determines the computation of an
158 interpolated value <i>v</i> between two points <i>P1</i> and <i>P2</i> on a
159 curve. Let <i>h1</i> be the value at point <i>P1,</i> <i>h2</i> be the value at point
160 <i>P2,</i> and <i>t</i> be a parameter varying from 0 to 1 when moving from <i>P1
161 to</i> <i>P2</i>.
162 <ul>
163 <li>0 - the interpolation is linear: \f$v = h1 + t (h2 - h1 )\f$</li>
164 <li>1 - the interpolation is geometric: \f$v = h1 \times \left( \frac{h1}{h2} \right)^{t}\f$</li>
165 <li>2 - the interpolation is sinusoidal: \f$v = \frac{h1+h2}{2} + \frac{h1-h2}{2 \cdot \cos(\pi \cdot t)}\f$</li>
166 </ul>
167 Default is 0.</li>
168
169 \anchor blsurf_hmean_flag
170 <li>\b hmean_flag (integer) - determines the computation of the average of several
171 values:<ul>
172 <li>-1 - the minimum is computed.</li>
173 <li>0 or 2 - the arithmetic average is computed.
174 <li>1 - the geometric average is computed.</li>
175 </ul>
176 Default is 0.</li>
177
178 <li>\b CheckAdjacentEdges, \b CheckCloseEdges and \b CheckWellDefined
179 (integers) - gives the number of calls of equally named subroutines the
180 purpose of which is to improve the mesh of domains having narrow
181 parts. At each iteration,\b CheckCloseEdges decreases the sizes of the
182 edges when two boundary curves are neighboring,\b CheckAdjacentEdges
183 balances the sizes of adjacent edges, and \b CheckWellDefined checks if
184 the parametric domain is well defined. Default values are 0.</li>
185
186
187 <li>\b CoefRectangle (real)- defines the relative thickness of the rectangles
188 used by subroutine \b CheckCloseEdges (see above). Default is 0.25.</li>
189
190 <li>\b eps_collapse (real) - if more than 0.0, BLSURF removes
191 curves whose lengths are less than \b eps_collapse. To obtain an
192 approximate value of the length of a curve, it is arbitrarily
193 split into 20 edges. Default is 0.0.</li>
194
195 <li>\b eps_ends (real) - is used to detect the curves whose lengths are very
196 small, which sometimes constitutes an error. A message is printed
197 if \f$\left|P2-P1\right| < eps\_ends\f$, where <i>P1</i> and <i>P2</i> are the
198 extremities of a curve. Default is \f$\frac{\mathrm{diag}}{500.0}\f$.</li>
199
200 <li>\b prefix (char) - is a prefix of the files generated by
201 BLSURF. Default is "x".</li>
202
203 <li>\b refs (integer) - reference of a surface, used when exporting
204 files. Default is 1.</li>
205 </ul>
206
207 \n
208 The following PreCAD options are commonly usable. 
209 <ul>
210 <li>\b closed_geometry (int) - describes whether the working geometry 
211 should be closed or not. When activated, this option helps PreCAD to process 
212 the dirtiest geometries. By default this option is 0.</li>
213 <li>\b debug (int) - If debug = 1 PreCAD will be very verbose and will output 
214 some intermediate files in the working directory. By default this
215 option is 0.</li>
216 <li>\b eps_nano_relative (real) -  the same as \b eps_nano, but relatively to 
217 the diagonal of the box bounding the geometry. By default this option is \f$10^{-5}\f$.</li>
218 <li>\b eps_sewing (real) - tolerance of the assembly. It rarely requires to be tuned. 
219 By default this option is \f$\mathrm{diag} \times 5 \cdot 10^{-4}\f$.</li>
220 <li>\b eps_sewing_relative (real) -  the same as \b eps_nano but relatively to 
221 the diagonal of the box bounding the geometry. By default this option is \f$5 \cdot 10^{-4}\f$.</li>
222 <li>\b manifold_geometry (int) - describes whether the working geometry should be manifold or not.
223 When activated, this option helps PreCAD to process the dirtiest
224 geometries. By default this option is 0.</li>
225 <li>\b create_tag_collision (int) - creates new tags from original ones in case 
226 of collision (entity merge or association for example). By default
227 this option is 0.</li>
228 <li>\b periodic_tolerance (real) - defines the maximum distance error accepted between 
229 two sets of periodic entities. By default this option is \f$\mathrm{diag} \times 10^{-5}\f$.</li>
230 <li>\b periodic_tolerance_relative (real) -  the same as \b
231 periodic_tolerance but in a relative unit. Bu default this option is \f$10^{-5}\f$.</li>
232 <li>\b periodic_split_tolerance (real) - This periodicity processing related option defines 
233 the minimum distance between a CAD point and an imprinted point. It allows to indirectly 
234 control the number of created points and small edges. By default this
235 option is \f$\mathrm{diag} \times 10^{-4}\f$.</li>
236 <li>\b periodic_split_tolerance_relative (real -  the same as \b
237 periodic_split_tolerance but in a relative unit. By default this
238 option is \f$10^{-4}\f$.</li>
239 </ul>
240
241 \n
242 The following advanced options are not documented and you can use them
243 at your own risk.
244 \n\n Integer variables:
245 <ul>
246 <li>    addsurf_ivertex</li>
247 <li>    anisotropic    </li>
248 <li>    background     </li>
249 <li>    coiter         </li>
250 <li>    communication  </li>
251 <li>    decim          </li>
252 <li>    export_flag    </li>
253 <li>    file_h         </li>
254 <li>    gridnu         </li>
255 <li>    gridnv         </li>
256 <li>    intermedfile   </li>
257 <li>    memory         </li>
258 <li>    normals        </li>
259 <li>    optim          </li>
260 <li>    pardom_flag    </li>
261 <li>    pinch          </li>
262 <li>    rigid          </li>
263 <li>    surforient     </li>
264 <li>    tconf          </li>
265 <li>    topo_collapse  </li>
266 </ul>
267 Real variables:
268 <ul>
269 <li>    addsurf_angle    </li>
270 <li>    addsurf_R        </li>
271 <li>    addsurf_H        </li>
272 <li>    addsurf_FG       </li>
273 <li>    addsurf_r        </li>
274 <li>    addsurf_PA       </li>
275 <li>    angle_compcurv   </li>
276 <li>    angle_ridge      </li>
277 <li>    anisotropic_ratio</li>
278 <li>    eps_pardom       </li>
279 </ul>
280 String variables:
281 <ul>
282 <li>    export_format  </li>
283 <li>    export_option  </li>
284 <li>    import_option  </li>  
285 </ul>
286
287 \ref blsurf_top "Back to top"
288
289 \anchor blsurf_local_size
290 <h1>Local size</h1>
291
292 Local sizes can be defined on faces, edges or vertices.
293 <ul>
294 <li>The faces, edges and vertices can belong to the meshed geometrical
295 object or to its sub-shapes (created using <b>Explode</b> command).</li>
296 <li>Groups of faces, edges and vertices are also handled.</li>
297 <li>It is possible to attribute the same size to several geometries using multi-selection.</li>
298 <li>The sizes are constant values or python functions.</li>
299 <li>In case of a python function, the following rules must be respected:
300 <ul>
301 <li>The name of the function is f.</li>
302 <li>If geometry is a face or a group of faces, the function is f(u,v).</li>
303 <li>If geometry is an edge or a group of edges, the function is f(t).</li>
304 <li>If geometry is a vertex or a group of vertices, the function is f().</li>
305 <li>The function must return a double.</li>
306 </ul></li>
307 </ul>
308
309 3 different types of size maps can be defined:
310 <ol>
311 <li type="a">\ref blsurf_sizemap_computation "Computation of the physical size"</li>
312 <li type="a">\ref blsurf_attractor "Advanced maps"</li>
313 <li type="a">\ref blsurf_attractor_computation "Computation of attractors"</li>
314 </ol>
315
316 \ref blsurf_top "Back to top"
317
318 \anchor blsurf_sizemap_computation
319 <h2>Computation of the physical size</h2>
320 \image html blsurf_parameters_sizemap1.png 
321
322 The physical size is obtained by querying sizemap functions associated to the input CAD object for surfaces, curves and points.
323 Each function can either return a value h (which is then trimmed
324 between the two bounds hphymin and hphymax), or "no answer" (by not
325 assigning a value to h), thus providing great flexibility in the
326 specification of the sizes. The computation depends on whether point P is internal to a surface, internal to a curve, or at the end of several curves:
327 <ul>
328 <li> If point P is internal to a surface, the CAD surface size function is queried. If no answer is returned, one interpolates with the values at the vertices of the discretized interface curves.</li>
329 <li> If point P is internal to a curve, the CAD curve size function is queried first. If no answer is returned, the surface size function is queried for every adjacent surface and the mean value of the returned values is computed. If no answer is returned, sizes h1 and h2 at both ends of the curve are considered (see next item) and the interpolated value is computed.</li>
330 <li> If point P is at the extremity of several curves, the CAD point size function is queried first. If no answer is returned, the curve size function is queried for every adjacent curve and the mean value of the returned values is computed. If no answer is returned, the surface size function is queried for every adjacent surface and the mean value of the returned values is computed. If there is still no answer returned, the default value hphydef is kept.</li>
331 </ul>
332 In order to compute the mean of several values, the arithmetic mean is used by default, but this can be modified by the parameter \ref blsurf_hmean_flag "hmean flag". In the same way, in order to interpolate two values, a linear interpolation is used by default, but this can be modified by \ref blsurf_hinterpol_flag "hinterpol flag".
333
334 \ref blsurf_local_size "Back to \"Local size\"" \n
335 \ref blsurf_top "Back to top"
336
337 \anchor blsurf_attractor
338 <h2>Advanced maps</h2>
339 \n
340 \image html blsurf_parameters_sizemap2.png 
341 \n
342 More specific size maps can be defined on faces. 
343
344 <ul>
345 <li> <i> Attractors </i> allow to define the size of the mesh elements
346 on a face so that the mesh is the finest on the attractor shape and
347 becomes coarser when getting far from this shape.
348 <ul> 
349 <li> The selected attractor can be a Vertex, an Edge, a Wire or a
350 Compound mixing several entities of those types.</li>
351 <li> The attractor doesn't have to be a sub-shape of the shape to mesh.</li>
352 <li> The size will grow exponentially (see the formula below) but is
353 bounded by gradation, \n so if you want the formula to be strictly
354 respected, you should set the <i>gradation</i> 
355 to its maximum (2.5) in the <i>arguments</i> tab. 
356 </ul>
357 \n
358 <li> Furthermore you can choose to <i> keep the size constant </i>
359 until a certain distance from a shape. This option can be combined or
360 not with an <i>attractor</i> size map described above. 
361 <ul>
362 <li> If the two options are combined the size will remain constant
363 until the distance specified in "constant over" and grow then as
364 prescribed by the attractor function.</li>
365 <li> Else the growing is only controled by the standard arguments of
366 BLSURF (gradation ...).</li>
367 </ul>
368 </ul>
369
370 \image html blsurf_const_size_near_shape2.png "Example of size map with constant size option, the size is kept constant on the left side of the surface until a certain distance"
371
372 Remark : The validation of the hypothesis might take a few seconds if
373 attractors are defined or the "constant size" option is used because a
374 map of distances has to be built on the whole surface for each face
375 where such a hypothesis has been defined.
376
377 <br><b>See Also</b> a sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including size map.
378
379 \ref blsurf_local_size "Back to \"Local size\"" \n
380 \ref blsurf_top "Back to top"
381
382 \anchor blsurf_attractor_computation
383 <h2>Computation of attractors</h2>
384 \n
385 The size grows exponentially following the equation : 
386 \f$h(d) = \mathrm{User Size} + (\mathrm{h\_start} - \mathrm{User Size}) \times e ^ { - \left( \frac{d}{R} \right) ^ {2} }\f$
387 \n
388 Where :
389 <ul>
390 <li>h_start is the desired size on the given attractor shape</li>
391 <li>d is the distance of the current point from the attractor
392 shape. The distance is the geodesic distance (i.e. calculated by following the surface to be meshed) </li>
393 <li>R is called the distance of influence and allows controlling the growth rate of the mesh </li>
394 </ul>
395
396 \image html blsurf_attractors2.png "Example of mesh created using attractors, the attractors here are the side edges and the size grows from the side of the surface towards the apex"
397
398 \ref blsurf_local_size "Back to \"Local size\"" \n
399 \ref blsurf_top "Back to top"
400
401 \anchor blsurf_enforced_elements
402 <h1>Enforced vertices</h1>
403
404 \image html blsurf_parameters_enforced_vertices.png
405
406 It is possible to define some enforced vertices to BLSurf algorithm.
407 An enforced vertex is defined on a Face or a Compound by
408 <ul>
409 <li> selecting an existing Vertex or Compound,</li>
410 <li> or creating a new vertex given its coordinates.</li>
411 </ul>
412 The enforced vertex is the projection of a point defined by its
413 (x,y,z) coordinates on the selected face.
414 <ul>
415 <li>It is possible to define several enforced vertices on a face or a group of faces.</li>
416 <li>If the projected point is on the boundary or outside of the face, it will be ignored.</li>
417 <li>If a group name is specified, the enforced nodes will be added in the group. If the group does not exist it will be created.
418 </ul>
419
420 <br><b>See Also</b> a sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including enforced vertices.
421
422 \ref blsurf_top "Back to top"
423
424 \anchor blsurf_limitations
425 <h1>Limitations</h1>
426
427 Currently BLSURF plugin has the following limitations.
428 <ul>
429   <li>BLSURF algorithm cannot be used as a local algorithm (on
430       sub-meshes) or as a provider of a low-level
431       mesh for some 3D algorithms, because the BLSURF mesher (and
432       consequently plugin) does not provide the information on node
433       parameters on edges (U) and faces (U,V). For example the
434       following combinations of algorithms are impossible:
435       <ul>
436         <li> global MEFISTO or Quadrangle(mapping) + local BLSURF;</li>
437         <li> BLSURF + Projection 2D from faces meshed by BLSURF;</li>
438         <li> local BLSURF + Extrusion 3D;</li>
439       </ul>
440   </li>
441 </ul>
442
443 \ref blsurf_top "Back to top"
444
445 */