feat: Add ElemsAroundElem to NeighborIndex #35

Merged
mrtz-j merged 1 commits from mrtz/e2e into main 2025-11-05 11:07:04 +00:00
mrtz-j commented 2025-11-05 10:40:59 +00:00 (Migrated from gitlab.com)

Add ElemsAroundElem to NeighborIndex, could probably also just used a Hashmap.

let private makeElemsSurroundingElemMap (ean: ElemsAroundNode) (elem: Elem array) : ElemsAroundElem =
    elem
    |> Array.mapi (fun elemIdx (n1, n2, n3) ->
        // For each element, find all elements that share any of its nodes
        let surroundingElems =
            [| ean[n1]; ean[n2]; ean[n3] |]
            |> Array.concat
            |> Array.distinct
            |> Array.filter (fun x -> x <> elemIdx) // Remove self
        elemIdx, surroundingElems
    )
    |> Map.ofArray

Also format with Fantomas.

Add ElemsAroundElem to NeighborIndex, could probably also just used a Hashmap. ```fsharp let private makeElemsSurroundingElemMap (ean: ElemsAroundNode) (elem: Elem array) : ElemsAroundElem = elem |> Array.mapi (fun elemIdx (n1, n2, n3) -> // For each element, find all elements that share any of its nodes let surroundingElems = [| ean[n1]; ean[n2]; ean[n3] |] |> Array.concat |> Array.distinct |> Array.filter (fun x -> x <> elemIdx) // Remove self elemIdx, surroundingElems ) |> Map.ofArray ``` Also format with Fantomas.
mrtz-j commented 2025-11-05 10:40:59 +00:00 (Migrated from gitlab.com)

requested review from @stigrj and @SimenLK

requested review from @stigrj and @SimenLK
mrtz-j commented 2025-11-05 10:40:59 +00:00 (Migrated from gitlab.com)

assigned to @mrtz-j

assigned to @mrtz-j
stigrj (Migrated from gitlab.com) approved these changes 2025-11-05 10:40:59 +00:00
mrtz-j commented 2025-11-05 10:42:28 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
mrtz-j commented 2025-11-05 10:48:45 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
stigrj commented 2025-11-05 11:06:14 +00:00 (Migrated from gitlab.com)

🚢 it

:ship: it
stigrj commented 2025-11-05 11:06:15 +00:00 (Migrated from gitlab.com)

approved this merge request

approved this merge request
stigrj (Migrated from gitlab.com) merged commit 571302a86b into main 2025-11-05 11:07:04 +00:00
stigrj commented 2025-11-05 11:07:05 +00:00 (Migrated from gitlab.com)

mentioned in commit 571302a86b

mentioned in commit 571302a86b9350b0d315a65057a7f4087b539973
Sign in to join this conversation.