Conversation
…coarsen and expand
504e17a to
1a4c536
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements a major refactoring of the set algebra system in samurai, replacing the old visitor-based approach with a new traverser-based architecture. The changes introduce a more modular and maintainable design for performing set operations (union, intersection, difference) on mesh cell arrays.
Changes:
- Complete rewrite of the subset/set algebra implementation using a traverser-based architecture
- Addition of new traverser classes for various operations (union, intersection, difference, expansion, contraction, projection, translation)
- Replacement of old visitor pattern with a cleaner set base class and traverser interface
- New utility functions for set operations and tuple/range iteration
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_subset.cpp | Updated tests to use new API (vmin instead of compute_min), added expand_2d, expand_3d, contract tests, contains debug code |
| include/samurai/subset/visitor.hpp | Deleted old visitor-based implementation |
| include/samurai/subset/start_end_fct.hpp | Deleted old start/end function implementation |
| include/samurai/subset/concepts.hpp | Deleted old concepts file |
| include/samurai/subset/utils.hpp | Refactored with new utility functions, contains critical bug in enumerate_items |
| include/samurai/subset/traversers/*.hpp | New traverser implementations for all set operations |
| include/samurai/subset/set_base.hpp | New base class for set operations |
| include/samurai/subset/nary_set_operator.hpp | New n-ary set operator implementation |
| include/samurai/subset/node.hpp | Simplified to include only headers |
| include/samurai/level_cell_array.hpp | Updated constructors to work with new set base, contains commented code |
| include/samurai/interval.hpp | Modified equality operator to exclude index field |
| include/samurai/samurai_config.hpp | Added configuration flags for new features |
| include/samurai/static_algorithm.hpp | Added conditional logic for native expand |
| include/samurai/mesh.hpp | Updated to call to_lca() on set operations |
| include/samurai/boundary.hpp | Added const correctness |
| include/samurai/algorithm.hpp | Updated for_each_interval for new API |
| demos/tutorial/set_operator.cpp | Updated contraction to contract function call |
| demos/FiniteVolume/advection_3d.cpp | New 3D advection demo |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Can you check that all |
|
We could also just keep the version of 'ListOfIntervals' for the traversers and delete the rest. |
done. |
Description
This PR implements a major refactoring of the set algebra system in samurai, replacing the old visitor-based approach with a new traverser-based architecture. The changes introduce a more modular and maintainable design for performing set operations (union, intersection, difference) on mesh cell arrays.
It also resolves a long-standing issue that resulted from the visitor-based approach that was previously implemented. This approach assumes that all sets in algebra are commutative, which is not the case. We now have a valid set algebra.
Changes:
Code of Conduct
By submitting this PR, you agree to follow our Code of Conduct