os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir + '/.') i = 1 for item in cocase.items_: print(i, "/", len(cocase.items_), ":", item.geometryFileName_) if (item.dimensionality_ == GEOMETRY_2D): print("CONVERTING") theGridRCovise.set_grid_path( os.path.dirname(theCoCaseFileName) + '/' + item.geometryFileName_) theGridWCovise.set_grid_path( os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir + '/' + item.geometryFileName_) theNet.connect(theGridRCovise, 'mesh', theSimplify, 'meshIn') theNet.connect(theSimplify, 'meshOut', theGridWCovise, 'mesh_in') if (len(item.variables_) == 0): theGridRCovise.execute() theNet.finishedBarrier() else: theNet.connect(theDataRCovise, 'mesh', theSimplify, 'dataIn_0') theNet.connect(theSimplify, 'dataOut_0', theDataWCovise, 'mesh_in') firstRun = True for var in item.variables_: theDataRCovise.set_grid_path( os.path.dirname(theCoCaseFileName) + '/' + os.path.basename(var[1])) theDataWCovise.set_grid_path( os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir + '/' + os.path.basename(var[1])) if firstRun: theGridRCovise.execute() theDataRCovise.execute()
pass shutil.copy(theCoCaseFileName, os.path.dirname(theCoCaseFileName) + "/" + theOutputSubDir + "/.") i = 1 for item in cocase.items_: print(i, "/", len(cocase.items_), ":", item.geometryFileName_) if item.dimensionality_ == GEOMETRY_2D: print("CONVERTING") theGridRCovise.set_grid_path(os.path.dirname(theCoCaseFileName) + "/" + item.geometryFileName_) theGridWCovise.set_grid_path( os.path.dirname(theCoCaseFileName) + "/" + theOutputSubDir + "/" + item.geometryFileName_ ) theNet.connect(theGridRCovise, "mesh", theSimplify, "meshIn") theNet.connect(theSimplify, "meshOut", theGridWCovise, "mesh_in") if len(item.variables_) == 0: theGridRCovise.execute() theNet.finishedBarrier() else: theNet.connect(theDataRCovise, "mesh", theSimplify, "dataIn_0") theNet.connect(theSimplify, "dataOut_0", theDataWCovise, "mesh_in") firstRun = True for var in item.variables_: theDataRCovise.set_grid_path(os.path.dirname(theCoCaseFileName) + "/" + os.path.basename(var[1])) theDataWCovise.set_grid_path( os.path.dirname(theCoCaseFileName) + "/" + theOutputSubDir + "/" + os.path.basename(var[1]) ) if firstRun: theGridRCovise.execute() theDataRCovise.execute() theNet.finishedBarrier() if firstRun:
os.mkdir(os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir) except: pass shutil.copy(theCoCaseFileName, os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir + '/.') # get all used .covise filenames from the cocase coviseFileNames = [] for item in cocase.items_: coviseFileNames.append(item.geometryFileName_) for var in item.variables_: coviseFileNames.append(os.path.basename(var[1])) # do the reducing i = 1 for coviseFileName in coviseFileNames: theRCovise.set_grid_path( os.path.dirname(theCoCaseFileName) + '/' + coviseFileName) theWCovise.set_grid_path( os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir + '/' + coviseFileName) print(i, "/", len(coviseFileNames), ": ", coviseFileName) theRCovise.execute() theNet.finishedBarrier() i += 1 sys.exit()
try: os.mkdir(os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir) except: pass shutil.copy(theCoCaseFileName, os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir + '/.') # get all used .covise filenames from the cocase coviseFileNames = [] for item in cocase.items_: coviseFileNames.append(item.geometryFileName_) for var in item.variables_: coviseFileNames.append(os.path.basename(var[1])) # do the reducing i = 1 for coviseFileName in coviseFileNames: theRCovise.set_grid_path(os.path.dirname(theCoCaseFileName) + '/' + coviseFileName) theWCovise.set_grid_path(os.path.dirname(theCoCaseFileName) + '/' + theOutputSubDir + '/' + coviseFileName) print(i, "/", len(coviseFileNames), ": ", coviseFileName) theRCovise.execute() theNet.finishedBarrier() i += 1 sys.exit()