Back to index

salome-med  6.5.0
med_test1.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 parsing a MED file using MED Memory from SALOME platform:
00026 # It analyses all meshes in the MED file (coordinates, connectivity of d-cells as
00027 # well as (d-1)-cells, families). It analyses fields stored in the MED file (d is
00028 # the space dimension). You can assume that it is a kind of MED file parser.
00029 ###################################################################################
00030 #
00031 from libMEDMEM_Swig import *
00032 from random import *
00033 import os
00034 #
00035 #befor running this script, please be sure about the path the file fileName
00036 #
00037 filePath=os.environ["MED_ROOT_DIR"]
00038 filePath=os.path.join(filePath, "share", "salome", "resources", "med")
00039 
00040 medFile = os.path.join(filePath, "carre_en_quad4_seg2.med")
00041 #medFile = os.path.join(filePath, "cube_hexa8_quad4.med")
00042 
00043 def print_ord(i):
00044     if i == 0:
00045         return 'first'
00046     elif i == 1:
00047         return 'second'
00048     elif i == 2:
00049         return 'third'
00050     else:
00051         return `i`+'th'
00052 
00053 md = MEDFILEBROWSER(medFile)
00054 
00055 nbMeshes = md.getNumberOfMeshes()
00056 
00057 nbFields = md.getNumberOfFields()
00058 
00059 print "The med file", medFile, "contains", nbMeshes, "mesh(es) and", nbFields, "field(s)"
00060 
00061 if (nbMeshes>0):
00062     print "Mesh(es) Name(s) is(are) "
00063 
00064     for i in range(nbMeshes):
00065         mesh_name = md.getMeshName(i)
00066         print "   - ",mesh_name
00067 
00068 if (nbFields>0):
00069     print "Field(s) Name(s) is(are) "
00070 
00071     for i in range(nbFields):
00072         field_name = md.getFieldName(i)
00073         print "   - ",field_name
00074 
00075 print ""
00076 
00077 if (nbMeshes>0):
00078     print "Mesh(es) Analysis "
00079     for i in range(nbMeshes):
00080         mesh_name = md.getMeshName(i)
00081         mesh = MESH(MED_DRIVER,md.getFileName(),mesh_name)
00082         spaceDim = mesh.getSpaceDimension()
00083         meshDim = mesh.getMeshDimension()
00084         print "The",print_ord(i), "mesh, '",mesh_name,"', is a",spaceDim,"D mesh on a",meshDim,"D geometry"
00085         nbNodes = mesh.getNumberOfNodes()
00086         print "The mesh has",nbNodes,"Nodes"
00087         coordSyst = mesh.getCoordinatesSystem()
00088         print "The coordinates system is",coordSyst
00089         print "The Coordinates :"
00090         coordNames = []
00091         coordUnits = []
00092         for isd in range(spaceDim):
00093             coordNames.append(mesh.getCoordinateName(isd))
00094             coordUnits.append(mesh.getCoordinateUnit(isd))
00095 
00096         print "names:", coordNames
00097         print "units", coordUnits
00098         print "values:"
00099         coordinates = mesh.getCoordinates(MED_FULL_INTERLACE)
00100         for k in range(nbNodes):
00101             kp1 = k+1
00102             coords = []
00103             for isd in range(spaceDim):
00104                 isdp1 = isd+1
00105                 coords.append(mesh.getCoordinate(kp1,isdp1))
00106 
00107             print coords," ---- ", coordinates[k*spaceDim:((k+1)*spaceDim)]
00108 
00109         print ""
00110         print "Show the Nodal Connectivity of Cells:"
00111         nbTypesCell = mesh.getNumberOfTypes(MED_CELL)
00112         print ""
00113         if (nbTypesCell>0):
00114             print "The Mesh has",nbTypesCell,"Type(s) of Cell"
00115             types = mesh.getTypes(MED_CELL)
00116             for k in range(nbTypesCell):
00117                 type = types[k]
00118                 nbElemType = mesh.getNumberOfElements(MED_CELL,type)
00119                 print "For the type:",type,"there is(are)",nbElemType,"elemnt(s)"
00120                 connectivity = mesh.getConnectivity(MED_NODAL,MED_CELL,type)
00121                 nbNodesPerCell = type%100
00122                 for j in range(nbElemType):
00123                     print "Element",(j+1)," ",connectivity[j*nbNodesPerCell:(j+1)*nbNodesPerCell]
00124 
00125         print ""
00126         print "Show the Nodal Connectivity of constituents (Faces in 3D or Edges in 2D):"
00127 
00128         if (spaceDim == 3) : constituent = MED_FACE
00129         elif (spaceDim == 2) : constituent = MED_EDGE
00130         else : print "proble with the sapce dimension : ",spaceDim
00131 
00132         nbTypesConst = mesh.getNumberOfTypes(constituent)
00133         print ""
00134         if (nbTypesConst>0):
00135             print "The Mesh has",nbTypesConst,"Type(s) of Constituent"
00136             types = mesh.getTypes(constituent)
00137             for k in range(nbTypesConst):
00138                 type = types[k]
00139                 nbElemType = mesh.getNumberOfElements(constituent,type)
00140                 print "For the type:",type,"there is(are)",nbElemType,"elemnt(s)"
00141                 connectivity = mesh.getConnectivity(MED_NODAL,constituent,type)
00142                 nbNodesPerCell = type%100
00143                 for j in range(nbElemType):
00144                     print "Element",(j+1)," ",connectivity[j*nbNodesPerCell:(j+1)*nbNodesPerCell]
00145 
00146         print ""
00147         print "Show the Reverse Nodal Connectivity:"
00148         ReverseConnectivity = mesh.getReverseConnectivity(MED_NODAL)
00149         ReverseConnectivityIndex = mesh.getReverseConnectivityIndex(MED_NODAL)
00150         print ""
00151         for j in range(nbNodes):
00152             begin = ReverseConnectivityIndex[j]-1
00153             end = ReverseConnectivityIndex[j+1]-1
00154             print "Node",(j+1),"-->",ReverseConnectivity[begin:end]
00155 
00156         print ""
00157         print "Show the Descending Connectivity:"
00158         mesh.calculateConnectivity(MED_DESCENDING,MED_CELL)
00159         nbElemts = mesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
00160         Connectivity = mesh.getConnectivity(MED_DESCENDING,MED_CELL,MED_ALL_ELEMENTS)
00161         ConnectivityIndex = mesh.getConnectivityIndex(MED_DESCENDING,MED_CELL)
00162         print ""
00163         for j in range(nbElemts):
00164             begin = ConnectivityIndex[j]-1
00165             end = ConnectivityIndex[j+1]-1
00166             print "Element",(j+1),"-->",Connectivity[begin:end]
00167 
00168         print ""
00169         for entity in [MED_NODE,MED_CELL,MED_FACE,MED_EDGE]:
00170             nbFam = mesh.getNumberOfFamilies(entity)
00171             if (entity == MED_NODE) & (nbFam > 0):
00172                 print "This mesh has",nbFam,"Node Family(ies)"
00173             elif (entity == MED_CELL) & (nbFam > 0):
00174                 print "This mesh has",nbFam,"Cell Family(ies)"
00175             elif (entity == MED_FACE) & (nbFam > 0):
00176                 print "This mesh has",nbFam,"Face Family(ies)"
00177             elif (entity == MED_EDGE) & (nbFam > 0):
00178                 print "This mesh has",nbFam,"Edge Family(ies)"
00179 
00180             if nbFam > 0:
00181                 for j in range(nbFam):
00182                     print ""
00183                     family = mesh.getFamily(entity,j+1)
00184                     familyName = family.getName()
00185                     familyDescription = family.getDescription()
00186                     familyEntity = family.getEntity()
00187                     familyBool = family.isOnAllElements()
00188                     print "  -Name:",familyName
00189                     print "  -Description:",familyDescription
00190                     print "  -Entity:",familyEntity
00191                     familyIdentifier = family.getIdentifier()
00192                     nbOfAtt = family.getNumberOfAttributes()
00193                     print "  -Identifier:",familyIdentifier
00194                     print "  -Number Of Attributes:",nbOfAtt
00195                     attributesids = family.getAttributesIdentifiers()
00196                     attributesvals = family.getAttributesValues()
00197                     for k in range(nbOfAtt):
00198                         print "    * Attributes:",attributesids[k],":",attributesvals[k],",",family.getAttributeDescription(k+1)
00199                     nbOfGrp = family.getNumberOfGroups()
00200                     print "  -Number Of Groups:",nbOfGrp
00201                     for k in range(nbOfGrp):
00202                         print "    * Group:",family.getGroupName(k+1)
00203                     print "  -Entities list:"
00204                     if (familyBool):
00205                         print "  -Is on all entities"
00206                     else:
00207                         nbOfTypes = family.getNumberOfTypes()
00208                         types = family.getTypes()
00209                         print "  -Number Of Types:",nbOfTypes
00210                         for k in range(nbOfTypes):
00211                             type = types[k]
00212                             nbOfElmtsOfType = family.getNumberOfElements(type)
00213                             number = family.getNumber(type)
00214                             print "    * Type",type
00215                             print "    * Number",number[0:nbOfElmtsOfType]
00216                         print ""
00217                         numberFamily = family.getNumber(MED_ALL_ELEMENTS)
00218                         print "    * Getting an Integer Field on the family ",familyName
00219                         fieldFamilyIntg = FIELDINT(family,spaceDim)
00220                         fieldFamilyIntg.setIterationNumber(0)
00221                         fieldFamilyIntg.setOrderNumber(0)
00222                         fieldFamilyIntg.setTime(0.0)
00223                         for kcomp in range(spaceDim):
00224                             kcomp1 = kcomp+1
00225                             if kcomp == 0:
00226                                 fieldCompName = "comp1"
00227                                 fieldCompDesc = "desc1"
00228                                 fieldCompUnit = "unit1"
00229                             if kcomp == 1:
00230                                 fieldCompName = "comp2"
00231                                 fieldCompDesc = "desc2"
00232                                 fieldCompUnit = "unit2"
00233                             if kcomp == 2:
00234                                 fieldCompName = "comp2"
00235                                 fieldCompDesc = "desc2"
00236                                 fieldCompUnit = "unit2"
00237 
00238                             fieldFamilyIntg.setComponentName(kcomp1,fieldCompName)
00239                             fieldFamilyIntg.setComponentDescription(kcomp1,fieldCompDesc)
00240                             fieldFamilyIntg.setMEDComponentUnit(kcomp1,fieldCompUnit)
00241                         fieldFamilyName = "Integer Field on "+familyName
00242                         fieldFamilyIntg.setName(fieldFamilyName)
00243                         field_name = fieldFamilyIntg.getName()
00244                         type_field = fieldFamilyIntg.getValueType()
00245                         nbOfComp = fieldFamilyIntg.getNumberOfComponents()
00246                         print "      The field",field_name,"is with the type",type_field
00247                         print "      It has",nbOfComp,"Component(s)"
00248                         for kcomp in range(nbOfComp):
00249                             kcomp1 = kcomp+1
00250                             compName = fieldFamilyIntg.getComponentName(kcomp1)
00251                             compDesc = fieldFamilyIntg.getComponentDescription(kcomp1)
00252                             compUnit = fieldFamilyIntg.getMEDComponentUnit(kcomp1)
00253                             print "      * Component:",kcomp1
00254                             print "          Name:",compName
00255                             print "          Description:",compDesc
00256                             print "          Unit:",compUnit
00257 
00258                         nbOf = fieldFamilyIntg.getSupport().getNumberOfElements(MED_ALL_ELEMENTS)
00259                         print "      Values:",nbOf
00260                         print "      Randomly set and get to check ..!"
00261                         for k in range(nbOf):
00262                             valueI = []
00263                             for kcomp in range(nbOfComp):
00264                                 valueI.append(randint(0,100))
00265 
00266 #                            print "     Set Entry *",(k+1)," ",valueI[:nbOfComp]
00267                             valInd = numberFamily[k]
00268                             fieldFamilyIntg.setRow(valInd,valueI)
00269                             valueIverif = fieldFamilyIntg.getRow(valInd)
00270                             print "     Set/Get Entry *",(k+1)," ",valueI[:nbOfComp],"  /  ",valueIverif[:nbOfComp]
00271                         print "    * Getting a Real Field"
00272                         fieldFamilyDble = FIELDDOUBLE(family,spaceDim)
00273                         fieldFamilyDble.setIterationNumber(0)
00274                         fieldFamilyDble.setOrderNumber(0)
00275                         fieldFamilyDble.setTime(0.0)
00276                         for kcomp in range(spaceDim):
00277                             kcomp1 = kcomp+1
00278                             if kcomp == 0:
00279                                 fieldCompName = "comp1"
00280                                 fieldCompDesc = "desc1"
00281                                 fieldCompUnit = "unit1"
00282                             if kcomp == 1:
00283                                 fieldCompName = "comp2"
00284                                 fieldCompDesc = "desc2"
00285                                 fieldCompUnit = "unit2"
00286                             if kcomp == 2:
00287                                 fieldCompName = "comp2"
00288                                 fieldCompDesc = "desc2"
00289                                 fieldCompUnit = "unit2"
00290 
00291                             fieldFamilyDble.setComponentName(kcomp1,fieldCompName)
00292                             fieldFamilyDble.setComponentDescription(kcomp1,fieldCompDesc)
00293                             fieldFamilyDble.setMEDComponentUnit(kcomp1,fieldCompUnit)
00294 
00295                         fieldFamilyName = "Real Field on "+familyName
00296                         fieldFamilyDble.setName(fieldFamilyName)
00297                         field_name = fieldFamilyDble.getName()
00298                         type_field = fieldFamilyDble.getValueType()
00299                         nbOfComp = fieldFamilyDble.getNumberOfComponents()
00300                         print "      The field",field_name,"is with the type",type_field
00301                         print "      It has",nbOfComp,"Component(s)"
00302                         for kcomp in range(nbOfComp):
00303                             kcomp1 = kcomp+1
00304                             compName = fieldFamilyDble.getComponentName(kcomp1)
00305                             compDesc = fieldFamilyDble.getComponentDescription(kcomp1)
00306                             compUnit = fieldFamilyDble.getMEDComponentUnit(kcomp1)
00307                             print "      * Component:",kcomp1
00308                             print "          Name:",compName
00309                             print "          Description:",compDesc
00310                             print "          Unit:",compUnit
00311 
00312                         nbOf = fieldFamilyDble.getSupport().getNumberOfElements(MED_ALL_ELEMENTS)
00313                         print "      Values:",nbOf
00314                         print "      Randomly set and get to check ..!"
00315                         for k in range(nbOf):
00316                             valueI = []
00317                             for kcomp in range(nbOfComp):
00318                                 valueI.append(random())
00319 
00320 #                            print "     Set Entry *",(k+1)," ",valueI[:nbOfComp]
00321                             valInd = numberFamily[k]
00322                             fieldFamilyDble.setRow(valInd,valueI)
00323                             valueIverif = fieldFamilyDble.getRow(valInd)
00324                             print "     Set/Get Entry *",(k+1)," ",valueI[:nbOfComp],"  /  ",valueIverif[:nbOfComp]
00325                 print ""
00326         print ""
00327         for entity in [MED_NODE,MED_CELL,MED_FACE,MED_EDGE]:
00328             nbGrp = mesh.getNumberOfGroups(entity)
00329             if (entity == MED_NODE) & (nbGrp > 0):
00330                 print "This mesh has",nbGrp,"Node Group(s)"
00331             elif (entity == MED_CELL) & (nbGrp > 0):
00332                 print "This mesh has",nbGrp,"Cell Group(s)"
00333             elif (entity == MED_FACE) & (nbGrp > 0):
00334                 print "This mesh has",nbGrp,"Face Group(s)"
00335             elif (entity == MED_EDGE) & (nbGrp > 0):
00336                 print "This mesh has",nbGrp,"Edge Group(s)"
00337 
00338             if nbGrp > 0:
00339                 for j in range(nbGrp):
00340                     print ""
00341                     group = mesh.getGroup(entity,j+1)
00342                     groupName = group.getName()
00343                     groupDescription = group.getDescription()
00344                     groupEntity = group.getEntity()
00345                     groupBool = group.isOnAllElements()
00346                     print "  -Name:",groupName
00347                     print "  -Description:",groupDescription
00348                     print "  -Entity:",groupEntity
00349                     nbOfFam = group.getNumberOfFamilies()
00350                     print "  -Number Of Families:",nbOfFam
00351                     for k in range(nbOfFam):
00352                         print "    * Family:",group.getFamily(k+1).getName()
00353                     print "  -Entities list:"
00354                     if (groupBool):
00355                         print "  -Is on all entities"
00356                     else:
00357                         nbOfTypes = group.getNumberOfTypes()
00358                         types = group.getTypes()
00359                         print "  -Number Of Types:",nbOfTypes
00360                         for k in range(nbOfTypes):
00361                             type = types[k]
00362                             nbOfElmtsOfType = group.getNumberOfElements(type)
00363                             number = group.getNumber(type)
00364                             print "    * Type",type
00365                             print "    * Number",number[0:nbOfElmtsOfType]
00366                         print ""
00367                 print ""
00368 
00369         print "Building of the support on all Cells of the mesh."
00370         supportCell = mesh.getSupportOnAll( MED_CELL )
00371         print ""
00372         barycenter = mesh.getBarycenter(supportCell)
00373         print "Getting barycenter of all Cells of the mesh"
00374         for j in range(nbElemts):
00375             barycenterCell = barycenter.getRow(j+1)
00376             print "    * ",barycenterCell[:spaceDim]
00377         print ""
00378         if spaceDim == 3 :
00379             print "Getting volume of all Cells of the mesh:"
00380             volume = mesh.getVolume(supportCell)
00381             voltot = 0.
00382             for j in range(nbElemts):
00383                 volumeCell = volume.getValueIJ(j+1,1)
00384                 print "    * ",volumeCell
00385                 voltot = voltot + volumeCell
00386             print "Volume of the mesh:",voltot
00387             print ""
00388             print "Building of the support on all Faces of the mesh."
00389             supportFace = SUPPORT(mesh,"Support on all faces of the mesh",MED_FACE)
00390             nbFace = mesh.getNumberOfElements(MED_FACE,MED_ALL_ELEMENTS)
00391             print ""
00392             print "Getting normal of each face of this support",nbFace
00393             nbTypeFace = mesh.getNumberOfTypes(MED_FACE)
00394             TypeFace = mesh.getTypes(MED_FACE)
00395             print "nbTypeFace:",nbTypeFace,"----",TypeFace[:nbTypeFace]
00396             normal = mesh.getNormal(supportFace)
00397             area = mesh.getArea(supportFace)
00398             for j in range(nbFace):
00399                 normalFace = normal.getRow(j+1)
00400                 areaFace = area.getRow(j+1)
00401                 value1 = normalFace[0]
00402                 value2 = normalFace[1]
00403                 value3 = normalFace[2]
00404                 norm = (value1*value1 + value2*value2 + value3*value3)**(0.5)
00405                 print "    * ",normalFace[:spaceDim],"norm:",norm," --> area ",areaFace[0]
00406         elif spaceDim == 2:
00407             print "Getting area on all Cells of the mesh:"
00408             area = mesh.getArea(supportCell)
00409             areatot = 0.
00410             for j in range(nbElemts):
00411                 areaCell = area.getValueIJ(j+1,1)
00412                 print "    * ",areaCell
00413                 areatot = areatot + areaCell
00414             print "Area of the mesh:",areatot
00415             print ""            
00416             print "Building of the support on all Edges of the mesh."
00417             supportEdge = mesh.getSupportOnAll(MED_EDGE)
00418             nbEdge = mesh.getNumberOfElements(MED_EDGE,MED_ALL_ELEMENTS)
00419             print ""
00420             print "Getting normal of each edge of this support",nbEdge
00421             nbTypeEdge = mesh.getNumberOfTypes(MED_EDGE)
00422             TypeEdge = mesh.getTypes(MED_EDGE)
00423             print "nbTypeEdge:",nbTypeEdge,"----",TypeEdge[:nbTypeEdge]
00424             normal = mesh.getNormal(supportEdge)
00425             length = mesh.getLength(supportEdge)
00426             for j in range(nbEdge):
00427                 normalEdge = normal.getRow(j+1)
00428                 lengthEdge = length.getRow(j+1)
00429                 value1 = normalEdge[0]
00430                 value2 = normalEdge[1]
00431                 norm = (value1*value1 + value2*value2)**(0.5)
00432                 print "    * ",normalEdge[:spaceDim],"norm:",norm," --> length ",lengthEdge[0]
00433         print ""
00434         print "Building support on Elements of the boundary"
00435         if spaceDim == 3 :
00436             suppBound = mesh.getBoundaryElements(MED_FACE)
00437             nbElmBound = suppBound.getNumberOfElements(MED_ALL_ELEMENTS)
00438             print "Getting normal field on the boundary",nbElmBound
00439             normalBound = mesh.getNormal(suppBound)
00440             if suppBound.isOnAllElements():
00441                 numberSuppBound = range(1,nbElmBound+1)
00442             else:
00443                 numberSuppBound = suppBound.getNumber(MED_ALL_ELEMENTS)
00444             for j in range(nbElmBound):
00445                 valInd = numberSuppBound[j]
00446                 normalBoundJ = normalBound.getRow(valInd)
00447                 value1 = normalBoundJ[0]
00448                 value2 = normalBoundJ[1]
00449                 value3 = normalBoundJ[2]
00450                 norm = (value1*value1 + value2*value2 + value3*value3)**(0.5)
00451                 print "    * ",normalBoundJ[:spaceDim],"norm:",norm
00452         elif spaceDim == 2:
00453             suppBound = mesh.getBoundaryElements(MED_EDGE)
00454             nbElmBound = suppBound.getNumberOfElements(MED_ALL_ELEMENTS)
00455             print "Getting normal field on the boundary",nbElmBound
00456             normalBound = mesh.getNormal(suppBound)
00457             if suppBound.isOnAllElements():
00458                 numberSuppBound = range(1,nbElmBound+1)
00459             else:
00460                 numberSuppBound = suppBound.getNumber(MED_ALL_ELEMENTS)
00461             for j in range(nbElmBound):
00462                 valInd = numberSuppBound[j]
00463                 normalBoundJ = normalBound.getRow(valInd)
00464                 value1 = normalBoundJ[0]
00465                 value2 = normalBoundJ[1]
00466                 norm = (value1*value1 + value2*value2)**(0.5)
00467                 print "    * ",normalBoundJ[:spaceDim],"norm:",norm
00468         print ""
00469 if (nbFields>0):
00470     print "Field(s) Analysis "
00471     for i in range(nbFields):
00472         field_name = md.getFieldName(i)
00473         dtits = md.getFieldIteration(field_name)
00474         nbOfIt = len(dtits)
00475         print "The",print_ord(i),"field is",field_name,"with",nbOfIt,"iteration(s)"
00476         for dtitfield in dtits:
00477             dt = dtitfield.getdt()
00478             it = dtitfield.getit()
00479             type = md.getFieldType(field_name)
00480             print "     * Iteration:",dt,"Order number:",it,"Type:",type
00481             if type == MED_INT32:
00482                 fieldint = FIELDINT(MED_DRIVER,md.getFileName(),field_name,dt,it,mesh)
00483                 name = fieldint.getName()
00484                 desc = fieldint.getDescription()
00485                 nbOfComp = fieldint.getNumberOfComponents()
00486                 print "     Field",name," : ",desc
00487                 print "     Number Of Components:",nbOfComp
00488                 iterationNb = fieldint.getIterationNumber()
00489                 orderNb = fieldint.getOrderNumber()
00490                 time = fieldint.getTime()
00491                 print "     Iteration Number",iterationNb
00492                 print "     Order Number",orderNb
00493                 print "     Time",time
00494                 for k in range(nbOfComp):
00495                     kp1 = k+1
00496                     compName = fieldint.getComponentName(kp1)
00497                     compDesc = fieldint.getComponentDescription(kp1)
00498                     compUnit = fieldint.getMEDComponentUnit(kp1)
00499                     print "      * Component:",kp1
00500                     print "          Name:",compName
00501                     print "          Description:",compDesc
00502                     print "          Unit:",compUnit
00503 
00504                 support = fieldint.getSupport()
00505                 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00506                 print "     Values:",nbOf
00507                 for k in range(nbOf):
00508                     valueI = fieldint.getRow(k+1)
00509                     print "     *",valueI[:nbOfComp]
00510             elif type == MED_REEL64:
00511                 fielddouble = FIELDDOUBLE(MED_DRIVER,md.getFileName(),field_name,dt,it,mesh)
00512                 name = fielddouble.getName()
00513                 desc = fielddouble.getDescription()
00514                 nbOfComp = fielddouble.getNumberOfComponents()
00515                 print "     Field",name," : ",desc
00516                 print "     Number Of Components:",nbOfComp
00517                 iterationNb = fielddouble.getIterationNumber()
00518                 orderNb = fielddouble.getOrderNumber()
00519                 time = fielddouble.getTime()
00520                 print "     Iteration Number",iterationNb
00521                 print "     Order Number",orderNb
00522                 print "     Time",time
00523                 for k in range(nbOfComp):
00524                     kp1 = k+1
00525                     compName = fielddouble.getComponentName(kp1)
00526                     compDesc = fielddouble.getComponentDescription(kp1)
00527                     compUnit = fielddouble.getMEDComponentUnit(kp1)
00528                     print "      * Component:",kp1
00529                     print "          Name:",compName
00530                     print "          Description:",compDesc
00531                     print "          Unit:",compUnit
00532 
00533                 support = fielddouble.getSupport()
00534                 nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
00535                 print "     Values:",nbOf
00536                 for k in range(nbOf):
00537                     valueI = fielddouble.getRow(k+1)
00538                     print "     *",valueI[:nbOfComp]
00539             else:
00540                 print "  !!!! Bad type of Field !!!!"
00541 
00542 print "END of the Pyhton script ..... Ctrl D to exit"