]> SALOME platform Git repositories - modules/homard.git/blob - doc/en/tui_create_yacs.rst
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:: SetType                                           |
109 |                                                               |
110 | **SetType(Type)**                                             |
111 |     Defines the type of the schema.                           |
112 |                                                               |
113 |     - ``Type`` : the type of the schema                       |
114 |                                                               |
115 |         * 1 : constant                                        |
116 |         * 2 : variable                                        |
117 +---------------------------------------------------------------+
118 | .. module:: GetType                                           |
119 |                                                               |
120 | **GetType()**                                                 |
121 |     Returns the type of the schema                            |
122 +---------------------------------------------------------------+
123 | .. module:: SetScriptFile                                     |
124 |                                                               |
125 | **SetScriptFile(script_file)**                                |
126 |     Defines the file of the script python that launches the   |
127 |     computation                                               |
128 |                                                               |
129 |     - ``script_file`` : the name of the file that contains    |
130 |       the script python                                       |
131 +---------------------------------------------------------------+
132 | .. module:: GetScriptFile                                     |
133 |                                                               |
134 | **GetScriptFile()**                                           |
135 |     Returns the name of the file that contains the script     |
136 |     python                                                    |
137 +---------------------------------------------------------------+
138 | .. module:: SetDirName                                        |
139 |                                                               |
140 | **SetDirName(dir_name)**                                      |
141 |     Defines the name of the directory for the computation     |
142 |                                                               |
143 |     - ``dir_name`` : the name of the directory for the        |
144 |       computation                                             |
145 +---------------------------------------------------------------+
146 | .. module:: GetDirName                                        |
147 |                                                               |
148 | **GetDirName()**                                              |
149 |     Returns the name of the directory for the computation     |
150 +---------------------------------------------------------------+
151 | .. module:: SetMeshFile                                       |
152 |                                                               |
153 | **SetMeshFile(mesh_file)**                                    |
154 |     Defines the MED file of the very first mesh               |
155 |                                                               |
156 |     - ``mesh_file`` : the name of the MED file that contains  |
157 |       the very first mesh for the computation                 |
158 +---------------------------------------------------------------+
159 | .. module:: GetMeshFile                                       |
160 |                                                               |
161 | **GetMeshFile()**                                             |
162 |     Returns the name of the MED file of the very first mesh   |
163 |     for the computation                                       |
164 +---------------------------------------------------------------+
165
166
167 Example
168 *******
169 The creation of a schema is done as follows:
170 ::
171
172     ScriptFile = "/scratch/D68518/Salome/HOMARD_SALOME/HOMARD_SRC/doc/files/ScriptAster.py"
173     DirName = "/scratch/D68518/computation"
174     MeshFile = "/scratch/D68518/computation/maill.00.med"
175     YACS_0 = Case.CreateYACSSchema("YACS_0", ScriptFile, DirName, MeshFile)
176
177 It can be writen down in a file :
178 ::
179
180     YACSFile = "/scratch/D68518/computation/yacs.xml"
181     codret = YACS_0.WriteOnFile(YACSFile)
182
183 Similar graphical input
184 ***********************
185 Look at :ref:`gui_create_yacs`
186
187
188