Parallel function evaluation in 3D

Asked by Sebastian Lührs


today I tried some function evaluation for a given point on an 3d mesh.
With a 2d mesh it works with one process or in parallel (by using parameters["allow_extrapolation"]=True an the update()-function). When I activate the 3d mesh i get the right value only for one process the other one produce an error-message:

>>mpirun -np 2 python
Process 0: Number of global vertices: 1331
Process 0: Number of global cells: 6000
Traceback (most recent call last):
  File "", line 7, in <module>
    print u(0.33,0.33,0.33)
  File "/usr/lib/python2.7/dist-packages/dolfin/functions/", line 378, in __call__
    self.eval(values, x)

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
*** -------------------------------------------------------------------------
*** Error: Unable to perform call to DOLFIN function.
*** Reason: The function compute has not been implemented (in /build/buildd/dolfin-1.1.0/dolfin/intersection/IntersectionOperatorImplementation.h line 302).
*** Where: This error was encountered inside log.h.
*** Process: 1
*** -------------------------------------------------------------------------

Here some minimal Code reproducing the issue:

from dolfin import *
mesh = UnitCubeMesh(10,10,10)
V = FunctionSpace(mesh, 'CG', 1)
u = interpolate(Expression("x[0]+x[1]+x[2]"),V)
print u(0.33,0.33,0.33)

Is it possible to do function evaluation in parallel on a 3d mesh?
At the moment i use dolfin 1.1.0.
Thx for help.

Question information

English Edit question
DOLFIN Edit question
No assignee Edit question
Solved by:
Jan Blechta
Last query:
Last reply:
Revision history for this message
Best Jan Blechta (blechta) said :

There is missing an implementation of some geometry related algorithms in 3D. I also discourage you from using parameters["allow_extrapolation"]=True when not necessary. It allows very crude, far extrapolations far from outside of partition!

To your problem: evaluate only on processes owning this point. You can also simply

   print u(0.33,0.33,0.33)
except RuntimeError:

Revision history for this message
Sebastian Lührs (sluehrs) said :

Thx for your help.

I only needed this feature to do some plotting operations (plots along path and so on). So I think I will do the plotting in a second step now, by writing the function to a file and reading it with only one process in my plotting script.

Revision history for this message
Sebastian Lührs (sluehrs) said :

Thanks Jan Blechta, that solved my question.