Product of vector and scalar Expression fails to evaluate

Issue #289 invalid
André Gaul created an issue

With dolfin 1.3.0 the following code

from dolfin import *
e = Expression(('x[0]', '1'))*Expression('x[1]')
e((1.,1.))

results in

UFLException: Expecting a component matching the indices tuple.

Comments (4)

  1. Martin Sandve Alnæs

    Symbolic evaluation is only implemented for scalar expressions, I think e0 and e1 will work.

    However this approach is mainly used for testing and debugging, expect ridiculously slow performance.

  2. André Gaul reporter

    thx, e[0](1., 1.), e[1](1., 1.) works. The behavior is a bit confusing because evaluating the expression e = Expression(('x[0]', '1')) works with e(1., 1.).

  3. Martin Sandve Alnæs

    As I said, symbolic evaluation is mainly intended for testing and debugging, you probably don't want to use it for anything serious.

  4. Log in to comment