Ferrite-FEM/Ferrite.jl

AMR for line grids (1D forest of binary trees)

開放

#1,431 建立於 2026年7月30日

 (0 則留言) (0 個反應) (0 位負責人)Julia (109 個分叉)github user discovery
AMRfeaturegood first issue

倉庫指標

星標
 (439 顆星)
PR 合併指標
 (平均合併 15天 5小時) (30 天內合併 17 個 PR)

描述

#780 adds adaptive mesh refinement for Quadrilateral (2D) and Hexahedron (3D) grids via a p4est-style forest of octrees (ForestBWG). The same machinery could support Line grids in 1D — a forest of binary trees — but this is deliberately left out of the initial PR (review discussion).

Compared to the 2D/3D case, 1D is structurally much simpler, which makes this a nice self-contained follow-up:

  • OctantBWG{1, 2} ("bintant"): 1 coordinate, level + x; Morton index degenerates to the plain binary code, children/parent/vertices are one-liners.
  • The inter-tree connectivity is trivial: a macro edge ("tree face") is a single vertex shared by at most two trees, so there are no orientations, no corner/edge permutation tables (/𝒬/𝒫 etc. are not needed at all) — the transform machinery collapses to a mirror-or-shift of one coordinate.
  • 2:1 balancing reduces to vertex balancing; there are no hanging nodes in a conforming sense (a refined/unrefined interface meets in a shared vertex), so creategrid needs no conformity info and a Grid (not a NonConformingGrid) could be returned.
  • Most of the entry points (refine!, coarsen!, refine_and_coarsen!, balanceforest!, creategrid) should generalize with small, mostly mechanical dim = 1 methods.

Starting points in the code: src/Adaptivity/BWG.jl (OctantBWG, OctreeBWG, ForestBWG, and the DEFAULT_MAXLEVEL tuple, which already reserves a slot for dim = 1), the AMR devdocs page, and test/test_p4est.jl for the test patterns to mirror.

Suggested by @termi-official during the #780 review.

貢獻者指南