Hi all,
http://fenicsproject.org/qa/44/mesh-refine-meshfunction
from the link above we know we can refine the mesh, which is equivalent to use high order function space.
But I have a problem about the MeshFunction refine. Suppose we do the following:
mesh=UnitSquareMesh(2,2)
mesh1=refine(mesh)
f=CellFunction("uint",mesh)
f.set_all(0)
f.array()[2:5]=1
f_refined = adapt(f,mesh1)
Traceback (most recent call last):
File "", line 1, in
File "/Applications/FEniCS1.2.app/Contents/Resources/lib/python2.7/site-packages/dolfin/cpp/fem.py", line 3572, in adapt
return _fem.adapt(*args)
RuntimeError:
*** -------------------------------------------------------------------------
*** Error: Unable to adapt mesh function.
*** Reason: Unable to extract information about parent mesh entites.
*** Where: This error was encountered inside adapt.cpp.
*** Process: 0
*** -------------------------------------------------------------------------
In the help file, the python support the syntax adapt(mesh_function, refined_mesh). I do not what goes wrong here. since in above asked question, they all have the same problems. Any help would be appreciated. Thanks.