← Back to team overview

dolfin team mailing list archive

Re: Error in pydolfin/Function/demo

 

On Tue, Jan 22, 2008 at 05:22:03PM +0100, Martin Sandve Alnæs wrote:
> I believe I also saw this error on Kristians computer last week:
> 
> .../dolfin/src/demo/nls/nonlinearpoisson/python$ python demo.py
> ...
> Traceback (most recent call last):
>   File "demo.py", line 158, in <module>
>     u0 = Function(element, mesh, x, compiled_form)
>   File "/opt/dolfin-dev//lib/python2.5/site-packages/dolfin/assemble.py",
> line 99, in __init__
>     cpp_Function.__init__(self, *others)
>   File "/opt/dolfin-dev//lib/python2.5/site-packages/dolfin/dolfin.py",
> line 3047, in __init__
>     this = _dolfin.new_cpp_Function(*args)
> NotImplementedError: Wrong number of arguments for overloaded function
> 'new_cpp_Function'.
>   Possible C/C++ prototypes are:
> ...
>     dolfin::Function(PyObject *,dolfin::Mesh &,dolfin::Vector &,dolfin::Form &)
> ...
> 
> 
> The problem is that jit returns a ufc::form, not a dolfin::Form which
> dolfin::Function expects.

There may be more to it than that. I haven't looked closely at this
demo, but if you look in the code, you'll find the following note:

#
# THIS DEMO IS CURRENTLY NOT WORKING
#
# ERROR:

We wrote the C++ demos first and then ported them to Python. Not
everything in the interface has been ported to Python so some of the
Python demos are not working.

We should probably raise a runtime error in all demos not working at
the top of the files to avoid confusion. (Or even better, fix all demos.)

-- 
Anders


Follow ups

References