This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Cannot evaluate function at point inside the domain

+1 vote

Hello,

I am facing a problem when trying to evaluate a function at a point.
The error I get is

*** -------------------------------------------------------------------------
*** Error:   Unable to evaluate function at point.
*** Reason:  The point is not inside the domain. Consider calling "Function::set_allow_extrapolation(true)" on this Function to allow extrapolation.
*** Where:   This error was encountered inside Function.cpp.
*** Process: 0
*** 
*** DOLFIN version: 1.6.0
*** Git changeset:  
*** -------------------------------------------------------------------------

but the point is indeed inside the domain.

I found this thread: http://fenicsproject.org/qa/8045/evaluate-function-fails-for-point-inside-mesh but it does not help me, since I am not calling the project method, nor am I using a 1D mesh.
I am instead trying to compute a P0 discontinuous function from a P1 continous function (basically, some kind of sign function).

What is puzzling is that this problems occurs on my work Linux box but not on my personal Apple laptop. The version of dolfin installed is the same on both machines, though (1.6.0).

Please find at this link ( https://www.dropbox.com/s/la4d55v35hnkokx/test_eval.tar.gz?dl=0 ) a compressed directory with all that's needed to run a test that hopefully reproduces the problem.

You can see the point at which the error is raised if you run the program as

./main --verbose true

On my machine, such point is (0.0666667, 0.373333), which is obviously inside the domain (which is the rectangle defined by (-1, 0) and (1, 1) ).

What am I missing?

Thanks a lot

Mattia

asked Jun 14, 2016 by mattia_ FEniCS Novice (270 points)
...