Salome HOME
Merge from V6_main 01/04/2013
[modules/med.git] / src / MEDMEM_SWIG / med_field_anal.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23
24 ############################################################################
25 # This Python script is testing the generation of MED field using a
26 # user-callable function with different number of components and
27 # different SUPPORTs.
28 ############################################################################
29 #
30 from math import *
31
32 def f_scal_dbl_2d(x, y):
33     ret = []
34     ret.append(x + y)
35     return ret
36
37 def f_scal_dbl_3d(x, y, z):
38     ret = []
39     ret.append(x + y + z)
40     return ret
41
42 def f_vect_dbl_2d(x, y):
43     ret = []
44     ret.append(x + y)
45     ret.append(2.*(x + y))
46     return ret
47
48 def f_vect_dbl_3d(x, y, z):
49     ret = []
50     ret.append(x + y + z)
51     ret.append(2.*(x + y + z))
52     ret.append(3.*(x + y + z))
53     return ret
54
55 def f_scal_int_2d(x, y):
56     ret = []
57     ret_tmp = x + y
58     ret_tmp = int(ret_tmp)
59     ret.append(ret_tmp)
60     return ret
61
62 def f_scal_int_3d(x, y, z):
63     ret = []
64     ret_tmp = x + y + z
65     ret_tmp = int(ret_tmp)
66     ret.append(ret_tmp)
67     return ret
68
69 def f_vect_int_2d(x, y):
70     ret = []
71     ret.append(int(x + y))
72     ret.append(int(2.*(x + y)))
73     return ret
74
75 def f_vect_int_3d(x, y, z):
76     ret = []
77     ret.append(int(x + y + z))
78     ret.append(int(2.*(x + y + z)))
79     ret.append(int(3.*(x + y + z)))
80     return ret
81
82 from libMEDMEM_Swig import *
83 from random import *
84 import os
85 #
86 #befor running this script, please be sure about the path the file fileName
87 #
88 filePath=os.environ["MED_ROOT_DIR"]
89 filePath=os.path.join(filePath, "share", "salome", "resources", "med")
90
91 medFile = os.path.join(filePath, "carre_en_quad4_seg2.med")
92 medFile = os.path.join(filePath, "cube_hexa8_quad4.med")
93
94 def print_ord(i):
95     if i == 0:
96         return 'first'
97     elif i == 1:
98         return 'second'
99     elif i == 2:
100         return 'third'
101     else:
102         return `i`+'th'
103
104 md = MEDFILEBROWSER(medFile)
105 nbMeshes = md.getNumberOfMeshes()
106
107 print "The med file", medFile, "contains", nbMeshes, "mesh(es)"
108
109 mesh_name = md.getMeshName(0)
110 mesh = MESH(MED_DRIVER,medFile,mesh_name)
111 spaceDim = mesh.getSpaceDimension()
112 meshDim = mesh.getMeshDimension()
113 nbNodes = mesh.getNumberOfNodes()
114
115 print ""
116 print "The mesh",mesh_name,"is a",spaceDim,"D mesh on a",meshDim,"D geometry and has",nbNodes,"Nodes"
117
118 supportOnCell = mesh.getSupportOnAll(MED_CELL)
119
120 supportOnNode = mesh.getSupportOnAll(MED_NODE)
121
122 if (spaceDim == 3) :
123     supportOnConst = mesh.getSupportOnAll(MED_FACE)
124 elif (spaceDim == 2) :
125     supportOnConst = mesh.getSupportOnAll(MED_EDGE)
126
127 ##print ""
128 ##print supportOnCell
129
130 if (spaceDim == 2) :
131     fieldDoubleScalOnCell = createFieldDoubleFromAnalytic(supportOnCell,1,
132                                                           f_scal_dbl_2d)
133     fieldDoubleVectOnCell = createFieldDoubleFromAnalytic(supportOnCell,
134                                                           spaceDim,
135                                                           f_vect_dbl_2d)
136     fieldIntScalOnCell = createFieldIntFromAnalytic(supportOnCell,1,
137                                                     f_scal_int_2d)
138     fieldIntVectOnCell = createFieldIntFromAnalytic(supportOnCell,spaceDim,
139                                                     f_vect_int_2d)
140 elif (spaceDim == 3) :
141     fieldDoubleScalOnCell = createFieldDoubleFromAnalytic(supportOnCell,1,
142                                                           f_scal_dbl_3d)
143     fieldDoubleVectOnCell = createFieldDoubleFromAnalytic(supportOnCell,
144                                                           spaceDim,
145                                                           f_vect_dbl_3d)
146     fieldIntScalOnCell = createFieldIntFromAnalytic(supportOnCell,1,
147                                                     f_scal_int_3d)
148     fieldIntVectOnCell = createFieldIntFromAnalytic(supportOnCell,spaceDim,
149                                                     f_vect_int_3d)
150
151 fieldDoubleScalOnCell.setName("Scalar Double Field on all Cells")
152 fieldDoubleScalOnCell.setDescription("Generated via a Python function")
153
154 fieldDoubleVectOnCell.setName("Vector Double Field on all Cells")
155 fieldDoubleVectOnCell.setDescription("Generated via a Python function")
156
157 fieldIntScalOnCell.setName("Scalar Integer Field on all Cells")
158 fieldIntScalOnCell.setDescription("Generated via a Python function")
159
160 fieldIntVectOnCell.setName("Vector Integer Field on all Cells")
161 fieldIntVectOnCell.setDescription("Generated via a Python function")
162
163 name = fieldDoubleScalOnCell.getName()
164 desc = fieldDoubleScalOnCell.getDescription()
165 nbOfComp = fieldDoubleScalOnCell.getNumberOfComponents()
166 print "     Field",name," : ",desc
167 print "     Number Of Components:",nbOfComp
168 iterationNb = fieldDoubleScalOnCell.getIterationNumber()
169 orderNb = fieldDoubleScalOnCell.getOrderNumber()
170 time = fieldDoubleScalOnCell.getTime()
171 print "     Iteration Number",iterationNb
172 print "     Order Number",orderNb
173 print "     Time",time
174 for k in range(nbOfComp):
175     kp1 = k+1
176     compName = fieldDoubleScalOnCell.getComponentName(kp1)
177     compDesc = fieldDoubleScalOnCell.getComponentDescription(kp1)
178     compUnit = fieldDoubleScalOnCell.getMEDComponentUnit(kp1)
179     print "      * Component:",kp1
180     print "          Name:",compName
181     print "          Description:",compDesc
182     print "          Unit:",compUnit
183
184 support = fieldDoubleScalOnCell.getSupport()
185 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
186 print "     Values:",nbOf
187 for k in range(nbOf):
188     valueI = fieldDoubleScalOnCell.getRow(k+1)
189     print "     *",valueI[:nbOfComp]
190
191 print ""
192 name = fieldDoubleVectOnCell.getName()
193 desc = fieldDoubleVectOnCell.getDescription()
194 nbOfComp = fieldDoubleVectOnCell.getNumberOfComponents()
195 print "     Field",name," : ",desc
196 print "     Number Of Components:",nbOfComp
197 iterationNb = fieldDoubleVectOnCell.getIterationNumber()
198 orderNb = fieldDoubleVectOnCell.getOrderNumber()
199 time = fieldDoubleVectOnCell.getTime()
200 print "     Iteration Number",iterationNb
201 print "     Order Number",orderNb
202 print "     Time",time
203 for k in range(nbOfComp):
204     kp1 = k+1
205     compName = fieldDoubleVectOnCell.getComponentName(kp1)
206     compDesc = fieldDoubleVectOnCell.getComponentDescription(kp1)
207     compUnit = fieldDoubleVectOnCell.getMEDComponentUnit(kp1)
208     print "      * Component:",kp1
209     print "          Name:",compName
210     print "          Description:",compDesc
211     print "          Unit:",compUnit
212
213 support = fieldDoubleVectOnCell.getSupport()
214 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
215 print "     Values:",nbOf
216 for k in range(nbOf):
217     valueI = fieldDoubleVectOnCell.getRow(k+1)
218     print "     *",valueI[:nbOfComp]
219
220 print ""
221 name = fieldIntScalOnCell.getName()
222 desc = fieldIntScalOnCell.getDescription()
223 nbOfComp = fieldIntScalOnCell.getNumberOfComponents()
224 print "     Field",name," : ",desc
225 print "     Number Of Components:",nbOfComp
226 iterationNb = fieldIntScalOnCell.getIterationNumber()
227 orderNb = fieldIntScalOnCell.getOrderNumber()
228 time = fieldIntScalOnCell.getTime()
229 print "     Iteration Number",iterationNb
230 print "     Order Number",orderNb
231 print "     Time",time
232 for k in range(nbOfComp):
233     kp1 = k+1
234     compName = fieldIntScalOnCell.getComponentName(kp1)
235     compDesc = fieldIntScalOnCell.getComponentDescription(kp1)
236     compUnit = fieldIntScalOnCell.getMEDComponentUnit(kp1)
237     print "      * Component:",kp1
238     print "          Name:",compName
239     print "          Description:",compDesc
240     print "          Unit:",compUnit
241
242 support = fieldIntScalOnCell.getSupport()
243 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
244 print "     Values:",nbOf
245 for k in range(nbOf):
246     valueI = fieldIntScalOnCell.getRow(k+1)
247     print "     *",valueI[:nbOfComp]
248
249 print ""
250 name = fieldIntVectOnCell.getName()
251 desc = fieldIntVectOnCell.getDescription()
252 nbOfComp = fieldIntVectOnCell.getNumberOfComponents()
253 print "     Field",name," : ",desc
254 print "     Number Of Components:",nbOfComp
255 iterationNb = fieldIntVectOnCell.getIterationNumber()
256 orderNb = fieldIntVectOnCell.getOrderNumber()
257 time = fieldIntVectOnCell.getTime()
258 print "     Iteration Number",iterationNb
259 print "     Order Number",orderNb
260 print "     Time",time
261 for k in range(nbOfComp):
262     kp1 = k+1
263     compName = fieldIntVectOnCell.getComponentName(kp1)
264     compDesc = fieldIntVectOnCell.getComponentDescription(kp1)
265     compUnit = fieldIntVectOnCell.getMEDComponentUnit(kp1)
266     print "      * Component:",kp1
267     print "          Name:",compName
268     print "          Description:",compDesc
269     print "          Unit:",compUnit
270
271 support = fieldIntVectOnCell.getSupport()
272 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
273 print "     Values:",nbOf
274 for k in range(nbOf):
275     valueI = fieldIntVectOnCell.getRow(k+1)
276     print "     *",valueI[:nbOfComp]
277
278 ##print ""
279 ##print supportOnNode
280
281 if (spaceDim == 2) :
282     fieldDoubleScalOnNode = createFieldDoubleFromAnalytic(supportOnNode,1,
283                                                           f_scal_dbl_2d)
284     fieldDoubleVectOnNode = createFieldDoubleFromAnalytic(supportOnNode,
285                                                           spaceDim,
286                                                           f_vect_dbl_2d)
287     fieldIntScalOnNode = createFieldIntFromAnalytic(supportOnNode,1,
288                                                     f_scal_int_2d)
289     fieldIntVectOnNode = createFieldIntFromAnalytic(supportOnNode, spaceDim,
290                                                     f_vect_int_2d)
291 elif (spaceDim == 3) :
292     fieldDoubleScalOnNode = createFieldDoubleFromAnalytic(supportOnNode,1,
293                                                           f_scal_dbl_3d)
294     fieldDoubleVectOnNode = createFieldDoubleFromAnalytic(supportOnNode,
295                                                           spaceDim,
296                                                           f_vect_dbl_3d)
297     fieldIntScalOnNode = createFieldIntFromAnalytic(supportOnNode,1,
298                                                     f_scal_int_3d)
299     fieldIntVectOnNode = createFieldIntFromAnalytic(supportOnNode, spaceDim,
300                                                     f_vect_int_3d)
301
302 fieldDoubleScalOnNode.setName("Scalar Double Field on all Nodes")
303 fieldDoubleScalOnNode.setDescription("Generated via a Python function")
304
305 fieldDoubleVectOnNode.setName("Vector Double Field on all Nodes")
306 fieldDoubleVectOnNode.setDescription("Generated via a Python function")
307
308 fieldIntScalOnNode.setName("Scalar Integer Field on all Nodes")
309 fieldIntScalOnNode.setDescription("Generated via a Python function")
310
311 fieldIntVectOnNode.setName("Vector Integer Field on all Nodes")
312 fieldIntVectOnNode.setDescription("Generated via a Python function")
313
314 print ""
315 name = fieldDoubleScalOnNode.getName()
316 desc = fieldDoubleScalOnNode.getDescription()
317 nbOfComp = fieldDoubleScalOnNode.getNumberOfComponents()
318 print "     Field",name," : ",desc
319 print "     Number Of Components:",nbOfComp
320 iterationNb = fieldDoubleScalOnNode.getIterationNumber()
321 orderNb = fieldDoubleScalOnNode.getOrderNumber()
322 time = fieldDoubleScalOnNode.getTime()
323 print "     Iteration Number",iterationNb
324 print "     Order Number",orderNb
325 print "     Time",time
326 for k in range(nbOfComp):
327     kp1 = k+1
328     compName = fieldDoubleScalOnNode.getComponentName(kp1)
329     compDesc = fieldDoubleScalOnNode.getComponentDescription(kp1)
330     compUnit = fieldDoubleScalOnNode.getMEDComponentUnit(kp1)
331     print "      * Component:",kp1
332     print "          Name:",compName
333     print "          Description:",compDesc
334     print "          Unit:",compUnit
335
336 support = fieldDoubleScalOnNode.getSupport()
337 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
338 print "     Values:",nbOf
339 for k in range(nbOf):
340     valueI = fieldDoubleScalOnNode.getRow(k+1)
341     print "     *",valueI[:nbOfComp]
342
343 print ""
344 name = fieldDoubleVectOnNode.getName()
345 desc = fieldDoubleVectOnNode.getDescription()
346 nbOfComp = fieldDoubleVectOnNode.getNumberOfComponents()
347 print "     Field",name," : ",desc
348 print "     Number Of Components:",nbOfComp
349 iterationNb = fieldDoubleVectOnNode.getIterationNumber()
350 orderNb = fieldDoubleVectOnNode.getOrderNumber()
351 time = fieldDoubleVectOnNode.getTime()
352 print "     Iteration Number",iterationNb
353 print "     Order Number",orderNb
354 print "     Time",time
355 for k in range(nbOfComp):
356     kp1 = k+1
357     compName = fieldDoubleVectOnNode.getComponentName(kp1)
358     compDesc = fieldDoubleVectOnNode.getComponentDescription(kp1)
359     compUnit = fieldDoubleVectOnNode.getMEDComponentUnit(kp1)
360     print "      * Component:",kp1
361     print "          Name:",compName
362     print "          Description:",compDesc
363     print "          Unit:",compUnit
364
365 support = fieldDoubleVectOnNode.getSupport()
366 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
367 print "     Values:",nbOf
368 for k in range(nbOf):
369     valueI = fieldDoubleVectOnNode.getRow(k+1)
370     print "     *",valueI[:nbOfComp]
371
372 print ""
373 name = fieldIntScalOnNode.getName()
374 desc = fieldIntScalOnNode.getDescription()
375 nbOfComp = fieldIntScalOnNode.getNumberOfComponents()
376 print "     Field",name," : ",desc
377 print "     Number Of Components:",nbOfComp
378 iterationNb = fieldIntScalOnNode.getIterationNumber()
379 orderNb = fieldIntScalOnNode.getOrderNumber()
380 time = fieldIntScalOnNode.getTime()
381 print "     Iteration Number",iterationNb
382 print "     Order Number",orderNb
383 print "     Time",time
384 for k in range(nbOfComp):
385     kp1 = k+1
386     compName = fieldIntScalOnNode.getComponentName(kp1)
387     compDesc = fieldIntScalOnNode.getComponentDescription(kp1)
388     compUnit = fieldIntScalOnNode.getMEDComponentUnit(kp1)
389     print "      * Component:",kp1
390     print "          Name:",compName
391     print "          Description:",compDesc
392     print "          Unit:",compUnit
393
394 support = fieldIntScalOnNode.getSupport()
395 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
396 print "     Values:",nbOf
397 for k in range(nbOf):
398     valueI = fieldIntScalOnNode.getRow(k+1)
399     print "     *",valueI[:nbOfComp]
400
401 print ""
402 name = fieldIntVectOnNode.getName()
403 desc = fieldIntVectOnNode.getDescription()
404 nbOfComp = fieldIntVectOnNode.getNumberOfComponents()
405 print "     Field",name," : ",desc
406 print "     Number Of Components:",nbOfComp
407 iterationNb = fieldIntVectOnNode.getIterationNumber()
408 orderNb = fieldIntVectOnNode.getOrderNumber()
409 time = fieldIntVectOnNode.getTime()
410 print "     Iteration Number",iterationNb
411 print "     Order Number",orderNb
412 print "     Time",time
413 for k in range(nbOfComp):
414     kp1 = k+1
415     compName = fieldIntVectOnNode.getComponentName(kp1)
416     compDesc = fieldIntVectOnNode.getComponentDescription(kp1)
417     compUnit = fieldIntVectOnNode.getMEDComponentUnit(kp1)
418     print "      * Component:",kp1
419     print "          Name:",compName
420     print "          Description:",compDesc
421     print "          Unit:",compUnit
422
423 support = fieldIntVectOnNode.getSupport()
424 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
425 print "     Values:",nbOf
426 for k in range(nbOf):
427     valueI = fieldIntVectOnNode.getRow(k+1)
428     print "     *",valueI[:nbOfComp]
429
430 ##print ""
431 ##print supportOnConst
432
433 if (spaceDim == 2) :
434     fieldDoubleScalOnConst = createFieldDoubleFromAnalytic(supportOnConst,1,
435                                                            f_scal_dbl_2d)
436     fieldDoubleVectOnConst = createFieldDoubleFromAnalytic(supportOnConst,
437                                                            spaceDim,
438                                                            f_vect_dbl_2d)
439     fieldIntScalOnConst = createFieldIntFromAnalytic(supportOnConst,1,
440                                                      f_scal_int_2d)
441     fieldIntVectOnConst = createFieldIntFromAnalytic(supportOnConst, spaceDim,
442                                                      f_vect_int_2d)
443 elif (spaceDim == 3) :
444     fieldDoubleScalOnConst = createFieldDoubleFromAnalytic(supportOnConst,1,
445                                                            f_scal_dbl_3d)
446     fieldDoubleVectOnConst = createFieldDoubleFromAnalytic(supportOnConst,
447                                                            spaceDim,
448                                                            f_vect_dbl_3d)
449     fieldIntScalOnConst = createFieldIntFromAnalytic(supportOnConst,1,
450                                                      f_scal_int_3d)
451     fieldIntVectOnConst = createFieldIntFromAnalytic(supportOnConst, spaceDim,
452                                                      f_vect_int_3d)
453
454 fieldDoubleScalOnConst.setName("Scalar Double Field on all Faces/Edges")
455 fieldDoubleScalOnConst.setDescription("Generated via a Python function")
456
457 fieldDoubleVectOnConst.setName("Vector Double Field on all Faces/Edges")
458 fieldDoubleVectOnConst.setDescription("Generated via a Python function")
459
460 fieldIntScalOnConst.setName("Scalar Integer Field on all Faces/Edges")
461 fieldIntScalOnConst.setDescription("Generated via a Python function")
462
463 fieldIntVectOnConst.setName("Vector Integer Field on all Faces/Edges")
464 fieldIntVectOnConst.setDescription("Generated via a Python function")
465
466 print ""
467 name = fieldDoubleScalOnConst.getName()
468 desc = fieldDoubleScalOnConst.getDescription()
469 nbOfComp = fieldDoubleScalOnConst.getNumberOfComponents()
470 print "     Field",name," : ",desc
471 print "     Number Of Components:",nbOfComp
472 iterationNb = fieldDoubleScalOnConst.getIterationNumber()
473 orderNb = fieldDoubleScalOnConst.getOrderNumber()
474 time = fieldDoubleScalOnConst.getTime()
475 print "     Iteration Number",iterationNb
476 print "     Order Number",orderNb
477 print "     Time",time
478 for k in range(nbOfComp):
479     kp1 = k+1
480     compName = fieldDoubleScalOnConst.getComponentName(kp1)
481     compDesc = fieldDoubleScalOnConst.getComponentDescription(kp1)
482     compUnit = fieldDoubleScalOnConst.getMEDComponentUnit(kp1)
483     print "      * Component:",kp1
484     print "          Name:",compName
485     print "          Description:",compDesc
486     print "          Unit:",compUnit
487
488 support = fieldDoubleScalOnConst.getSupport()
489 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
490 print "     Values:",nbOf
491 for k in range(nbOf):
492     valueI = fieldDoubleScalOnConst.getRow(k+1)
493     print "     *",valueI[:nbOfComp]
494
495 print ""
496 name = fieldDoubleVectOnConst.getName()
497 desc = fieldDoubleVectOnConst.getDescription()
498 nbOfComp = fieldDoubleVectOnConst.getNumberOfComponents()
499 print "     Field",name," : ",desc
500 print "     Number Of Components:",nbOfComp
501 iterationNb = fieldDoubleVectOnConst.getIterationNumber()
502 orderNb = fieldDoubleVectOnConst.getOrderNumber()
503 time = fieldDoubleVectOnConst.getTime()
504 print "     Iteration Number",iterationNb
505 print "     Order Number",orderNb
506 print "     Time",time
507 for k in range(nbOfComp):
508     kp1 = k+1
509     compName = fieldDoubleVectOnConst.getComponentName(kp1)
510     compDesc = fieldDoubleVectOnConst.getComponentDescription(kp1)
511     compUnit = fieldDoubleVectOnConst.getMEDComponentUnit(kp1)
512     print "      * Component:",kp1
513     print "          Name:",compName
514     print "          Description:",compDesc
515     print "          Unit:",compUnit
516
517 support = fieldDoubleVectOnConst.getSupport()
518 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
519 print "     Values:",nbOf
520 for k in range(nbOf):
521     valueI = fieldDoubleVectOnConst.getRow(k+1)
522     print "     *",valueI[:nbOfComp]
523
524 print ""
525 name = fieldIntScalOnConst.getName()
526 desc = fieldIntScalOnConst.getDescription()
527 nbOfComp = fieldIntScalOnConst.getNumberOfComponents()
528 print "     Field",name," : ",desc
529 print "     Number Of Components:",nbOfComp
530 iterationNb = fieldIntScalOnConst.getIterationNumber()
531 orderNb = fieldIntScalOnConst.getOrderNumber()
532 time = fieldIntScalOnConst.getTime()
533 print "     Iteration Number",iterationNb
534 print "     Order Number",orderNb
535 print "     Time",time
536 for k in range(nbOfComp):
537     kp1 = k+1
538     compName = fieldIntScalOnConst.getComponentName(kp1)
539     compDesc = fieldIntScalOnConst.getComponentDescription(kp1)
540     compUnit = fieldIntScalOnConst.getMEDComponentUnit(kp1)
541     print "      * Component:",kp1
542     print "          Name:",compName
543     print "          Description:",compDesc
544     print "          Unit:",compUnit
545
546 support = fieldIntScalOnConst.getSupport()
547 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
548 print "     Values:",nbOf
549 for k in range(nbOf):
550     valueI = fieldIntScalOnConst.getRow(k+1)
551     print "     *",valueI[:nbOfComp]
552
553 print ""
554 name = fieldIntVectOnConst.getName()
555 desc = fieldIntVectOnConst.getDescription()
556 nbOfComp = fieldIntVectOnConst.getNumberOfComponents()
557 print "     Field",name," : ",desc
558 print "     Number Of Components:",nbOfComp
559 iterationNb = fieldIntVectOnConst.getIterationNumber()
560 orderNb = fieldIntVectOnConst.getOrderNumber()
561 time = fieldIntVectOnConst.getTime()
562 print "     Iteration Number",iterationNb
563 print "     Order Number",orderNb
564 print "     Time",time
565 for k in range(nbOfComp):
566     kp1 = k+1
567     compName = fieldIntVectOnConst.getComponentName(kp1)
568     compDesc = fieldIntVectOnConst.getComponentDescription(kp1)
569     compUnit = fieldIntVectOnConst.getMEDComponentUnit(kp1)
570     print "      * Component:",kp1
571     print "          Name:",compName
572     print "          Description:",compDesc
573     print "          Unit:",compUnit
574
575 support = fieldIntVectOnConst.getSupport()
576 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
577 print "     Values:",nbOf
578 for k in range(nbOf):
579     valueI = fieldIntVectOnConst.getRow(k+1)
580     print "     *",valueI[:nbOfComp]
581
582 print ""
583 print "END of the Pyhton script ..... Ctrl D to exit"