Salome HOME
Utilisation potentielle efficace de matrices diagonales
[modules/adao.git] / doc / advanced.rst
1 .. _section_advanced:
2
3 ================================================================================
4 Advanced usage of the ADAO module
5 ================================================================================
6
7 This section presents advanced methods to use the ADAO module, how to get more
8 information, or how to use it without the graphical user interface (GUI).
9
10 Exporting an ADAO command file (JDC) to YACS in console mode
11 ------------------------------------------------------------
12
13 An export command can use the Python file generated by the editor used to build
14 the ADAO command file (JDC). If the ADAO command file is named "Study1.comm",
15 then a file named "Study1.py" can be found in the same directory. The complete
16 procedure is the following:
17
18 #.      using the SALOME application including ADAO module, launch SALOME with ``./runAppli -k``
19 #.      initialise the command line session with: ``./runSession``
20 #.      change to the YACS calculation scheme directory to be executed
21 #.      execute the export command: ``python ${ADAO_ROOT_DIR}/bin/salome/AdaoYacsSchemaCreator.py <input Python file> <output YACS xml scheme>``
22 #.      standard output comes on console, successive executions can be done
23 #.      stop SALOME:  ``killSalome.py``
24 #.      exit from the session: ``CTRL+D``
25
26 Be careful, if the output YACS xml scheme file already exists, this command
27 replace it without asking the user. The command accepts files with or without
28 path specifications.
29
30 It is not necessary to launch and shut down SALOME each time if the application
31 is already running.
32
33 Running an ADAO calculation scheme in YACS in console mode
34 ----------------------------------------------------------
35
36 This section describes how to execute in console mode a YACS calculation scheme,
37 obtained using the ADAO "Export to YACS" function. It uses the standard YACS
38 console mode, which will be briefly recall here (see YACS documentation for more
39 information).
40
41 The way to do that is as follows:
42
43 #.      using the SALOME application including ADAO module, launch SALOME with ``./runAppli -k``
44 #.      initialise the command line session with: ``./runSession``
45 #.      change to the YACS calculation scheme directory to be executed
46 #.      execute the YACS supervisor:  ``driver <ADAO YACS xml scheme>``
47 #.      standard output comes on console, successive executions can be done
48 #.      stop SALOME:  ``killSalome.py``
49 #.      exit from the session: ``CTRL+D``
50
51 It is not necessary to launch and shut down SALOME each time if the application
52 is already running.
53
54 Getting more information when running an assimilation calculation
55 -----------------------------------------------------------------
56
57 When running, the ADAO module is logging useful data and messages. There are two
58 ways to obtain theses informations.
59
60 The first one, and the preferred way, is to use the built-in variable "*Debug*"
61 integrated in every "*ASSIMILATION_STUDY*". It is available through the GUI of
62 the module. Setting it to "*1*" will send a lot of messages in the log window of
63 the YACS scheme execution.
64
65 The second one consist in using the "*logging*" native module of Python (see the
66 Python documentation http://docs.python.org/library/logging.html for more
67 informations on this module). Everywhere in the YACS scheme, mainly through the
68 scripts entries, the user can set the logging level in accordance to the needs
69 of detailed informations. The different logging levels are: "*DEBUG*", "*INFO*",
70 "*WARNING*", "*ERROR*", "*CRITICAL*". All the informations flagged with a
71 certain level will be printed for whatever activated level above this particular
72 one (included). The easiest way is to change the log level is to write the
73 following Python lines::
74
75     import logging
76     logging.getLogger().setLevel(logging.DEBUG)
77
78 The standard logging module default level is "*WARNING*", the default level in
79 the ADAO module is "*INFO*".