You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
edge_face_connectivity pointing to an index variable identifying all faces that share the same edge, i. e. are neighbors to an edge. This connectivity array is thus a matrix of size nEdges x 2. It is intended to be used in combination with data defined on edges. The start_index attribute should be used to specify the indexing convention and 0-based indexing is the default. Attribute _FillValue must be present.
For each unique edge identifier [0, n_edge), find one or both faces that contain that edge identifier. I'm not certain on what the best implementation would be, but I was thinking of constructing a dictionary where each key is the edge identifier, and as we iterate over each face edge, populating the dictionary with which face index contains that edge
Thank you for sharing your approach to handling the connectivity issue. Your method resonates with certain concepts from computational geometry, specifically the idea of mesh arrangements.
This approach is actually quite similar to the strategies we employed in computational geometry, a field where handling such geometric information is routine. Incorporating this kind of mesh arrangement in our codes would undoubtedly be beneficial. In fact, mesh arrangement does more than just solve the connectivity problem you mentioned. It can also determine if an arbitrary point is located inside a given polygon, a topic that I plan to delve into in my upcoming research.
One primary concern here is the direction of the edges. According to the UGRID convention, the edge should be counter-clockwise directed. This raises a challenge: for instance, edge "3" runs from vertex 1 --> 0 in face 'b' but from vertex 0 --> 1 in face 'a'. This discrepancy calls for the introduction of a concept known as the "half-edge". As you can infer, each half-edge relates to its adjacent face, providing a solution to the edge directionality issue. This is precisely how mesh arrangements address such problems.
For a deeper dive into these concepts, I recommend looking into the following papers:
Thank you for sharing your approach to handling the connectivity issue. Your method resonates with certain concepts from computational geometry, specifically the idea of mesh arrangements.
This approach is actually quite similar to the strategies we employed in computational geometry, a field where handling such geometric information is routine. Incorporating this kind of mesh arrangement in our codes would undoubtedly be beneficial. In fact, mesh arrangement does more than just solve the connectivity problem you mentioned. It can also determine if an arbitrary point is located inside a given polygon, a topic that I plan to delve into in my upcoming research.
One primary concern here is the direction of the edges. According to the UGRID convention, the edge should be counter-clockwise directed. This raises a challenge: for instance, edge "3" runs from vertex 1 --> 0 in face 'b' but from vertex 0 --> 1 in face 'a'. This discrepancy calls for the introduction of a concept known as the "half-edge". As you can infer, each half-edge relates to its adjacent face, providing a solution to the edge directionality issue. This is precisely how mesh arrangements address such problems.
For a deeper dive into these concepts, I recommend looking into the following papers:
Thank you for the detailed response! Is the direction of the edge important if we are only interested in computing which faces saddle a given edge?
The mesh arrangement concept captures this precisely:
During the input construction, the mesh arrangement notes that the descending yellow half-edge (3) is linked to face 'b', whereas the ascending half-edge (3) corresponds to face 'a'.
So, when inquiring about the faces adjacent to edge (3), the mesh arrangement can promptly indicate faces 'a' and 'b' as the answer. It can also answer the problem "Which edge is adjacent to face a"
While it's entirely feasible to identify faces adjacent to an edge without emphasizing edge direction, it's essential to recognize the inherent subtleties. These nuances might become significant in advanced use cases or as our project progresses.
I advocate for the mesh arrangement for several reasons:
For creating a fast and reliable algorithm on a spherical surface, the mesh arrangement is nearly indispensable. Not only does it offer solutions to your adjacency concerns, but it also robustly addresses whether a specific point lies within a given polygon. Furthermore, it can shed light on other topological issues, such as identifying mesh "holes" and their locations. As previously mentioned, this direction aligns with my upcoming research focus.
The solution presented in Is pole point inside #510 just aims to accelerate our present trajectory, enabling the integral function's swift availability. However, I anticipate utilizing the mesh arrangement to refine the algorithm down the line.
Incorporating mesh arrangement into our workflow will preempt the need to keep re-building the wheel repeatedly. It also helps us steer clear of extensive code refactoring in the future.
But I also understand your concern about bringing out a working solution as soon as possible. And I am just sharing my thoughts about the mesh arrangement here. I am always open to any suitable solutions or suggestions related to our project
Thank you for the detailed response! Is the direction of the edge important if we are only interested in computing which faces saddle a given edge?
The mesh arrangement concept captures this precisely:
During the input construction, the mesh arrangement notes that the descending yellow half-edge (3) is linked to face 'b', whereas the ascending half-edge (3) corresponds to face 'a'.
So, when inquiring about the faces adjacent to edge (3), the mesh arrangement can promptly indicate faces 'a' and 'b' as the answer. It can also answer the problem "Which edge is adjacent to face a"
While it's entirely feasible to identify faces adjacent to an edge without emphasizing edge direction, it's essential to recognize the inherent subtleties. These nuances might become significant in advanced use cases or as our project progresses.
I advocate for the mesh arrangement for several reasons:
For creating a fast and reliable algorithm on a spherical surface, the mesh arrangement is nearly indispensable. Not only does it offer solutions to your adjacency concerns, but it also robustly addresses whether a specific point lies within a given polygon. Furthermore, it can shed light on other topological issues, such as identifying mesh "holes" and their locations. As previously mentioned, this direction aligns with my upcoming research focus.
The solution presented in Is pole point inside #510 just aims to accelerate our present trajectory, enabling the integral function's swift availability. However, I anticipate utilizing the mesh arrangement to refine the algorithm down the line.
Incorporating mesh arrangement into our workflow will preempt the need to keep re-building the wheel repeatedly. It also helps us steer clear of extensive code refactoring in the future.
But I also understand your concern about bringing out a working solution as soon as possible. And I am just sharing my thoughts about the mesh arrangement here. I am always open to any suitable solutions or suggestions related to our project
This is a fantastic response! I'll give those two papers above a read through. Thank you!
Activity
philipc2 commentedon Oct 16, 2023
@hongyuchen1030
Do you have any algorithmic suggestions on implementing this connectivity?
I was planning on using the
face_edgeconnectivity to obtain the edges that make up each face. Each edge will be assigned a unique index.Any two faces that then share an edge ($face_{a}$ , $face_{b}$ ) will become the indices stored in that row for the
edge_faceconnectivityExample
The values in red represent a unique identifier into each face, with the values in green being a unique identifier for each edge
Face Edgeswith Unique Identifier Applied[2, 1, 3] (a)
[3, 5, 4] (b)
[5, 7, 6] (c)
[7, 8, 9] (d)
Corresponding
Edge FaceConnectivity[a, None] (1)
[a, None] (2)
[a, b] (3)
[b, None] (4)
[b, c] (5)
[c, None] (6)
[c, d] (7)
[d, None] (8)
[d, None] (9)
Implementation / Algorithm
For each unique edge identifier [0, n_edge), find one or both faces that contain that edge identifier. I'm not certain on what the best implementation would be, but I was thinking of constructing a dictionary where each key is the edge identifier, and as we iterate over each face edge, populating the dictionary with which face index contains that edge
Algorithm using the example
Dictionary (start)
{}Dictionary (After Face a)
{"2": [a], "3": [a], "1": [a]}Dictionary (After Face b)
{"2": [a], "3": [a, b], "1": [a], "4": [b], "5": [b],}We would continue this until we've iterated over each face. Any thoughts?
hongyuchen1030 commentedon Oct 16, 2023
Thank you for sharing your approach to handling the connectivity issue. Your method resonates with certain concepts from computational geometry, specifically the idea of mesh arrangements.
This approach is actually quite similar to the strategies we employed in computational geometry, a field where handling such geometric information is routine. Incorporating this kind of mesh arrangement in our codes would undoubtedly be beneficial. In fact, mesh arrangement does more than just solve the connectivity problem you mentioned. It can also determine if an arbitrary point is located inside a given polygon, a topic that I plan to delve into in my upcoming research.
One primary concern here is the direction of the edges. According to the UGRID convention, the edge should be counter-clockwise directed. This raises a challenge: for instance, edge "3" runs from vertex 1 --> 0 in face 'b' but from vertex 0 --> 1 in face 'a'. This discrepancy calls for the introduction of a concept known as the "half-edge". As you can infer, each half-edge relates to its adjacent face, providing a solution to the edge directionality issue. This is precisely how mesh arrangements address such problems.
For a deeper dive into these concepts, I recommend looking into the following papers:
Let me know if you need more clarification or if you have any other thoughts on this. Looking forward to working closely on this!
philipc2 commentedon Oct 16, 2023
Thank you for the detailed response! Is the direction of the edge important if we are only interested in computing which faces saddle a given edge?
In the case here, for the yellow edge (3), we want to know which two faces (a, b) saddle a give edge. Does the direction here matter?
philipc2 commentedon Oct 16, 2023
Here's a quick implementation I put together in a notebook.
These values line up with what is provided in MPAS datasets.

