My fault. The problem here was that I forgot to change from Function
to Expression in the code string. But perhaps the check needs to be
improved? The error message does not help.

My next problem now is that one needs to set the geometric dimension
at the time of construction for a C++ expression. How can I send this
to my Expression sub class from Python?

--
Anders


On Fri, Oct 16, 2009 at 01:29:57PM +0200, Anders Logg wrote:
> I'm getting this error with a code that used to work:
>
>   f = Expression(code, V=V)
>
>  File
>  
> "/home/logg/scratch/src/dolfin-dev/local/lib/python2.6/site-packages/dolfin/expression.py",
>  line 575, in __new__
>     [element.cell().geometric_dimension()])[0]
>   File
>   
> "/home/logg/scratch/src/dolfin-dev/local/lib/python2.6/site-packages/dolfin/compile_expressions.py",
>   line 216, in compile_expressions
>     classname, code = expression_to_dolfin_expression(cpparg,
>     defaults, dim)
>   File
>   
> "/home/logg/scratch/src/dolfin-dev/local/lib/python2.6/site-packages/dolfin/compile_expressions.py",
>   line 65, in expression_to_dolfin_expression
>     fragments = expression_to_code_fragments(expr, defaults,
>     ["v","x"])
>   File
>   
> "/home/logg/scratch/src/dolfin-dev/local/lib/python2.6/site-packages/dolfin/compile_extension_module.py",
>   line 66, in expression_to_code_fragments
>     raise TypeError, "The c++ keyword '%s' was detected in C++
>     expression."%sym
> TypeError: The c++ keyword 'class' was detected in C++ expression.
>



> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@fenics.org
> http://www.fenics.org/mailman/listinfo/dolfin-dev

Attachment: signature.asc
Description: Digital signature

_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@fenics.org
http://www.fenics.org/mailman/listinfo/dolfin-dev

Reply via email to