Salome HOME
Add PreCAD
[modules/smesh.git] / doc / salome / gui / SMESH / input / blsurf_hypo.doc
1 /*!
2
3 \page blsurf_hypo_page BLSURF Parameters hypothesis
4
5 \n BLSURF Parameters hypothesis works only with <b>BLSURF</b> 2d
6 algorithm. This algorithm is a commercial software.
7 \n To get a licence, visit http://www.distene.com/corp/eval-distene.html
8
9 <h1>General parameters</h1>
10
11 \image html blsurf_parameters.png
12
13 <ul>
14 <li><b>Name</b> - allows defining the name of the hypothesis (BLSURF
15 Parameters_n by default).</li>
16
17 <li><b>Physical Mesh</b> - can be set to None, Custom or Size Map
18  <ul>
19   <li>if set to "Custom", allows user input in the
20 in <b>User size</b>, <b>Max Physical Size</b> and <b>Min Physical
21 Size</b> fields.</li>
22   <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>
23 </ul>
24 </li>
25
26 <li><b>User size</b> - defines the size of the generated mesh elements. </li>
27
28 <li><b>Max Physical Size</b> - defines the upper limit of mesh element size. </li>
29
30 <li><b>Min Physical Size</b> - defines the lower limit of mesh element size. </li>
31
32 <li><b>Geometrical mesh</b> - if set to "Custom", allows user input in
33  <b>Angle Mesh S</b>, <b>Angle Mesh C</b> and
34 <b>Gradation</b> fields. These fields control
35 computation of the element size, so called <i>geometrical size</i>, conform to
36 the surface geometry considering local curvatures. \n
37 If both the <b>User size</b> and the <i>geometrical size</i> are defined, the
38  eventual element size correspond to the least of the two. </li>
39
40 <li><b>Angle Mesh S</b> - maximum angle between the mesh face and the
41 tangent to the geometrical surface at each mesh node, in degrees. </li>
42
43 <li><b>Angle Mesh C</b> - maximum angle between the mesh edge and the
44 tangent to the geometrical curve at each mesh node, in degrees. </li>
45
46 <li><b>Max Geometrical Size</b> - defines the upper limit of the <i>geometrical size</i>.</li>
47
48 <li><b>Min Geometrical Size</b> - defines the lower limit of the <i>geometrical size</i>.</li>
49
50 <li><b>Gradation</b> - maximum ratio between the lengths of
51 two adjacent edges. </li>
52
53 <li><b>Allow Quadrangles</b> - if checked, allows the creation of quadrilateral elements.</li>
54
55 <li><b>Patch independent</b> - if checked, geometrical
56 edges are not respected and all geometrical faces are meshed as one
57 hyper-face.</li>
58
59 <h1>Advanced parameters</h1>
60
61 \image html blsurf_parameters_advanced.png
62
63 <li><b>Topology</b> - allows creation of a conform mesh on a shell of
64 not sewed faces. 
65 <ul>
66   <li>"From CAD" means that mesh conformity is assured by conformity
67   of a shape.</li>
68   <li>"Pre-process" and "Pre-process++" allow the BLSURF software to
69   pre-process the geometrical model to eventually produce a conform
70   mesh. </li>
71   <li>"PreCAD" is an auxiliary CAD pre-processing module which has 
72   two main goals:
73   <ul>
74     <li> Complete missing or inadequate CAD-description.</li>
75     <li>Perform topology reconstruction and specific geometry 
76     enhancement for mesh generation.</li>
77   </ul>
78   This module requires a specific licence.
79   </li>
80 </ul>
81
82 <li><b>Verbosity level</b> - Defines the percentage of "verbosity" of
83 BLSURF [0-100].</li>
84
85 <li><b>Add option</b> - provides the choice of multiple advanced
86 options, which appear, if selected, in a table where it is possible to
87 input the value of the option and to edit it later.</li>
88
89 <li><b>Clear option</b> - removes the option selected in the table.
90
91 </ul>
92
93 \n
94 The following options are commonly usable. The notion of <i>diag</i>
95 used in the descriptions means
96 the diagonal of the bounding box of the geometrical object to mesh.
97
98 <ul>
99 <li><b>topo_eps1</b> (real) - is the tolerance level inside a CAD
100 patch. By default is equal to <i>diag</i> � 10-4. This tolerance is used to
101 identify nodes to merge within one geometrical face when \b Topology
102 option is to pre-process. Default is <i>diag</i>/10.0.</li>
103
104 <li><b>topo_eps2</b> (real) - is the tolerance level between two CAD
105 patches. By default is equal to <i>diag</i> � 10-4. This tolerance is used to
106 identify nodes to merge over different geometrical faces when
107 \b Topology option is to pre-process. Default is <i>diag</i>/10.0.</li>
108
109 <li>\b LSS (real) - is an abbreviation for "length of sub-segment". It is
110 a maximal allowed length of a mesh edge. Default is 0.5.</li>
111
112 <li>\b frontal (integer)
113 <ul>
114 <li> 1 - the mesh generator inserts points with an advancing front method.</li>
115 <li> 0 - it inserts them with an algebraic method (on internal edges). This method is
116 slightly faster but generates less regular meshes. </li>
117 </ul>
118 Default is 0.</li>
119
120 \anchor blsurf_hinterpol_flag
121 <li>\b hinterpol_flag (integer) - determines the computation of an
122 interpolated value <i>v</i> between two points <i>P1</i> and <i>P2</i> on a
123 curve. Let <i>h1</i> be the value at point <i>P1,</i> <i>h2</i> be the value at point
124 <i>P2,</i> and <i>t</i> be a parameter varying from 0 to 1 when moving from <i>P1
125 to</i> <i>P2</i> . 
126 <ul>
127 <li>0 - the interpolation is linear: <i>v = h1 + t (h2 - h1 )</i></li>
128 <li>1 - the interpolation is geometric: <i>v = h1 * pow( h2/h1, t)</i></li>
129 <li>2 - the interpolation is sinusoidal: <i>v = (h1+h2)/2 +
130 (h1-h2)/2*cos(PI*t)</i></li>
131 </ul>
132 Default is 0.</li>
133
134 \anchor blsurf_hmean_flag
135 <li>\b hmean_flag (integer) - determines the computation of the average of several
136 values:<ul>
137 <li>-1 - the minimum is computed.</li>
138 <li>0 or 2 - the arithmetic average computed.
139 <li>1 - the geometric average is computed.</li>
140 </ul>
141 Default is 0.</li>
142
143 <li>\b CheckAdjacentEdges, \b CheckCloseEdges and \b CheckWellDefined
144 (integers) - gives the number of calls of equally named subroutines the
145 purpose of which is to improve the mesh of domains having narrow
146 parts. At each iteration,\b CheckCloseEdges decreases the sizes of the
147 edges when two boundary curves are neighboring,\b CheckAdjacentEdges
148 balances the sizes of adjacent edges, and \b CheckWellDefined checks if
149 the parametric domain is well defined. Default values are 0.</li>
150
151
152 <li>\b CoefRectangle (real)- defines the relative thickness of the rectangles
153 used by subroutine \b CheckCloseEdges (see above). Default is 0.25.</li>
154
155 <li>\b eps_collapse (real) - if more than 0.0, BLSURF removes
156 curves whose lengths are less than \b eps_collapse. To obtain an
157 approximate value of the length of a curve, it is arbitrarily
158 split into 20 edges. Default is 0.0.</li>
159
160 <li>\b eps_ends (real) - is used to detect the curves whose lengths are very
161 small, which sometimes constitutes an error. A message is printed
162 if<i> fabs(P2-P1) < eps_ends</i>, where <i>P1</i> and <i>P2</i> are the
163 extremities of a curve. Default is <i>diag</i>/500.0.</li>
164
165 <li>\b prefix (char) - is a prefix of the files generated by
166 BLSURF. Default is "x".</li>
167
168 <li>\b refs (integer) - reference of a surface, used when exporting
169 files. Default is 1.</li>
170 </ul>
171
172 \n
173 The following advanced options are not documented and you can use them
174 at your own risk.
175 \n\n Integer variables:
176 <ul>
177 <li>    addsurf_ivertex</li>
178 <li>    background     </li>
179 <li>    coiter         </li>
180 <li>    communication  </li>
181 <li>    decim          </li>
182 <li>    export_flag    </li>
183 <li>    file_h         </li>
184 <li>    gridnu         </li>
185 <li>    gridnv         </li>
186 <li>    intermedfile   </li>
187 <li>    memory         </li>
188 <li>    normals        </li>
189 <li>    optim          </li>
190 <li>    pardom_flag    </li>
191 <li>    pinch          </li>
192 <li>    rigid          </li>
193 <li>    surforient     </li>
194 <li>    tconf          </li>
195 <li>    topo_collapse  </li>
196 </ul>
197 Real variables:
198 <ul>
199 <li>    addsurf_angle  </li>
200 <li>    addsurf_R      </li>
201 <li>    addsurf_H      </li>
202 <li>    addsurf_FG     </li>
203 <li>    addsurf_r      </li>
204 <li>    addsurf_PA     </li>
205 <li>    angle_compcurv </li>
206 <li>    angle_ridge    </li>
207 <li>    eps_pardom     </li>
208 </ul>
209 String variables:
210 <ul>
211 <li>    export_format  </li>
212 <li>    export_option  </li>
213 <li>    import_option  </li>  
214 </ul>
215
216 <h1>Custom size map</h1>
217
218 \image html blsurf_parameters_sizemap1.png 
219
220 User sizes can be defined on faces, edges or vertices.
221 <ul>
222 <li>The faces, edges and vertices can belong to the meshed geometrical
223 object or to its sub-shapes (created using <b>Explode</b> command).</li>
224 <li>Groups of faces, edges and vertices are also handled.</li>
225 <li>It is possible to attribute the same size to several geometries using multi-selection.</li>
226 <li>The sizes are constant values or python functions.</li>
227 <li>In case of a python function, the following rules must be respected:
228 <ul>
229 <li>The name of the function is f.</li>
230 <li>If geometry is a face or a group of faces, the function is f(u,v).</li>
231 <li>If geometry is an edge or a group of edges, the function is f(t).</li>
232 <li>If geometry is a vertex or a group of vertices, the function is f().</li>
233 <li>The function must return a double.</li>
234 </ul></li>
235 </ul>
236
237 \anchor blsurf_sizemap_computation
238 <h2>Computation of the physical size</h2>
239 \n
240 The physical size is obtained by querying sizemap functions associated to the input CAD object for surfaces, curves and points.
241 Each function can either return a value h (which is then trimmed
242 between the two bounds hphymin and hphymax), or "no answer" (by not
243 assigning a value to h), thus providing great flexibility in the
244 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:
245 <ul>
246 <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>
247 <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>
248 <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>
249 </ul>
250 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".
251
252 \anchor blsurf_attractor
253 <h2>Advanced maps</h2>
254 \n
255 \image html blsurf_parameters_sizemap2.png 
256 \n
257 More specific size maps can be defined on faces. 
258
259 <ul>
260 <li> <i> Attractors </i> allow to define the size of the mesh elements
261 on a face so that the mesh is the finest on the attractor shape and
262 becomes coarser when getting far from this shape.
263 <ul> 
264 <li> The selected attractor can be a Vertex, an Edge, a Wire or a
265 Compound mixing several entities of those types.</li>
266 <li> The attractor doesn't have to be a sub-shape of the shape to mesh.</li>
267 <li> The size will grow exponentially (see the formula below) but is
268 bounded by gradation, \n so if you want the formula to be strictly
269 respected, you should set the <i>gradation</i> 
270 to its maximum (2.5) in the <i>arguments</i> tab. 
271 </ul>
272 \n
273 <li> Furthermore you can choose to <i> keep the size constant </i>
274 until a certain distance from a shape. This option can be combined or
275 not with an <i>attractor</i> size map described above. 
276 <ul>
277 <li> If the two options are combined the size will remain constant
278 until the distance specified in "constant over" and grow then as
279 prescribed by the attractor function.</li>
280 <li> Else the growing is only controled by the standard arguments of
281 BLSURF (gradation ...).</li>
282 </ul>
283 </ul>
284
285 \image html blsurf_attractors2.png "Example of mesh created using
286 attractors, the attractors here are the side edges and the size grows
287 from the side of the surface towards the apex"
288 \n
289 \image html blsurf_const_size_near_shape2.png "Example of size map
290 with constant size option, the size is kept constant on the left side
291 of the surface until a certain distance"
292 \n
293 Remark : The validation of the hypothesis might take a few seconds if
294 attractors are defined or the "constant size" option is used because a
295 map of distances has to be built on the whole surface for each face
296 where such a hypothesis has been defined.
297
298 <br><b>See Also</b> a sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including size map.
299
300 \anchor blsurf_attractor_computation
301 <h2>Computation of attractors</h2>
302 \n
303 The size grows exponentially following the equation : h(d) = User size + (h_start - User Size) * exp( -(d / R)^2  ).
304 \n
305 Where :
306 <ul>
307 <li>h_start is the desired size on the given attractor shape</li>
308 <li>d is the distance of the current point from the attractor
309 shape. The distance is the geodesic distance (i.e. calculated by following the surface to be meshed) </li>
310 <li>R is called the distance of influence and allows controlling the growth rate of the mesh </li>
311 </ul>
312
313 <h1>Custom enforced vertices</h1>
314
315 \image html blsurf_parameters_enforced_vertices.png
316
317 It is possible to define some enforced vertices to BLSurf algorithm
318 without creating any vertices by CAD algorithms.
319 <ul>
320 <li>The enforced vertex is the projection of a point defined by its
321 (x,y,z) coordinates on the selected face.</li>
322 <li>It is possible to define several enforced vertices on a face or a group of faces.</li>
323 <li>If the projected point is on the boundary or outside of the face, it will be ignored.</li>
324 </ul>
325
326 <br><b>See Also</b> a sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including enforced vertices.
327
328 <h1>Limitations</h1>
329
330 Currently BLSURF plugin has the following limitations.
331 <ul>
332   <li>BLSURF algorithm cannot be used as a local algorithm (on
333       sub-meshes) or as a provider of a low-level
334       mesh for some 3D algorithms, because the BLSURF mesher (and
335       consequently plugin) does not provide the information on node
336       parameters on edges (U) and faces (U,V). For example the
337       following combinations of algorithms are impossible:
338       <ul>
339         <li> global MEFISTO or Quadrangle(mapping) + local BLSURF;</li>
340         <li> BLSURF + Projection 2D from faces meshed by BLSURF;</li>
341         <li> local BLSURF + Extrusion 3D;</li>
342       </ul>
343   </li>
344 </ul>
345
346 */