Salome HOME
yacs
authornicolas <nicolas>
Fri, 5 Jul 2013 16:12:34 +0000 (16:12 +0000)
committernicolas <nicolas>
Fri, 5 Jul 2013 16:12:34 +0000 (16:12 +0000)
14 files changed:
doc/en/divers.rst
doc/en/gui_create_case.rst
doc/en/index.rst
doc/en/intro.rst
doc/en/regles.rst
doc/en/tutorials.rst
doc/en/yacs.rst [new file with mode: 0644]
doc/files/yacs_01.xml [new file with mode: 0644]
doc/fr/divers.rst
doc/fr/gui_create_boundary.rst
doc/fr/index.rst
doc/fr/intro.rst
doc/fr/regles.rst
doc/fr/yacs.rst [new file with mode: 0644]

index fe90bcf5966189139d1bfe0ff4817c771615a641..463aa6c1d9f98543165a9f38c51592a8699f4a29 100644 (file)
@@ -1,7 +1,8 @@
-.. _gui_divers:
+.. _divers:
 
 Miscellaneous
 #############
+
 References
 **********
 .. index:: single: reference
@@ -73,7 +74,58 @@ SALOME RELEASE 7.2.0 :
      ``iter.Compute(option)`` becomes ``iter.Compute(option1, option2)``
    - A serie of iterations that is stored in a directory can be followed (see :ref:`gui_create_case`)
 
+SALOME VERSION 7.2.1 :
+   - English documentation
+
+Contact
+*******
+.. index:: single: Contact
+
+Gérald NICOLAS, Software Manager
+
+Address:
+EDF R&D, 1, avenue du Général de Gaulle, 92141 CLAMART Cedex, FRANCE
+
+Phone : (33/0) 1.47.65.56.94
+
+Email : Gerald.Nicolas[at]edf.fr
+
+
+Thierry FOUQUET
+
+Address:
+EDF R&D, 1, avenue du Général de Gaulle, 92141 CLAMART Cedex, FRANCE
+
+Phone : (33/0) 1.47.65.41.45
+
+Email : Thierry.Fouquet[at]edf.fr
+
+
+Really miscellaneous
+********************
+
+HOMARD is an acronym for
+ - Outil de
+ - Maillage
+ - Adaptatif par
+ - Raffinement et
+ - Déraffinement
+
+which means:
+ - Tool for
+ - Adaptive
+ - Meshing by
+ - Refinement and
+ - Unrefinement
+
+HOMARD is the french name for lobster.
+Then, our mascot is very nice in `the city of the loabster <http://www.shediac.org.cfm>`_ : |M|
 
+.. |M| image:: ../images/mascotte.gif
+   :align: middle
+   :alt: Mascot
+   :width: 144
+   :height: 94
 
 
 
index ee89f571b73c012b9015d8c1317b7698c231a54a..08aedc6a2e416062e8e25c5a7f640b9c49e02169 100644 (file)
@@ -103,7 +103,6 @@ HOMARD is able to work with 2D or 3D meshes as well, including the following ele
 
 If pyramids are present into the initial mesh, HOMARD stops with an error. However, if no refinement will be in contact with any edge of those pyramids, the "Authorized pyramids" whould be checked. The adaptation will go on and the pyramids will be back as they are into the initial mesh.
 
-
 The pursuit of a case
 *********************
 .. index:: single: pursuit
index fb543a195f56d3af56eff96b4a16179f9362f5da..a238f8ceab55ab9680e11c956b3390de2e2ebb15 100644 (file)
@@ -19,6 +19,7 @@ User's guide
    demarrage_rapide
    gui_usage
    tui_usage
+   yacs
    tutorials
 
 General presentation
index 7f01d476e40a80b3cdafa25a6e8112bd693c57c4..21295fc2ab009f8b23556922ff5fba640d24fd8c 100644 (file)
@@ -5,11 +5,11 @@ Introduction
 
 General presentation
 ********************
-Le logiciel HOMARD est destiné à adapter les maillages dans le cadre des codes de calculs par éléments ou volumes finis. Ce logiciel, réalisé par EDF R&D, procède par raffinement et déraffinement des maillages bidimensionnels ou tridimensionnels. Il est conçu pour être utilisé indépendamment du code de calcul auquel il est couplé.
+The software HOMARD is intended to adapt the meshes within the framework of the computer codes by finite elements or finite volumes. This software, carried out by EDF R&D, proceeds by refinement and unefinement of the two-dimensional or three-dimensional meshes. It is conceived to be used independently of the computer code with which it is coupled.
 
-Raffiner le maillage signifie découper des mailles désignées selon des indications founies par l'utilisateur. Déraffiner le maillage signifie revenir en arrière sur des découpages précédemment réalisés : ainsi, en aucun cas HOMARD ne peut simplifier un maillage existant qui aura été créé trop fin. Le déraffinement prend toute son importance dans les calculs quand la zone d'intérêt se déplace au cours du calcul pour ne plus tenir compte de raffinements précédemment réalisés et qui deviennent inutiles. On en trouvera une illustration au bas de cette page.
+To refine the mesh means to cut out elements indicated according to indications provided by the user. Unrefine the mesh means to reconsider behind cuttings previously carried out: thus, to in no case HOMARD cannot simplify an existing mesh which will have been created too fine. Unrefinement takes all its importance in calculations when the zone of interest moves during calculation: one will not hold any more account of refinements previously carried out and which become useless. One will find of it an illustration with the bottom of this page.
 
-HOMARD sait traiter des maillages en 2 ou 3 dimensions et comportant les mailles suivantes :
+HOMARD can treat meshes into 2 or 3 dimensions and comprising the following elements:
    - mesh-points
    - segments
    - triangles
@@ -18,19 +18,18 @@ HOMARD sait traiter des maillages en 2 ou 3 dimensions et comportant les mailles
    - hexahaedra
    - prisms
 
-Ces mailles peuvent être présentes simultanément. Par exemple, HOMARD saura adapter un maillage comportant des triangles et des quadrangles.
-Les noeuds acceptés sont évidemment les noeuds qui sont les sommets des mailles, ce qui correspond à la description classique « en degré 1 » . Si les éléments sont décrits « en degré 2 », les noeuds complémentaires sont gérés. En revanche, il ne peut pas y asee cohabitation de mailles décrites en degré 1 et d'autres décrites en degré 2. Enfin, HOMARD sait prendre en compte des noeuds isolés, qui n'appartiendraient à aucune définition de mailles : ils ressortiront tels quels du processus d'adaptation.
+These elements can be present simultaneously. For example, HOMARD will be able to adapt a comprising mesh of the triangles and the quadrangles.
+The accepted nodes are obviously the nodes which are the vertices of the elements, which corresponds to a traditional description "in degree 1". If the elements are described "in degree 2", the additional nodes are managed. On the other hand, elements described in degree 1 and others described in degree 2 cannot be inthe same mesh. Lastly, HOMARD can take into account isolated nodes, which would not belong to any definition of elements: they will arise such as they are from the process of adaptation.
 
-Le cas des pyramides est à part. Pour un maillage comportant des hexaèdres ou des prismes, la mise en conformité du maillage issu du raffinement crée des pyramides pour assurer la liaison entre deux régions de niveaux de raffinement différents. Ces pyramides sont gérées comme toutes les mailles de transition et ne sont pas redécoupées par la suite. En revanche, si le maillage initial contient des pyramides, HOMARD ne saura pas l'adapter et émettra un message d'erreur. Dans certains cas particuliers, on pourra néanmoins traiter un tel maillage, comme il est décrit dans la rubrique 'Options avancées' de :ref:`gui_create_case`).
+The case of the pyramids is except for. For a comprising mesh of the hexahedrons or the prisms, the setting in conformity of the mesh resulting from refinement creates pyramids to ensure the connection between two areas of different levels of refinement. These pyramids are managed like all the elements of transition and are no more split thereafter. On the other hand, if the initial mesh contains pyramids, HOMARD will not be able to adapt it and will transmit an error message. In certain typical cases, one will be able nevertheless to treat such a mesh, as it is described in the heading advanced options of the creation of a case.
 
-Plusieurs motivations apparaissent pour adapter un maillage :
+Several motivations appear to adapt a mesh:
 
-  - on veut simplifier la réalisation du maillage d'une géométrie complexe : on part d'un maillage grossier et on confie à un processus automatique la charge de le raffiner.
-  - on veut s'assurer de la convergence de la solution numérique : plutôt que de réaliser à la main des maillages de plus en plus fins, on laisse le logiciel chercher lui-même les endroits où il faudrait affiner le maillage pour augmenter la précision du résultat.
-  - les conditions du calcul changent au cours de son déroulement : les zones qui doivent être maillées finement se déplacent. Si on maille fin partout dès le début, le maillage est trop gros. En adaptant au fur et à mesure, le maillage ne sera fin qu'aux endroits nécessaires : sa taille sera réduite et la qualité de la solution sera bonne.
-
-Dans tous les cas, le principe de l'adaptation de maillage reste le même. Sur le maillage de départ, on réalise le calcul standard. Avec une analyse de la solution numérique obtenue, on estime l'erreur qui a été commise par rapport à la solution réelle. Cette estimation se représente par une valeur d'indicateur d'erreur dans chaque maille du calcul. A partir de là, on applique le principe suivant : les mailles où l'indicateur d'erreur est fort devraient être plus petites et, réciproquement, les mailles où l'indicateur d'erreur est faible pourraient être plus grandes. Avec cette information, on alimente HOMARD qui va modifier le maillage en conséquence. Sur le nouveau maillage, on recommencera alors le calcul.
+  - one wants to simplify the realization of the mesh of a complex geometry: one starts from a coarse mesh and one entrusts to an automatic process the load to refine it.
+  - one wants to make sure of the convergence of the numerical solution: rather than to realize with the hand of the increasingly fine meshs, one lets the software seek itself the places where it would be necessary to refine the mesh to increase the precision of the result.
+  - the conditions of calculation change during time: the zones which must be with a mesh finely move. If the mesh is fine everywhere as of the beginning, the mesh is too large. While adapting progressively, the mesh will be fine only at the places necessary: its size will be reduced and the quality of the solution will be good.
 
