Anders Logg wrote: > On Wed, Oct 07, 2009 at 12:11:57PM +0100, Garth N. Wells wrote: >> >> Anders Logg wrote: >>> On Wed, Oct 07, 2009 at 09:08:53AM +0100, Garth N. Wells wrote: >>>> We seem to have a problem with Python and interpolating functions. When >>>> I try >>>> >>>> P1 = FunctionSpace(mesh_post, "CG", 1) >>>> u_post = interpolate(u, P1); >>>> >>>> I get the below error. >>>> >>>> Garth >>>> >>>> >>>> Traceback (most recent call last): >>>> File "demo.py", line 128, in <module> >>>> u_post = interpolate(u, P1); >>>> File >>>> "/home/garth/code/fenics/dolfin/dolfin-all/local/lib/python2.6/site-packages/dolfin/interpolate.py", >>>> line 28, in interpolate >>>> Pv.interpolate(v) >>>> RuntimeError: *** Error: Treating Function as UFC function. Is that >>>> correct? >>> Yes, it is correct. >>> >>> I assume you are interpolating u from another space, possibly DG? >>> >>> Then we should get to the else{} clause in the restrict() which >>> triggers the error. I added the error there temporarily so that we can >>> check that we only get to else{} when we should. Before the hash fix >>> yesterday, we got there all the time which works but is very >>> inefficient. >>> >>> I have not had time yet to run more than a couple of demos. Feel free >>> to remove the error if you have checked that all demos run except the >>> few (doing interpolation) where the error should be triggered. >>> >> I tried removing the error and running >> >> demo/function/nonmatching-interpolation/cpp >> >> but and there is a very nasty bug which I can't track down. The code is >> failing inside the generated ufc code for tabulating the dof map. > > I'll take a look later tonight. >
There is something screwed up with ufc_cell. We could be restricting to a ufc::cell which has not been properly prepared (e.g. for P2 elements). Garth > -- > Anders > > >> Garth >> >> >> >> _______________________________________________ >> DOLFIN-dev mailing list >> DOLFIN-dev@fenics.org >> http://www.fenics.org/mailman/listinfo/dolfin-dev >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> DOLFIN-dev mailing list >> DOLFIN-dev@fenics.org >> http://www.fenics.org/mailman/listinfo/dolfin-dev _______________________________________________ DOLFIN-dev mailing list DOLFIN-dev@fenics.org http://www.fenics.org/mailman/listinfo/dolfin-dev