orthopoly.py 文件源码

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

项目:pyballd 作者: Yurlungur 项目源码 文件源码
def differentiate(self,grid_func,orderx,ordery):
        """Given a grid function defined on the colocation points,
        differentiate it up to the appropriate order in each direction.
        """
        assert type(orderx) is int
        assert type(ordery) is int
        assert orderx >= 0
        assert ordery >= 0

        if orderx > 0:
            df = np.dot(self.stencil_x.PD,grid_func)
            return self.differentiate(df,orderx-1,ordery)

        if ordery > 0:
            df = np.dot(grid_func,self.stencil_y.PD.transpose())
            return self.differentiate(df,orderx,ordery-1)

        #if orderx == 0 and ordery == 0:
        return grid_func
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号