posterior.py 文件源码

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

项目:hippylib 作者: hippylib 项目源码 文件源码
def exportU(self, Vh, fname, varname = "evect", normalize=1):
        """
        Export in paraview the generalized eigenvectors U.
        Inputs:
        - Vh:        the parameter finite element space
        - fname:     the name of the paraview output file
        - varname:   the name of the paraview variable
        - normalize: if True the eigenvector are rescaled such that || u ||_inf = 1 
        """
        evect = Function(Vh, name=varname)
        fid = File(fname)

        for i in range(0,self.U.shape[1]):
            Ui = self.U[:,i]
            if normalize:
                s = 1/np.linalg.norm(Ui, np.inf)
                evect.vector().set_local(s*Ui)
            else:
                evect.vector().set_local(Ui)
            fid << evect
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号