Salome HOME
Remplacement de ref par doc dans les hyperliens
[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 :doc:`gui_create_yacs`.
9
10 Méthodes de la classe cas
11 *************************
12 See also in :doc:`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 |     Writes the schema into the file of the schema             |
66 |     By default, it is the file ``schema.xml``, in the         |
67 |     directory of the case. If ``WriteOnFile`` was used before |
68 |     the writings are into this new file.                      |
69 |                                                               |
70 |     Returns an integer:                                       |
71 |         * 0: the writing is done                              |
72 |         * other value: problem                                |
73 +---------------------------------------------------------------+
74 | .. module:: WriteOnFile                                       |
75 |                                                               |
76 | **WriteOnFile(file_xml)**                                     |
77 |     Writes the schema into a specified file.                  |
78 |                                                               |
79 |     - ``file_xml`` : name of the xml file for the schema      |
80 |                                                               |
81 |     Returns an integer:                                       |
82 |         * 0: the writing is done                              |
83 |         * other value: problem                                |
84 +---------------------------------------------------------------+
85 | .. module:: Delete                                            |
86 |                                                               |
87 | **Delete(option)**                                            |
88 |     Deletes the schema                                        |
89 |                                                               |
90 |     - ``option``: an integer to define what to do with the    |
91 |       xml file of the schema                                  |
92 |                                                               |
93 |         * 0: the files is kept                                |
94 |         * 1: the files is removed                             |
95 |                                                               |
96 |     Returns an integer:                                       |
97 |         * 0: the destruction is done                          |
98 |         * other value: problem                                |
99 +---------------------------------------------------------------+
100
101
102 Informations about the schema
103 =============================
104
105 +---------------------------------------------------------------+
106 +---------------------------------------------------------------+
107 | .. module:: GetName                                           |
108 |                                                               |
109 | **GetName()**                                                 |
110 |     Returns the name of the schema                            |
111 +---------------------------------------------------------------+
112 | .. module:: SetType                                           |
113 |                                                               |
114 | **SetType(Type)**                                             |
115 |     Defines the type of the schema.                           |
116 |                                                               |
117 |     - ``Type`` : the type of the schema                       |
118 |                                                               |
119 |         * 1 : constant                                        |
120 |         * 2 : variable                                        |
121 +---------------------------------------------------------------+
122 | .. module:: GetType                                           |
123 |                                                               |
124 | **GetType()**                                                 |
125 |     Returns the type of the schema                            |
126 +---------------------------------------------------------------+
127 | .. module:: SetScriptFile                                     |
128 |                                                               |
129 | **SetScriptFile(script_file)**                                |
130 |     Defines the file of the script python that launches the   |
131 |     computation                                               |
132 |                                                               |
133 |     - ``script_file`` : the name of the file that contains    |
134 |       the script python                                       |
135 +---------------------------------------------------------------+
136 | .. module:: GetScriptFile                                     |
137 |                                                               |
138 | **GetScriptFile()**                                           |
139 |     Returns the name of the file that contains the script     |
140 |     python                                                    |
141 +---------------------------------------------------------------+
142 | .. module:: SetDirName                                        |
143 |                                                               |
144 | **SetDirName(dir_name)**                                      |
145 |     Defines the name of the directory for the computation     |
146 |                                                               |
147 |     - ``dir_name`` : the name of the directory for the        |
148 |       computation                                             |
149 +---------------------------------------------------------------+
150 | .. module:: GetDirName                                        |
151 |                                                               |
152 | **GetDirName()**                                              |
153 |     Returns the name of the directory for the computation     |
154 +---------------------------------------------------------------+
155 | .. module:: SetMeshFile                                       |
156 |                                                               |
157 | **SetMeshFile(mesh_file)**                                    |
158 |     Defines the MED file of the very first mesh               |
159 |                                                               |
160 |     - ``mesh_file`` : the name of the MED file that contains  |
161 |       the very first mesh for the computation                 |
162 +---------------------------------------------------------------+
163 | .. module:: GetMeshFile                                       |
164 |                                                               |
165 | **GetMeshFile()**                                             |
166 |     Returns the name of the MED file of the very first mesh   |
167 |     for the computation                                       |
168 +---------------------------------------------------------------+
169 | .. module:: SetXMLFile                                        |
170 |                                                               |
171 | **SetXMLFile(xml_file)**                                      |
172 |     Defines the xml file                                      |
173 |                                                               |
174 |     - ``mesh_file`` : the name of the xml file                |
175 +---------------------------------------------------------------+
176 | .. module:: GetXMLFile                                        |
177 |                                                               |
178 | **GetXMLFile()**                                              |
179 |     Returns the name of the xml file                          |
180 +---------------------------------------------------------------+
181
182
183 The options of the schema
184 =========================
185 The default values are defined by the preferences of the module HOMARD.
186
187 +---------------------------------------------------------------+
188 +---------------------------------------------------------------+
189 | .. module:: SetMaxIter                                        |
190 |                                                               |
191 | **SetMaxIter(MaxIter)**                                       |
192 |     Defines the maximal number of iterations for the schema.  |
193 |                                                               |
194 |     - ``MaxIter`` : the maximal number of iterations of the   |
195 |       schema                                                  |
196 +---------------------------------------------------------------+
197 | .. module:: GetMaxIter                                        |
198 |                                                               |
199 | **GetMaxIter()**                                              |
200 |     Returns the maximal number of iterations of the schema    |
201 +---------------------------------------------------------------+
202 | .. module:: SetMaxNode                                        |
203 |                                                               |
204 | **SetMaxNode(MaxNode)**                                       |
205 |     Defines the maximal number of nodes for the adaptation.   |
206 |                                                               |
207 |     - ``MaxNode`` : the maximal number of nodes for the       |
208 |       adaptation. If MaxNode equals 0, no limit.              |
209 +---------------------------------------------------------------+
210 | .. module:: GetMaxNode                                        |
211 |                                                               |
212 | **GetMaxNode()**                                              |
213 |     Returns the maximal number of nodes for the adaptation    |
214 +---------------------------------------------------------------+
215 | .. module:: SetMaxElem                                        |
216 |                                                               |
217 | **SetMaxElem(MaxElem)**                                       |
218 |     Defines the maximal number of meshes for the adaptation.  |
219 |                                                               |
220 |     - ``MaxElem`` : the maximal number of meshes for the      |
221 |       adaptation. If MaxElem equals 0, no limit.              |
222 +---------------------------------------------------------------+
223 | .. module:: GetMaxElem                                        |
224 |                                                               |
225 | **GetMaxElem()**                                              |
226 |     Returns the maximal number of meshes for the adaptation   |
227 +---------------------------------------------------------------+
228 | .. module:: SetTestConvergence                                |
229 |                                                               |
230 | **SetTestConvergence(Type, VRef)**                            |
231 |     Defines a convergence test for the schema.                |
232 |                                                               |
233 |     - ``Type`` : the type of convergence of the schema.       |
234 |                                                               |
235 |         * 0 : no test                                         |
236 |         * 1 : if the test value is greater than VRef          |
237 |         * 2 : if the test value is lower than VRef            |
238 |                                                               |
239 |     - ``VRef`` : the reference value for the test             |
240 +---------------------------------------------------------------+
241 | .. module:: GetTestConvergenceType                            |
242 |                                                               |
243 | **GetTestConvergenceType()**                                  |
244 |     Returns the type of convergence of the schema.            |
245 +---------------------------------------------------------------+
246 | .. module:: GetTestConvergenceVRef                            |
247 |                                                               |
248 | **GetTestConvergenceVRef()**                                  |
249 |     Returns the reference value for the test.                 |
250 +---------------------------------------------------------------+
251
252
253 Example
254 *******
255 The creation of a schema is done as follows:
256 ::
257
258     ScriptFile = "/scratch/D68518/Salome/HOMARD_SALOME/HOMARD_SRC/doc/files/ScriptAster.py"
259     DirName = "/scratch/D68518/computation"
260     MeshFile = "/scratch/D68518/computation/maill.00.med"
261     YACS_0 = Case.CreateYACSSchema("YACS_0", ScriptFile, DirName, MeshFile)
262     YACS_0.SetMaxIter(4)
263
264 It can be writen down in a file :
265 ::
266
267     YACSFile = "/scratch/D68518/computation/yacs.xml"
268     codret = YACS_0.WriteOnFile(YACSFile)
269
270 Similar graphical input
271 ***********************
272 Look at :doc:`gui_create_yacs`
273
274
275