Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Unable to evaluate expression (SkewedFlow) #24

Open
benzwick opened this issue Jan 7, 2019 · 1 comment
Open

Error: Unable to evaluate expression (SkewedFlow) #24

benzwick opened this issue Jan 7, 2019 · 1 comment

Comments

@benzwick
Copy link
Collaborator

benzwick commented Jan 7, 2019

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:

# Wrap the boundary function in an Expression to avoid the need to interpolate it back to V
class MyExp(UserExpression):
def eval(self, values, x):
try:
values[0] = su(x)
except:
values[0] = 0

This could be a DOLFIN bug.

@mikaem
Copy link
Owner

mikaem commented Jan 7, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants