Skip to content
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

Improve subsetting robustness by using triangle for buffer meshing #110

Merged
merged 26 commits into from
Sep 25, 2023

Conversation

SorooshMani-NOAA
Copy link
Collaborator

@SorooshMani-NOAA SorooshMani-NOAA commented Sep 14, 2023

Need to pin python to 3.11 due to issues with building current version #57d988f (tag: v20220202) of triangle.

The fix is already in the package, but they just need to release it to PyPI .

Update
A new version of triangle is not released on PyPI, so no need to pin to pre 3.11 python

Comment on lines +196 to +201
elm_polys = []
for elm_type in ELEM_2D_TYPES:
elems = getattr(mesh, elm_type)['index']
elm_polys.extend(
[Polygon(mesh.vert2['coord'][cell]) for cell in elems]
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Old polygon from mesh sometimes failed randomly for cases where two separate polygons are touching at multiple forms, forming islands between them

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This method might be slower and/or more memory hungry (not tested) but it is correct!

@SorooshMani-NOAA
Copy link
Collaborator Author

The subset and combine functionality has been also tested by @FariborzDaneshvar-NOAA and @yichengt900 as a part of the on demand workflow for storm simulation for storms including Irene 2011, Harvey 2017, Florence 2018, Ian 2022.

The only remaining issue to address is #111

@SorooshMani-NOAA SorooshMani-NOAA merged commit 18d15ac into main Sep 25, 2023
9 checks passed
@SorooshMani-NOAA SorooshMani-NOAA deleted the enhance/subset_triangle branch October 11, 2023 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant