base.py 文件源码

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

项目:voropy 作者: nschloe 项目源码 文件源码
def get_cell_mask(self, subdomain=None):
        if subdomain is None:
            # http://stackoverflow.com/a/42392791/353337
            return numpy.s_[:]

        if subdomain.is_boundary_only:
            # There are no boundary cells
            return numpy.array([])

        if subdomain not in self.subdomains:
            self._mark_vertices(subdomain)

        is_in = self.subdomains[subdomain]['vertices'][self.idx_hierarchy]
        # Take `all()` over all axes except the last one (cell_ids).
        n = len(is_in.shape)
        return numpy.all(is_in, axis=tuple(range(n-1)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号