Skip to content

Introduce index-based functions for system interactions so that we can handle intersystem specific interactions#1057

Open
svchb wants to merge 7 commits intotrixi-framework:mainfrom
svchb:more_semi_refactor
Open

Introduce index-based functions for system interactions so that we can handle intersystem specific interactions#1057
svchb wants to merge 7 commits intotrixi-framework:mainfrom
svchb:more_semi_refactor

Conversation

@svchb
Copy link
Copy Markdown
Collaborator

@svchb svchb commented Jan 22, 2026

This PR refactors the semidiscretization and neighborhood-search internals to pass explicit system_index and neighbor_index values through pairwise update and interaction paths.
That removes repeated system_indices(...) lookups when wrapping u/v views, fetching neighborhood searches, and dispatching pairwise work.
It enables cleaner future handling of system-pair-specific interactions without changing the current behavior.

foreach_system_indexed(semi) do system_index, system
    foreach_system_indexed(semi) do neighbor_index, neighbor
        nhs = get_neighborhood_search(system, neighbor, semi,
                                      system_index, neighbor_index)
        u_system = wrap_u(u_ode, system, semi, system_index)
        u_neighbor = wrap_u(u_ode, neighbor, semi, neighbor_index)

        if is_special_pair(system, neighbor)
            interact_special_pair!(..., nhs, u_system, u_neighbor)
        else
            interact!(..., system, neighbor, semi,
                      system_index, neighbor_index)
        end
    end
end

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 91.58879% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.51%. Comparing base (379db88) to head (b222d5d).

Files with missing lines Patch % Lines
src/general/neighborhood_search.jl 70.58% 5 Missing ⚠️
src/io/io.jl 0.00% 2 Missing ⚠️
src/general/general.jl 0.00% 1 Missing ⚠️
src/general/semidiscretization.jl 97.82% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (379db88) and HEAD (b222d5d). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (379db88) HEAD (b222d5d)
total 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1057       +/-   ##
===========================================
- Coverage   89.06%   67.51%   -21.56%     
===========================================
  Files         128      129        +1     
  Lines        9868     9917       +49     
===========================================
- Hits         8789     6695     -2094     
- Misses       1079     3222     +2143     
Flag Coverage Δ
total ?
unit 67.51% <91.58%> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@svchb svchb force-pushed the more_semi_refactor branch from 5bae1ad to 7fececa Compare April 14, 2026 13:27
@svchb svchb force-pushed the more_semi_refactor branch from 7fececa to bbc064e Compare April 14, 2026 13:33
svchb added 2 commits April 14, 2026 15:41
# Conflicts:
#	src/general/neighborhood_search.jl
#	src/general/semidiscretization.jl
@svchb svchb requested a review from efaulhaber April 15, 2026 11:33
@svchb svchb self-assigned this Apr 15, 2026
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