Skip to content

Implement class_id workaround for all methods - #378

Open
Fuad-HH wants to merge 1 commit into
SCOREC:developfrom
Fuad-HH:develop
Open

Implement class_id workaround for all methods#378
Fuad-HH wants to merge 1 commit into
SCOREC:developfrom
Fuad-HH:develop

Conversation

@Fuad-HH

@Fuad-HH Fuad-HH commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Only moved EnsureClassification to mesh_geometry.h as a common ground.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 EnsureClassification from omega_h_lagrange.cpp into mesh_geometry.h (and adjusted includes).
  • Updated OmegaHEntityLayout construction to call EnsureClassification(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),
@Fuad-HH
Fuad-HH requested a review from jacobmerson September 10, 2026 18:39
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.

2 participants