Back to index

salome-med  6.5.0
med_field_anal.py
Go to the documentation of this file.
00001 #  -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00005 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00006 #
00007 # This library is free software; you can redistribute it and/or
00008 # modify it under the terms of the GNU Lesser General Public
00009 # License as published by the Free Software Foundation; either
00010 # version 2.1 of the License.
00011 #
00012 # This library is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 # Lesser General Public License for more details.
00016 #
00017 # You should have received a copy of the GNU Lesser General Public
00018 # License along with this library; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00020 #
00021 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00022 #
00023 
00024 ############################################################################
00025 # This Python script is testing the generation of MED field using a
00026 # user-callable function with different number of components and
00027 # different SUPPORTs.
00028 ############################################################################
00029 #
00030 from math import *
00031 
00032 def f_scal_dbl_2d(x, y):
00033     ret = []
00034     ret.append(x + y)
00035     return ret
00036 
00037 def f_scal_dbl_3d(x, y, z):
00038     ret = []
00039     ret.append(x + y + z)
00040     return ret
00041 
00042 def f_vect_dbl_2d(x, y):
00043     ret = []
00044     ret.append(x + y)
00045     ret.append(2.*(x + y))
00046     return ret
00047 
00048 def f_vect_dbl_3d(x, y, z):
00049     ret = []
00050     ret.append(x + y + z)
00051     ret.append(2.*(x + y + z))
00052     ret.append(3.*(x + y + z))
00053     return ret
00054 
00055 def f_scal_int_2d(x, y):
00056     ret = []
00057     ret_tmp = x + y
00058     ret_tmp = int(ret_tmp)
00059     ret.append(ret_tmp)
00060     return ret
00061 
00062 def f_scal_int_3d(x, y, z):
00063     ret = []
00064     ret_tmp = x + y + z
00065     ret_tmp = int(ret_tmp)
00066     ret.append(ret_tmp)
00067     return ret
00068 
00069 def f_vect_int_2d(x, y):
00070     ret = []
00071     ret.append(int(x + y))
00072     ret.append(int(2.*(x + y)))
00073     return ret
00074 
00075 def f_vect_int_3d(x, y, z):
00076     ret = []
00077     ret.append(int(x + y + z))
00078     ret.append(int(2.*(x + y + z)))
00079     ret.append(int(3.*(x + y + z)))
00080     return ret
00081 
00082 from libMEDMEM_Swig import *
00083 from random import *
00084 import os
00085 #
00086 #befor running this script, please be sure about the path the file fileName
00087 #
00088 filePath=os.environ["MED_ROOT_DIR"]
00089 filePath=os.path.join(filePath, "share", "salome", "resources", "med")
00090 
00091 medFile = os.path.join(filePath, "carre_en_quad4_seg2.med")
00092 medFile = os.path.join(filePath, "cube_hexa8_quad4.med")
00093 
00094 def print_ord(i):
00095     if i == 0:
00096         return 'first'
00097     elif i == 1:
00098         return 'second'
00099     elif i == 2:
00100         return 'third'
00101     else:
00102         return `i`+'th'
00103 
00104 md = MEDFILEBROWSER(medFile)
00105 nbMeshes = md.getNumberOfMeshes()
00106 
00107 print "The med file", medFile, "contains", nbMeshes, "mesh(es)"
00108 
00109 mesh_name = md.getMeshName(0)
00110 mesh = MESH(MED_DRIVER,medFile,mesh_name)
00111 spaceDim = mesh.getSpaceDimension()
00112 meshDim = mesh.getMeshDimension()
00113 nbNodes = mesh.getNumberOfNodes()
00114 
00115 print ""
00116 print "The mesh",mesh_name,"is a",spaceDim,"D mesh on a",meshDim,"D geometry and has",nbNodes,"Nodes"
00117 
00118 supportOnCell = mesh.getSupportOnAll(MED_CELL)
00119 
00120 supportOnNode = mesh.getSupportOnAll(MED_NODE)
00121 
00122 if (spaceDim == 3) :
00123     supportOnConst = mesh.getSupportOnAll(MED_FACE)
00124 elif (spaceDim == 2) :
00125     supportOnConst = mesh.getSupportOnAll(MED_EDGE)
00126 
00127 ##print ""
00128 ##print supportOnCell
00129 
00130 if (spaceDim == 2) :
00131     fieldDoubleScalOnCell = createFieldDoubleFromAnalytic(supportOnCell,1,
00132                                                           f_scal_dbl_2d)
00133     fieldDoubleVectOnCell = createFieldDoubleFromAnalytic(supportOnCell,
00134                                                           spaceDim,
00135                                                           f_vect_dbl_2d)
00136     fieldIntScalOnCell = createFieldIntFromAnalytic(supportOnCell,1,
00137                                                     f_scal_int_2d)
00138     fieldIntVectOnCell = createFieldIntFromAnalytic(supportOnCell,spaceDim,
00139                                                     f_vect_int_2d)
00140 elif (spaceDim == 3) :
00141     fieldDoubleScalOnCell = createFieldDoubleFromAnalytic(supportOnCell,1,
00142                                                           f_scal_dbl_3d)
00143     fieldDoubleVectOnCell = createFieldDoubleFromAnalytic(supportOnCell,
00144                                                           spaceDim,
00145                                                           f_vect_dbl_3d)
00146     fieldIntScalOnCell = createFieldIntFromAnalytic(supportOnCell,1,
00147                                                     f_scal_int_3d)
00148     fieldIntVectOnCell = createFieldIntFromAnalytic(supportOnCell,spaceDim,
00149                                                     f_vect_int_3d)
00150 
00151 fieldDoubleScalOnCell.setName("Scalar Double Field on all Cells")
00152 fieldDoubleScalOnCell.setDescription("Generated via a Python function")
00153 
00154 fieldDoubleVectOnCell.setName("Vector Double Field on all Cells")
00155 fieldDoubleVectOnCell.setDescription("Generated via a Python function")
00156 
00157 fieldIntScalOnCell.setName("Scalar Integer Field on all Cells")
00158 fieldIntScalOnCell.setDescription("Generated via a Python function")
00159 
00160 fieldIntVectOnCell.setName("Vector Integer Field on all Cells")
00161 fieldIntVectOnCell.setDescription("Generated via a Python function")
00162 
00163 name = fieldDoubleScalOnCell.getName()
00164 desc = fieldDoubleScalOnCell.getDescription()
00165 nbOfComp = fieldDoubleScalOnCell.getNumberOfComponents()
00166 print "     Field",name," : ",desc
00167 print "     Number Of Components:",nbOfComp
00168 iterationNb = fieldDoubleScalOnCell.getIterationNumber()
00169 orderNb = fieldDoubleScalOnCell.getOrderNumber()
00170 time = fieldDoubleScalOnCell.getTime()
00171 print "     Iteration Number",iterationNb
00172 print "     Order Number",orderNb
00173 print "     Time",time
00174 for k in range(nbOfComp):
00175     kp1 = k+1
00176     compName = fieldDoubleScalOnCell.getComponentName(kp1)
00177     compDesc = fieldDoubleScalOnCell.getComponentDescription(kp1)
00178     compUnit = fieldDoubleScalOnCell.getMEDComponentUnit(kp1)
00179     print "      * Component:",kp1
00180     print "          Name:",compName
00181     print "          Description:",compDesc
00182     print "          Unit:",compUnit
00183 
00184 support = fieldDoubleScalOnCell.getSupport()
00185 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00186 print "     Values:",nbOf
00187 for k in range(nbOf):
00188     valueI = fieldDoubleScalOnCell.getRow(k+1)
00189     print "     *",valueI[:nbOfComp]
00190 
00191 print ""
00192 name = fieldDoubleVectOnCell.getName()
00193 desc = fieldDoubleVectOnCell.getDescription()
00194 nbOfComp = fieldDoubleVectOnCell.getNumberOfComponents()
00195 print "     Field",name," : ",desc
00196 print "     Number Of Components:",nbOfComp
00197 iterationNb = fieldDoubleVectOnCell.getIterationNumber()
00198 orderNb = fieldDoubleVectOnCell.getOrderNumber()
00199 time = fieldDoubleVectOnCell.getTime()
00200 print "     Iteration Number",iterationNb
00201 print "     Order Number",orderNb
00202 print "     Time",time
00203 for k in range(nbOfComp):
00204     kp1 = k+1
00205     compName = fieldDoubleVectOnCell.getComponentName(kp1)
00206     compDesc = fieldDoubleVectOnCell.getComponentDescription(kp1)
00207     compUnit = fieldDoubleVectOnCell.getMEDComponentUnit(kp1)
00208     print "      * Component:",kp1
00209     print "          Name:",compName
00210     print "          Description:",compDesc
00211     print "          Unit:",compUnit
00212 
00213 support = fieldDoubleVectOnCell.getSupport()
00214 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00215 print "     Values:",nbOf
00216 for k in range(nbOf):
00217     valueI = fieldDoubleVectOnCell.getRow(k+1)
00218     print "     *",valueI[:nbOfComp]
00219 
00220 print ""
00221 name = fieldIntScalOnCell.getName()
00222 desc = fieldIntScalOnCell.getDescription()
00223 nbOfComp = fieldIntScalOnCell.getNumberOfComponents()
00224 print "     Field",name," : ",desc
00225 print "     Number Of Components:",nbOfComp
00226 iterationNb = fieldIntScalOnCell.getIterationNumber()
00227 orderNb = fieldIntScalOnCell.getOrderNumber()
00228 time = fieldIntScalOnCell.getTime()
00229 print "     Iteration Number",iterationNb
00230 print "     Order Number",orderNb
00231 print "     Time",time
00232 for k in range(nbOfComp):
00233     kp1 = k+1
00234     compName = fieldIntScalOnCell.getComponentName(kp1)
00235     compDesc = fieldIntScalOnCell.getComponentDescription(kp1)
00236     compUnit = fieldIntScalOnCell.getMEDComponentUnit(kp1)
00237     print "      * Component:",kp1
00238     print "          Name:",compName
00239     print "          Description:",compDesc
00240     print "          Unit:",compUnit
00241 
00242 support = fieldIntScalOnCell.getSupport()
00243 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00244 print "     Values:",nbOf
00245 for k in range(nbOf):
00246     valueI = fieldIntScalOnCell.getRow(k+1)
00247     print "     *",valueI[:nbOfComp]
00248 
00249 print ""
00250 name = fieldIntVectOnCell.getName()
00251 desc = fieldIntVectOnCell.getDescription()
00252 nbOfComp = fieldIntVectOnCell.getNumberOfComponents()
00253 print "     Field",name," : ",desc
00254 print "     Number Of Components:",nbOfComp
00255 iterationNb = fieldIntVectOnCell.getIterationNumber()
00256 orderNb = fieldIntVectOnCell.getOrderNumber()
00257 time = fieldIntVectOnCell.getTime()
00258 print "     Iteration Number",iterationNb
00259 print "     Order Number",orderNb
00260 print "     Time",time
00261 for k in range(nbOfComp):
00262     kp1 = k+1
00263     compName = fieldIntVectOnCell.getComponentName(kp1)
00264     compDesc = fieldIntVectOnCell.getComponentDescription(kp1)
00265     compUnit = fieldIntVectOnCell.getMEDComponentUnit(kp1)
00266     print "      * Component:",kp1
00267     print "          Name:",compName
00268     print "          Description:",compDesc
00269     print "          Unit:",compUnit
00270 
00271 support = fieldIntVectOnCell.getSupport()
00272 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00273 print "     Values:",nbOf
00274 for k in range(nbOf):
00275     valueI = fieldIntVectOnCell.getRow(k+1)
00276     print "     *",valueI[:nbOfComp]
00277 
00278 ##print ""
00279 ##print supportOnNode
00280 
00281 if (spaceDim == 2) :
00282     fieldDoubleScalOnNode = createFieldDoubleFromAnalytic(supportOnNode,1,
00283                                                           f_scal_dbl_2d)
00284     fieldDoubleVectOnNode = createFieldDoubleFromAnalytic(supportOnNode,
00285                                                           spaceDim,
00286                                                           f_vect_dbl_2d)
00287     fieldIntScalOnNode = createFieldIntFromAnalytic(supportOnNode,1,
00288                                                     f_scal_int_2d)
00289     fieldIntVectOnNode = createFieldIntFromAnalytic(supportOnNode, spaceDim,
00290                                                     f_vect_int_2d)
00291 elif (spaceDim == 3) :
00292     fieldDoubleScalOnNode = createFieldDoubleFromAnalytic(supportOnNode,1,
00293                                                           f_scal_dbl_3d)
00294     fieldDoubleVectOnNode = createFieldDoubleFromAnalytic(supportOnNode,
00295                                                           spaceDim,
00296                                                           f_vect_dbl_3d)
00297     fieldIntScalOnNode = createFieldIntFromAnalytic(supportOnNode,1,
00298                                                     f_scal_int_3d)
00299     fieldIntVectOnNode = createFieldIntFromAnalytic(supportOnNode, spaceDim,
00300                                                     f_vect_int_3d)
00301 
00302 fieldDoubleScalOnNode.setName("Scalar Double Field on all Nodes")
00303 fieldDoubleScalOnNode.setDescription("Generated via a Python function")
00304 
00305 fieldDoubleVectOnNode.setName("Vector Double Field on all Nodes")
00306 fieldDoubleVectOnNode.setDescription("Generated via a Python function")
00307 
00308 fieldIntScalOnNode.setName("Scalar Integer Field on all Nodes")
00309 fieldIntScalOnNode.setDescription("Generated via a Python function")
00310 
00311 fieldIntVectOnNode.setName("Vector Integer Field on all Nodes")
00312 fieldIntVectOnNode.setDescription("Generated via a Python function")
00313 
00314 print ""
00315 name = fieldDoubleScalOnNode.getName()
00316 desc = fieldDoubleScalOnNode.getDescription()
00317 nbOfComp = fieldDoubleScalOnNode.getNumberOfComponents()
00318 print "     Field",name," : ",desc
00319 print "     Number Of Components:",nbOfComp
00320 iterationNb = fieldDoubleScalOnNode.getIterationNumber()
00321 orderNb = fieldDoubleScalOnNode.getOrderNumber()
00322 time = fieldDoubleScalOnNode.getTime()
00323 print "     Iteration Number",iterationNb
00324 print "     Order Number",orderNb
00325 print "     Time",time
00326 for k in range(nbOfComp):
00327     kp1 = k+1
00328     compName = fieldDoubleScalOnNode.getComponentName(kp1)
00329     compDesc = fieldDoubleScalOnNode.getComponentDescription(kp1)
00330     compUnit = fieldDoubleScalOnNode.getMEDComponentUnit(kp1)
00331     print "      * Component:",kp1
00332     print "          Name:",compName
00333     print "          Description:",compDesc
00334     print "          Unit:",compUnit
00335 
00336 support = fieldDoubleScalOnNode.getSupport()
00337 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00338 print "     Values:",nbOf
00339 for k in range(nbOf):
00340     valueI = fieldDoubleScalOnNode.getRow(k+1)
00341     print "     *",valueI[:nbOfComp]
00342 
00343 print ""
00344 name = fieldDoubleVectOnNode.getName()
00345 desc = fieldDoubleVectOnNode.getDescription()
00346 nbOfComp = fieldDoubleVectOnNode.getNumberOfComponents()
00347 print "     Field",name," : ",desc
00348 print "     Number Of Components:",nbOfComp
00349 iterationNb = fieldDoubleVectOnNode.getIterationNumber()
00350 orderNb = fieldDoubleVectOnNode.getOrderNumber()
00351 time = fieldDoubleVectOnNode.getTime()
00352 print "     Iteration Number",iterationNb
00353 print "     Order Number",orderNb
00354 print "     Time",time
00355 for k in range(nbOfComp):
00356     kp1 = k+1
00357     compName = fieldDoubleVectOnNode.getComponentName(kp1)
00358     compDesc = fieldDoubleVectOnNode.getComponentDescription(kp1)
00359     compUnit = fieldDoubleVectOnNode.getMEDComponentUnit(kp1)
00360     print "      * Component:",kp1
00361     print "          Name:",compName
00362     print "          Description:",compDesc
00363     print "          Unit:",compUnit
00364 
00365 support = fieldDoubleVectOnNode.getSupport()
00366 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00367 print "     Values:",nbOf
00368 for k in range(nbOf):
00369     valueI = fieldDoubleVectOnNode.getRow(k+1)
00370     print "     *",valueI[:nbOfComp]
00371 
00372 print ""
00373 name = fieldIntScalOnNode.getName()
00374 desc = fieldIntScalOnNode.getDescription()
00375 nbOfComp = fieldIntScalOnNode.getNumberOfComponents()
00376 print "     Field",name," : ",desc
00377 print "     Number Of Components:",nbOfComp
00378 iterationNb = fieldIntScalOnNode.getIterationNumber()
00379 orderNb = fieldIntScalOnNode.getOrderNumber()
00380 time = fieldIntScalOnNode.getTime()
00381 print "     Iteration Number",iterationNb
00382 print "     Order Number",orderNb
00383 print "     Time",time
00384 for k in range(nbOfComp):
00385     kp1 = k+1
00386     compName = fieldIntScalOnNode.getComponentName(kp1)
00387     compDesc = fieldIntScalOnNode.getComponentDescription(kp1)
00388     compUnit = fieldIntScalOnNode.getMEDComponentUnit(kp1)
00389     print "      * Component:",kp1
00390     print "          Name:",compName
00391     print "          Description:",compDesc
00392     print "          Unit:",compUnit
00393 
00394 support = fieldIntScalOnNode.getSupport()
00395 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00396 print "     Values:",nbOf
00397 for k in range(nbOf):
00398     valueI = fieldIntScalOnNode.getRow(k+1)
00399     print "     *",valueI[:nbOfComp]
00400 
00401 print ""
00402 name = fieldIntVectOnNode.getName()
00403 desc = fieldIntVectOnNode.getDescription()
00404 nbOfComp = fieldIntVectOnNode.getNumberOfComponents()
00405 print "     Field",name," : ",desc
00406 print "     Number Of Components:",nbOfComp
00407 iterationNb = fieldIntVectOnNode.getIterationNumber()
00408 orderNb = fieldIntVectOnNode.getOrderNumber()
00409 time = fieldIntVectOnNode.getTime()
00410 print "     Iteration Number",iterationNb
00411 print "     Order Number",orderNb
00412 print "     Time",time
00413 for k in range(nbOfComp):
00414     kp1 = k+1
00415     compName = fieldIntVectOnNode.getComponentName(kp1)
00416     compDesc = fieldIntVectOnNode.getComponentDescription(kp1)
00417     compUnit = fieldIntVectOnNode.getMEDComponentUnit(kp1)
00418     print "      * Component:",kp1
00419     print "          Name:",compName
00420     print "          Description:",compDesc
00421     print "          Unit:",compUnit
00422 
00423 support = fieldIntVectOnNode.getSupport()
00424 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00425 print "     Values:",nbOf
00426 for k in range(nbOf):
00427     valueI = fieldIntVectOnNode.getRow(k+1)
00428     print "     *",valueI[:nbOfComp]
00429 
00430 ##print ""
00431 ##print supportOnConst
00432 
00433 if (spaceDim == 2) :
00434     fieldDoubleScalOnConst = createFieldDoubleFromAnalytic(supportOnConst,1,
00435                                                            f_scal_dbl_2d)
00436     fieldDoubleVectOnConst = createFieldDoubleFromAnalytic(supportOnConst,
00437                                                            spaceDim,
00438                                                            f_vect_dbl_2d)
00439     fieldIntScalOnConst = createFieldIntFromAnalytic(supportOnConst,1,
00440                                                      f_scal_int_2d)
00441     fieldIntVectOnConst = createFieldIntFromAnalytic(supportOnConst, spaceDim,
00442                                                      f_vect_int_2d)
00443 elif (spaceDim == 3) :
00444     fieldDoubleScalOnConst = createFieldDoubleFromAnalytic(supportOnConst,1,
00445                                                            f_scal_dbl_3d)
00446     fieldDoubleVectOnConst = createFieldDoubleFromAnalytic(supportOnConst,
00447                                                            spaceDim,
00448                                                            f_vect_dbl_3d)
00449     fieldIntScalOnConst = createFieldIntFromAnalytic(supportOnConst,1,
00450                                                      f_scal_int_3d)
00451     fieldIntVectOnConst = createFieldIntFromAnalytic(supportOnConst, spaceDim,
00452                                                      f_vect_int_3d)
00453 
00454 fieldDoubleScalOnConst.setName("Scalar Double Field on all Faces/Edges")
00455 fieldDoubleScalOnConst.setDescription("Generated via a Python function")
00456 
00457 fieldDoubleVectOnConst.setName("Vector Double Field on all Faces/Edges")
00458 fieldDoubleVectOnConst.setDescription("Generated via a Python function")
00459 
00460 fieldIntScalOnConst.setName("Scalar Integer Field on all Faces/Edges")
00461 fieldIntScalOnConst.setDescription("Generated via a Python function")
00462 
00463 fieldIntVectOnConst.setName("Vector Integer Field on all Faces/Edges")
00464 fieldIntVectOnConst.setDescription("Generated via a Python function")
00465 
00466 print ""
00467 name = fieldDoubleScalOnConst.getName()
00468 desc = fieldDoubleScalOnConst.getDescription()
00469 nbOfComp = fieldDoubleScalOnConst.getNumberOfComponents()
00470 print "     Field",name," : ",desc
00471 print "     Number Of Components:",nbOfComp
00472 iterationNb = fieldDoubleScalOnConst.getIterationNumber()
00473 orderNb = fieldDoubleScalOnConst.getOrderNumber()
00474 time = fieldDoubleScalOnConst.getTime()
00475 print "     Iteration Number",iterationNb
00476 print "     Order Number",orderNb
00477 print "     Time",time
00478 for k in range(nbOfComp):
00479     kp1 = k+1
00480     compName = fieldDoubleScalOnConst.getComponentName(kp1)
00481     compDesc = fieldDoubleScalOnConst.getComponentDescription(kp1)
00482     compUnit = fieldDoubleScalOnConst.getMEDComponentUnit(kp1)
00483     print "      * Component:",kp1
00484     print "          Name:",compName
00485     print "          Description:",compDesc
00486     print "          Unit:",compUnit
00487 
00488 support = fieldDoubleScalOnConst.getSupport()
00489 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00490 print "     Values:",nbOf
00491 for k in range(nbOf):
00492     valueI = fieldDoubleScalOnConst.getRow(k+1)
00493     print "     *",valueI[:nbOfComp]
00494 
00495 print ""
00496 name = fieldDoubleVectOnConst.getName()
00497 desc = fieldDoubleVectOnConst.getDescription()
00498 nbOfComp = fieldDoubleVectOnConst.getNumberOfComponents()
00499 print "     Field",name," : ",desc
00500 print "     Number Of Components:",nbOfComp
00501 iterationNb = fieldDoubleVectOnConst.getIterationNumber()
00502 orderNb = fieldDoubleVectOnConst.getOrderNumber()
00503 time = fieldDoubleVectOnConst.getTime()
00504 print "     Iteration Number",iterationNb
00505 print "     Order Number",orderNb
00506 print "     Time",time
00507 for k in range(nbOfComp):
00508     kp1 = k+1
00509     compName = fieldDoubleVectOnConst.getComponentName(kp1)
00510     compDesc = fieldDoubleVectOnConst.getComponentDescription(kp1)
00511     compUnit = fieldDoubleVectOnConst.getMEDComponentUnit(kp1)
00512     print "      * Component:",kp1
00513     print "          Name:",compName
00514     print "          Description:",compDesc
00515     print "          Unit:",compUnit
00516 
00517 support = fieldDoubleVectOnConst.getSupport()
00518 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00519 print "     Values:",nbOf
00520 for k in range(nbOf):
00521     valueI = fieldDoubleVectOnConst.getRow(k+1)
00522     print "     *",valueI[:nbOfComp]
00523 
00524 print ""
00525 name = fieldIntScalOnConst.getName()
00526 desc = fieldIntScalOnConst.getDescription()
00527 nbOfComp = fieldIntScalOnConst.getNumberOfComponents()
00528 print "     Field",name," : ",desc
00529 print "     Number Of Components:",nbOfComp
00530 iterationNb = fieldIntScalOnConst.getIterationNumber()
00531 orderNb = fieldIntScalOnConst.getOrderNumber()
00532 time = fieldIntScalOnConst.getTime()
00533 print "     Iteration Number",iterationNb
00534 print "     Order Number",orderNb
00535 print "     Time",time
00536 for k in range(nbOfComp):
00537     kp1 = k+1
00538     compName = fieldIntScalOnConst.getComponentName(kp1)
00539     compDesc = fieldIntScalOnConst.getComponentDescription(kp1)
00540     compUnit = fieldIntScalOnConst.getMEDComponentUnit(kp1)
00541     print "      * Component:",kp1
00542     print "          Name:",compName
00543     print "          Description:",compDesc
00544     print "          Unit:",compUnit
00545 
00546 support = fieldIntScalOnConst.getSupport()
00547 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00548 print "     Values:",nbOf
00549 for k in range(nbOf):
00550     valueI = fieldIntScalOnConst.getRow(k+1)
00551     print "     *",valueI[:nbOfComp]
00552 
00553 print ""
00554 name = fieldIntVectOnConst.getName()
00555 desc = fieldIntVectOnConst.getDescription()
00556 nbOfComp = fieldIntVectOnConst.getNumberOfComponents()
00557 print "     Field",name," : ",desc
00558 print "     Number Of Components:",nbOfComp
00559 iterationNb = fieldIntVectOnConst.getIterationNumber()
00560 orderNb = fieldIntVectOnConst.getOrderNumber()
00561 time = fieldIntVectOnConst.getTime()
00562 print "     Iteration Number",iterationNb
00563 print "     Order Number",orderNb
00564 print "     Time",time
00565 for k in range(nbOfComp):
00566     kp1 = k+1
00567     compName = fieldIntVectOnConst.getComponentName(kp1)
00568     compDesc = fieldIntVectOnConst.getComponentDescription(kp1)
00569     compUnit = fieldIntVectOnConst.getMEDComponentUnit(kp1)
00570     print "      * Component:",kp1
00571     print "          Name:",compName
00572     print "          Description:",compDesc
00573     print "          Unit:",compUnit
00574 
00575 support = fieldIntVectOnConst.getSupport()
00576 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00577 print "     Values:",nbOf
00578 for k in range(nbOf):
00579     valueI = fieldIntVectOnConst.getRow(k+1)
00580     print "     *",valueI[:nbOfComp]
00581 
00582 print ""
00583 print "END of the Pyhton script ..... Ctrl D to exit"