hongyuchen1030 commentedon Oct 17, 2023
The mesh arrangement concept captures this precisely:
During the input construction, the mesh arrangement notes that the descending yellow half-edge (3) is linked to face 'b', whereas the ascending half-edge (3) corresponds to face 'a'.
So, when inquiring about the faces adjacent to edge (3), the mesh arrangement can promptly indicate faces 'a' and 'b' as the answer. It can also answer the problem "Which edge is adjacent to face a"
While it's entirely feasible to identify faces adjacent to an edge without emphasizing edge direction, it's essential to recognize the inherent subtleties. These nuances might become significant in advanced use cases or as our project progresses.
I advocate for the mesh arrangement for several reasons:
For creating a fast and reliable algorithm on a spherical surface, the mesh arrangement is nearly indispensable. Not only does it offer solutions to your adjacency concerns, but it also robustly addresses whether a specific point lies within a given polygon. Furthermore, it can shed light on other topological issues, such as identifying mesh "holes" and their locations. As previously mentioned, this direction aligns with my upcoming research focus.
The solution presented in Is pole point inside #510 just aims to accelerate our present trajectory, enabling the integral function's swift availability. However, I anticipate utilizing the mesh arrangement to refine the algorithm down the line.
Incorporating mesh arrangement into our workflow will preempt the need to keep re-building the wheel repeatedly. It also helps us steer clear of extensive code refactoring in the future.
But I also understand your concern about bringing out a working solution as soon as possible. And I am just sharing my thoughts about the mesh arrangement here. I am always open to any suitable solutions or suggestions related to our project
philipc2 commentedon Oct 17, 2023
This is a fantastic response! I'll give those two papers above a read through. Thank you!