+In all the cases, the principle of the adaptation of mesh remains the same one. On the starting mesh, one carries out standard calculation. With an analysis of the numerical solution obtained, one estimates the error which was made compared to the real solution. This estimate is represented by a value of indicator of error in each element of calculation. From there, the following principle is applied: the elements where the indicator of error is strong should be smaller and, reciprocally, the elements where the indicator of error is low could be larger. With this information, one feeds HOMARD which will modify the mesh consequently. On the new mesh, calculation then will be started again.
 
 Broadly speaking, an iteration for meshing adaptation is as shown on the figure below. The finite element software calculates the numerical solution on meshing Mk, then, from that, deduces the values for the error indicator over the whole meshing. Based on the knowledge of meshing #k and indicator #k, HOMARD generates a new meshing #k+1.
 
@@ -45,16 +44,21 @@ The complete chain starts from the initial meshing, then incorporates successive
 Some variations may exist. If no error indicator is available, another filed can be used to drive the adaptation. A stress field in mechanics can be used: the refinement of the elements where the stress is high is often efficient to improve the quality of the results. It is also possible to drive the adaptation according the variation of a filed from one element to its neighbours. The refinement can be filtered by zones or groups of elements.
 
 .. note::
-  For a extensive description of HOMARD, see :download:`Description générale de HOMARD <../files/HOMARD_0.pdf>`.
+  For a extensive description of HOMARD, see :download:`Description of HOMARD <../files/HOMARD_0.pdf>`.
 
 .. note::
   To quote HOMARD, please refer to:
 
   G. Nicolas and T. Fouquet, Adaptive Mesh Refinement for Conformal Hexahedral Meshes, "*Finite Elements in Analysis and Design*", Vol. 67, pp. 1-12, 2013, doi:10.1016/j.finel.2012.11.008
 
-
   `Available here <http://dx.doi.org/10.1016/j.finel.2012.11.008>`_
 
+.. index:: single: yacs
+
+.. note::
+  This alternation (computation/adaptation) suits in the :ref:`yacs` schemes.
+
+
 Methods for splitting the elements
 **********************************
 .. index:: single: splitting
@@ -169,7 +173,7 @@ For a tetrahedron with two split edges, this is possible only if the edges are o
 
 For a tetrahedron with one split edge, the middle of the split edge is joined to the opposite apex, and two tetrahedrons are created.
 
-.. image:: ../images/dec_tetr_6.gif
+.. image:: ../images/dec_tetr_7.gif
    :align: center
    :alt: Découpage de conformité d'un tétraèdre - 3
    :width: 116
index 129ad11226b35a70ff5b9db596129e268fb55261..d4b5abd9155c372a79cb47ad6a95f0ac899be66d 100644 (file)
@@ -37,14 +37,17 @@ A case of fluid mechanics is to be modeled here, where a flow enters then exits
 
 If the element needs to be split around the inlet area, new nodes are generated. The problem here is to find out to which category a new node located between a wall node or an inlet node belongs to. If -- left-hand side case -- the wall gets priority, everything is fine. Conversely, if -- right-hand side case -- it is the inlet that gets priority, there is a problem: this results in artificially expanding the inlet, therefore distorting the calculation!
 
-.. image:: ../images/cl_2.gif
-   :align: left
+
+|cl_2| Wall ------------------------------ Inlet |cl_3|
+
+.. |cl_2| image:: ../images/cl_2.gif
+   :align: middle
    :width: 244
    :height: 129
 
 
-.. image:: ../images/cl_3.gif
-   :align: right
+.. |cl_3| image:: ../images/cl_3.gif
+   :align: middle
    :width: 244
    :height: 128
 
index 1400b5bdf9a2623a2c629d58e8a65f358c1a9d75..93e4f9e586285faa199f5214164009c5a080dded 100644 (file)
@@ -3,14 +3,14 @@ Examples
 .. index:: single: example
 .. index:: single: python
 
-On trouvera ici les instructions python pour quelques configurations caractéristiques. Les fichiers de données associés sont téléchargeables. Il faut penser à adapter la valeur de la variable ``data_dir`` : c'est le répertoire dans lequel les fichiers med auront été enregistrés.
-C'est dans le répertoire ``dircase`` que seront écrits les fichiers résultant des adaptations successives. Ce répertoire est créé par défaut dans ``/tmp``.
+One will find here the instructions python for some characteristic configurations. The associated data files are downloadable. It is necessary to think of adapting the value of the variable ``data_dir``: it is the directory in which the files med will have been recorded.
+It is in the directory ``dircase`` that the files will be written resulting from the successive adaptations. This directory is created by default in ``/tmp``.
 
 Loading of the module HOMARD
 ****************************
 .. index:: single: yacs
 
-Le chargement du module HOMARD se fait de manière analogue aux autres modules.
+The loading of the module HOMARD is done in a way similar to the other modules.
 
  ::
 
@@ -18,7 +18,7 @@ Le chargement du module HOMARD se fait de mani
   homard = salome.lcc.FindOrLoadComponent('FactoryServer','HOMARD')
   homard.SetCurrentStudy(salome.myStudy)
 
-Pour utiliser le module HOMARD au sein d'un schéma YACS distribué, le chargement se fait ainsi :
+To use the module HOMARD within a distributed scheme YACS, the loading is made as follows:
 
  ::
 
@@ -31,9 +31,10 @@ Uniform refinement
 ******************
 .. index:: single: refinement;uniform
 
-On fera ici trois raffinements uniformes successifs du maillage contenu dans le fichier ``tutorial_1.00.med``. Quelques remarques :
-  * la même hypothèse est utilisée à chaque itération
-  * le maillage produit porte toujours le même nom. Cela ne pose pas de problème car il est stocké dans des fichiers différents.
+One will make here three successive uniform refinements of the mesh contained in the file ``tutorial_1.00.med``. Some notes:
+  * the same hypothesis is used with each iteration
+  * the produced mesh always bears the same name. That does not pose a problem because it is stored in different files.
+
 
 .. literalinclude:: ../files/tutorial_1.py
    :lines: 53-86
@@ -41,15 +42,15 @@ On fera ici trois raffinements uniformes successifs du maillage contenu dans le
 .. note::
   Download the files
 
-  * :download:`maillage initial<../files/tutorial_1.00.med.gz>`
-  * :download:`commandes python<../files/tutorial_1.py>`
+  * :download:`initial mesh<../files/tutorial_1.00.med.gz>`
+  * :download:`python script<../files/tutorial_1.py>`
 
 
 Refinement by zones
 *******************
 .. index:: single: zone
 
-On procède ici au raffinement selon des zones. Pour passer du maillage initial au maillage 'M_1', on utilise une boîte encadrant le plan z=1 et une sphère centrée sur l'origine de rayon 1.05. Puis pour passer du maillage 'M_1' au maillage 'M_2', on remplace la sphère par une boîte encadrant le cube de côté 0.5, pointant sur l'origine. On notera que le type de raffinement n'a pas été précisé ; par défaut, il sera donc conforme.
+One proceeds here to refinement according to zones. To pass from the initial mesh to the mesh 'M_1', one uses a box framing the z=1 plane and a sphere centered on the origin with radius 1.05. Then to pass from the mesh 'M_1' to the mesh 'M_2', one replaces the sphere by a box framing the cube on side 0.5, pointing on the origin. It will be noted that the type of refinement was not specified; by default, it will be thus in conformity.
 
 .. literalinclude:: ../files/tutorial_2.py
    :lines: 53-98
@@ -57,16 +58,16 @@ On proc
 .. note::
   Download the files
 
-  * :download:`maillage initial<../files/tutorial_2.00.med.gz>`
-  * :download:`commandes python<../files/tutorial_2.py>`
+  * :download:`initial mesh<../files/tutorial_2.00.med.gz>`
+  * :download:`python script<../files/tutorial_2.py>`
 
 
 Refinement driven by a field
 ****************************
 .. index:: single: field
 
-On procède ici au raffinement selon un champ. Les hypothèses servent à définir le nom du champ et les seuils de raffinement/déraffinement. La donnée du fichier et des instants est faite dans l'itération. Des champs sur les noeuds ou sur les mailles sont interpolés.
-Pour adapter le maillage H_1 issu de l'itération Iter_1, deux variantes sont appliquées. Dans la première, Iter_2, le champ est un champ scalaire d'indicateurs d'erreur et on découpe les 1.5% de mailles où l'erreur est la plus grande. Dans la seconde variante, Iter_2_bis, on se base sur un champ vectoriel et on examine le saut de ce vecteur entre une maille et ses voisines : on découpera là où la norme infinie de ce saut est supérieure au seuil absolu de 0.0001.
+One proceeds here to refinement according to a field. The hypotheses are used to define the name of the field and the thresholds of refinement/unefinement. The input of the file and the instants is made in the iteration. Fields on the nodes or the elements are interpolated.
+To adapt the H_1 mesh resulting from the Iter_1 iteration, two alternatives are applied. In the first, Iter_2, the field is a scalar field of indicators of error and one cuts out the 1.5% of elements where the error is largest. In the second alternative, Iter_2_bis, one is based on a vector field and one examines the jump of this vector between an element and its neighbors: one will cut out where the infinite standard of this jump is higher than the absolute threshold of 0.0001.
 
 .. literalinclude:: ../files/tutorial_3.py
    :lines: 53-128
@@ -74,9 +75,9 @@ Pour adapter le maillage H_1 issu de l'it
 .. note::
   Download the files
 
-  * :download:`maillage et champ étape 0<../files/tutorial_3.00.med.gz>`
-  * :download:`maillage et champ étape 1<../files/tutorial_3.01.med.gz>`
-  * :download:`commandes python<../files/tutorial_3.py>`
+  * :download:`mesh and field stage 0<../files/tutorial_3.00.med.gz>`
+  * :download:`mesh and field stage 1<../files/tutorial_3.01.med.gz>`
+  * :download:`python script<../files/tutorial_3.py>`
 
 
 Non plane boundaries
@@ -84,8 +85,8 @@ Non plane boundaries
 .. index:: single: field
 .. index:: single: yacs
 
-On teste ici le suivi des frontières courbes : des frontières analytiques pour décrire les différentes surfaces des tuyaux et une frontière discrète pour décrire les lignes d'intersection des deux tuyaux. Le pilotage du raffinement est le suivant : raffinement uniforme de toutes les mailles contenues dans des groupes désignés. On commence par raffiner les faces internes aux tuyaux ; ensuite, on raffine deux fois de suite les faces externes aux tuyaux.
-Le schéma YACS réalisant cette adaptation est téléchargeable.
+One tests the follow-up of the curved borders here: analytical borders to describe various surfaces of the pipes and a discrete border to describe the intersecting lines of the two pipes. The driving of refinement is the following: uniform refinement of all the elements contained in indicated groups. One starts by refining the inner faces with the pipes; then, one refines continuation twice the external faces with the pipes.
+Scheme YACS carrying out this adaptation is downloadable.
 
 .. literalinclude:: ../files/tutorial_4.py
    :lines: 53-112
@@ -93,18 +94,18 @@ Le sch
 .. note::
   Download the files
 
-  * :download:`maillage initial<../files/tutorial_4.00.med.gz>`
-  * :download:`maillage de la frontière discrète<../files/tutorial_4.fr.med.gz>`
-  * :download:`commandes python<../files/tutorial_4.py>`
-  * :download:`schéma YACS<../files/tutorial_4.xml>`
+  * :download:`initial mesh<../files/tutorial_4.00.med.gz>`
+  * :download:`mesh of the discrete boundary<../files/tutorial_4.fr.med.gz>`
+  * :download:`python script<../files/tutorial_4.py>`
+  * :download:`YACS scheme<../files/tutorial_4.xml>`
 
 
 Specific instructions for a 2D mesh
 ***********************************
 .. index:: single: 2D
 
-Les instructions pour adapter un maillage 2D sont exactement identiques à celles nécessaires à l'adaptation d'un maillage 3D. La seule exception concerne le raffinement selon des zones géométriques : des fonctions différentes sont utilisées pour pouvoir définir des zones 2D. On donne alors les coordonnées 2D des zones, en précisant l'orientation du plan du maillage.
-Dans le cas présenté ici, on raffine une première fois toutes les mailles contenues dans un disque percé, puis dans une seconde itération, toutes les mailles contenues dans un rectangle. On notera l'utilisation du suivi des frontières circulaires du domaine.
+The instructions to adapt a 2D mesh are exactly identical to those necessary to the adaptation of a 3D mesh. The only exception relates to refinement according to geometrical zones: different functions are used to be able to define 2D zones. One gives the 2D coordinates zones, by specifying the orientation of the plane of the mesh.
+In the case presented here, one for the first time refines all the elements contained in a bored disk, then in one second iteration, all the elements contained in a rectangle. One will note the use of the follow-up of the circular borders of the field.
 
 .. literalinclude:: ../files/tutorial_5.py
    :lines: 53-98
@@ -112,9 +113,9 @@ Dans le cas pr
 .. note::
   Download the files
 
-  * :download:`maillage initial<../files/tutorial_5.00.med.gz>`
-  * :download:`maillage de la frontière discrète<../files/tutorial_5.fr.med.gz>`
-  * :download:`commandes python<../files/tutorial_5.py>`
+  * :download:`initial mesh<../files/tutorial_5.00.med.gz>`
+  * :download:`mesh of the discrete boundary<../files/tutorial_5.fr.med.gz>`
+  * :download:`python script<../files/tutorial_5.py>`
 
 
 .. toctree::
