Parallel function evaluation in 3D

Asked by Sebastian Lührs

Hi,

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 problem.py
Process 0: Number of global vertices: 1331
Process 0: Number of global cells: 6000
0.99
Traceback (most recent call last):
  File "poisson.py", line 7, in <module>
    print u(0.33,0.33,0.33)
  File "/usr/lib/python2.7/dist-packages/dolfin/functions/function.py", line 378, in __call__
    self.eval(values, x)
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://answers.launchpad.net/dolfin
***
*** 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 *
parameters["allow_extrapolation"]=True
mesh = UnitCubeMesh(10,10,10)
V = FunctionSpace(mesh, 'CG', 1)
u = interpolate(Expression("x[0]+x[1]+x[2]"),V)
u.update()
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

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

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

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

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

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 :
#3

Thanks Jan Blechta, that solved my question.