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
评论列表
文章目录