Hi everyone, the variable value after projection seems wrong. Here is the code,
from dolfin import *
import matplotlib.pyplot as plt
from mshr import *
#from ufl import as_vector
t = 0
domain = Rectangle(Point(0.0,0.0), Point(10.0,10.0))
mesh = generate_mesh(domain,40)
V = FunctionSpace(mesh, “CG”, 1)
u1 = Function(V)
u1.assign(Constant(1.0))
v = project(u1,V)
vtkfile_test = File(‘u1.pvd’)
vtkfile_test << (u1, t)
vtkfile_test = File(‘v.pvd’)
vtkfile_test << (v, t)
exit()
u1 is correct (left), however, the projection variables v seems wrong (right):
What’s the problem here? Why this happen? Thanks a lot if anyone can answer me.