dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #10979
Re: Problem with compile_function
On Sat, Dec 06, 2008 at 12:02:43PM +0100, Johan Hake wrote:
> On Friday 05 December 2008 18:02:07 Anders Logg wrote:
> > I'm having problems getting vector-valued constants working. Take a
> > look at
> >
> > demo/pde/stokes/taylor-hood/python
> >
> > It reports
> >
> > assert(isinstance(defaults[i], (dict, types.NoneType)),"Wrong type
> > in 'defaults'")
> > TypeError: 'NoneType' object is unsubscriptable
> >
> > It seems like defaults is set to None and then defaults is indexed.
> >
> > Any ideas?
>
> Should be fixed now. I have added better argument checking to
> compile_function. But you have to send in a tuple of strings to
> compile_function if you want to produce a vector values function. A list is
> interpreted as len(cppexpr) number of scalar functions.
>
> This is a bit fragile, but it is documented in the Function doc string.
ok! I wasn't aware of the difference.
Maybe we should have both compile_function and compile_functions
instead of differentiating between tuples and lists?
There is already a compile_functions defined in compile_functions.py,
but that does not seem to be used. Should it be removed (and the name
reused for batch-processing functions)?
--
Anders
Attachment:
signature.asc
Description: Digital signature
Follow ups
References