Back to index

salome-med  6.5.0
Functions | Variables
medClient_test Namespace Reference

Functions

def print_ord
def changeBlankToUnderScore
def getMedObjectFromStudy
def getMeshObjectFromStudy
def getSupportObjectFromStudy
def getFieldObjectFromStudy

Variables

tuple sg = SALOMEGUI_Swig()
string fileName = "cube_hexa8_quad4.med"
tuple medComp = salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
list filePath = os.environ["MED_ROOT_DIR"]
tuple filePathName = os.path.join( filePath, fileName )
tuple medObj = getMedObjectFromStudy(fileName)
tuple nbOfMeshes = medObj.getNumberOfMeshes()
tuple meshNames = medObj.getMeshNames()
list meshName = meshNames[i]
tuple meshObj = medObj.getMeshByName(meshName)
tuple nbFam = meshObj.getNumberOfFamilies(entity)
tuple nbGrp = meshObj.getNumberOfGroups(entity)
tuple familyName = (meshObj.getFamily(entity,j+1))
tuple familyObj = getSupportObjectFromStudy(meshName,familyName)
tuple groupName = (meshObj.getGroup(entity,j+1))
tuple groupObj = getSupportObjectFromStudy(meshName,groupName)
string entitySupport = "MED_NOEUD"
string entitySuppor = "MED_FACE"
string supportName = "SupportOnAll_"
tuple supportObj = getSupportObjectFromStudy(meshName,supportName)
tuple meshLocalCopy0 = MESHClient(meshObj)
tuple meshLocalCopy = MESHClient(meshObj)
tuple name = meshLocalCopy.getName()
tuple spaceDimension = meshLocalCopy.getSpaceDimension()
tuple meshDimension = meshLocalCopy.getMeshDimension()
tuple numberOfNodes = meshLocalCopy.getNumberOfNodes()
tuple coordSyst = meshLocalCopy.getCoordinatesSystem()
list coordNames = []
list coordUnits = []
tuple coordinates = meshLocalCopy.getCoordinates(MED_FULL_INTERLACE)
int kp1 = 1
tuple nbTypesCell = meshLocalCopy.getNumberOfTypes(MED_CELL)
tuple types = meshLocalCopy.getTypes(MED_CELL)
list type = types[k]
tuple nbElemType = meshLocalCopy.getNumberOfElements(MED_CELL,type)
tuple connectivity = meshLocalCopy.getConnectivity(MED_NODAL,MED_CELL,MED_ALL_ELEMENTS)
tuple index = meshLocalCopy.getConnectivityIndex(MED_NODAL,MED_CELL)
int nbNodesPerCell = 100
tuple nbOfFields = medObj.getNumberOfFields()
tuple fieldNames = medObj.getFieldNames()
list fieldName = fieldNames[i]
tuple nbOfIt = medObj.getFieldNumberOfIteration(fieldName)
tuple dtitfield = medObj.getFieldIteration(fieldName,j)
list dt = dtitfield[0]
list it = dtitfield[1]
tuple fieldTyped = FIELDDOUBLEClient(fieldObj)
tuple desc = fieldTyped.getDescription()
tuple nbOfComp = fieldTyped.getNumberOfComponents()
tuple iterationNb = fieldTyped.getIterationNumber()
tuple orderNb = fieldTyped.getOrderNumber()
tuple time = fieldTyped.getTime()
tuple support = fieldTyped.getSupport()
tuple nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)
tuple valueI = fieldTyped.getRow(k+1)

Function Documentation

def medClient_test.changeBlankToUnderScore (   stringWithBlank)

Definition at line 50 of file medClient_test.py.

00050 
00051 def changeBlankToUnderScore(stringWithBlank):
00052     blank = ' '
00053     underscore = '_'
00054     decompString = string.split(stringWithBlank,blank)
00055     length = len(decompString)
00056     stringWithUnderScore = decompString[0]
00057     for i in range(1,length):
00058         stringWithUnderScore += underscore
00059         stringWithUnderScore += decompString[i]
00060     return stringWithUnderScore

Here is the caller graph for this function:

def medClient_test.getFieldObjectFromStudy (   dt,
  it,
  fieldName,
  supportName,
  meshName 
)

Definition at line 113 of file medClient_test.py.

