Skip to content

make grid coloring not depend on iteration order of dicts and sets#1295

Merged
KristofferC merged 2 commits intomasterfrom
kc/coloring_order
Mar 6, 2026
Merged

make grid coloring not depend on iteration order of dicts and sets#1295
KristofferC merged 2 commits intomasterfrom
kc/coloring_order

Conversation

@KristofferC
Copy link
Copy Markdown
Collaborator

Resolves #1261

@KristofferC
Copy link
Copy Markdown
Collaborator Author

Ferrite tests pass now, but JET still fails on nightly.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.25%. Comparing base (236eb50) to head (6d2f8f9).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1295   +/-   ##
=======================================
  Coverage   94.25%   94.25%           
=======================================
  Files          40       40           
  Lines        6750     6750           
=======================================
  Hits         6362     6362           
  Misses        388      388           

☔ 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.

Copy link
Copy Markdown
Member

@KnutAM KnutAM left a comment

Choose a reason for hiding this comment

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

LGTM.

Is there any performance difference?

Comment thread src/Grid/coloring.jl Outdated
# Incidence matrix for element connections in the grid
function create_incidence_matrix(g::AbstractGrid, cellset = 1:getncells(g))
cell_containing_node = Dict{Int, Set{Int}}()
cell_containing_node = OrderedDict{Int, Set{Int}}()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this change required? Or is it for speed?

The final incidence_matrix is unique for a given grid, so should be independent on the iteration order, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not needed, I've reverted this.

@KristofferC
Copy link
Copy Markdown
Collaborator Author

Is there any performance difference?

Not from what I could measure (@btime create_coloring(generate_grid(Hexahedron, (40, 40, 40)));)

@KristofferC KristofferC merged commit 34c457e into master Mar 6, 2026
15 of 16 checks passed
@KristofferC KristofferC deleted the kc/coloring_order branch March 6, 2026 12:14
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.

Coloring vtk export tests fails on prerelease

2 participants