dictMCTyp={NORM_HEXA8:"hexa8",NORM_POLYHED:"nfaced",NORM_QUAD4:"quad4",NORM_POLYGON:"nsided",NORM_POINT1:"point",NORM_SEG2:"bar2",NORM_SEG3:"bar3",NORM_TRI3:"tria3",NORM_TRI6:"tria6",NORM_QUAD8:"quad8",NORM_TETRA4:"tetra4",NORM_TETRA10:"tetra10",NORM_PYRA5:"pyramid5",NORM_PYRA13:"pyramid13",NORM_PENTA6:"penta6",NORM_PENTA15:"penta15",NORM_HEXA20:"hexa20"}
discSpatial={ON_CELLS:"element",ON_NODES:"node"}
dictCompo={1:"scalar",3:"vector",6:"tensor",9:"tensor9"}
- dictMCTyp2 = {v:k for k, v in dictMCTyp.items()}
- discSpatial2 = {v:k for k, v in discSpatial.items()}
- dictCompo2 = {v:k for k, v in dictCompo.items()}
+ dictMCTyp2 = {v:k for k, v in list(dictMCTyp.items())}
+ discSpatial2 = {v:k for k, v in list(discSpatial.items())}
+ dictCompo2 = {v:k for k, v in list(dictCompo.items())}
pass
self._ze_top_dict={}
its,areForgottenTS=mdfs.getCommonIterations()
if areForgottenTS:
- print("WARNING : some iterations are NOT present in all fields ! Kept iterations are : %s !"%(str(its)))
+ print(("WARNING : some iterations are NOT present in all fields ! Kept iterations are : %s !"%(str(its))))
pass
TimeValues=""
for it in its:
if nbCompo not in self.dictCompo:
l = [x for x in self.dictCompo if x - nbCompo > 0]
if len(l)==0:
- print("Field \"%s\" will be ignored because number of components (%i) is too big to be %s supported by case files !"%(mdf.getName(),nbCompo,str(list(self.dictCompo.keys()))))
+ print(("Field \"%s\" will be ignored because number of components (%i) is too big to be %s supported by case files !"%(mdf.getName(),nbCompo,str(list(self.dictCompo.keys())))))
continue
pass
- print("WARNING : Field \"%s\" will have its number of components (%i) set to %i, in order to be supported by case files (must be in %s) !"%(mdf.getName(),nbCompo,l[0],str(list(self.dictCompo.keys()))))
+ print(("WARNING : Field \"%s\" will have its number of components (%i) set to %i, in order to be supported by case files (must be in %s) !"%(mdf.getName(),nbCompo,l[0],str(list(self.dictCompo.keys())))))
nbCompo=l[0]
pass
if nbCompo in dictVars:
mm.write(self.__str80("coordinates"))
pass
else:
- print("UnManaged type of field for field \"%s\" !"%(mdf.getName()))
+ print(("UnManaged type of field for field \"%s\" !"%(mdf.getName())))
pass
a=np.memmap(f,dtype='float32',mode='w+',offset=mm.tell(),shape=(nbCompo,end-bg))
b=arr.toNumPyArray() ; b=b.reshape(nbCompo,end-bg)
try:
medfd=cr.loadInMEDFileDS()
except:
- print "An error occurred during the conversion!"
- print "#######################################"
+ print("An error occurred during the conversion!")
+ print("#######################################")
raise
medfd.write(fOut,2)
-print "#########\nFile \"%s\" written !\n#########"%(fOut)
+print("#########\nFile \"%s\" written !\n#########"%(fOut))
cw.setMEDFileDS(mfd)
listOfWrittenFileNames=cw.write(fOut)
except InterpKernelException as e:
- print "An error occurred during the conversion!"
- print "#######################################"
+ print("An error occurred during the conversion!")
+ print("#######################################")
raise e
-print "#########"
+print("#########")
for l in listOfWrittenFileNames:
- print "File \"%s\" successfully written !"%(l)
+ print("File \"%s\" successfully written !"%(l))
pass
-print "#########"
+print("#########")