Dear Floriane,
> On 26 Oct 2018, at 11:06, Floriane Gidel [RPG] <mmfg@leeds.ac.uk> wrote:
> 
> Dear all,
> 
> When trying to evaluate a function u on some mesh points with
> 
> mesh = Mesh('coarse/Omega_coarse.msh')
> V = FunctionSpace(mesh, "CG",1)
> V_Vec = VectorFunctionSpace(mesh, "CG", 1)
> u = Function(V)
> points = Function(V_vec).interpolate(SpatialCoordinate(mesh))
> dat = u.at(points.dat.data_ro)
> 
> I get the following error:
> 
> File "lin_dyn_unicell.py", line 117, in <module>
>     dat = u.at(points.dat.data_ro)
>   File "/Users/gidel/Documents/Firedrake/firedrake/src/firedrake/firedrake/function.py", line 585, in at
>     raise PointNotInDomainError(self.function_space().mesh(), points[i].reshape(-1))
> firedrake.function.PointNotInDomainError: domain <Mesh #1> does not contain point [200.          66.66666667]
> 
> 
> How is that possible while both function spaces are defined on the same mesh? 
You have run into the delightful world of computational geometry. Unfortunately points might not be determined to be in any cell if they fall close to cell boundaries.
You can reduce the tightness of the tolerance used to check if a point is in a cell by saying:
data = u.at(points, tolerance=1e-6)
Thanks,
Lawrence
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake