def get_y_prec(reader, readPath):
"""Read the mean velocity profile of the precursor
and the total number of points in the y direction.
"""
if reader == "foamFile":
uMeanTimes = os.listdir(os.path.join(readPath, "postProcessing",
"collapsedFields"))
y = np.genfromtxt(os.path.join(readPath, "postProcessing",
"collapsedFields",
uMeanTimes[-1],
"UMean_X.xy"))[:, 0]
elif reader == "hdf5":
readPath = h5py.File(readPath, 'r', driver='mpio', comm=MPI.COMM_WORLD)
y = readPath["points"]["pointsY"][:, 0]
readPath.close()
else:
raise ValueError("Unknown reader: "+reader)
return y
评论列表
文章目录