Skip to content

feat: add a "check internal tag" action to mesh-doctor#236

Open
bd713 wants to merge 8 commits intomainfrom
feat/bd713/checkInternalTags
Open

feat: add a "check internal tag" action to mesh-doctor#236
bd713 wants to merge 8 commits intomainfrom
feat/bd713/checkInternalTags

Conversation

@bd713
Copy link
Contributor

@bd713 bd713 commented Feb 25, 2026

Description

This PR adds a new mesh-doctor action to verify that tagged 2D elements are internal (i.e., have exactly 2 volume neighbors):

  • Identifies problematic cells with 0, 1, or 3+ neighbors
  • Optional mesh output with faulty cells retagged to a null value
  • Verbose mode for detailed connectivity diagnostics

Usage

mesh-doctor checkInternalTags -i mesh.vtu \
  --tagArray FaultMask \
  --tagValues 1 2 3 4 5 6 7 8 9 \
  --fixedOutput meshFixTag.vtu \
  --nullTagValue 9999

@bd713 bd713 self-assigned this Feb 25, 2026
@jafranc jafranc added flag: ready for review test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI labels Feb 27, 2026
help="[string]: Output CSV file for problematic elements (optional)" )

p.add_argument( '--' + __NULL_TAG_VALUE,
type=float,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why float ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to be consistent with the original vtu which stores FaultMask as a float rather than a int.
But I agree all tags should be int.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code is now handling all tags as int.

type=str,
metavar=", ".join( __DATA_MODE_VALUES ),
default=__DATA_MODE_DEFAULT,
help='[string]: For ".vtu" output format, the data mode can be binary or ascii. Defaults to binary.' )
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there any value at this point in ascii ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was mimicking other action. Will force binary and change orphan2d as well.

Comment on lines 252 to 258
# Collect bad elements
for elem in elementsByNeighbors[ 0 ]:
allBadElements.append( elem )
for elem in elementsByNeighbors[ 1 ]:
allBadElements.append( elem )
for elem in elementsByNeighbors[ 'other' ]:
allBadElements.append( elem )
Copy link
Collaborator

@jafranc jafranc Feb 27, 2026

Choose a reason for hiding this comment

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

Suggested change
# Collect bad elements
for elem in elementsByNeighbors[ 0 ]:
allBadElements.append( elem )
for elem in elementsByNeighbors[ 1 ]:
allBadElements.append( elem )
for elem in elementsByNeighbors[ 'other' ]:
allBadElements.append( elem )
# Collect bad elements
allBadElements.extend( elementsByNeighbors[0] )
allBadElements.extend( elementsByNeighbors[1] )
allBadElements.extend( elementsByNeighbors['other'] )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, suggestion is now integrated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flag: ready for review test-geos-integration Triggers the testing of geosPythonPackages import and integration in GEOS CI type: feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants