Salome HOME
Instants du champ de pilotage de l'adaptation
[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 |     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 Example
184 *******
185 The creation of a schema is done as follows:
186 ::
187
188     ScriptFile = "/scratch/D68518/Salome/HOMARD_SALOME/HOMARD_SRC/doc/files/ScriptAster.py"
189     DirName = "/scratch/D68518/computation"
190     MeshFile = "/scratch/D68518/computation/maill.00.med"
191     YACS_0 = Case.CreateYACSSchema("YACS_0", ScriptFile, DirName, MeshFile)
192
193 It can be writen down in a file :
194 ::
195
196     YACSFile = "/scratch/D68518/computation/yacs.xml"
197     codret = YACS_0.WriteOnFile(YACSFile)
198
199 Similar graphical input
200 ***********************
201 Look at :ref:`gui_create_yacs`
202
203
204