Skip to content

Find a closest point in an element given a free point #4173

@YaqiWang

Description

@YaqiWang

This can be a useful functionality. In my use case, I have a lot of source points generated separately from the mesh generation. These points are located on a surface, which may not exactly located on element sides when the surface is curved. For each source point, I need to put its contribution on a variable defined on the surface, which requires me to find a point on an element side that is closest to the source point. Currently, I am using a point locator to find an element side closes to the point and then call

const Point mapped_point = FEInterface::inverse_map(dim, elem_side, source_point);

to get the point on the reference element. The reference coordinates are probably outside of the reference element. But because the point is fairly close to the element, this inverse_map call is expected to be successful. I am thinking a quick sub-optimal way to fix mapped_point up so that it is inside the element. Tag @roystgnr because he mentioned he already had some code like this.

I made this a broader issue. For some special types of elements, like an edge, or a triangle, there exists algorithms to do this. But hopefully we can make this support general types of elements including high-order isoparametric elements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions