From: Jean-Philippe ARGAUD Date: Sun, 11 Nov 2012 14:24:57 +0000 (+0100) Subject: Correcting the standard usage documentation X-Git-Tag: V6_6_0~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=13c25f76b80fc3623fa237690b5fb15ccddcf410;p=modules%2Fadao.git Correcting the standard usage documentation --- diff --git a/doc/examples.rst b/doc/examples.rst index 8cbfe7c..5350651 100644 --- a/doc/examples.rst +++ b/doc/examples.rst @@ -10,6 +10,9 @@ Tutorials on using the ADAO module .. |eficas_save| image:: images/eficas_save.png :align: middle :scale: 50% +.. |eficas_saveas| image:: images/eficas_saveas.png + :align: middle + :scale: 50% .. |eficas_yacs| image:: images/eficas_yacs.png :align: middle :scale: 50% diff --git a/doc/images/adao_activate.png b/doc/images/adao_activate.png index dac7bc0..bb99801 100644 Binary files a/doc/images/adao_activate.png and b/doc/images/adao_activate.png differ diff --git a/doc/images/adao_exporttoyacs.png b/doc/images/adao_exporttoyacs.png index a20de32..25a98d7 100644 Binary files a/doc/images/adao_exporttoyacs.png and b/doc/images/adao_exporttoyacs.png differ diff --git a/doc/images/adao_jdcexample01.png b/doc/images/adao_jdcexample01.png index 8f1cce5..5dbd8a4 100644 Binary files a/doc/images/adao_jdcexample01.png and b/doc/images/adao_jdcexample01.png differ diff --git a/doc/images/adao_viewer.png b/doc/images/adao_viewer.png index 0764e59..acf79d1 100644 Binary files a/doc/images/adao_viewer.png and b/doc/images/adao_viewer.png differ diff --git a/doc/images/eficas_save.png b/doc/images/eficas_save.png index dd00abd..27a73ca 100644 Binary files a/doc/images/eficas_save.png and b/doc/images/eficas_save.png differ diff --git a/doc/images/eficas_saveas.png b/doc/images/eficas_saveas.png index 61a080e..1e97c2b 100644 Binary files a/doc/images/eficas_saveas.png and b/doc/images/eficas_saveas.png differ diff --git a/doc/images/yacs_compile.png b/doc/images/yacs_compile.png new file mode 100644 index 0000000..479fa55 Binary files /dev/null and b/doc/images/yacs_compile.png differ diff --git a/doc/using.rst b/doc/using.rst index faf3a2b..918427c 100644 --- a/doc/using.rst +++ b/doc/using.rst @@ -6,14 +6,24 @@ Using the ADAO module .. |eficas_new| image:: images/eficas_new.png :align: middle + :scale: 50% .. |eficas_save| image:: images/eficas_save.png :align: middle + :scale: 50% +.. |eficas_saveas| image:: images/eficas_saveas.png + :align: middle + :scale: 50% .. |eficas_yacs| image:: images/eficas_yacs.png :align: middle + :scale: 50% +.. |yacs_compile| image:: images/yacs_compile.png + :align: middle + :scale: 50% This section presents the usage of the ADAO module in SALOME. It is complemented -by advanced usage procedures in the section :ref:`section_advanced`, and by -examples in the section :ref:`section_examples`. +by the detailed description of all the commands and keywords in the section +:ref:`section_reference`, by advanced usage procedures in the section +:ref:`section_advanced`, and by examples in the section :ref:`section_examples`. Logical procedure to build an ADAO test case -------------------------------------------- @@ -37,11 +47,8 @@ SALOME or not. Each step will be detailed in the next section. -Detailed procedure to build an ADAO test case ---------------------------------------------- - -Activate the ADAO module and use the editor GUI -+++++++++++++++++++++++++++++++++++++++++++++++ +STEP: Activate the ADAO module and use the editor GUI +----------------------------------------------------- As always for a module, it has to be activated by choosing the appropriate module button (or menu) in the toolbar of SALOME. If there is no SALOME study @@ -66,45 +73,46 @@ create a new ADAO case, and you will see: .. centered:: **The EFICAS editor for cases definition in module ADAO** -It is a good habit to save the ADAO case now, by pushing the "*Save*" button -|eficas_save| or by choosing the "*Save/Save as*" entry in the "*ADAO*" menu. -You will be prompted for a location in your file tree and a name, that will be -completed by a "*.comm*" extension used for JDC EFICAS files. +STEP: Build and modify the ADAO case and save it +------------------------------------------------ -Build and modify the ADAO case and save it -++++++++++++++++++++++++++++++++++++++++++ - -To build a case using EFICAS, you have to go through a series of steps, by -selecting a keyword and then filling in its value. +To build a case using EFICAS, you have to go through a series of substeps, by +selecting, at each substep, a keyword and then filling in its value. The structured editor indicates hierarchical types, values or keywords allowed. Incomplete or incorrect keywords are identified by a visual error red flag. Possible values are indicated for keywords defined with a limited list of -values, and adapted entries are given for the other keywords. All the mandatory -command or keyword are already present, and optionnal commands can be added. +values, and adapted entries are given for the other keywords. Some help messages +are contextually provided in the editor reserved places. -A new case is set up with the minimal list of commands. No mandatory command can -be suppressed, but others can be added as allowed keywords for an -"*ASSIMILATION_STUDY*" command. As an example, one can add an -"*AlgorithmParameters*" keyword, as described in the last part of the section -:ref:`section_examples`. +A new case is set up with the minimal list of commands. All the mandatory +commands or keywords are already present, none of them can be suppressed. +Optionnal keywords can be added by choosing them in a list of suggestions of +allowed ones for the main command, for example the "*ASSIMILATION_STUDY*" +command. As an example, one can add an "*AlgorithmParameters*" keyword, as +described in the last part of the section :ref:`section_examples`. At the end, when all fields or keywords have been correctly defined, each line of the commands tree must have a green flag. This indicates that the whole case -is valid and completed. +is valid and completed (and can be saved). .. _adao_jdcexample00: .. image:: images/adao_jdcexample01.png :align: center - :width: 50% + :scale: 75% .. centered:: **Example of a valid ADAO case** Finally, you have to save your ADAO case by pushing the "*Save*" button -|eficas_save| or by choosing the "*Save/Save as*" entry in the "*ADAO*" menu. +|eficas_save|, or the "*Save as*" button |eficas_saveas|, or by choosing the +"*Save/Save as*" entry in the "*ADAO*" menu. You will be prompted for a location +in your file tree and a name, that will be completed by a "*.comm*" extension +used for JDC EFICAS files. This will generate a pair of files describing the +ADAO case, with the same base name, the first one being completed by a "*.comm*" +extension and the second one by a "*.py*" extension [#]_. -Export the ADAO case as a YACS scheme -+++++++++++++++++++++++++++++++++++++ +STEP: Export the ADAO case as a YACS scheme +------------------------------------------- When the ADAO case is completed, you have to export it as a YACS scheme [#]_ in order to execute the data assimilation calculation. This can be easily done by @@ -119,109 +127,91 @@ menu in the object browser. .. centered:: **"Export to YACS" sub-menu to generate the YACS scheme from the ADAO case** -This will lead to automatically generate an XML file for the YACS scheme, and -open YACS module on this file. The YACS file will be stored in the same -directory and with the same name as the ADAO saved case, only changing its -extension from "*.comm*" to "*.xml*". *Be careful, if the name already exist, it -will overwrite it without prompting for replacing the file*. In the same time, -an intermediary python file is also stored in the same place, with a "*.py*" -extension replacing the "*.comm*" one [#]_. +This will lead to automatically generate a YACS scheme, and open the YACS module +on this scheme. The YACS file, associated with the scheme, will be stored in the +same directory and with the same base name as the ADAO saved case, only changing +its extension to "*.xml*". Be careful, *if the XML file name already exist, it +will be overwriten without prompting for replacing the file*. -Modify and supplement the YACS scheme and save it -+++++++++++++++++++++++++++++++++++++++++++++++++ +STEP: Supplement and modify the YACS scheme and save it +------------------------------------------------------- .. index:: single: Analysis When the YACS scheme is generated and opened in SALOME through the YACS module -GUI, you can modify or supplement the scheme like any YACS scheme. It is -recommended to save the modified scheme with a new name, in order to preserve in -the case you re-export to YACS the ADAO case. +GUI, you can modify or supplement the scheme like any YACS scheme. Nodes or +blocs can be added, copied or modified to elaborate complex analysis, or to +insert data assimilation or optimization capabilities into more complex YACS +calculation schemes. It is recommended to save the modified scheme with a new +name, in order to preserve the XML file in the case you re-export the ADAO case +to YACS. The main supplement needed in the YACS scheme is a postprocessing step. The evaluation of the results has to be done in the physical context of the -simulation used by the data assimilation procedure. +simulation used by the data assimilation procedure. The postprocessing can be +provided throught the "*UserPostAnalysis*" ADAO keyword as a script, or can be +build as YACS nodes using all SALOME possibilities. The YACS scheme has an "*algoResults*" output port of the computation bloc, -which gives access to a "*pyobj*" containing all the results. These results can -be obtained by retrieving the named variables stored along the calculation. The -main is the "*Analysis*" one, that can be obtained by the python command (for -example in an in-line script node):: +which gives access to a "*pyobj*" named hereafter "*ADD*", containing all the +processing results. These results can be obtained by retrieving the named +variables stored along the calculation. The main is the "*Analysis*" one, that +can be obtained by the python command (for example in an in-line script node or +a script provided throught the "*UserPostAnalysis*" keyword):: - Analysis = results.ADD.get("Analysis").valueserie(-1) + ADD = algoResults.getAssimilationStudy() + Analysis = ADD.get("Analysis").valueserie() -This is a complex object, similar to a list of values calculated at each step of -data assimilation calculation. In order to get the last data assimilation -analysis, one can use:: +"*Analysis*" is a complex object, similar to a list of values calculated at each +step of data assimilation calculation. In order to get and print the optimal +data assimilation state evaluation, in script provided throught the +"*UserPostAnalysis*" keyword, one can use:: - Xa = results.ADD.get("Analysis").valueserie(-1) + Xa = ADD.get("Analysis").valueserie(-1) + print "Optimal state:", Xa + print This ``Xa`` is a vector of values, that represents the solution of the data -assimilation evaluation problem, noted as :math:`\mathbf{x}^a` in the section -:ref:`section_theory`. +assimilation or optimization evaluation problem, noted as :math:`\mathbf{x}^a` +in the section :ref:`section_theory`. Such command can be used to print results, or to convert these ones to structures that can be used in the native or external SALOME postprocessing. A simple example is given in the section :ref:`section_examples`. -Execute the YACS case and obtain the results -++++++++++++++++++++++++++++++++++++++++++++ - -.. index:: single: Analysis -.. index:: single: Innovation -.. index:: single: APosterioriCovariance -.. index:: single: OMB (Observation minus Background) -.. index:: single: BMA (Background minus Analysis) -.. index:: single: OMA (Observation minus Analysis) -.. index:: single: CostFunctionJ -.. index:: single: CostFunctionJo -.. index:: single: CostFunctionJb +STEP: Execute the YACS case and obtain the results +-------------------------------------------------- The YACS scheme is now complete and can be executed. Parametrisation and execution of a YACS case is fully compliant with the standard way to deal with a YACS scheme, and is described in the *YACS module User's Guide*. -Results can be obtained, through the "*algoResults*" output port, using YACS -nodes to retrieve all the informations in the "*pyobj*" object, to transform -them, to convert them, to save part of them, etc. - -The data assimilation results and complementary calculations can be retrieved -using the "*get*" method af the "*algoResults.ADD*" object. This method pick the -different output variables identified by their name. Indicating in parenthesis -their availability as automatic (for every algorithm) or optional (depending on -the algorithm), and their notation coming from section :ref:`section_theory`, -the main available output variables are the following: - -#. "Analysis" (automatic): the control state evaluated by the data assimilation - procedure, noted as :math:`\mathbf{x}^a`. -#. "Innovation" (automatic): the difference between the observations and the - control state transformed by the observation operator, noted as - :math:`\mathbf{y}^o - \mathbf{H}\mathbf{x}^b`. -#. "APosterioriCovariance" (optional): the covariance matrix of the *a - posteriori* analysis errors, noted as :math:`\mathbf{A}`. -#. "OMB" (optional): the difference between the observations and the - background, similar to the innovation. -#. "BMA" (optional): the difference between the background and the analysis, - noted as :math:`\mathbf{x}^b - \mathbf{x}^a`. -#. "OMA" (optional): the difference between the observations and the analysis, - noted as :math:`\mathbf{y}^o - \mathbf{H}\mathbf{x}^a`. -#. "CostFunctionJ" (optional): the minimisation function, noted as :math:`J`. -#. "CostFunctionJo" (optional): the observation part of the minimisation - function, noted as :math:`J^o`. -#. "CostFunctionJb" (optional): the background part of the minimisation - function, noted as :math:`J^b`. - -Input variables are also available as output in order to gather all the -information at the end of the procedure. - -All the variables are list of typed values, each item of the list -corresponding to the value of the variable at a time step or an iteration step -in the data assimilation optimization procedure. The variable value at a given -"*i*" step can be obtained by the method "*valueserie(i)*". The last one -(consisting in the solution of the evaluation problem) can be obtained using the -step "*-1*" as in a standard list. +To recall the simplest way to proceed, the YACS scheme has to be compiled using +the button |yacs_compile|, or the equivalent YACS menu entry, to prepare the +scheme to run. Then the compiled scheme can be started, executed step by step or +using breakpoints, etc. + +The standard output will be pushed into the "*YACS Container Log*", obtained +through the right click menu of the "*proc*" window in the YACS GUI. The errors +are shown either in the "*YACS Container Log*", or at the command line in the +shell window (if SALOME has been launched by its explicit command and not by +menu). As an example, the output of the above simple case is the following:: + + Entering in the assimilation study + Name is set to........: Test + Algorithm is set to...: Blue + Debug is set to.......: False + Launching the analyse + + Optimal state: [0.5, 0.5, 0.5] + +shown in the "*YACS Container Log*". + +The execution can also be done using a shell script, as described in the section +:ref:`section_advanced`. .. [#] For more information on EFICAS, see the *EFICAS module* available in SALOME GUI. .. [#] For more information on YACS, see the *YACS module User's Guide* available in the main "*Help*" menu of SALOME GUI. -.. [#] This intermediary python file can be safely removed after YACS export, but can also be used as described in the section :ref:`section_advanced`. +.. [#] This intermediary python file can also be used as described in the section :ref:`section_advanced`.