6 .. index:: single: type of conformity
7 .. index:: single: mesh;initial
9 The variables are described in :doc:`gui_create_case`.
11 Methods of the class homard
12 ***************************
17 +---------------------------------------------------------------+
18 +---------------------------------------------------------------+
19 | .. module:: CreateCase |
21 | **CreateCase(case_name, mesh_name, mesh_file)** |
22 | Returns an instance of the class ``cas`` after its |
25 | - ``case_name``: the name of the case |
26 | - ``mesh_name``: the name of the initial mesh |
27 | - ``mesh_file``: the name of the MED file of this mesh |
31 | * the directory for the results is ``/tmp`` |
32 | * the adaptation is conformal |
33 +---------------------------------------------------------------+
34 | .. module:: GetCase |
36 | **GetCase(case_name)** |
37 | Returns an instance of the class ``cas`` known by its name|
39 | - ``case_name``: the name of the case |
40 +---------------------------------------------------------------+
41 | .. module:: GetAllCasesName |
43 | **GetAllCasesName()** |
44 | Returns the liste of the name of all the existing cases |
46 +---------------------------------------------------------------+
48 Creation of a case by pursuit of a computed iteration
49 =====================================================
51 +---------------------------------------------------------------+
52 +---------------------------------------------------------------+
53 | .. module:: CreateCaseFromIteration |
55 | **CreateCaseFromIteration(case_name, dir_name)** |
56 | Returns an instance of the class ``cas`` after its |
59 | - ``case_name``: the name of the case |
60 | - ``dir_name``: the name of the directory that contains |
63 +---------------------------------------------------------------+
64 | .. module:: CreateCaseFromCaseLastIteration |
66 | **CreateCaseFromCaseLastIteration(case_name, dir_name)** |
67 | Returns an instance of the class ``cas`` after its |
70 | - ``case_name``: the name of the case |
71 | - ``dir_name``: the name of the directory that contains |
74 +---------------------------------------------------------------+
75 | .. module:: CreateCaseFromCaseIteration |
77 | **CreateCaseFromCaseIteration(case_name, dir_name, number)** |
78 | Returns an instance of the class ``cas`` after its |
81 | - ``case_name``: the name of the case |
82 | - ``dir_name``: the name of the directory that contains |
84 | - ``number``: the number of the iteration of the case |
86 +---------------------------------------------------------------+
90 Methods of the class cas
91 ************************
92 .. index:: single: YACS
94 +---------------------------------------------------------------+
95 +---------------------------------------------------------------+
96 | .. module:: GetName |
99 | Returns the name of the case |
100 +---------------------------------------------------------------+
101 | .. module:: SetDirName |
103 | **SetDirName(dirname)** |
104 | Gives a directory for the results of the case. It can be |
105 | done only after the creation of the case and before the |
106 | first computation. |
108 | - ``dirname``: the name of the directory of the results |
109 +---------------------------------------------------------------+
110 | .. module:: GetDirName |
113 | Returns the name of the directory of the results of the |
115 +---------------------------------------------------------------+
116 | .. module:: SetConfType |
118 | **SetConfType(conf_type)** |
119 | Defines the type of conformity for the case |
121 | - ``conf_type``: integer as follows: |
123 | * 0: conformal (default) |
124 | * 1: non conformal with at max 2 cut edges per element|
125 | * 2: non conformal with one hanging node per edge of |
127 | * 3: non conformal without any constraint |
128 | * -1: conformal with boxes (no staircases) |
129 | * -2: non-conformal with boxes (no staircases) |
130 +---------------------------------------------------------------+
131 | .. module:: GetConfType |
133 | **GetConfType()** |
134 | Returns the type of conformity |
135 +---------------------------------------------------------------+
136 | .. module:: SetExtType |
138 | **SetExtType(ext_type)** |
139 | Defines the external type for the case |
141 | - ``ext_type`` : integer as follows: |
143 | * 0 : Standard MED (default) |
144 | * 1 : Saturne MED |
145 | * 2 : Saturne 2D MED |
146 +---------------------------------------------------------------+
147 | .. module:: GetExtType |
150 | Returns the external type for the case |
151 +---------------------------------------------------------------+
152 | .. module:: GetIter0 |
155 | Returns the iteration linked to the initial mesh. |
156 | This iteration is automatically created by the module |
157 | HOMARD. It is used to connect the iterations. It is |
158 | connected to an initial mesh or to the iteration of a |
160 +---------------------------------------------------------------+
161 | .. module:: AddBoundary |
163 | **AddBoundary(boundary)** |
164 | Add a boundary to the definition of a case |
166 | - ``boundary``: name of the curved boundary |
167 +---------------------------------------------------------------+
168 | .. module:: AddBoundaryGroup |
170 | **AddBoundaryGroup(boundary, group)** |
171 | Add a boundary to the definition of a case |
173 | - ``boundary``: name of the curved boundary |
175 | Discrete boundary: |
177 | . if all the curved lines are involved, the second |
178 | argument is an empty string. |
179 | . if only some curved lines are involved, ``group`` is |
180 | the name of the group of segments |
182 | Analytical boundary: |
184 | - ``group``: name of the group of faces located on the |
186 +---------------------------------------------------------------+
187 | .. module:: Delete |
189 | **Delete(option)** |
190 | Deletes the case and all the connected iterations. The MED|
191 | file of the first mesh is kept. |
193 | - ``option``: an integer to define what to do with the |
194 | MED file of the associated meshes |
196 | * 0: the files are kept |
197 | * 1: the files are removed |
199 | Returns an integer: |
200 | * 0: the destruction is done |
201 | * other value: problem |
202 +---------------------------------------------------------------+
203 | .. module:: GetState |
206 | Returns the state of the case: |
207 | * 0: corresponds to an initial mesh |
208 | * other value: pursuit of an iteration with number n |
209 +---------------------------------------------------------------+
210 | .. module:: WriteYACSSchema |
212 | **WriteYACSSchema(ScriptFile, DirName, MeshFile)** |
213 | Writes a schema YACS relative to the case. |
215 | - ``ScriptFile`` : name of the file that contains the |
216 | script to launch the computation |
217 | - ``DirName`` : the directory for the computation |
218 | - ``MeshFile`` : name of the file that contains the mesh |
219 | for the very first computation |
220 +---------------------------------------------------------------+
225 +---------------------------------------------------------------+
226 +---------------------------------------------------------------+
227 | .. module:: SetPyram |
229 | **SetPyram(option)** |
230 | Defines the status of the pyramids in this case |
232 | - ``option``: integer that defines the status of the |
233 | pyramids that could belongs to the initial mesh |
235 | * 0: rejected pyramids (default) |
236 | * 1: authorized pyramids |
237 +---------------------------------------------------------------+
238 | .. module:: GetPyram |
241 | Returns the status of the pyramids in this case |
242 +---------------------------------------------------------------+
244 Informations for the initial mesh
245 *********************************
247 +---------------------------------------------------------------+
248 +---------------------------------------------------------------+
249 | .. module:: MeshInfo |
251 | **MeshInfo(Qual, Diam, Conn, Tail, Inte)** |
252 | Gives information about the current mesh. For every |
253 | option, the choice #0 corresponds to 'no action', while |
254 | the choice #1 launches the option. |
256 | - ``Qual``: quality of the elements |
257 | - ``Diam``: diametre of the elements |
258 | - ``Conn``: connexity of the domain; a single block, how |
260 | - ``Tail``: size of the parts of the domain, group by |
262 | - ``Inte``: staggered elements, by dimension |
263 +---------------------------------------------------------------+
268 The creation of the object case_1 is done as follows:
274 mesh_file = "/scratch/Salome/Adapt/m0.med"
275 case_1 = homard.CreateCase(case_name, mesh_name, mesh_file)
276 dirname = "/scratch/Salome/Adapt/resu"
277 case_1.SetDirName(dirname)
278 case_1.SetConfType(1)
279 case_1.AddBoundaryGroup( 'intersection', '' )
280 case_1.AddBoundaryGroup( 'cyl_1', 'T1_EXT' )
281 case_1.AddBoundaryGroup( 'cyl_1', 'T2_EXT' )
282 case_1.AddBoundaryGroup( 'cyl_2', 'T_INT' )
286 Similar graphical input
287 ***********************
288 Look at :doc:`gui_create_case`