Back to index

salome-med  6.5.0
Functions | Variables
test_profil_MedFieldDriver Namespace Reference

Functions

def analyseField

Variables

string medFile = "zzzz121b_without_tr6.med"
string fieldName = "RESUZERODEPL____________________"
int iterationNumber = 1
 iterationNumber = -1 orderNumber = -1
int orderNumber = 1
list filePath = os.environ["MED_ROOT_DIR"]
tuple field

Function Documentation

Definition at line 60 of file test_profil_MedFieldDriver.py.

00060 
00061 def analyseField(field):
00062     fieldName = field.getName()
00063     fieldType = field.getValueType()
00064     fieldDesc = field.getDescription()
00065     fieldIterationNumber = field.getIterationNumber()
00066     fieldOrderNumber = field.getOrderNumber()
00067     fieldTime = field.getTime()
00068     fieldNbOfComp = field.getNumberOfComponents()
00069     print "The field ",fieldName," with the description ",fieldDesc," typed ",fieldType
00070     print "Iteration number ",fieldIterationNumber," OrderNumber ",fieldOrderNumber," Time ",fieldTime
00071     print "It has ",fieldNbOfComp,"components"
00072     for k in range(fieldNbOfComp):
00073         kp1 = k+1
00074         fieldCompName = field.getComponentName(kp1)
00075         fieldCompDesc = field.getComponentDescription(kp1)
00076         fieldCompUnit = field.getMEDComponentUnit(kp1)
00077         print "      * Component:",kp1
00078         print "          Name:",fieldCompName
00079         print "          Description:",fieldCompDesc
00080         print "          Unit:",fieldCompUnit
00081         pass
00082     fieldSupport = field.getSupport()
00083     fieldMeshName = fieldSupport.getMeshName()
00084     fieldSupportOnAll = fieldSupport.isOnAllElements()
00085     fieldNbEntities = fieldSupport.getNumberOfElements(MED_ALL_ELEMENTS)
00086     fieldEntityType = fieldSupport.getEntity()
00087     fieldSupportNumber = range(1,fieldNbEntities+1)
00088     if (not fieldSupportOnAll):
00089         fieldSupportNumber = fieldSupport.getNumber(MED_ALL_ELEMENTS)
00090         pass
00091     print " fieldSupportNumber ", fieldSupportNumber
00092     fieldInterlacingType = field.getInterlacingType()
00093     print "It relies on the mesh named ",fieldMeshName
00094     print "its interlacing type ",fieldInterlacingType
00095     print "and it is on ",fieldNbEntities," entities of the type ",fieldEntityType
00096     if (fieldInterlacingType == MED_FULL_INTERLACE):
00097         for i in range(fieldNbEntities):
00098             value = field.getRow(fieldSupportNumber[i])
00099             print " * ",fieldSupportNumber[i]," --- ",value
00100             pass
00101         pass
00102     elif (fieldInterlacingType == MED_FULL_INTERLACE):
00103         for i in range(fieldNbOfComp):
00104             value = field.getColumn(fieldSupportNumber[i])
00105             print " * ",fieldSupportNumber[i]," --- ",value
00106             pass
00107         pass
00108     pass


Variable Documentation

Initial value:
00001 FIELDDOUBLE(MED_DRIVER, medFile, fieldName,
00002                     iterationNumber, orderNumber)

Definition at line 109 of file test_profil_MedFieldDriver.py.

string test_profil_MedFieldDriver.fieldName = "RESUZERODEPL____________________"

Definition at line 39 of file test_profil_MedFieldDriver.py.

tuple test_profil_MedFieldDriver.filePath = os.environ["MED_ROOT_DIR"]

Definition at line 55 of file test_profil_MedFieldDriver.py.

iterationNumber = -1 orderNumber = -1

Definition at line 46 of file test_profil_MedFieldDriver.py.

tuple test_profil_MedFieldDriver.medFile = "zzzz121b_without_tr6.med"

Definition at line 36 of file test_profil_MedFieldDriver.py.

Definition at line 47 of file test_profil_MedFieldDriver.py.