00113 
00114 def getFieldObjectFromStudy(dt,it,fieldName,supportName,meshName):
00115     type = -1
00116     meshNameStudy = changeBlankToUnderScore(meshName)
00117     objNameInStudy = "/Med/MEDFIELD/"+fieldName+"/("+str(dt)+","+str(it)+")_ON_"+supportName+"_OF_"+meshNameStudy
00118     mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
00119     if (mySO == None) :
00120         print objNameInStudy," cannot be found in the Study"
00121         return -1,-1
00122     else:
00123         anAttr = mySO.FindAttribute("AttributeIOR")[1]
00124         obj = salome.orb.string_to_object(anAttr.Value())
00125         myObj = obj._narrow(SALOME_MED.FIELDINT)
00126         type = 0
00127         if (myObj == None):
00128             myObj = obj._narrow(SALOME_MED.FIELDDOUBLE)
00129             type = 1
00130             if (myObj == None) :
00131                 print objNameInStudy," has been found in the Study but with the wrong type"
00132         return myObj,type

Here is the call graph for this function:

Definition at line 61 of file medClient_test.py.

00061 
00062 def getMedObjectFromStudy(file):
00063     objNameInStudy = "MED_OBJECT_FROM_FILE_"+file
00064     compNameInStudy= "MED"
00065     listOfSO = salome.myStudy.FindObjectByName(objNameInStudy,compNameInStudy)
00066     listLength = len(listOfSO)
00067     if (listLength == 0) :
00068         print objNameInStudy," cannot be found in the Study under the component ",compNameInStudy
00069         return None
00070     elif (listLength > 1) :
00071         print "there are more than one instance of ",objNameInStudy," in the Study under the component ",compNameInStudy
00072         return None
00073     mySO = listOfSO[0]
00074     if (mySO == None) :
00075         print objNameInStudy," cannot be found in the Study"
00076         return mySO
00077     else:
00078         anAttr = mySO.FindAttribute("AttributeIOR")[1]
00079         obj = salome.orb.string_to_object(anAttr.Value())
00080         myObj = obj._narrow(SALOME_MED.MED)
00081         if (myObj == None) :
00082             print objNameInStudy," has been found in the Study but with the wrong type"
00083         return myObj

Definition at line 84 of file medClient_test.py.

00084 
00085 def getMeshObjectFromStudy(meshName):
00086     objNameInStudy = "/Med/MEDMESH/"+meshName
00087     mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
00088     if (mySO == None) :
00089         print objNameInStudy," cannot be found in the Study"
00090         return mySO
00091     else:
00092         anAttr = mySO.FindAttribute("AttributeIOR")[1]
00093         obj = salome.orb.string_to_object(anAttr.Value())
00094         myObj = obj._narrow(SALOME_MED.MESH)
00095         if (myObj == None) :
00096             print objNameInStudy," has been found in the Study but with the wrong type"
00097         return myObj

def medClient_test.getSupportObjectFromStudy (   meshName,
  supportName 
)

Definition at line 98 of file medClient_test.py.

00098 
00099 def getSupportObjectFromStudy(meshName,supportName):
00100     meshNameStudy = changeBlankToUnderScore(meshName)
00101     objNameInStudy = "/Med/MEDMESH/MEDSUPPORTS_OF_"+meshNameStudy+"/"+supportName
00102     mySO = salome.myStudy.FindObjectByPath(objNameInStudy)
00103     if (mySO == None) :
00104         print objNameInStudy," cannot be found in the Study"
00105         return mySO
00106     else:
00107         anAttr = mySO.FindAttribute("AttributeIOR")[1]
00108         obj = salome.orb.string_to_object(anAttr.Value())
00109         myObj = obj._narrow(SALOME_MED.SUPPORT)
00110         if (myObj == None) :
00111             print objNameInStudy," has been found in the Study but with the wrong type"
00112         return myObj

Here is the call graph for this function:

Definition at line 40 of file medClient_test.py.

00040 
00041 def print_ord(i):
00042     if i == 0:
00043         return 'first'
00044     elif i == 1:
00045         return 'second'
00046     elif i == 2:
00047         return 'third'
00048     else:
00049         return `(i+1)`+'th'


Variable Documentation

tuple medClient_test.connectivity = meshLocalCopy.getConnectivity(MED_NODAL,MED_CELL,MED_ALL_ELEMENTS)

Definition at line 251 of file medClient_test.py.

tuple medClient_test.coordinates = meshLocalCopy.getCoordinates(MED_FULL_INTERLACE)

Definition at line 236 of file medClient_test.py.

Definition at line 227 of file medClient_test.py.

tuple medClient_test.coordSyst = meshLocalCopy.getCoordinatesSystem()

Definition at line 224 of file medClient_test.py.

Definition at line 228 of file medClient_test.py.

tuple medClient_test.desc = fieldTyped.getDescription()

Definition at line 302 of file medClient_test.py.

Definition at line 274 of file medClient_test.py.

tuple medClient_test.dtitfield = medObj.getFieldIteration(fieldName,j)

Definition at line 273 of file medClient_test.py.

string medClient_test.entitySuppor = "MED_FACE"

Definition at line 202 of file medClient_test.py.

string medClient_test.entitySupport = "MED_NOEUD"

Definition at line 198 of file medClient_test.py.

tuple medClient_test.familyName = (meshObj.getFamily(entity,j+1))

Definition at line 183 of file medClient_test.py.

Definition at line 184 of file medClient_test.py.

Definition at line 269 of file medClient_test.py.

tuple medClient_test.fieldNames = medObj.getFieldNames()

Definition at line 267 of file medClient_test.py.

tuple medClient_test.fieldTyped = FIELDDOUBLEClient(fieldObj)

Definition at line 295 of file medClient_test.py.

string medClient_test.fileName = "cube_hexa8_quad4.med"

Definition at line 133 of file medClient_test.py.

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

Definition at line 143 of file medClient_test.py.

tuple medClient_test.filePathName = os.path.join( filePath, fileName )

Definition at line 146 of file medClient_test.py.

tuple medClient_test.groupName = (meshObj.getGroup(entity,j+1))

Definition at line 189 of file medClient_test.py.

Definition at line 190 of file medClient_test.py.

tuple medClient_test.index = meshLocalCopy.getConnectivityIndex(MED_NODAL,MED_CELL)

Definition at line 252 of file medClient_test.py.

Definition at line 275 of file medClient_test.py.

tuple medClient_test.iterationNb = fieldTyped.getIterationNumber()

Definition at line 306 of file medClient_test.py.

Definition at line 238 of file medClient_test.py.

tuple medClient_test.medComp = salome.lcc.FindOrLoadComponent("FactoryServer", "MED")

Definition at line 139 of file medClient_test.py.

Definition at line 153 of file medClient_test.py.

tuple medClient_test.meshDimension = meshLocalCopy.getMeshDimension()

Definition at line 221 of file medClient_test.py.

Definition at line 217 of file medClient_test.py.

Definition at line 211 of file medClient_test.py.

Definition at line 160 of file medClient_test.py.

tuple medClient_test.meshNames = medObj.getMeshNames()

Definition at line 156 of file medClient_test.py.

tuple medClient_test.meshObj = medObj.getMeshByName(meshName)

Definition at line 163 of file medClient_test.py.

tuple medClient_test.name = meshLocalCopy.getName()

Definition at line 219 of file medClient_test.py.

tuple medClient_test.nbElemType = meshLocalCopy.getNumberOfElements(MED_CELL,type)

Definition at line 249 of file medClient_test.py.

tuple medClient_test.nbFam = meshObj.getNumberOfFamilies(entity)

Definition at line 170 of file medClient_test.py.

tuple medClient_test.nbGrp = meshObj.getNumberOfGroups(entity)

Definition at line 171 of file medClient_test.py.

Definition at line 256 of file medClient_test.py.

tuple medClient_test.nbOf = support.getNumberOfElements(MED_ALL_ELEMENTS)

Definition at line 313 of file medClient_test.py.

tuple medClient_test.nbOfComp = fieldTyped.getNumberOfComponents()

Definition at line 303 of file medClient_test.py.

tuple medClient_test.nbOfFields = medObj.getNumberOfFields()

Definition at line 265 of file medClient_test.py.

tuple medClient_test.nbOfIt = medObj.getFieldNumberOfIteration(fieldName)

Definition at line 270 of file medClient_test.py.

tuple medClient_test.nbOfMeshes = medObj.getNumberOfMeshes()

Definition at line 155 of file medClient_test.py.

tuple medClient_test.nbTypesCell = meshLocalCopy.getNumberOfTypes(MED_CELL)

Definition at line 242 of file medClient_test.py.

tuple medClient_test.numberOfNodes = meshLocalCopy.getNumberOfNodes()

Definition at line 222 of file medClient_test.py.

tuple medClient_test.orderNb = fieldTyped.getOrderNumber()

Definition at line 307 of file medClient_test.py.

tuple medClient_test.sg = SALOMEGUI_Swig()

Definition at line 38 of file medClient_test.py.

tuple medClient_test.spaceDimension = meshLocalCopy.getSpaceDimension()

Definition at line 220 of file medClient_test.py.

tuple medClient_test.support = fieldTyped.getSupport()

Definition at line 312 of file medClient_test.py.

string medClient_test.supportName = "SupportOnAll_"

Definition at line 206 of file medClient_test.py.

Definition at line 207 of file medClient_test.py.

tuple medClient_test.time = fieldTyped.getTime()

Definition at line 308 of file medClient_test.py.

Definition at line 248 of file medClient_test.py.

tuple medClient_test.types = meshLocalCopy.getTypes(MED_CELL)

Definition at line 246 of file medClient_test.py.

tuple medClient_test.valueI = fieldTyped.getRow(k+1)

Definition at line 316 of file medClient_test.py.