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