Salome HOME
Update SMESH GUI documentation
[modules/smesh.git] / doc / salome / gui / SMESH / input / ghs3dprl_hypo.doc
1 /*!
2
3 \page ghs3dprl_hypo_page GHS3DPRL Parameters hypothesis
4
5 \n GHS3DPRL Parameters hypothesis works only with <b>Tetrahedron (Tepal with TetMesh-GHS3D)</b> algorithm.
6 \n
7 \n This algorithm is a commercial software, its use requires a licence (http://www.distene.com/fr/build/offer.html).
8
9 \n Tepal gives the possibility to generate a partitioned
10 mesh with 200 million tetrahedrons on a computer with average memory size
11 (2Go RAM) in about 50 hours on one CPU (Xeon, 2008). 
12 This is a serious alternative to GHS3D, which requires a much less common
13 configuration with 64Go RAM to only try to make a partition of a mesh with
14 200 million tetrahedrons, no result guaranteed.
15 \n
16 \note The Plugin doesn't load in the Memory the supposedly large resulting meshes. 
17 The meshes are saved in MED files and can be imported in the user-defined location via menu File-Import-MED Files.
18 \n Pay attention, that Salome GUI needs 2Go RAM. to load a MED
19 file with 5 million tetrahedrons.
20
21 \image html ghs3dprl_parameters_basic.png
22
23 <ul>
24 <li>
25 <b>Name</b> - allows to define the name of the hypothesis (GHS3DPRL Parameters by default).
26 </li>
27 <li>
28 <b>MED_Name</b> - allows to define the path and the prefix of the 
29 resulting MED files ("DOMAIN" by default). 
30 If the path is not defined, the environment variable $SALOME_TMP_DIR
31 is used. If $SALOME_TMP_DIR is not defined as well, the environment
32 variable $TMP is used.
33 </li>
34 <li>
35 <b>Nb_Part</b> - allows to define the number of generated MED files.
36 The initial skin (triangles) will be meshed (tetrahedrons) and partitioned 
37 in Nb_Part by the elementary algorithm implemented in Tepal.<br>
38 </li>
39 <li>
40 <b>Keep_Files</b> - if this box is checked, input files of Tepal 
41 (GHS3DPRL.points and GHS3DPRL.faces) are not deleted after use (...if the
42 background mode was not used).
43 </li>
44 <li>
45 <b>Tepal_in_Background</b> - if this box is checked, Tepal execution
46 and MED file generation are launched in background mode and the user
47 can even exit Salome. Pay attention that in this case Tepal algorithm works
48 independently of "killSalome.py", and sometimes on another host.
49 </li>
50 <li>
51 <b>To_Mesh_Holes</b> - if this box is checked, the parameter component 
52 of tetmesh-ghs3d will mesh holes.
53 </li>
54
55 <h1>Modifying GHS3DPRL Advanced Parameters</h1><br>
56 GHS3DPRL Plugin launches a standalone binary executable tepal2med.<br>
57 tepal2med launches tepal, waits for the end of computation, and
58 converts the resulting output tepal files into MED files.<br>
59 Some advanced optional parameters are accessible as arguments.<br>
60
61 If keep_files option is checked, it is possible to re-launch tepal2med
62 or tepal in the Terminal as a command with custom parameters.<br>
63
64 <li>
65 <b>Advanced tepal2med Parameters</b> - type "tepal2med --help" in the Terminal. <p>
66
67 \verbatim
68 myname@myhost > /export/home/myname/salome_5/GHS3DPRLPLUGIN_5/bin/salome/tepal2med --help
69 Available options:
70    --help         : produces this help message
71    --casename     : path and name of input tepal2med files which are
72                        - output files of tepal .msg .noboite .faces .points .glo
73                        - output file of GHS3DPRL_Plugin casename_skin.med (optional)
74                          with initial skin and its initial groups
75    --number       : number of partitions
76    --medname      : path and name of output MED files
77    --limitswap    : max size of working cpu memory (Mo) (before swapping on .temp files)
78    --verbose      : trace of execution (0->6)
79    --test         : more tests about joints, before generation of output files
80    --menu         : a GUI menu for option number
81    --launchtepal  : also launch tepal on files casename.faces and casename.points and option number
82    --meshholes    : force parameter component of tetmesh-ghs3d to mesh holes
83    --background   : force background mode from launch tepal and generation of final MED files (big meshes)
84    --deletegroups : regular expression (see QRegExp) which matches unwanted groups in final MED files
85                     (try --deletegroups="(\bAll_Nodes|\bAll_Faces)"
86                     (try --deletegroups="((\bAll_|\bNew_)(N|F|T))"
87 example:
88    tepal2med --casename=/tmp/GHS3DPRL --number=2 --medname=DOMAIN --limitswap=1000 
89              --verbose=0 --test=yes --menu=no --launchtepal=no
90
91 \endverbatim
92
93 </li>
94 <li>
95 <p>
96  <b>Advanced tepal Parameters</b> <p>
97
98 \verbatim
99
100 USAGE : tepal options
101
102 With options :
103      --filename name (-f name) :
104           Prefix of the input case (MANDATORY)
105
106      --ndom n (-n n) :
107           Number of subdomains to make (MANDATORY)
108
109      --ghs3d ghs3d options (-g ghs3d options) :
110           Runs temesh ghs3d on a previously generated subdomain. (ghs3d options must be "quoted")
111
112      --memory m (-m m) :
113           Max amount of memory (megabytes) allowed for ghs in the cutting process. (default is 0 : unlimited)
114
115      --mesh_only  (-Z ) :
116           Only (re)meshes all subdomains and updates communications messages
117
118      --mesh_call command (-c command) :
119           Calls the user specified command for meshing all the
120           subomains after their skin has been generated
121
122      --stats_only  (-S ) :
123           Only computes and shows some statistics on subdomains
124
125      --rebuild  (-r ) :
126           Merges final subdomains skins
127
128      --rebuild_tetra  (-R ) :
129           Merges final subdomains skins and tetraedra
130
131      --rebuild_iface  (-i ) :
132           Includes interfaces in final subdomains merge
133
134      --rebuild_retag  (-t ) :
135           Tags vertices, faces (and tetra if selected) with their
136           subdomain number in the final merge of subdomains (keeps the lowest tag for shared elements)
137
138      --rebuild_ensight_parts  (-e ) :
139           Builds ensight geom file with parts
140
141      --tetmesh_args str (-G str) :
142           Arguments to pass to Tetmesh during cutting process
143
144 \endverbatim
145
146 </li>
147 <li>
148 <p>
149 <b>Advanced ghs3d Parameters (through tepal's --tetmesh_args)</b> - type "ghs3d -h" in a Terminal. <p>
150
151 \verbatim
152 myname@myhost > ghs3d -h
153
154 USE
155     /export/home/myname/ghs3d-4.0/DISTENE/Tools/TetMesh-GHS3D4.0/bin/Linux/ghs3dV4.0
156     [-u] [-m memory>] [-M MEMORY] [-f prefix] [-v verbose]
157     [-c component] [-p0] [-C] [-E count] [-t] [-o level]
158     [-I filetype] [-a/-b] [-O n m]
159
160 DESCRIPTION
161
162  -u (-h)        : prints this message.
163
164  -m memory      : launches the software with memory in Megabytes.
165                   The default value of this parameter is 64 Megabytes and its
166                   minimum value is 10 Megabytes.
167                   It is also possible to set this parameter with the
168                   environment variable GHS3D_MEMORY by means of an operation
169                   equivalent to:
170                            setenv GHS3D_MEMORY memory,
171                   the value specified in the command line has the priority on
172                   the environment variable.
173
174  -M MEMORY      : provides the automatic memory adjustment feature.
175                   If MEMORY (in Megabytes) is equal to zero, the size of the work space is
176                   calculated from the input. If MEMORY is not equal to
177                   zero, the software starts with MEMORY amount of work space.
178                   The software reallocates memory as necessary.
179                   The start value of  MEMORY can range from 0 to 64 Megabytes,
180                   the maximum depends on -m option and the actual memory available.
181
182  -f prefix      : defines the generic prefix of the files.
183
184  -v verbose     : sets the output level parameter (the verbose parameter
185                   must be in the range 0 to 10).
186
187  -c component   : chooses the meshed component. If the parameter is
188                       0, all components will be meshed, if
189                       1, only the main (outermost) component will be meshed
190
191  -p0            : disables creation of internal points.
192
193  -C             : uses an alternative boundary recovery mechanism. It should be used only
194                   when the standard boundary recovery fails.
195
196  -E count       : sets the extended output for error messages. If -E is used,
197                   the error messages will be printed, it is possible
198                   to indicate the maximum number of printed messages between 1 and 100.
199
200  -t             : generates an error file prefix.Log
201
202  -o level       : sets the required optimisation level.
203                   Valid optimisation levels are:
204                   none, light, standard or strong,
205                   with increase of "quality vs speed" ratio.
206
207  -I filetype    : defines the input mesh format as follows:
208                     -IP input files are ascii files, named prefix.points
209                      and prefix.faces - this is the default type of files
210                     -IPb input files are binary files, named prefix.pointsb
211                      and prefix.facesb
212                     -IM input file is ascii file, named prefix.mesh
213                   where prefix is defined with -f option
214
215  -a/-b          : selects the output file type:
216                     -a for ascii (the default) and
217                     -b for binary.
218
219  -On            : saves a NOPO file in addition. NOPO is the mesh data
220                   structure of the Simail and Modulef software packages.
221  -Om            : saves a mesh file in addition.
222  -Omn           : saves both NOPO and mesh files.
223
224  ==============================================================================
225                    TETMESH-GHS3D SOFTWARE 4.0-3 (December, 2006)
226                                  END OF SESSION
227                 COPYRIGHT (C)1989-2006 INRIA ALL RIGHTS RESERVED
228  ==============================================================================
229       ( Distene SAS
230         Phone: +33(0)1-69-26-62-10   Fax: +33(0)1-69-26-90-33
231         EMail: support@distene.com )
232
233 \endverbatim
234
235 </li>
236 <h1>Saving user's preferred GHS3DPRL Advanced Parameters</h1><br>
237 GHS3DPRL Plugin launches standalone binary executable tepal2med.<br>
238 You may rename tepal2med as tepal2med.exe for example, and replace
239 tepal2med by a shell script at your convenience to overriding parameters.<br>... or else $PATH modification... .<br>Idem for tepal.<br><br>
240 <li>
241 <b>Advanced tepal2med Parameters</b> - overriding parameter deletegroups<p>
242
243 \code
244 #!/bin/bash
245 #script tepal2med overriding parameter deletegroups
246 #we have renamed binary executable tepal2med as tepal2med.exe
247 #echo tepal2med initial parameters are $1 $2 $3 $4 ... or $*
248 #$0 is ignored
249
250 tepal2med.exe $* --deletegroups="(\bAll_Nodes|\bAll_Faces)"
251
252 \endcode
253
254 </li>
255 <li>
256 <p>
257 <b>Advanced tepal Parameters</b> - overriding parameter component of ghs3d (to mesh holes). <p>
258
259 \code
260 #!/bin/bash
261 #script tepal overriding parameter component of tetmesh-ghs3d
262 #we have renamed binary executable tepal as tepal.exe
263
264 #optionnaly we could set licence only for us
265 DISTENE_LICENSE_FILE="Use global envvar: DLIM8VAR"
266 DLIM8VAR="dlim8 1:1:29030@is142356/0016175ef08c::a1ba1...etc...e19"
267 SIMULOGD_LICENSE_FILE=29029@is142356
268
269 tepal.exe $* --tetmesh_args "-c 0"
270
271 \endcode
272
273 </li>
274 <li>
275 <p>
276 <b>Advanced tepal Parameters</b> - overriding launching tepal on other host. <p>
277
278 \code
279 #!/bin/bash
280 #script tepal overriding launching tepal on other host (tepal run 64 bits only)
281 #we have renamed binary executable tepal as tepal.exe
282 #common file system (same path) otherwise scp... on input or result files
283 #ssh -keygen -t rsa done and files id_rsa et id-rsa.pub move in ~/.ssh
284
285 #example of typical command
286 #tepal -f /home/myname/tmp/GHS3DPRL -n 4 > /home/myname/tmp/tepal.log
287 #echo parameters $1 $2 $3 $4 ... or $*
288
289 #tepal licence ought to be known on otherhost
290 ssh otherhost "tepal.exe $* > /home/myname/tmp/tepal.log"
291
292 #or more and more
293 #ssh otherhost "tepal.exe $* --tetmesh_args \"-c 0\"" > /home/myname/tmp/tepal.log
294
295 \endcode
296
297 </li>
298
299 <h1>TUI use.</h1><br>
300
301 <li>
302 <p>
303 <b>example ex30_tepal.py.</b><p>
304
305 \code
306
307 #!/bin/python
308 import os
309
310 import geompy
311 import smesh
312
313 # Parameters
314 # ----------
315
316 results = "/tmp/ZZ"
317
318 radius =  50
319 height = 200
320
321 # Build a cylinder
322 # ----------------
323
324 base = geompy.MakeVertex(0, 0, 0)
325 direction = geompy.MakeVectorDXDYDZ(0, 0, 1)
326
327 cylinder = geompy.MakeCylinder(base, direction, radius, height)
328
329 geompy.addToStudy(cylinder, "Cylinder")
330
331 # Define a mesh on a geometry
332 # ---------------------------
333
334 m = smesh.Mesh(cylinder)
335
336 # 2D mesh with BLSURF
337 # -------------------
338
339 algo2d = m.Triangle(smesh.BLSURF)
340
341 algo2d.SetPhysicalMesh(1)
342 algo2d.SetPhySize(5)
343
344 algo2d.SetGeometricMesh(0)
345
346 # 3D mesh with tepal
347 # ------------------
348
349 algo3d = m.Tetrahedron(smesh.GHS3DPRL)
350
351 algo3d.SetMEDName(results)
352 algo3d.SetNbPart(4)
353 algo3d.SetBackground(False)
354 algo3d.SetKeepFiles(False)
355 algo3d.SetToMeshHoles(True)
356
357 # Launch meshers
358 # --------------
359
360 status = m.Compute()
361
362 # Test if ok
363 # ----------
364
365 if os.access(results+".xml", os.F_OK):
366     print "Ok: tepal"
367 else:
368     print "KO: tepal"
369 \endcode
370
371 </li>
372 </ul>
373
374
375 */