diff --git a/doc/en/yacs.rst b/doc/en/yacs.rst
new file mode 100644 (file)
index 0000000..eaaad7e
--- /dev/null
@@ -0,0 +1,295 @@
+.. _yacs:
+
+YACS
+####
+.. index:: single: yacs
+
+Introduction
+************
+
+Using a YACS scheme allows the coupling between a computation and an adaptation as described into :ref:`intro`. This coupling can be repeated inside a loop as long as a criteria for the convergence is reached for instance. Many ways are available to program a YACS scheme. The solution that is shown here is correct but many others are too!
+
+Here is the description of a scheme for a computation in which a value is to be stabilized. The computation starts over an initial mesh, then HOMARD makes an adaptation. A new computation is done over this new mesh and its result is analyzed. Depending on this analysis, the coupling goes on or does not. The general look of the scheme is this one:
+
+.. image:: ../images/yacs_01.png
+   :align: center
+   :alt: yacs - allure générale
+   :width: 535
+   :height: 362
+
+.. note::
+  Among all the treated data, certain are unchanging: the name of the directory of calculation, the name of the case, the name of the hypothesis of adaptation, etc. It was chosen to impose them 'hard' in the various parameters of service or within the scripts python. We could also define them a priori in a node PresetNode and then pass on them by links. We did not hold this solution because it increases strongly the number of parameters and links attached to every node. It is very penalizing for the legibility of the scheme. The only data which are going to circulate are the ones been imperative by the description of the service and those that evolve during the execution of the scheme.
+
+The boxes
+*********
+
+The main boxes are:
+
+- DataInit : initialisation of the initial mesh
+- Etude_Initialisation : launching of the module HOMARD inside SALOME
+- Tant_que_le_calcul_n_a_pas_converge : gestion of the loop computation/adaptation
+- Bilan : final information
+
+DataInit
+========
+.. image:: ../images/yacs_a_01.png
+   :align: left
+   :alt: DataInit
+   :width: 158
+   :height: 61
+
+This box is type PresetNode's elementary node. Its only function is to initialize the variable MeshFile that contains the name of the file of the initial mesh.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 70-74
+
+Etude_Initialisation
+====================
+The box Etude_Initialisation launches the component HOMARD inside SALOME. It is a block consisted of two parts, that are invariable whatever is the envisaged application:
+
+- StudyCreation : python node
+- SetCurrentStudy : service of the component HOMARD
+
+.. image:: ../images/yacs_b_01.png
+   :align: left
+   :alt: Etude_Initialisation
+   :width: 323
+   :height: 97
+
+The python node StudyCreation initialize the SALOME study that is given through the output:
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 39-57
+
+The service SetCurrentStudy connects this study to an instance of HOMARD.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 58-63
+
+
+Tant_que_le_calcul_n_a_pas_converge
+===================================
+The box Tant_que_le_calcul_n_a_pas_converge is type WhileLoop. The condition is initialized in 1: the internal block Alternance_Calcul_HOMARD is executed. Within this block, we calculate and we adapt the mesh; when the process has to stop either as a result of error, or by convergence, the condition passes in 0. The loop ends and we pass in the following box, Bilan.
+
+.. image:: ../images/yacs_c_01.png
+   :align: left
+   :alt: Boucle
+   :width: 195
+   :height: 142
+
+Bilan
+=====
+.. image:: ../images/yacs_d_01.png
+   :align: left
+   :alt: Bilan
+   :width: 158
+   :height: 63
+
+This box is a node python that takes in input a character string, MessInfo. If everything passed well, this message is empty. A window QT appears to confirm the convergence. If there was a problem, the message contains messages emitted during the calculations. The window QT shows this message.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 424-437
+
+
+Loop for the calculations
+*************************
+.. image:: ../images/yacs_c_02.png
+   :align: left
+   :alt: Boucle
+   :width: 323
+   :height: 158
+
+This box is a block that manages the computation, the adaptation and the analysis.
+
+Calcul
+======
+.. image:: ../images/yacs_c_03.png
+   :align: left
+   :alt: Calcul
+   :width: 155
+   :height: 87
+
+This box is a node python that is going to drive the calculation. In input, we find the number of the calculation (0 at first) and the name of the file which contains the mesh on which to calculate. In output, we find an integer which represents the error on this calculation (0 so everything goes well) and a dictionary python gathering the results of the calculation. The body of the node is established by the launch of a script python that activates the calculation.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 155-182
+
+In this example, we must define:
+
+- rep_calc : the directory in which will be executed the calculation.
+- rep_script : the directory in which is the python that will launch the calculation. This directory is to be added to the PATH. From this directory, we shall import LanceCas from the file LanceCas.py
+
+The python LanceCas is programmed as the user wishes it so that the calculation can be made on the current mesh. According to the mode of launch of the code of calculation, we can need other information, as the number of the calculation or the directory of the calculation for example. The freedom is total. In our case, the arguments of input are the name of the file of mesh, the number of the calculation and the directory of calculation. They are given in a list python: ["--rep_calc=rep_calc", "--numero=numCalc", "--mesh_file=MeshFile"]
+].
+
+On the other hand the output of the script has to obey the following rule. We get back a code of error, an error message and a dictionary. This dictionary contains necessarily the following keys:
+
+- "FileName" : the name of the file that contains the results of the calculation
+- "MeshName" : the name of the used mesh
+- "V00" : the value the convergence of which we want to test
+
+Adaptation
+==========
+.. image:: ../images/yacs_c_04.png
+   :align: left
+   :alt: Adaptation
+   :width: 672
+   :height: 569
+
+The box Adaptation is a Switch node driven by the code of error of the previous calculation. If this code is nil, YACS will activate the box Adaptation_HOMARD that will launch the adaptation. If the code is not nil, we pass directly in the box Arret_boucle.
+
+Adaptation_HOMARD
+-----------------
+The first task tries to execute concern the initialization of the data necessary for HOMARD in the box HOMARD_Initialisation. This box is a switch node driven by the number of the calculation. In the starting up, the number is nil and YACS activates the box Homard_init_au_debut.
+
+Homard_init_au_debut
+^^^^^^^^^^^^^^^^^^^^
+.. image:: ../images/yacs_c_06.png
+   :align: left
+   :alt: Homard_init_au_debut
+   :width: 481
+   :height: 150
+
+This box begins by creating the case HOMARD by calling the CreateCase service.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 220-227
+
+The name of the case CaseName is imposed on "Calculation". The parameters of input MeshName and FileName arises from the output of the previous calculation. The parameter of output is an instance of case.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 461-464
+
+The options of this case must be now given. It is made by the node python CaseOptions. It is imperative to give the directory of calculation. We shall look at the description of the functions in:ref: ' tui_create_case '. In output, we get back the instance of the iteration corresponding to the initial state of the case.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 228-242
+
+Finally, a hypothesis is created by calling the CreateHypothèse service. The parameter of output is an instance of hypothese.
+
+Homard_Exec
+^^^^^^^^^^^
+Once initialized, the adaptation can be calculated. It is the goal of the Homard_Exec box, in the form of a script python.
+
+.. image:: ../images/yacs_c_09.png
+   :align: left
+   :alt: Homard_Exec
+   :width: 153
+   :height: 141
+
+The directory of calculation is recovered.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 258-263
+
+../..
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 339-347
+
+The hypothesis transmitted in input parameter characterized (look :ref:`tui_create_hypothese`) :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 267-291
+
+It is necessary to establish a name for the future iteration. To make sure that the name was never used, one installs a mechanism of incremental naming starting from the name of the initial iteration. As this initial name is the name of the initial mesh, one obtains a succession of names in the form: M_001, M_002, M_003, etc
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 293-303
+
+The iteration is supplemented : hypothesis, future mesh, field (look :ref:`tui_create_iteration`) :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 305-325
+
+The iteration is calculated. If it were correct, variable OK equals 1: one will be able to continue the execution of the scheme. If there were a problem, variable OK equals 0 to mean that calculation must stop; an error message then is given.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 327-338
+
+After this execution, the process leaves the Adaptation_HOMARD node, then Adaptation node. One arrives then at the node of analysis.
+
+Homard_init_ensuite
+^^^^^^^^^^^^^^^^^^^
+.. image:: ../images/yacs_c_07.png
+   :align: left
+   :alt: Homard_init_ensuite
+   :width: 323
+   :height: 97
+
+For the following passing in the block of adaptation, it is necessary to recover:
+
+- the last created iteration: service LastIteration (look :ref:`tui_create_iteration`)
+- the created hypothesis: service GetHypothesis (look :ref:`tui_create_hypothese`)
+
+One passes then in the Homard_Exec node to calculate the new mesh.
+
+Arret_boucle
+------------
+.. image:: ../images/yacs_c_08.png
+   :align: left
+   :alt: Arret_boucle
+   :width: 163
+   :height: 152
+
+The Arret_boucle block is present to only make forward variables because the input parameters of the nodes must always be filled. It is a very simple python:
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 185-196
+
+Analyse
+=======
+.. image:: ../images/yacs_c_05.png
+   :align: left
+   :alt: Analyse
+   :width: 155
+   :height: 169
+
+The Analyse block is a script python which ensures the complete control of the process by examining the causes of possible error successively.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 77-90
+
+../..
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 145-154
+
+One starts by analyzing the return of the computer code:
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 92-97
+
+Checking of the presence of the name of the mesh in the dictionary of the results:
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 99-106
+
+Checking of the presence of the name of the result file in the dictionary of the results:
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 108-115
+
+Checking of convergence. That supposes that the value to be tested is present in the dictionary under the key 'V00'. Here, one set up a test on the variation of the value of one calculation at the other. With the first passage, nothing is tested. In the following passing, one tests if the relative variation is lower than 1 thousandths. One could have set up an absolute test if one had recovered a total level of error for example.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 117-135
+
+Lastly, it is checked that a maximum nomber of adaptations is not exceeded:
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 137-142
+
+
+Use this scheme
+***************
+To reproduce this example, here it :download:`scheme to be downloaded <../files/yacs_01.xml>`. It should be adapted to simulation considered. In particular, it is necessary:
+
+- to adjust the names of the files and the directories
+- to provide a script of launching of calculation respecting the instructions evoked herebefore
+- to choose the hypothesis of driving of the adaptation
+- to set up the test of stop
+
+
+
+
diff --git a/doc/files/yacs_01.xml b/doc/files/yacs_01.xml
new file mode 100644 (file)
index 0000000..8ae0e2d
--- /dev/null
@@ -0,0 +1,524 @@
+<?xml version='1.0' encoding='iso-8859-1' ?>
+<proc name="HOMARD">
+   <property name="DefaultStudyID" value="1"/>
+   <objref name="CALCIUM_real" id="IDL:Ports/Calcium_Ports/Calcium_Real_Port:1.0"/>
+   <type name="string" kind="string"/>
+   <struct name="Engines/dataref">
+      <member name="ref" type="string"/>
+   </struct>
+   <objref name="GEOM_Object" id="IDL:GEOM/GEOM_Object:1.0"/>
+   <objref name="HOMARD_Cas" id="IDL:HOMARD/HOMARD_Cas:1.0"/>
+   <objref name="HOMARD_Hypothesis" id="IDL:HOMARD/HOMARD_Hypothesis:1.0"/>
+   <objref name="HOMARD_Iteration" id="IDL:HOMARD/HOMARD_Iteration:1.0"/>
+   <objref name="Study" id="IDL:SALOMEDS/Study:1.0"/>
+   <type name="bool" kind="bool"/>
+   <sequence name="boolvec" content="bool"/>
+   <type name="double" kind="double"/>
+   <sequence name="dblevec" content="double"/>
+   <objref name="file" id="file"/>
+   <type name="int" kind="int"/>
+   <sequence name="intvec" content="int"/>
+   <struct name="stringpair">
+      <member name="name" type="string"/>
+      <member name="value" type="string"/>
+   </struct>
+   <sequence name="propvec" content="stringpair"/>
+   <objref name="pyobj" id="python:obj:1.0"/>
+   <sequence name="seqboolvec" content="boolvec"/>
+   <sequence name="seqdblevec" content="dblevec"/>
+   <sequence name="seqint" content="int"/>
+   <sequence name="seqintvec" content="intvec"/>
+   <sequence name="seqstring" content="string"/>
+   <sequence name="stringvec" content="string"/>
+   <sequence name="seqstringvec" content="stringvec"/>
+   <container name="DefaultContainer">
+      <property name="container_name" value="FactoryServer"/>
+      <property name="name" value="localhost"/>
+   </container>
+   <bloc name="Etude_Initialisation">
+      <inline name="StudyCreation">
+         <script><code><![CDATA[
+import orbmodule
+import SALOMEDS_idl
+
+import HOMARD
+import HOMARD_Gen_idl
+import HOMARD_Cas_idl
+import HOMARD_Iteration_idl
+import HOMARD_Hypothesis_idl
+import HOMARD_Zone_idl
+import HOMARD_Boundary_idl
+
+clt = orbmodule.client()
+StudyManager = clt.Resolve("/myStudyManager")
+NewStudy = StudyManager.NewStudy("my_homard_study")
+]]></code></script>
+         <outport name="NewStudy" type="Study"/>
+      </inline>
+      <service name="SetCurrentStudy">
+         <component>HOMARD</component>
+         <load container="DefaultContainer"/>
+         <method>SetCurrentStudy</method>
+         <inport name="theStudy" type="Study"/>
+      </service>
+      <control> <fromnode>StudyCreation</fromnode> <tonode>SetCurrentStudy</tonode> </control>
+      <datalink control="false">
+         <fromnode>StudyCreation</fromnode> <fromport>NewStudy</fromport>
+         <tonode>SetCurrentStudy</tonode> <toport>theStudy</toport>
+      </datalink>
+   </bloc>
+   <datanode name="DataInit">
+      <parameter name="MeshFile" type="string">
+         <value><string>/scratch/D68518/HOMARD_SVN/trunk/training/tet_aster_ther/maill.00.med</string></value>
+      </parameter>
+   </datanode>
+   <while name="Tant_que_le_calcul_n_a_pas_converge">
+      <bloc name="Alternance_Calcul_HOMARD">
+         <inline name="Analyse">
+            <script><code><![CDATA[
+global NumCalc
+global resu1
+# Valeurs par defaut
+NumCalcP1 = NumCalc + 1
+MeshName = " "
+FileName = " "
+#
+NbCalcMax = 50
+#
+MessInfo = None
+Error = 0
+while not Error :
+#
+# Si le calcul a fini en erreur, on arrete :
+#
+    if ErrCalc :
+        MessInfo = "Erreur de calcul numero %d" % ErrCalc
+        Error = abs(ErrCalc)
+        break
+#
+# Si le maillage n'a pas ete defini, on arrete :
+#
+    if dico_resu.has_key("MeshName") :
+        MeshName = dico_resu["MeshName"]
+    else :
+        MessInfo = "Le maillage n'a pas ete defini"
+        Error = -2
+        break
+#
+# Si le fichier n'a pas ete defini, on arrete :
+#
+    if dico_resu.has_key("FileName") :
+        FileName = dico_resu["FileName"]
+    else :
+        MessInfo = "Le fichier du maillage n'a pas ete defini"
+        Error = -3
+        break
+#
+# Si le critere est respecte, on arrete :
+#
+    if dico_resu.has_key("V00") :
+        valeur_v = dico_resu["V00"]
+        if NumCalc == 0 :
+            resu1 = [valeur_v]
+        else :
+            resu1.append(valeur_v)
+        if NumCalc > 2 :
+            solu_m1 = resu1[-2]
+            rap = ( resu1[-1] - solu_m1 ) / solu_m1
+            if abs(rap) < 0.001 :
+                MessInfo = ""
+                Error = -9999
+                break
+    else :
+        MessInfo = "La valeur a tester n'a pas ete fournie"
+        Error = -4
+        break
+#
+# Si on depasse le maximum, on arrete :
+#
+    if NumCalc > NbCalcMax :
+        MessInfo = "La limite en nombre de calculs a ete atteinte : %d" % NbCalcMax
+        Error = -1
+        break
+#
+    break
+]]></code></script>
+            <inport name="NumCalc" type="int"/>
+            <inport name="ErrCalc" type="int"/>
+            <inport name="dico_resu" type="pyobj"/>
+            <outport name="Error" type="int"/>
+            <outport name="NumCalcP1" type="int"/>
+            <outport name="MeshName" type="string"/>
+            <outport name="FileName" type="string"/>
+            <outport name="MessInfo" type="string"/>
+         </inline>
+         <inline name="Calcul">
+            <script><code><![CDATA[
+import sys
+import os
+# REPBASE : le repertoire de base de l'application
+REPBASE = os.environ["HOMARD_TRAINING"]
+rep_calc = os.path.join(REPBASE, "tet_aster_ther")
+rep_script = os.path.join(REPBASE, "script")
+sys.path.append(rep_script)
+from LanceCas import LanceCas
+#
+argu  = ["-v"]
+argu.append("--rep_calc=" + rep_calc)
+argu.append("--numero=%d" % numCalc)
+argu.append("--mesh_file="  + MeshFile)
+#
+LanceCas_A = LanceCas(argu)
+#
+Error, message_erreur, dico_resu = LanceCas_A.calcul ()
+#
+dico_resu["rep_calc"] = rep_calc
+#
+]]></code></script>
+            <inport name="numCalc" type="int"/>
+            <inport name="MeshFile" type="string"/>
+            <outport name="Error" type="int"/>
+            <outport name="dico_resu" type="pyobj"/>
+         </inline>
+         <switch name="Adaptation" select="0">
+            <default>
+               <bloc name="Arret_boucle">
+                  <inline name="Arret">
+                     <script><code><![CDATA[
+OK = 0
+MeshFile = " "
+]]></code></script>
+                     <inport name="MessInfo" type="string"/>
+                     <outport name="OK" type="bool"/>
+                     <outport name="MeshFile" type="string"/>
+                     <outport name="MessInfo" type="string"/>
+                  </inline>
+               </bloc>
+            </default>
+            <case id="0">
+               <bloc name="Adaptation_HOMARD">
+                  <switch name="HOMARD_Initialisation" select="0">
+                     <default>
+                        <bloc name="HOMARD_Init_ensuite">
+                           <service name="LastIteration">
+                              <node>Etude_Initialisation.SetCurrentStudy</node>
+                              <method>LastIteration</method>
+                              <inport name="CaseName" type="string"/>
+                              <outport name="return" type="HOMARD_Iteration"/>
+                           </service>
+                           <service name="GetHypothesis">
+                              <node>Etude_Initialisation.SetCurrentStudy</node>
+                              <method>GetHypothesis</method>
+                              <inport name="HypoName" type="string"/>
+                              <outport name="return" type="HOMARD_Hypothesis"/>
+                           </service>
+                           <control> <fromnode>LastIteration</fromnode> <tonode>GetHypothesis</tonode> </control>
+                        </bloc>
+                     </default>
+                     <case id="1">
+                        <bloc name="HOMARD_Init_au_debut">
+                           <service name="CreateCase">
+                              <node>Etude_Initialisation.SetCurrentStudy</node>
+                              <method>CreateCase</method>
+                              <inport name="CaseName" type="string"/>
+                              <inport name="MeshName" type="string"/>
+                              <inport name="FileName" type="string"/>
+                              <outport name="return" type="HOMARD_Cas"/>
+                           </service>
+                           <inline name="Case_Options">
+                              <script><code><![CDATA[
+import os
+# Repertoire d'execution
+REPBASE = os.environ["HOMARD_TRAINING"]
+DirName = os.path.join(REPBASE, "tet_aster_ther", "resu")
+Case.SetDirName(DirName)
+# Options de conformite
+Case.SetConfType(1)
+# Iteration 0 associee
+Iter0 = Case.GetIter0()
+]]></code></script>
+                              <inport name="Case" type="HOMARD_Cas"/>
+                              <outport name="Iter0" type="HOMARD_Iteration"/>
+                           </inline>
+                           <service name="CreateHypothesis">
+                              <node>Etude_Initialisation.SetCurrentStudy</node>
+                              <method>CreateHypothesis</method>
+                              <inport name="HypoName" type="string"/>
+                              <outport name="return" type="HOMARD_Hypothesis"/>
+                           </service>
+                           <control> <fromnode>CreateCase</fromnode> <tonode>Case_Options</tonode> </control>
+                           <control> <fromnode>Case_Options</fromnode> <tonode>CreateHypothesis</tonode> </control>
+                           <datalink control="false">
+                              <fromnode>CreateCase</fromnode> <fromport>return</fromport>
+                              <tonode>Case_Options</tonode> <toport>Case</toport>
+                           </datalink>
+                        </bloc>
+                     </case>
+                  </switch>
+                  <inline name="HOMARD_Exec">
+                     <script><code><![CDATA[
+import os
+# Repertoire d'execution
+REPBASE = os.environ["HOMARD_TRAINING"]
+DirName = os.path.join(REPBASE, "tet_aster_ther", "resu")
+#
+# Hypothese
+# =========
+# . Nom de l'hypothese
+# --------------------
+HypoName = Hypo.GetName()
+#
+# . Options
+# ---------
+# . Le mode d'adaptation : raffinement selon un champ
+Hypo.SetAdapRefinUnRef(1, 1, 0)
+# . Nom du champ
+Hypo.SetField('ERREUR')
+# . Nom de la composante
+Hypo.AddComp('ERTABS')
+# . Valeurs prises par maille
+Hypo.SetUseComp(0)
+# . Mode de pilotage
+if NumAdapt <= 2 :
+    seuil = 5.
+else :
+    seuil = 3.
+# Type de seuil : 3 : x% des mailles les pires
+Hypo.SetRefinThr(3, seuil)
+#
+# . Taille de maille limite
+aux = 0.0015
+Hypo.SetDiamMin(aux)
+#
+# Nom de la future iteration
+# ==========================
+# . Nom de l'iteration precedente
+LastIterName = LastIter.GetName()
+aux = '%03d' % NumAdapt
+# . A l'iteration 1, on complete
+if  NumAdapt == 1 :
+  IterName = LastIterName + "_" + aux
+# . Ensuite, on substitue
+else :
+  IterName = LastIterName[:-3] + aux
+#
+# Creation de l'iteration
+# =======================
+Iter = LastIter.NextIteration(IterName)
+#
+# Options de l'iteration
+# ======================
+# . Association de l'hypothese
+Iter.AssociateHypo(HypoName)
+#
+# . Le nom du futur maillage
+MeshName = dico_resu["MeshName"]
+Iter.SetMeshName(MeshName)
+#
+# . Le fichier du futur maillage
+aux = '%02d' % NumAdapt
+MeshFile = os.path.join (DirName, "maill."+aux+".med")
+Iter.SetMeshFile(MeshFile)
+#
+# . Le fichier contenant les champs
+FileName = dico_resu["FileName"]
+Iter.SetFieldFile(FileName)
+#
+# Calcul
+# ======
+Error = Iter.Compute(1,1)
+#
+# Arret de la boucle si erreur
+# ============================
+if Error :
+    OK = 0
+    MessInfo = "Erreur dans HOMARD pour l'adaptation numero %d" % NumAdapt
+else :
+    OK = 1
+    MessInfo = " "
+]]></code></script>
+                     <inport name="NumAdapt" type="int"/>
+                     <inport name="LastIter" type="HOMARD_Iteration"/>
+                     <inport name="Hypo" type="HOMARD_Hypothesis"/>
+                     <inport name="dico_resu" type="pyobj"/>
+                     <outport name="OK" type="bool"/>
+                     <outport name="MessInfo" type="string"/>
+                     <outport name="MeshFile" type="string"/>
+                  </inline>
+                  <control> <fromnode>HOMARD_Initialisation</fromnode> <tonode>HOMARD_Exec</tonode> </control>
+                  <datalink control="false">
+                     <fromnode>HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration</fromnode> <fromport>return</fromport>
+                     <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
+                  </datalink>
+                  <datalink control="false">
+                     <fromnode>HOMARD_Initialisation.p1_HOMARD_Init_au_debut.Case_Options</fromnode> <fromport>Iter0</fromport>
+                     <tonode>HOMARD_Exec</tonode> <toport>LastIter</toport>
+                  </datalink>
+                  <datalink control="false">
+                     <fromnode>HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis</fromnode> <fromport>return</fromport>
+                     <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
+                  </datalink>
+                  <datalink control="false">
+                     <fromnode>HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis</fromnode> <fromport>return</fromport>
+                     <tonode>HOMARD_Exec</tonode> <toport>Hypo</toport>
+                  </datalink>
+               </bloc>
+            </case>
+         </switch>
+         <control> <fromnode>Analyse</fromnode> <tonode>Adaptation</tonode> </control>
+         <control> <fromnode>Calcul</fromnode> <tonode>Analyse</tonode> </control>
+         <datalink control="false">
+            <fromnode>Analyse</fromnode> <fromport>Error</fromport>
+            <tonode>Adaptation</tonode> <toport>select</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+            <tonode>Calcul</tonode> <toport>numCalc</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode> <toport>select</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Analyse</fromnode> <fromport>NumCalcP1</fromport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>NumAdapt</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Analyse</fromnode> <fromport>MeshName</fromport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode> <toport>MeshName</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Analyse</fromnode> <fromport>FileName</fromport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode> <toport>FileName</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Analyse</fromnode> <fromport>MessInfo</fromport>
+            <tonode>Adaptation.default_Arret_boucle.Arret</tonode> <toport>MessInfo</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Calcul</fromnode> <fromport>Error</fromport>
+            <tonode>Analyse</tonode> <toport>ErrCalc</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
+            <tonode>Analyse</tonode> <toport>dico_resu</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Calcul</fromnode> <fromport>dico_resu</fromport>
+            <tonode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</tonode> <toport>dico_resu</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MeshFile</fromport>
+            <tonode>Calcul</tonode> <toport>MeshFile</toport>
+         </datalink>
+         <datalink control="false">
+            <fromnode>Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MeshFile</fromport>
+            <tonode>Calcul</tonode> <toport>MeshFile</toport>
+         </datalink>
+      </bloc>
+      <datalink control="false">
+         <fromnode>Alternance_Calcul_HOMARD.Analyse</fromnode> <fromport>NumCalcP1</fromport>
+         <tonode>Alternance_Calcul_HOMARD.Analyse</tonode> <toport>NumCalc</toport>
+      </datalink>
+   </while>
+   <inline name="Bilan">
+      <script><code><![CDATA[
+from PyQt4 import QtGui
+import sys
+app = QtGui.QApplication(sys.argv)
+MessageBoxTitle = "Bilan"
+if MessInfo == "" :
+    MessInfo = "Le calcul est converge."
+    QtGui.QMessageBox.information(None, MessageBoxTitle, MessInfo)
+else :
+    QtGui.QMessageBox.critical(None, MessageBoxTitle, MessInfo)
+]]></code></script>
+      <inport name="MessInfo" type="string"/>
+   </inline>
+   <control> <fromnode>Etude_Initialisation</fromnode> <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> </control>
+   <control> <fromnode>DataInit</fromnode> <tonode>Etude_Initialisation</tonode> </control>
+   <control> <fromnode>Tant_que_le_calcul_n_a_pas_converge</fromnode> <tonode>Bilan</tonode> </control>
+   <datalink control="false">
+      <fromnode>DataInit</fromnode> <fromport>MeshFile</fromport>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul</tonode> <toport>MeshFile</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>OK</fromport>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> <toport>condition</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>OK</fromport>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode> <toport>condition</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret</fromnode> <fromport>MessInfo</fromport>
+      <tonode>Bilan</tonode> <toport>MessInfo</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec</fromnode> <fromport>MessInfo</fromport>
+      <tonode>Bilan</tonode> <toport>MessInfo</toport>
+   </datalink>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase</tonode><toport>CaseName</toport>
+      <value><string>Calcul</string></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul</tonode><toport>numCalc</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation</tonode><toport>select</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation</tonode><toport>select</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration</tonode><toport>CaseName</toport>
+      <value><string>Calcul</string></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis</tonode><toport>HypoName</toport>
+      <value><string>Hypo</string></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis</tonode><toport>HypoName</toport>
+      <value><string>Hypo</string></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge</tonode><toport>condition</toport>
+      <value><boolean>true</boolean></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse</tonode><toport>NumCalc</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <parameter>
+      <tonode>Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse</tonode><toport>ErrCalc</toport>
+      <value><int>0</int></value>
+   </parameter>
+   <presentation name="Etude_Initialisation" x="174.906" y="32" width="325" height="99" expanded="1" expx="174.906" expy="32" expWidth="325" expHeight="99" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateCase" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Exec" x="504.042" y="32" width="158" height="144" expanded="1" expx="504.042" expy="32" expWidth="158" expHeight="144" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut" x="5" y="59" width="483.5" height="153" expanded="1" expx="5" expy="59" expWidth="483.5" expHeight="153" shownState="0"/>
+   <presentation name="DataInit" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD" x="10" y="59" width="682.042" height="778" expanded="1" expx="10" expy="59" expWidth="682.042" expHeight="778" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Calcul" x="4" y="32" width="158" height="90" expanded="1" expx="4" expy="32" expWidth="158" expHeight="90" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation" x="4" y="204" width="674.042" height="570" expanded="1" expx="4" expy="204" expWidth="674.042" expHeight="570" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle" x="4" y="59" width="166" height="153" expanded="1" expx="4" expy="59" expWidth="166" expHeight="153" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.default_Arret_boucle.Arret" x="4" y="32" width="158" height="117" expanded="1" expx="4" expy="32" expWidth="158" expHeight="117" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.Case_Options" x="163" y="32" width="158" height="63" expanded="1" expx="163" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD" x="4" y="213" width="666.042" height="353" expanded="1" expx="4" expy="213" expWidth="666.042" expHeight="353" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation" x="5" y="33" width="492.5" height="316" expanded="1" expx="5" expy="33" expWidth="492.5" expHeight="316" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite" x="4" y="213" width="325" height="99" expanded="1" expx="4" expy="213" expWidth="325" expHeight="99" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.LastIteration" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.default_HOMARD_Init_ensuite.GetHypothesis" x="163" y="32" width="158" height="63" expanded="1" expx="163" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_HOMARD_Init_au_debut.CreateHypothesis" x="321.5" y="32" width="158" height="63" expanded="1" expx="321.5" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Bilan" x="535.69" y="36.4207" width="158" height="63" expanded="1" expx="535.69" expy="36.4207" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge" x="4" y="132" width="696.042" height="841" expanded="1" expx="4" expy="132" expWidth="696.042" expHeight="841" shownState="0"/>
+   <presentation name="Etude_Initialisation.StudyCreation" x="4" y="32" width="158" height="63" expanded="1" expx="4" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Etude_Initialisation.SetCurrentStudy" x="163" y="32" width="158" height="63" expanded="1" expx="163" expy="32" expWidth="158" expHeight="63" shownState="0"/>
+   <presentation name="Tant_que_le_calcul_n_a_pas_converge.Alternance_Calcul_HOMARD.Analyse" x="181.788" y="32" width="158" height="171" expanded="1" expx="181.788" expy="32" expWidth="158" expHeight="171" shownState="0"/>
+   <presentation name="__ROOT__" x="0" y="0" width="704.042" height="977" expanded="1" expx="0" expy="0" expWidth="704.042" expHeight="977" shownState="0"/>
+</proc>
index 5bad0d1c717819e102859d47cd1a09377d268d47..47b5e89448bd42f2477d53138ca8ace20b4a31d0 100644 (file)
@@ -74,7 +74,59 @@ SALOME VERSION 7.2.0 :
      ``iter.Compute(option)`` devient ``iter.Compute(option1, option2)``
    - Possibilité de poursuivre une suite d'itérations archivées dans un répertoire (voir :ref:`gui_create_case`)
 
+SALOME VERSION 7.2.1 :
+   - Documentation en anglais
 
+Contact
+*******
+.. index:: single: Contact
+
+Gérald NICOLAS, Responsable du Logiciel
+
+Adresse :
+EDF R&D, 1, avenue du Général de Gaulle, 92141 CLAMART Cedex, FRANCE
+
+Téléphone : (33/0) 1.47.65.56.94
+
+Email : Gerald.Nicolas[at]edf.fr
+
+
+Thierry FOUQUET
+
+Adresse :
+EDF R&D, 1, avenue du Général de Gaulle, 92141 CLAMART Cedex, FRANCE
+
+Téléphone : (33/0) 1.47.65.41.45
+
+Email : Thierry.Fouquet[at]edf.fr
+
+
+Vraiment divers ...
+*******************
+
+HOMARD est un acronyme pour :
+ - Outil de
+ - Maillage
+ - Adaptatif par
+ - Raffinement et
+ - Déraffinement
+
+Notre mascotte était toute trouvée dans `la ville du homard <http://www.shediac.org>`_  : |M|
+
+.. |M| image:: ../images/mascotte.gif
+   :align: middle
+   :alt: Mascotte
+   :width: 144
+   :height: 94
+
+West led the aaaaaaaaa |H| ffffffff |S| ccccccccccccccccc.
+
+.. |H| image:: ../images/mascotte.gif
+   :width: 144
+   :height: 94
+.. |S| image:: ../images/dec_tria_1.gif
+   :width: 399
+   :height: 88
 
 
 
index 5c5cd9d3dc61c5c0d000a35f3cf4628f85bbcad8..0a4cd7aaeca548f6247a0b3d483bd1f569b4c371 100644 (file)
@@ -82,7 +82,7 @@ Il existe trois types de fronti
 
 
 Un cylindre
------------
+===========
 .. index:: single: cylindre
 
 Le cylindre est défini par un point de l'axe, son axe et son rayon. L'axe est défini par un vecteur. La norme de ce vecteur n'est pas nécessairement égale à 1 ; de même, son orientation n'a aucune importance. Un nom de frontière est proposé automatiquement : Boun_1, Boun_2, etc. Ce nom peut être modifié. Il ne doit pas avoir déjà été utilisé pour une autre frontière.
@@ -91,7 +91,7 @@ Le cylindre est d
    :align: center
 
 Une sphère
-----------
+==========
 .. index:: single: sphere
 
 La sphère est définie par son centre et son rayon. Un nom de frontière est proposé automatiquement : Boun_1, Boun_2, etc. Ce nom peut être modifié. Il ne doit pas avoir déjà été utilisé pour une autre frontière.
@@ -102,7 +102,7 @@ La sph
 .. index:: single: arbre d'étude
 
 Un cône
--------
+=======
 .. index:: single: cone
 
 Un cône est défini de deux manières différentes : le centre, l'axe et l'angle d'ouverture en degré ou par deux points centrés sur l'axe et le rayon associé. Un nom de frontière est proposé automatiquement : Boun_1, Boun_2, etc. Ce nom peut être modifié. Il ne doit pas avoir déjà été utilisé pour une autre frontière.
index 79c264dfd2ff232d48202f93a02d67d609bf1bc9..01311fbc94c399e44d2a445751e21879475664f4 100644 (file)
@@ -19,6 +19,7 @@ Mode d'emploi
    demarrage_rapide
    gui_usage
    tui_usage
+   yacs
    tutorials
 
 Présentation générale
index d8bd70ea13df045a03c59c55df5550035fab08fe..ef46d1bdc1833e1c840148b0eccc36711d73be53 100644 (file)
@@ -7,7 +7,7 @@ Pr
 *********************
 Le logiciel HOMARD est destiné à adapter les maillages dans le cadre des codes de calculs par éléments ou volumes finis. Ce logiciel, réalisé par EDF R&D, procède par raffinement et déraffinement des maillages bidimensionnels ou tridimensionnels. Il est conçu pour être utilisé indépendamment du code de calcul auquel il est couplé.
 
-Raffiner le maillage signifie découper des mailles désignées selon des indications founies par l'utilisateur. Déraffiner le maillage signifie revenir en arrière sur des découpages précédemment réalisés : ainsi, en aucun cas HOMARD ne peut simplifier un maillage existant qui aura été créé trop fin. Le déraffinement prend toute son importance dans les calculs quand la zone d'intérêt se déplace au cours du calcul pour ne plus tenir compte de raffinements précédemment réalisés et qui deviennent inutiles. On en trouvera une illustration au bas de cette page.
+Raffiner le maillage signifie découper des mailles désignées selon des indications fournies par l'utilisateur. Déraffiner le maillage signifie revenir en arrière sur des découpages précédemment réalisés : ainsi, en aucun cas HOMARD ne peut simplifier un maillage existant qui aura été créé trop fin. Le déraffinement prend toute son importance dans les calculs quand la zone d'intérêt se déplace au cours du calcul : on ne tiendra plus compte de raffinements précédemment réalisés et qui deviennent inutiles. On en trouvera une illustration au bas de cette page.
 
 HOMARD sait traiter des maillages en 2 ou 3 dimensions et comportant les mailles suivantes :
    - mailles-points
@@ -53,6 +53,10 @@ Des variantes de ce sch
 
   `Accessible en cliquant ici <http://dx.doi.org/10.1016/j.finel.2012.11.008>`_
 
+.. index:: single: yacs
+
+.. note::
+  Cet alternance de calculs et d'adaptions est très appropriée à la mise place de schémas :ref:`yacs`.
 
 Mode de découpage des mailles
 *****************************
@@ -179,7 +183,7 @@ Pour un t
 
 Pour un tétraèdre dont une des arêtes est coupée : on joint le milieu de cette arête découpée au sommet opposé et il y a création de 2 tétraèdres.
 
-.. image:: ../images/dec_tetr_6.gif
+.. image:: ../images/dec_tetr_7.gif
    :align: center
    :alt: Découpage de conformité d'un tétraèdre - 3
    :width: 116
index 5a2704dd7289ba792c10cdde134f0523787cb858..45790970a7beacc0dfdd7d0dc1e70f7a55e086d0 100644 (file)
@@ -36,14 +36,16 @@ On veut mod
 
 S'il s'avère que le maillage a besoin de découpage autour de la zone d'entrée, il va y avoir création de nouveaux noeuds. Tout le problème va consister à savoir à quelle catégorie appartient un nouveau noeud situé entre un noeud de paroi ou un noeud d'entrée. Si, comme sur le schéma de gauche, on privilégie la paroi, tout va bien. En revanche si, comme sur le schéma de droite, on privilégie l'entrée, il y a un problème : cela revient à agrandir artificiellement l'entrée ... et donc à fausser le calcul !
 
-.. image:: ../images/cl_2.gif
-   :align: left
+|cl_2| Paroi ------------------------------ Entrée |cl_3|
+
+.. |cl_2| image:: ../images/cl_2.gif
+   :align: middle
    :width: 244
    :height: 129
 
 
-.. image:: ../images/cl_3.gif
-   :align: right
+.. |cl_3| image:: ../images/cl_3.gif
+   :align: middle
    :width: 244
    :height: 128
 
