Skip to content

Encapsulate spatial searches into class #621

Description

@javijv4

Problem

Follows the discussion in #609
Right now, there are several instances in the code performing spatial search to match vertices to vertices, vertices to faces, or faces to faces between different meshes. Ideally, all these spatial search are encapsulated into classes that the different applications call. This will make the code easier to read, easier to optimize, and make it easier to implement features that require this type of search.

Solution

Create a PointLocator class to centralize all spatial searches.

From looking at the code, I believe the following are all the instances where a spatial search is performed

Query type Current implementations
Nearest neighbor match_faces, match_nodes (read_msh.cpp), face_match (read_files.cpp), distrn, remesh face loop (remesh.cpp), find_vtp_point_index (BoundaryCondition.cpp)
Closest centroid uris_find_closest_face_centroid, find_closest_element_centroid (uris.cpp)
Containing element uris_find_tetra (uris.cpp), find_n (remesh.cpp)
Nodes within distance contact neighbor search (contact.cpp)
Point in region uris_point_in_bbox (uris.cpp), SpatialBounds::inside_* (CepMod.cpp)

I am not sure whether all this code is currently maintained (like the functions in contact.cpp), but these applications seem easy to implement, so replacing them shouldn't be complicated.

Additional context

In #609, alternatives for using specialized packages to accelerate spatial queries were proposed. Depending on implementation complexity, we can implement them now or leave optimization of these routines for a future issue.

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions