Salome HOME
Mise à jour documentation
[modules/smesh.git] / src / Tools / blocFissure / doc / scripts.rst
1 .. _script:\r
2 \r
3 With scripts\r
4 =====================================\r
5 \r
6 « Bloc Fissure » has a script mode which is very close to the :ref:`GUI <gui>`, in the sense that the same information is needed as input.This documentation aims at giving an example and explains how to generate a cracked mesh using a python script calling « Bloc Fissure » functions. There are several others functions available in « Bloc Fissure » but they are not documented in this documentation.\r
7 \r
8 The main command of « Bloc Fissure » is the casStandard function. It has a single argument which is a python dictionary with the following keys. All are mandatory parameters except those marked by /.\r
9 \r
10 +------------------------------------------------------------------------------------------------------------------+\r
11 |       Script parameters                                                                                          |\r
12 +======================+===================================+=======================================================+\r
13 | / **nomCas**         | *[string, default=’casStandard’]* |  Name of the problem                                  |\r
14 +----------------------+-----------------------------------+-------------------------------------------------------+\r
15 | **maillageSain**     | *[string]*                        |  Absolute address of the input structure 3D mesh      |\r
16 |                      |                                   |  in MED format                                        |\r
17 +----------------------+-----------------------------------+-------------------------------------------------------+\r
18 | **CAOFaceFissure**   | *[string]*                        |  Absolute address of the input crack geometry         |\r
19 |                      |                                   |  in XAO or BREP format                                |\r
20 +----------------------+-----------------------------------+-------------------------------------------------------+\r
21 | **edgeFiss**         | *[list of strings]*               |  List of edges group which define the crack front     |\r
22 +----------------------+-----------------------------------+-------------------------------------------------------+\r
23 |                      | *[list of integers]*              |  List of edges number which define the crack front    |\r
24 +----------------------+-----------------------------------+-------------------------------------------------------+\r
25 | **meshBrep**         | *[list of 2 floats]*              |  List of two floats defining respectively minimum and |\r
26 |                      |                                   |  maximum size of elements of the crack mesh           |\r
27 +----------------------+-----------------------------------+-------------------------------------------------------+\r
28 | **lgInfluence**      | *[float]*                         |  Length of influence - distance that defines the      |\r
29 |                      |                                   |  size of the extracted Box around the crack           |\r
30 +----------------------+-----------------------------------+-------------------------------------------------------+\r
31 | **rayonPipe**        | *[float]*                         |  Radius of the tore around the front                  |\r
32 |                      |                                   |                                                       |\r
33 +----------------------+-----------------------------------+-------------------------------------------------------+\r
34 | / **lenSegPipe**     | *[float, default=rayonPipe]*      |  Length of the segments of the tore along crack front |\r
35 |                      |                                   |                                                       |\r
36 +----------------------+-----------------------------------+-------------------------------------------------------+\r
37 |  **nbSegRad**        | *[integer]*                       |  Number of radial segment of the tore                 |\r
38 |                      |                                   |                                                       |\r
39 +----------------------+-----------------------------------+-------------------------------------------------------+\r
40 | **nbSegCercle**      | *[integer]*                       |  Number of sectors of the tore                        |\r
41 |                      |                                   |                                                       |\r
42 +----------------------+-----------------------------------+-------------------------------------------------------+\r
43 | **areteFaceFissure** | *[float]*                         |  Mesh size of elements for the Box remeshing          |\r
44 |                      |                                   |                                                       |\r
45 +----------------------+-----------------------------------+-------------------------------------------------------+\r
46 \r
47 Geometrical parameters of the tore are illustrated :\r
48 \r
49 .. image:: images/parametres.png\r
50    :width: 350\r
51    :align: center\r
52    :alt: Geometrical parameters of the tore\r
53 \r
54 Different levels of verbose are available. Use one of this 4 optional functions to set verbose type:\r
55 \r
56 - / **setDebug()**\r
57 \r
58 - / **setVerbose()**\r
59 \r
60 - / **setRelease()**\r
61 \r
62 - / **setUnitTests()**\r
63 \r
64 **example to run in salome session**::\r
65 \r
66   from blocFissure import gmu\r
67   from blocFissure.gmu import initLog\r
68   initLog.setDebug()\r
69 \r
70   from blocFissure.casStandard import casStandard\r
71 \r
72   dicoParams = dict(nomCas            = 'cubeFiss',\r
73                     maillageSain      = "/home/A123456/BF/cube.med",\r
74                     CAOFaceFissure    = "/home/A123456/BF/fiss.xao",\r
75                     edgeFiss          = ["Fond"],\r
76                     lgInfluence       = 20.,\r
77                     meshBrep          = (5.,10.),\r
78                     rayonPipe         = 5.,\r
79                     lenSegPipe        = 5,\r
80                     nbSegRad          = 5,\r
81                     nbSegCercle       = 32,\r
82                     areteFaceFissure  = 5)\r
83 \r
84   execInstance = casStandard(dicoParams)\r
85 \r
86 \r
87 \r
88 \r
89 \r