This PR is a follow-up of #61 and adds the algorithm to compute the dual mesh for the nodes. It uses the functionalities from #61 (which is why it's a draft PR so far) such that we create the dual mesh for the nodes from the dual mesh for the edges. Roughly spoken, it works like this:
for each edge in this node_edge_connectivity: if the cell in the corresponding dual edge mesh is triangular, add the center of the edge as another node.
sort the edges in the dual cells such that they build a chain
The anti-clockwise ordering results from the anti-clockwise ordering of the dual edge mesh.
I head to use cython for step 3 and 4 as I did not know how to best vectorize this.
This PR is a follow-up of #61 and adds the algorithm to compute the dual mesh for the nodes. It uses the functionalities from #61 (which is why it's a draft PR so far) such that we create the dual mesh for the nodes from the dual mesh for the edges. Roughly spoken, it works like this:
node_edge_connectivity
(similarly to the algorithm proposed by @Huite for theedge_face_connectivity
in https://github.com/NOAA-ORR-ERD/gridded/pull/61#issuecomment-762313944)node_edge_connectivity
: if the cell in the corresponding dual edge mesh is triangular, add the center of the edge as another node.The anti-clockwise ordering results from the anti-clockwise ordering of the dual edge mesh.
I head to use cython for step 3 and 4 as I did not know how to best vectorize this.