function domain is not correct after changing mesh coordinates
I am trying to solve a free boundary problem. To do so I want to adjust the mesh coordinates to represent the domain as it changes. The following code illustrates a problem that I am having though. I define a dolfin Function (I call it "u") on a FunctionSpace with domain [0,1] then change the mesh coordinates so I think that the domain will become [0,2]. But when I try to evaluate my Function at 1, I get an error message saying "The point is not inside the domain."
------------------- python code -------------------
from dolfin import *
from numpy import linspace
mesh = IntervalMesh(10, 0.0, 1.0)
V = FunctionSpace(mesh, 'Lagrange', 1)
u = interpolate(
print 'u(0.5) = ', u(0.5)
print 'u(1.0) = ', u(1.0)
mesh.coordinate
print 'u(0.5) = ', u(0.5)
print 'u(1.0) = ', u(1.0)
------------------- output -------------------
u(0.5) = 0.5
u(1.0) = 1.0
u(0.5) = 0.25
u(1.0) = Evaluating at x = <Point x = 1 y = 0 z = 0>
Traceback (most recent call last):
File "trash.py", line 14, in <module>
print 'u(1.0) = ', u(1.0)
File "/usr/lib/
self.
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
***
*** https:/
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------
*** Error: Unable to evaluate function at point.
*** Reason: The point is not inside the domain. Consider setting "allow_
*** Where: This error was encountered inside Function.cpp.
*** Process: 0
*** -------
------------------- end of output -------------------
If I include the statement
parameters[
as suggested by the error message the program works (with a warning message) but it seems like this should not be necsessary; the point (x=1) is inside the domain.
------------------- output after setting 'allow_
u(0.5) = 0.5
u(1.0) = 1.0
u(0.5) = 0.25
u(1.0) = Extrapolating function value at x = <Point x = 1 y = 0 z = 0> (not inside domain).
0.5
------------------- end of output -------------------
Is this a bug in FEniCS/DOLFIN or am I doing something wrong?
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Glen D. Granzow for more information if necessary.