Skip to content

Function to Check For Meshes With Holes #898

Closed

Description

@aaronzedwick

Proposed new feature or change:

Function that returns whether or not a mesh has holes in it. Something like this:

Grid.contains_holes()

Returns True if any holes exists and False if not.

Activity

  1. added
    new feature
    on Aug 22, 2024
  2. self-assigned this
    on Aug 22, 2024
  3. rajeeja commented on Aug 22, 2024

    @rajeeja
    Contributor
  4. aaronzedwick commented on Aug 22, 2024

    @aaronzedwick
    MemberAuthor

    Why can one function not work for both of them?
    …
    On Thu, Aug 22, 2024, 9:42 AM Aaron Zedwick @.> wrote: Proposed new feature or change: Function that returns whether or not a mesh has holes in it. Something like this: Grid.validate.holes_in_mesh() Returns True if any holes exists and False if not. — Reply to this email directly, view it on GitHub <#898>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALF6AR4XZLIY5REUY2JHE3ZSX2GVAVCNFSM6AAAAABM6J4QE6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4DAOJXGI2DMNY . You are receiving this because you are subscribed to this thread.Message ID: @.>

    A grid with holes in it is a valid grid, so putting under the normal validation function doesn't make sense. I just need a function to return whether a grid has holes or not for the dual mesh, because if a grid has holes in it, it should be approached differently especially when it comes to DataArrays.

  5. moved this from 📚 Backlog to 👀 In review in UXarray Developmenton Aug 22, 2024
  6. rajeeja commented on Aug 22, 2024

    @rajeeja
    Contributor

    A grid with holes in it is a valid grid, so putting under the normal validation function doesn't make sense. I just need a function to return whether a grid has holes or not for the dual mesh, because if a grid has holes in it, it should be approached differently especially when it comes to DataArrays.

    validation if you see the file grid/validation.py there are functions such as _check_connectivity _check_duplicates etc., you can add something to detect holes _detect_holes a new function is not required.

    The problem is the dual mesh must be constructed in a way that respects the topology of the original mesh, which can be non-trivial. What you really need is the idea of "geometry" and "mesh", it might be doable without the computational geometry here as we limit ourselves to spherical and earth type topology/meshes.

  7. aaronzedwick commented on Aug 22, 2024

    @aaronzedwick
    MemberAuthor

    A grid with holes in it is a valid grid, so putting under the normal validation function doesn't make sense. I just need a function to return whether a grid has holes or not for the dual mesh, because if a grid has holes in it, it should be approached differently especially when it comes to DataArrays.

    validation if you see the file grid/validation.py there are functions such as _check_connectivity _check_duplicates etc., you can add something to detect holes _detect_holes a new function is not required.

    The problem is the dual mesh must be constructed in a way that respects the topology of the original mesh, which can be non-trivial. What you really need is the idea of "geometry" and "mesh", it might be doable without the computational geometry here as we limit ourselves to spherical and earth type topology/meshes.

    I opened a PR earlier with my implementation idea, could you give it a review so I can better understand how you want it to be organized? I added a similar thing as what you said above, but I don’t know that it’s exactly what you are saying.

  8. changed the title [-]Validation Function For Meshes With Holes[/-] [+]Function to Check For Meshes With Holes[/+] on Aug 22, 2024
  9. aaronzedwick commented on Aug 22, 2024

    @aaronzedwick
    MemberAuthor

    #899 is the PR number, I changed the name of the issue as I think it might have been poorly worded and possibly confusing. I don't want to add a new validation function, I simply just want to add a check for holes function inside of validation.py

  10. philipc2 commented on Aug 23, 2024

    @philipc2
    Member

    This is a much needed check that we should include.

    Looping @hongyuchen1030 in for any inputs on this. We can chat about the algorithm in next weeks UXarray meeting.

  11. hongyuchen1030 commented on Aug 23, 2024

    @hongyuchen1030
    Contributor

    This is a much needed check that we should include.

    Looping @hongyuchen1030 in for any inputs on this. We can chat about the algorithm in next weeks UXarray meeting.

    All face in the Uxarray grid should be convex. And this mean there will not be any "hole" inside
    And before answering the "is Hole inside" algorithm, please think about the following question first:

    1. How to detect if a point is inside a face on the spherical surface. (I know the immediate answer is ray-casting, but we are on the spherical surface, so the ray will go back!)
    2. How to know an interval is "inside" a face。
    3. Why we need this "is Hole inside" function?
  12. hongyuchen1030 commented on Aug 23, 2024

    @hongyuchen1030
    Contributor

    @aaronzedwick And I also add a comment for the current implementation in the PR #899 (comment)

    Such implementation idea is not checking the hole, but to see if a face has FEWER nodes than other faces.

  13. rajeeja commented on Aug 23, 2024

    @rajeeja
    Contributor

    @aaronzedwick And I also add a comment for the current implementation in the PR #899 (comment)

    Such implementation idea is not checking the hole, but to see if a face has FEWER nodes than other faces.

    Oh, in that case it'd come out as True for a mesh with faces with different numbers of edges (mixed mesh, eg. tri/quad/hex etc.)

  14. hongyuchen1030 commented on Aug 24, 2024

    @hongyuchen1030
    Contributor

    @aaronzedwick And I also add a comment for the current implementation in the PR #899 (comment)

    Such implementation idea is not checking the hole, but to see if a face has FEWER nodes than other faces.

    Sorry for the misunderstanding about the purpose of such a function. The updated comment listed here. #899 (comment)

    Basically my question is why this function and what's the following steps for such function.

  15. moved this from 👀 In review to ✅ Done in UXarray Developmenton Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

new feature

Type

No type

Fields

Priority

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions