1 .. _gui_create_yacs_aster:
3 A schema YACS for *Code_Aster*
4 ##############################
5 .. index:: single: YACS
6 .. index:: single: Code_Aster
8 If the schema implies a coupling between *Code_Aster* and HOMARD, some comments are included here.
12 The directory for the computation
13 =================================
14 The first phase consists in creating a directory which will gather the files of the calculation and the files of the successive meshes.
18 The commands of the calculation are to be defined as for any calculation. The only point is about the test value for the convergence.
22 To get back the test value ``V_TEST``, the script fetches in the file ``resu`` a line such as:
27 For that purpose, the best way consists in placing the test value in an entitled table ``V_TEST``, for example after an extraction from a result:
29 .. literalinclude:: ../files/yacs_aster_01.comm
33 Then print this table for the two parameters ``INTITULE`` and component:
35 .. literalinclude:: ../files/yacs_aster_01.comm
39 To drive the adaptation
40 -----------------------
41 If the adaptation is driven by a field, it will be necessary to write this field in the exit MED file. It can be an error indicator (CALC_ERREUR command) or another field.
45 .. literalinclude:: ../files/yacs_aster_01.comm
51 The script for running *Code_Aster* to supply in the schema YACS is to be downloaded here: :download:`ScriptAster<../files/yacs_script.py>`. This file can be moved anywhere.
57 As soon as the commands are correct, a first calculation has to be done. That gives the opportunity to choose the parameters: *Code_Aster* version, calculation server, interactive/batch, and so on. These parameters will be used for the successive computations. Launching *Code_Aster* gathers these informations into a file ``export``. This file must be renamed as ``calcul.ref.export`` in the directory for the computation.
59 Creation of the schema
60 ======================
61 When the computation is over, the following steps must be done:
63 - to check that the result MED file was created and that the ligne with the test value is written down into the result file ``resu``;
64 - to activate the module HOMARD in SALOME;
65 - to create a case from the initial mesh;
66 - to create an iteration based on the selected field;
67 - possibly to calculate this iteration to check choices, but it is not compulsory;
68 - to create the schema based on this case.
72 The schema is written in the file ``schema.xml`` in the directory connected to the case which is the support. This file can be moved with no problem at all. The default parameters of control of the loop of the alternation (calculation/adaptation) can be modified.
74 The module YACS is activated, the schema is imported and it is launched.