-
Notifications
You must be signed in to change notification settings - Fork 16
Pcms localization library #253
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
base: develop
Are you sure you want to change the base?
Conversation
This reorganization will help decouple components. For example, the vmec field needs to use interpolation. With the utility libraries moved to a lower level, we can avoid a circular dependency between pcms::core pcms::interpolator. That is, pcms::core can utilize pcms::interpolator. This is really the first step in a broader re-organization of the pcms::sources to be more modular.
We create a library that performs localization tasks. At the moment, we only have one strategy, i.e., use a unform grid for localization. However, we anticipate adding additional backends for AroborX (SCOREC#245), adjacency based, KD-Tree, etc. This library split helps to organize the code, move things out of pcms::core which initally had everything, and clarify dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR continues the reorganization of the PCMS codebase by extracting utility and localization components into separate libraries (pcms_utility and pcms_localization). This modularization improves code organization and enables better dependency management.
- Moves utility headers (arrays, types, print, assert, etc.) from
pcms/topcms/utility/subdirectory with a new CMake library target - Extracts point search functionality into a new
pcms_localizationlibrary - Updates all include paths throughout the codebase to reflect the new structure
- Adds missing includes (e.g.,
<cmath>in coordinate_transform.h) that were previously satisfied transitively - Prefixes internal helper macros with
PCMS_to avoid potential naming conflicts
Reviewed changes
Copilot reviewed 59 out of 63 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/pcms/utility/CMakeLists.txt | Defines new pcms_utility library with proper exports and include paths |
| src/pcms/localization/CMakeLists.txt | Defines new pcms_localization library linking to pcms_utility and Omega_h |
| src/pcms/localization/point_search.cpp | Implements point search algorithms (newly added implementation file) |
| src/pcms/utility/*.h, *.cpp | Utility headers/sources moved with updated internal includes |
| src/pcms/utility/types.h | Removes redev dependency, adds standard library includes |
| src/pcms/utility/assert.h | Prefixes helper macros (CAT, SELECT, etc.) with PCMS_ namespace |
| src/pcms/coupler.h | Adds ProcessType alias to shield users from redev types |
| src/pcms/coordinate_transform.h | Adds missing <cmath> include for trigonometric functions |
| src/CMakeLists.txt | Removes utility source files, adds subdirectories and library dependencies |
| config.cmake.in | Includes new library target exports for utility and localization |
| test/.cpp, tools/.cpp, examples/*.cpp | Updates includes to use new pcms/utility/ and pcms/localization/ paths |
Comments suppressed due to low confidence (1)
src/pcms/utility/assert.cpp:1
- Missing include for
abort()function. The functionabort()is called on line 8 but the required header<cstdlib>is not included. While the code may compile in some environments due to transitive includes, this is fragile and may break in other environments or with different compilers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #include "pcms/utility/arrays.h" | ||
| #include "field.h" | ||
| #include "pcms/arrays.h" | ||
| #include "pcms/utility/arrays.h" |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate include directive. The header "pcms/utility/arrays.h" is included twice (lines 5 and 7). Remove one of the duplicate includes to keep the code clean.
This PR is the second step of the reorganization started in #252. It should be reviewed after #252.