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
@paullric I'm working on this implementation now, could you provide a little clarification about what this function is supposed to do?
Does the function build node_face_connectivity from scratch? Or is this function just building a reverse relationship from a pre-existing face_node_connectivity?
Activity
anissa111 commentedon Sep 13, 2022
@paullric I'm working on this implementation now, could you provide a little clarification about what this function is supposed to do?
Does the function build
node_face_connectivityfrom scratch? Or is this function just building a reverse relationship from a pre-existingface_node_connectivity?(cc @erogluorhan for updates)
paullric commentedon Sep 13, 2022
anissa111 commentedon Sep 13, 2022
Oh, okay, I see thank you! Is there a prefered method for doing this calculation or is something similar implemented in
tempestremapI should look at?Huite commentedon Sep 26, 2022
Hi @anissa111,
I butt in here occasionally, I've implemented this in
xugridif you're looking for inspiration:https://github.com/Deltares/xugrid/blob/main/xugrid/ugrid/ugrid2d.py#L406
It mostly uses some utils defined here:
https://github.com/Deltares/xugrid/blob/main/xugrid/connectivity.py
Which I find make it relatively easy to these transformations on connectivity arrays.
In general, I found it convenient to use scipy.sparse functionality to build/represent these arrays here and there. In particular, constructing a CSR (https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html) matrix does a lot of sorting (which is C++ behind the scenes). Alternatively, you require a lot of numpy sorting calls, which aren't that easy to do efficiently if the arrays are really not that rectangular; or you'd have to write a lot of numba code, I suppose.
anissa111 commentedon Sep 27, 2022
@Huite, thank you! I will definitely have a look at the links you've provided.
[-]Grid.build_node_face_connectivity[/-][+]`Grid.build_node_face_connectivity`[/+][-]`Grid.build_node_face_connectivity`[/-][+]Implement `Grid.build_node_face_connectivity`[/+]