Salome HOME
Copyright update 2022
[modules/homard.git] / doc / en / gui_create_yacs_aster.rst
1 .. _gui_create_yacs_aster:
2
3 A schema YACS for *Code_Aster*
4 ##############################
5 .. index:: single: YACS
6 .. index:: single: Code_Aster
7
8 If the schema implies a coupling between *Code_Aster* and HOMARD, some comments are included here.
9
10 Preparations
11 ************
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.
15
16 Commands
17 ========
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.
19
20 The test value
21 --------------
22 To get back the test value ``V_TEST``, the script fetches in the file ``resu`` a line such as:
23 ::
24
25     V_TEST    0.02071983
26
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:
28
29 .. literalinclude:: ../files/yacs_aster_01.comm
30    :language: python
31    :lines: 53-59
32
33 Then print this table for the two parameters ``INTITULE`` and component:
34
35 .. literalinclude:: ../files/yacs_aster_01.comm
36    :language: python
37    :lines: 63-64
38
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.
42
43 For example :
44
45 .. literalinclude:: ../files/yacs_aster_01.comm
46    :language: python
47    :lines: 68-78
48
49 The script
50 ==========
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.
52
53 How to do ?
54 ***********
55 A first calculation
56 ===================
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.
58
59 Creation of the schema
60 ======================
61 When the computation is over, the following steps must be done:
62
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.
69
70 To launch the schema
71 ====================
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.
73
74 The module YACS is activated, the schema is imported and it is launched.
75
76
77