diff --git a/doc/fr/yacs.rst b/doc/fr/yacs.rst
new file mode 100644 (file)
index 0000000..c639a0a
--- /dev/null
@@ -0,0 +1,293 @@
+.. _yacs:
+
+YACS
+####
+.. index:: single: yacs
+
+Introduction
+************
+
+L'utilisation de schémas YACS va permettre de coupler un calcul et une adaptation comme il est décrit dans :ref:`intro`. Ce couplage peut être répété au sein d'une boucle jusqu'à l'obtention d'un critère de convergence par exemple. Il existe de nombreuses façons de programmer un schéma YACS. La solution proposée ici fonctionne mais on peut très bien faire autrement !
+
+On va décrire ici un schéma s'appliquant à un calcul pour lequel on cherche à stabiliser une valeur. Le calcul démarre sur un maillage initial puis HOMARD enchaîne avec une adaptation. On refait un calcul sur ce nouveau maillage et son résultat est analysé. En fonction de cette analyse, le couplage continue ou non. L'allure générale du schéma est la suivante :
+
+.. image:: ../images/yacs_01.png
+   :align: center
+   :alt: yacs - allure générale
+   :width: 535
+   :height: 362
+
+.. note::
+  Parmi l'ensemble des données manipulées, certaines sont immuables : le nom du répertoire de calcul, le nom du cas, le nom de l'hypothèse d'adaptation, etc. Il a été choisi de les imposer 'en dur' dans les différents paramètres de service ou au sein des scripts python. On pourrait également les définir a priori dans un noeud PresetNode et ensuite les transmettre par des liens. Nous n'avons pas retenu cette solution car elle augmente fortement le nombre de paramètres et de liens attachés à chaque noeud. Cela est très pénalisant pour la lisibilité du schéma. Les seules données qui vont circuler sont celles imposées par la description du service et celles qui évoluent au cours de l'exécution du schéma.
+
+Les boîtes
+**********
+
+Les boîtes principales sont :
+
+- DataInit : initialisation du maillage initial
+- Etude_Initialisation : lancement du module HOMARD dans SALOME
+- Tant_que_le_calcul_n_a_pas_converge : gestion de la boucle d'alternance calcul/adaptation
+- Bilan : affichage final
+
+DataInit
+========
+.. image:: ../images/yacs_a_01.png
+   :align: left
+   :alt: DataInit
+   :width: 158
+   :height: 61
+
+Cette boîte est un noeud élémentaire de type PresetNode. Sa seule fonction est d'initialiser la variable MeshFile qui contient le nom du fichier du maillage initial.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 70-74
+
+Etude_Initialisation
+====================
+La boîte Etude_Initialisation lance le composant HOMARD dans SALOME. C'est un bloc composé de deux parties, qui sont invariables quelle que soit l'application envisagée :
+
+- StudyCreation : noeud python
+- SetCurrentStudy : service du composant HOMARD
+
+.. image:: ../images/yacs_b_01.png
+   :align: left
+   :alt: Etude_Initialisation
+   :width: 323
+   :height: 97
+
+Le noeud python StudyCreation sert à initialiser l'étude SALOME qui est fournie en sortie :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 39-57
+
+Le service SetCurrentStudy affecte cette étude à une instance de HOMARD.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 58-63
+
+
+Tant_que_le_calcul_n_a_pas_converge
+===================================
+La boîte Tant_que_le_calcul_n_a_pas_converge est une boucle de type WhileLoop. La condition est initialisée à 1 : le bloc interne Alternance_Calcul_HOMARD est exécuté. Au sein de ce bloc, on calcule et on adapte le maillage ; quand le processus doit s'arrêter soit par suite d'erreur, soit par convergence, la condition passe à 0. La boucle s'achève et on passe à la boîte suivante, Bilan.
+
+.. image:: ../images/yacs_c_01.png
+   :align: left
+   :alt: Boucle
+   :width: 195
+   :height: 142
+
+Bilan
+=====
+.. image:: ../images/yacs_d_01.png
+   :align: left
+   :alt: Bilan
+   :width: 158
+   :height: 63
+
+Cette boîte est un noeud python qui prend en entrée une chaîne de caractères, MessInfo. Si tout s'est bien passé, ce message est vide. Une fenêtre QT apparaît pour confirmer la convergence. S'il y a eu un problème, le message contient les messages émis au cours des calculs. La fenêtre QT affiche ce message.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 424-437
+
+
+La boucle de calculs
+********************
+.. image:: ../images/yacs_c_02.png
+   :align: left
+   :alt: Boucle
+   :width: 323
+   :height: 158
+
+Cette boîte est un bloc qui gère le calcul, l'adaptation et l'analyse.
+
+Calcul
+======
+.. image:: ../images/yacs_c_03.png
+   :align: left
+   :alt: Calcul
+   :width: 155
+   :height: 87
+
+Cette boîte est un noeud python qui va piloter le calcul. En entrée, on trouve le numéro du calcul (0 au départ) et le nom du fichier qui contient le maillage sur lequel calculer. En sortie, on trouve un entier qui représente l'erreur sur ce calcul (0 si tout va bien) et un dictionnaire python rassemblant les résultats du calcul. Le corps du noeud est constitué par le lancement d'un script python qui active le calcul.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 155-182
+
+Dans cet exemple, il faut définir :
+
+- rep_calc : le répertoire dans lequel sera exécuté le calcul.
+- rep_script : le répertoire dans lequel se trouve le python qui lancera le calcul. Ce répertoire est à ajouter au PATH. Depuis ce répertoire, on importera LanceCas depuis le fichier LanceCas.py
+
+Le python LanceCas est programmé comme l'utilisateur le souhaite pour que le calcul puisse être effectué sur le maillage courant. Selon le mode de lancement du code de calcul, on peut avoir besoin d'autres informations, comme le numéro du calcul ou le répertoire du calcul par exemple. La liberté est totale. Dans notre cas, les arguments d'entrée sont le nom du fichier de maillage, le numéro du calcul et le répertoire de calcul sous la forme de la liste python ["--rep_calc=rep_calc", "--numero=numCalc", "--mesh_file=MeshFile"]
+].
+
+En revanche la sortie du script doit obéir à la règle suivante. On récupère un code d'erreur, un message d'erreur et un dictionnaire. Ce dictionnaire contient obligatoirement les clés suivantes :
+
+- "FileName" : le nom du fichier qui contient les résultats du calcul
+- "MeshName" : le nom du maillage utilisé
+- "V00" : la valeur dont on veut tester la convergence
+
+Adaptation
+==========
+.. image:: ../images/yacs_c_04.png
+   :align: left
+   :alt: Adaptation
+   :width: 672
+   :height: 569
+
+La boîte Adaptation est un noeud Switch piloté par le code d'erreur du calcul précédent. Si ce code est nul, YACS activera la boîte Adaptation_HOMARD qui lancera l'adaptation. Si le code n'est pas nul, on passe directement dans la boîte Arret_boucle.
+
+Adaptation_HOMARD
+-----------------
+La première tâche à exécuter concerne l'initialisation des données nécessaires à HOMARD dans la boîte HOMARD_Initialisation. Cette boîte est un noeud switch piloté par le numéro du calcul. Au démarrage, le numéro est nul et YACS active la boîte Homard_init_au_debut.
+
+Homard_init_au_debut
+^^^^^^^^^^^^^^^^^^^^
+.. image:: ../images/yacs_c_06.png
+   :align: left
+   :alt: Homard_init_au_debut
+   :width: 481
+   :height: 150
+
+Cette boîte commence par créer le cas HOMARD en appelant le service CreateCase.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 220-227
+
+Le nom du cas CaseName est imposé à "Calcul". Les paramètres d'entrée MeshName et FileName sont issus de la sortie du calcul précédent. Le paramètre de sortie est une instance de cas.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 461-464
+
+Les options de ce cas doivent maintenant être renseignées. C'est fait par le noeud python CaseOptions. Il est impératif de renseigner le répertoire de calcul. On regardera la description des fonctions dans :ref:`tui_create_case`. En sortie, on récupère l'instance de l'itération correspondant à l'état initial du cas.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 228-242
+
+Enfin, une hypothèse est créée en appelant le service CreateHypothèse. Le paramètre de sortie est une instance d'hypothèse.
+
+Homard_Exec
+^^^^^^^^^^^
+Une fois initialisée, l'adaptation peut être calculée. C'est le but de la boîte Homard_Exec, sous forme d'un script python.
+
+.. image:: ../images/yacs_c_09.png
+   :align: left
+   :alt: Homard_Exec
+   :width: 153
+   :height: 141
+
+Le répertoire de calcul est récupéré.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 258-263
+
+../..
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 339-347
+
+L'hypothèse transmise en paramètre d'entrée est caractérisée (voir :ref:`tui_create_hypothese`) :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 267-291
+
+Il faut établir un nom pour la future itération. Pour s'assurer que le nom n'a jamais été utilisé, on met en place un mécanisme de nommage incrémental à partir du nom de l'itération initiale. Comme ce nom initial est le nom du maillage initial, on obtient une succession de noms sous la forme : M_001, M_002, M_003, etc.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 293-303
+
+L'itération est complétée : hypothèse, futur maillage, champ (voir :ref:`tui_create_iteration`) :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 305-325
+
+L'itération est calculée. Si tout s'est bien passé, la variable OK vaut 1 : on pourra continuer l'exécution du schéma. S'il y a eu un problème, la variable OK vaut 0 pour signifier que le calcul doit s'arrêter ; on donne alors un message d'erreur.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 327-338
+
+Après cette exécution, le processus sort du noeud Adaptation_HOMARD, puis du noeud Adaptation. On arrive alors au noeud d'analyse.
+
+Homard_init_ensuite
+^^^^^^^^^^^^^^^^^^^
+.. image:: ../images/yacs_c_07.png
+   :align: left
+   :alt: Homard_init_ensuite
+   :width: 323
+   :height: 97
+
+Aux passages suivants dans le bloc d'adaptation, il faut récupérer :
+
+- la dernière itération créée pour la poursuivre : service LastIteration (voir :ref:`tui_create_iteration`)
+- l'hypothèse créée : service GetHypothesis (voir :ref:`tui_create_hypothese`)
+
+On passe ensuite dans le noeud Homard_Exec pour calculer le nouveau maillage.
+
+Arret_boucle
+------------
+.. image:: ../images/yacs_c_08.png
+   :align: left
+   :alt: Arret_boucle
+   :width: 163
+   :height: 152
+
+Le bloc Arret_boucle n'est présent que pour faire transiter des variables car les paramètres d'entrée des noeuds doivent toujours être remplis. C'est un python très simple :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 185-196
+
+Analyse
+=======
+.. image:: ../images/yacs_c_05.png
+   :align: left
+   :alt: Analyse
+   :width: 155
+   :height: 169
+
+Le bloc Analyse est un script python qui assure le contrôle complet du processus en examinant successivement les causes d'erreur possible.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 77-90
+
+../..
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 145-154
+
+On commence par analyser le retour du code de calcul :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 92-97
+
+Vérification de la présence du nom du maillage dans le dictionnaire des résultats :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 99-106
+
+Vérification de la présence du nom du fichier de résultats dans le dictionnaire des résultats :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 108-115
+
+Vérification de la convergence. Cela suppose que la valeur à tester est présente dans le dictionnaire sous la clé 'V00'. Ici, on a mis en place un test sur la variation de la valeur d'un calcul à l'autre. Au premier passage, on ne teste rien. Aux passages suivants, on teste si la variation relative est inférieure à 1 millième. On aurait pu mettre en place un test absolu si on avait récupéré un niveau global d'erreur par exemple.
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 117-135
+
+Enfin, on vérifie que l'on ne dépasse pas un nomber maximal d'adaptations :
+
+.. literalinclude:: ../files/yacs_01.xml
+   :lines: 137-142
+
+
+Utiliser ce schéma
+******************
+Pour reproduire cet exemple, voici le :download:`schéma à télécharger <../files/yacs_01.xml>`. Il faut l'adapter à la simulation envisagée. En particulier, il faut :
+
+- ajuster les noms des fichiers et des répertoires
+- fournir un script de lancement du calcul respectant les consignes évoquées ci-avant
+- choisir les hypothèses de pilotage de l'adaptation
+- mettre en place le test d'arrêt
+
+