Skip to content

Conversation

@jacobmerson
Copy link
Collaborator

This PR is the second step of the reorganization started in #252. It should be reviewed after #252.

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.
Copy link

Copilot AI left a 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/ to pcms/utility/ subdirectory with a new CMake library target
  • Extracts point search functionality into a new pcms_localization library
  • 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 function abort() 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.

Comment on lines +5 to +7
#include "pcms/utility/arrays.h"
#include "field.h"
#include "pcms/arrays.h"
#include "pcms/utility/arrays.h"
Copy link

Copilot AI Dec 22, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant