mikaem / Oasis

55 stars 48 forks source link

Error: Unable to evaluate expression (SkewedFlow) #24

Open benzwick opened 5 years ago

benzwick commented 5 years ago

The SkewedFlow example fails with:

Traceback (most recent call last):
  File "NSfracStep.py", line 178, in <module>
    assemble_first_inner_iter(**vars())
  File "/home/ben/projects/oasis/Oasis-BZ/oasis/solvers/NSfracStep/IPCS_ABCN.py", line 204, in assemble_first_inner_iter
    [bc.apply(A) for bc in bcs['u0']]
  File "/home/ben/projects/oasis/Oasis-BZ/oasis/solvers/NSfracStep/IPCS_ABCN.py", line 204, in <listcomp>
    [bc.apply(A) for bc in bcs['u0']]
RuntimeError:

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to evaluate expression.
*** Reason:  Missing eval() function (must be overloaded).
*** Where:   This error was encountered inside Expression.cpp.
*** Process: 0
***
*** DOLFIN version: 2018.1.0
*** Git changeset:  7afe9e1a24edb0e8d5ae51c3419fbb49f44d3d79
*** -------------------------------------------------------------------------

but eval is defined here: https://github.com/mikaem/Oasis/blob/3de552ca7271b0f91bed51322bab4fce06e63a99/oasis/problems/NSfracStep/SkewedFlow.py#L51-L57

This could be a DOLFIN bug.

mikaem commented 5 years ago

Yes, probably a DOLFIN bug in DirichletBC. It seems to work with

m = project(MyExp(element=V.ufl_element()), V)
bc0 = DirichletBC(V, 0, walls)
bc1 = DirichletBC(V, m, inlet)