level.py 文件源码

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

项目:Fluid2d 作者: pvthinker 项目源码 文件源码
def coarsetofine(coarse,fine,x,y):
    """ input = x is on coarse / output = y is on fine """
    # these are function outside the object Grid
    # because it works on two different grids ...
    for k in range(coarse.nbcoarsetofine):
        if coarse.flag=='peak':
            t0 = time()  
            coarse.subdom.split(x,y) 
            t1 = time()
            coarse.time['split']+=t1-t0
            coarse.ncalls['split']+=1
        else:
            t0 = time()  
            interpolate(fine.msk,coarse.msk,x,fine.nh,y)
            t1 = time()
            fine.time['interpolate']+=t1-t0
            fine.ncalls['interpolate']+=1
            if coarse.nh<=2:
                fine.halo.fill(y)
                t0 = time() 
                fine.time['halo']+=t0-t1
                fine.ncalls['halo']+=1
            # else there is enough points in the halo to skip filling!
#        MPI.COMM_WORLD.Barrier()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号