I encountered a problem with the function evaluate when using a triangular mesh generated by GMSH (the msh file is located at the end of the issue).
The geometry is composed of two circles with radius 1 and 2. When I evaluate a field at the point (0.4,0.5), there is an assertion error: Point (0.4,0.5) is not inside any active cell. Of course, this point is indeed in a cell.
using Gridap
using GridapGmsh
model = GmshDiscreteModel("./model.msh");
Ω = Triangulation(model)
test = CellField(x->x[1],Ω)
test(Point(0.4,0.5)) #error
The problem seems to be located in the function _point_to_cell:
Hi,
I encountered a problem with the function
evaluate
when using a triangular mesh generated by GMSH (the msh file is located at the end of the issue). The geometry is composed of two circles with radius 1 and 2. When I evaluate a field at the point (0.4,0.5), there is an assertion error: Point (0.4,0.5) is not inside any active cell. Of course, this point is indeed in a cell.The problem seems to be located in the function
_point_to_cell
:By drawing the cells, I get this: so the point (0.4,0.5) is not in a cell where one of the vertices is the closest point.
The problem is the value of
searchmethod.num_nearest_vertices
. This variable is set to 1 but must be set to 2:By drawing the cells2, I get this:
Could you fix this issue by setting
searchmethod.num_nearest_vertices
to 2 for a triangular 2D mesh?Below is the model.msh file: