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