I changed this. but every mode eigenvector is giving white colour contour only.
the code is
import dolfinx.io
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, "eigenvector.xdmf", "w") as xdmf:
xdmf.write_mesh(mesh)
eig_v=[]
ef = 0
print("Number of converged eigenpairs %d" % evs)
if evs > 0:
for i in range(evs):
e_val = eigensolver.getEigenpair(i, vr, vi)
if (~np.isclose(e_val.real, 1.0)):
# Calculation of eigenfrequency from real part of eigenvalue
freq_3D = np.sqrt(e_val.real)/2/np.pi
# Beam eigenfrequency
if ef % 2 == 0:
# exact solution should correspond to weak axis bending
I_bend = H*B**3/12.
else:
# exact solution should correspond to strong axis bending
I_bend = B*H**3/12.
freq_beam = alpha(ef/2)**2*np.sqrt(E*I_bend/(rho*B*H*L**4))/2/np.pi
print(
"Solid FE: {0:8.5f} [Hz] "
"Beam theory: {1:8.5f} [Hz]".format(freq_3D, freq_beam))
ur = dolfinx.fem.Function(V)
ur.vector.array[:] = vr
xdmf.write_function(ur.copy())
eig_v.append(vr.copy())
ef += 1
the output is coming like this for all the modes