Skip to content

Implement Grid.build_node_face_connectivity #130

Closed

Description

@anissa111

Implement Grid.build_node_face_connectivity

Activity

  1. added
    new feature
    on Sep 13, 2022
  2. self-assigned this
    on Sep 13, 2022
  3. anissa111 commented on Sep 13, 2022

    @anissa111
    MemberAuthor

    @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?

    (cc @erogluorhan for updates)

  4. moved this from 📝 To Do to 🏗 In progress in UXarray Developmenton Sep 13, 2022
  5. paullric commented on Sep 13, 2022

    @paullric
    Contributor
  6. anissa111 commented on Sep 13, 2022

    @anissa111
    MemberAuthor

    It should have to build it from scratch, if face_node_connectivity is unavailable. If it is available then you can leverage it and transpose.

    Oh, okay, I see thank you! Is there a prefered method for doing this calculation or is something similar implemented in tempestremap I should look at?

  7. Huite commented on Sep 26, 2022

    @Huite

    Hi @anissa111,

    I butt in here occasionally, I've implemented this in xugrid if 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.

  8. anissa111 commented on Sep 27, 2022

    @anissa111
    MemberAuthor

    @Huite, thank you! I will definitely have a look at the links you've provided.

  9. moved this from 🏗 In progress to ✅ Done in UXarray Developmenton Jun 13, 2023
  10. moved this from ✅ Done to 🏗 In progress in UXarray Developmenton Jun 13, 2023
  11. changed the title [-]Grid.build_node_face_connectivity[/-] [+]`Grid.build_node_face_connectivity`[/+] on Jun 18, 2023
  12. changed the title [-]`Grid.build_node_face_connectivity`[/-] [+]Implement `Grid.build_node_face_connectivity`[/+] on Jun 18, 2023
  13. moved this from 🏗 In progress to 👀 In review in UXarray Developmenton Jul 11, 2023
  14. added this to the Grid Topology milestone on Aug 23, 2023
  15. moved this from 👀 In review to ✅ Done in UXarray Developmenton Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

new feature

Type

No type

Fields

Priority

None yet

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions