Back to index

salome-med  6.5.0
Functions | Variables
testMedAlliances1 Namespace Reference

Functions

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

Variables

list filePath = os.environ["MED_ROOT_DIR"]
tuple sg = SALOMEGUI_Swig()
list medFiles = []
tuple nbOfFiles = len(medFiles)
tuple med = salome.lcc.FindOrLoadComponent("FactoryServer", "MED")
list medFile = medFiles[i]

Function Documentation

def testMedAlliances1.changeBlankToUnderScore (   stringWithBlank)

Definition at line 48 of file testMedAlliances1.py.

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

Here is the caller graph for this function:

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

Definition at line 111 of file testMedAlliances1.py.

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

Here is the call graph for this function:

Definition at line 59 of file testMedAlliances1.py.

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

Definition at line 82 of file testMedAlliances1.py.

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

def testMedAlliances1.getSupportObjectFromStudy (   meshName,
  supportName 
)

Definition at line 96 of file testMedAlliances1.py.

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

Here is the call graph for this function:

Definition at line 38 of file testMedAlliances1.py.

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


Variable Documentation

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

Definition at line 28 of file testMedAlliances1.py.

tuple testMedAlliances1.med = salome.lcc.FindOrLoadComponent("FactoryServer", "MED")

Definition at line 177 of file testMedAlliances1.py.

Definition at line 180 of file testMedAlliances1.py.

Definition at line 128 of file testMedAlliances1.py.

Definition at line 175 of file testMedAlliances1.py.

tuple testMedAlliances1.sg = SALOMEGUI_Swig()

Definition at line 36 of file testMedAlliances1.py.