Salome HOME
Documentation sur les schémas YACS
[modules/homard.git] / doc / en / tui_create_yacs.rst
1 .. _tui_create_yacs:
2
3 The schema YACS
4 ###############
5
6 .. index:: single: YACS
7
8 The variables are described in :ref:`gui_create_yacs`.
9
10 Méthodes de la classe cas
11 *************************
12 See also in :ref:`tui_create_case`.
13
14 +---------------------------------------------------------------+
15 +---------------------------------------------------------------+
16 | .. module:: CreateYACSSchema                                  |
17 |                                                               |
18 | **CreateYACSSchema(yacs_name, ScriptFile, DirName, MeshFile)**|
19 |     Returns an instance of the class ``yacs``, after its      |
20 |     creation                                                  |
21 |                                                               |
22 |     - ``yacs_name`` : the name of the schema                  |
23 |     - ``ScriptFile`` : the file of the python script that     |
24 |       drives the computation, coupled with the mesh adaptation|
25 |     - ``DirName`` : the directory for the computation         |
26 |     - ``MeshFile`` : the MED file that contains the very first|
27 |       mesh for the computation                                |
28 +---------------------------------------------------------------+
29
30 Methodes of the class homard
31 ****************************
32
33 +---------------------------------------------------------------+
34 +---------------------------------------------------------------+
35 | .. module:: GetYACS                                           |
36 |                                                               |
37 | **GetYACS(yacs_name)**                                        |
38 |     Returns the instance of the class classe ``yacs``         |
39 |     known by its name                                         |
40 |                                                               |
41 |     - ``yacs_name`` : the name of the schema                  |
42 +---------------------------------------------------------------+
43 | .. module:: GetAllYACSsName                                   |
44 |                                                               |
45 | **GetAllYACSsName()**                                         |
46 |     Returns the list of the names of all the existing         |
47 |     schemas                                                   |
48 +---------------------------------------------------------------+
49
50
51
52 Methodes of the class YACS
53 **************************
54
55 General methods
56 ===============
57
58 +---------------------------------------------------------------+
59 +---------------------------------------------------------------+
60 | .. module:: Write                                             |
61 |                                                               |
62 | **Write()**                                                   |
63 |     Writes the schema into the file ``schema.xml``, in the    |
64 |     directory of the case                                     |
65 |                                                               |
66 |     Returns an integer:                                       |
67 |         * 0: the writing is done                              |
68 |         * other value: problem                                |
69 +---------------------------------------------------------------+
70 | .. module:: WriteOnFile                                       |
71 |                                                               |
72 | **WriteOnFile(file_xml)**                                     |
73 |     Writes the schema into a specified file.                  |
74 |                                                               |
75 |     - ``file_xml`` : name of the xml file for the schema      |
76 |                                                               |
77 |     Returns an integer:                                       |
78 |         * 0: the writing is done                              |
79 |         * other value: problem                                |
80 +---------------------------------------------------------------+
81 | .. module:: Delete                                            |
82 |                                                               |
83 | **Delete(option)**                                            |
84 |     Deletes the schema                                        |
85 |                                                               |
86 |     - ``option``: an integer to define what to do with the    |
87 |       xml file of the schema                                  |
88 |                                                               |
89 |         * 0: the files is kept                                |
90 |         * 1: the files is removed                             |
91 |                                                               |
92 |     Returns an integer:                                       |
93 |         * 0: the destruction is done                          |
94 |         * other value: problem                                |
95 +---------------------------------------------------------------+
96
97
98 Informations about the schema
99 =============================
100
101 +---------------------------------------------------------------+
102 +---------------------------------------------------------------+
103 | .. module:: GetName                                           |
104 |                                                               |
105 | **GetName()**                                                 |
106 |     Returns the name of the schema                            |
107 +---------------------------------------------------------------+
108 | .. module:: GetType                                           |
109 |                                                               |
110 | **GetType()**                                                 |
111 |     Returns the type of the schema                            |
112 |                                                               |
113 |         * 1 : static                                          |
114 |         * 2 : transitory                                      |
115 +---------------------------------------------------------------+
116 | .. module:: SetScriptFile                                     |
117 |                                                               |
118 | **SetScriptFile(script_file)**                                |
119 |     Defines the file of the script python that launches the   |
120 |     computation                                               |
121 |                                                               |
122 |     - ``script_file`` : the name of the file that contains    |
123 |       the script python                                       |
124 +---------------------------------------------------------------+
125 | .. module:: GetScriptFile                                     |
126 |                                                               |
127 | **GetScriptFile()**                                           |
128 |     Returns the name of the file that contains the script     |
129 |     python                                                    |
130 +---------------------------------------------------------------+
131 | .. module:: SetDirName                                        |
132 |                                                               |
133 | **SetDirName(dir_name)**                                      |
134 |     Defines the name of the directory for the computation     |
135 |                                                               |
136 |     - ``dir_name`` : the name of the directory for the        |
137 |       computation                                             |
138 +---------------------------------------------------------------+
139 | .. module:: GetDirName                                        |
140 |                                                               |
141 | **GetDirName()**                                              |
142 |     Returns the name of the directory for the computation     |
143 +---------------------------------------------------------------+
144 | .. module:: SetMeshFile                                       |
145 |                                                               |
146 | **SetMeshFile(mesh_file)**                                    |
147 |     Defines the MED file of the very first mesh               |
148 |                                                               |
149 |     - ``mesh_file`` : the name of the MED file that contains  |
150 |       the very first mesh for the computation                 |
151 +---------------------------------------------------------------+
152 | .. module:: GetMeshFile                                       |
153 |                                                               |
154 | **GetMeshFile()**                                             |
155 |     Returns the name of the MED file of the very first mesh   |
156 |     for the computation                                       |
157 +---------------------------------------------------------------+
158
159
160 Example
161 *******
162 The creation of a schema is done as follows:
163 ::
164
165     ScriptFile = "/scratch/D68518/Salome/HOMARD_SALOME/HOMARD_SRC/doc/files/ScriptAster.py"
166     DirName = "/scratch/D68518/computation"
167     MeshFile = "/scratch/D68518/computation/maill.00.med"
168     YACS_0 = Case.CreateYACSSchema("YACS_0", ScriptFile, DirName, MeshFile)
169
170 It can be writen down in a file :
171 ::
172
173     YACSFile = "/scratch/D68518/computation/yacs.xml"
174     codret = YACS_0.WriteOnFile(YACSFile)
175
176 Similar graphical input
177 ***********************
178 Look at :ref:`gui_create_yacs`
179
180
181