runLundRescaling.py 文件源码

python
阅读 66 收藏 0 点赞 0 评论 0

项目:eddylicious 作者: timofeymukha 项目源码 文件源码
def get_times(reader, readPath):
    """Read the time values associated with the precursor database."""

    # Grab the existing times and sort them
    if reader == "foamFile":
        dataDir = os.path.join(readPath, "postProcessing", "sampledSurface")
        times = os.listdir(dataDir)
        times = np.sort(times)
    elif reader == "hdf5":
        # Set the readPath to the file itself
        readPath = h5py.File(readPath, 'r', driver='mpio', comm=MPI.COMM_WORLD)
        times = readPath["velocity"]["times"][:]
        readPath.close()
    else:
        raise ValueError("Unknown reader: "+reader)

    return times
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号