-------- Original Message --------
Subject: Re: [FEniCS] eval in parallel
Date: 21/11/2014 12:22
From: Chris Richardson <ch...@bpi.cam.ac.uk>
To: Mikael Mortensen <mikael.morten...@gmail.com>

On 21/11/2014 11:52, Mikael Mortensen wrote:
On 20 Nov 2014, at 13:08, Jan Blechta <blec...@karlin.mff.cuni.cz>
wrote:

On Thu, 20 Nov 2014 11:33:26 +0100
Mikael Mortensen <mikael.morten...@gmail.com> wrote:

On 20 Nov 2014, at 10:54, Chris Richardson <ch...@bpi.cam.ac.uk>
wrote:

There has been some discussion on bitbucket about how to best
support evaluation and interpolation in parallel.

At present, user code like this:

mesh = UnitSquareMesh(10, 10)
Q = FunctionSpace(mesh, "CG", 1)
F = Function(Q)
F.interpolate(Expression("x[0]"))
print F(0.2, 0.2)

crashes in parallel. e.g. with mpirun -n 2

*** Error: Unable to evaluate function at point.
*** Reason: The point is not inside the domain. Consider setting
"allow_extrapolation" to allow extrapolation. *** Where: This
error was encountered inside Function.cpp.

Clearly "allow_extrapolation" is not needed, and this is actually
confusing to users.

Agreed, allow_extrapolation is very confusing. It should not be
thrown as an option, at least not in parallel.

Please, do not remove it. allow_extrapolation is useful for
circumventing failing floating-point-based evaluation of
Cell::inside(Point& p) for p interior point near facet of the cell.
The
problem is covered here
https://bitbucket.org/fenics-project/dolfin/issue/296 [2].

Floating point robustness should probably be handled inside the
collision routines and not by flags in Function::eval. Nevertheless,
it is very misleading to throw a suggestion to allow_extrapolation in
parallel. I think we should add something like

if (allow_extrapolation &&
MPI::size(_function_space->mesh()->mpi_comm()) == 1)

or simply not allow setting allow_extrapolation to true in parallel.

Chris, I think I’m leaning towards a brand new global_eval rather
than modifying the existing eval. But I have no strong opinion on
this.


Yes, I think there are reasonable fixes to Issue 296 (https://bitbucket.org/fenics-project/dolfin/issue/296/collision-algorithms-are-not-numerically) based on considering triangle edges, which should give consistent results on either side of a facet - but that is another issue.

I guess you might sometimes want to allow_extrapolation if a Point has strayed DOLFIN_EPS outside the original domain, e.g. refinement of an external edge.

--
Chris Richardson
BP Institute
Madingley Road
Cambridge CB3 0EZ
_______________________________________________
fenics mailing list
fenics@fenicsproject.org
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to