Problem with demo.py in Tutorial
More a remark than a question, as I've found a way around it:
When I entered the demo example from http://
fenics-test$ python demo.py
Calling FFC just-in-time (JIT) compiler, this may take some time.
Traceback (most recent call last):
File "demo.py", line 13, in <module>
u0 = Constant(mesh, 0.0)
TypeError: __init__() takes exactly 2 arguments (3 given)
Looking at the demos in dolfin-docs, I found I needed to change
u0 = Constant(mesh, 0.0)
to
u0 = Constant(0.0)
and later
f = Function(V, "500.0 * exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")
to
f = Expression("500.0 * exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)")
to get it to work. I just started with python and FEniCS, do you think the problem is with my installation?
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Christine Tobler for more information if necessary.