Implement class_id workaround for all methods - #378
Open
Fuad-HH wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
EnsureClassification() can return early based only on top-dimension tags, which can leave lower entity dimensions missing classification arrays and cause downstream mesh.get_array(..., "class_id"/"class_dim") failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR centralizes the Omega_h mesh “missing classification tags” workaround by moving EnsureClassification into pcms/utility/mesh_geometry.h, and ensures entity/layout construction triggers classification population before reading class_id / class_dim.
Changes:
- Moved
EnsureClassificationfromomega_h_lagrange.cppintomesh_geometry.h(and adjusted includes). - Updated
OmegaHEntityLayoutconstruction to callEnsureClassification(mesh)before members read classification tags.
File summaries
| File | Description |
|---|---|
| src/pcms/utility/mesh_geometry.h | Adds shared EnsureClassification helper and required Omega_h classification include. |
| src/pcms/field/layout/omega_h_lagrange.cpp | Removes the local EnsureClassification implementation and relies on the shared header helper. |
| src/pcms/field/layout/omega_h_entity.cpp | Ensures classification tags exist before initializer-list members read them from the mesh. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+109
to
+116
| if (mesh.has_tag(mesh.dim(), "class_id") && | ||
| mesh.has_tag(mesh.dim(), "class_dim")) { | ||
| return; | ||
| } | ||
| if (!mesh.has_tag(mesh.dim(), "class_dim")) { | ||
| Omega_h::classify_elements(&mesh); | ||
| Omega_h::finalize_classification(&mesh); | ||
| } |
Comment on lines
+57
to
60
| // dimension_ is the first member, so this runs before the class_ids_/ | ||
| // class_dims_ initializers below read the mesh's classification tags. | ||
| : dimension_((EnsureClassification(mesh), mesh.dim())), | ||
| entity_dim_(entity_dim), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Only moved
EnsureClassificationtomesh_geometry.has a common ground.