← Back to team overview

dolfin team mailing list archive

Re: Error in pydolfin/Function/demo

 

On Tue, Jan 22, 2008 at 06:21:31PM +0100, Martin Sandve Alnæs wrote:
> 2008/1/22, Anders Logg <logg@xxxxxxxxx>:
> > 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:
> 
> :-)
> 
> I'd like to get started seriously with the dolfin/syfi combo.
> 
> Where can I find a demo that
> - works
> - uses ufc forms from jit (which should then work with my ufc forms from syfi)
> - successfully defines a dolfin::Function?

  src/demo/pde/poisson (and most other demos in src/demo/pde)

> Naturally, all code that depends on ffc_Function won't work with syfi
> code, so I hope that's not too many places.

You may need to add some "if isinstance(bla bla)" in the assemble
function in DOLFIN. Just look in the file assemble.py. It should be
possible to modify it so it works out of the box with SyFi.

-- 
Anders


References