Skip to content

feat: Get raw value for faces connectivity data. #4244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jul 9, 2025

Conversation

prmukherj
Copy link
Collaborator

@prmukherj prmukherj commented Jul 5, 2025

This feature updates existing method to add a flag "flatten_connectivity" which changes its default return types to retrieve raw face connectivity data from surface field queries. It enables advanced users to directly access the vertex indices that define each face, which can be useful for custom post-processing or geometry interpretation.

Key Changes

  • Update get_faces_connectivity_data to provide raw-outputs.

Example usage:

python 

faces_connectivity_request = SurfaceFieldDataRequest(
    surfaces=[VelocityInlet(settings_source=solver_session, name="inlet")],
    data_types=[SurfaceDataType.FacesConnectivity],
    flatten_connectivity=True,
)
faces_connectivity_data = field_data.get_field_data(faces_connectivity_request)

# Accessing face connectivity
faces_connectivity_data["inlet"].connectivity
# Output: array([  4,   3,   2, ..., 379, 382, 388], shape=(1518,), dtype=int32)

# Accessing structured data:
transform_faces_connectivity_data(faces_connectivity_data["inlet"].connectivity)

Notes

  • The raw format directly returns vertex indices for each face without additional formatting or interpretation.
  • This enhancement aligns with use cases requiring low-level mesh topology access.

Please see tests and documentation for detailed usage.

@github-actions github-actions bot added the new feature Request or proposal for a new feature label Jul 5, 2025
@github-actions github-actions bot added the documentation Documentation related (improving, adding, etc) label Jul 5, 2025
@prmukherj prmukherj requested a review from abhishekchitwar July 5, 2025 04:39
@prmukherj
Copy link
Collaborator Author

@abhishekchitwar, this will suffice the requirement you had for getting raw data from faces_connectivity?

@abhishekchitwar
Copy link
Collaborator

@abhishekchitwar, this will suffice the requirement you had for getting raw data from faces_connectivity?

Thanks, @prmukherj! This avoids the need to explicitly flatten the face connectivity data when converting it to VTK or any other format.

@prmukherj
Copy link
Collaborator Author

@abhishekchitwar, this will suffice the requirement you had for getting raw data from faces_connectivity?

Thanks, @prmukherj! This avoids the need to explicitly flatten the face connectivity data when converting it to VTK or any other format.

@abhishekchitwar, we have decided to update the behavior so as to return the flat structure by default. So no changes required from your end to flatten it out or to add the flag. Thank you.

@seanpearsonuk
Copy link
Collaborator

@abhishekchitwar, this will suffice the requirement you had for getting raw data from faces_connectivity?

Thanks, @prmukherj! This avoids the need to explicitly flatten the face connectivity data when converting it to VTK or any other format.

@abhishekchitwar, we have decided to update the behavior so as to return the flat structure by default. So no changes required from your end to flatten it out or to add the flag. Thank you.

@prmukherj We did propose deprecating the previous format, which would usually imply initially providing a separate, temporary means for accessing the new format (possibly a different data_type). Should we not be concerned if instead we're simply making a breaking change without any prior notification?

@abhishekchitwar
Copy link
Collaborator

@abhishekchitwar, this will suffice the requirement you had for getting raw data from faces_connectivity?

Thanks, @prmukherj! This avoids the need to explicitly flatten the face connectivity data when converting it to VTK or any other format.

@abhishekchitwar, we have decided to update the behavior so as to return the flat structure by default. So no changes required from your end to flatten it out or to add the flag. Thank you.

@prmukherj We did propose deprecating the previous format, which would usually imply initially providing a separate, temporary means for accessing the new format (possibly a different data_type). Should we not be concerned if instead we're simply making a breaking change without any prior notification?

I believe it would be good to introduce a flatten = True flag, while keeping the default behavior set too False to ensure that existing workflows remain unaffected.

@prmukherj
Copy link
Collaborator Author

@abhishekchitwar, this will suffice the requirement you had for getting raw data from faces_connectivity?

Thanks, @prmukherj! This avoids the need to explicitly flatten the face connectivity data when converting it to VTK or any other format.

@abhishekchitwar, we have decided to update the behavior so as to return the flat structure by default. So no changes required from your end to flatten it out or to add the flag. Thank you.

@prmukherj We did propose deprecating the previous format, which would usually imply initially providing a separate, temporary means for accessing the new format (possibly a different data_type). Should we not be concerned if instead we're simply making a breaking change without any prior notification?

I believe it would be good to introduce a flatten = True flag, while keeping the default behavior set too False to ensure that existing workflows remain unaffected.

yes, doing that only. Just that the flatten behavior will be the default one later, going forward. So we need a deprecation message.

@prmukherj prmukherj merged commit 454c231 into main Jul 9, 2025
58 of 59 checks passed
@prmukherj prmukherj deleted the feat/get_raw_value_for_faces_connectivity branch July 9, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation related (improving, adding, etc) new feature Request or proposal for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants