Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance ROM Utilities: Introduce FindNearestNeighbors Utility for ROMs. #12278

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SADPR
Copy link
Contributor

@SADPR SADPR commented Apr 15, 2024

PR Description

This PR introduces a new utility function, FindNearestNeighbors, to the RomAuxiliaryUtilities within Kratos Rom Application. This function is essential for cosimulation scenarios where information needs to be accurately passed between interfaces of different model parts.

Details

  • Functionality: FindNearestNeighbors efficiently finds the closest node in the master node set for each node in a given list. It employs a spatial binning technique to expedite the search process, ensuring performance even with large node sets.
  • Use Case: Particularly useful in cosimulation environments where matching nodes across interfaces is crucial for accurate data transfer and interaction between different physical models.

Implementation

  • The utility function uses an unordered_set to store the IDs of the nearest nodes, guaranteeing that each ID is unique and preventing any duplication.

@SADPR
Copy link
Contributor Author

SADPR commented Apr 16, 2024

I am waiting for the PR #12274 to be merge to test this one with the final motor's HROM.

///@name Member Variables
///@{

NodeBinsType::UniquePointer mpBins;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mpBins appears to be used only in the new FindNearestNeighbors function and its regenerated every time the function is called.

If this is the case please just remove the variable and declare it inside the function.

If you intend the utility to be reusable (calculate the bins once) then please move the initialization of the member variable to a separate function and then use the pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
ROM Application Project
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

7 participants