ForestClaw / forestclaw

Quadtree/octree adaptive PDE solver based based on p4est.
http://www.forestclaw.org
BSD 2-Clause "Simplified" License
57 stars 21 forks source link

Feature edge-hanging corners #309

Closed hannesbrandt closed 4 months ago

hannesbrandt commented 5 months ago

This PR changes the domain-internal mesh creation. Now, quadrants that are corner neighbors across a coarser edge are detected and stored in the same format as all other corner-neighbor relations of the domain's mesh. To achieve this fclaw2d_domain_new_{p4est,conn} call the new functions p4est_{wrap,mesh}_new_params, which were recently introduced in https://github.com/cburstedde/p4est/pull/262 and https://github.com/cburstedde/p4est/pull/268.

scottaiton commented 5 months ago

I tried this out on the dim-ind-test branch on scottaiton/forestclaw and the edgehanging_corners flag seems to be getting lost on refinement.

Specifically, when running the unit test:

src/patches/clawpatch/clawpatch.TEST --test-case="3d clawpatch ghost fill on cube with refinement coarse interior"

the mesh on the initial domain has the flag:

Screenshot 2024-01-26 at 12 18 10 PM

but after a call to domain_adapt, the mesh in the new domain does not have the flag:

Screenshot 2024-01-26 at 12 20 58 PM
hannesbrandt commented 5 months ago

Good point, the mesh creation in wrap_adapt and wrap_partition was still calling mesh_new_ext. I addressed this issue in p4est as part of the recently merged PR https://github.com/cburstedde/p4est/pull/283. Now, the mesh is created consistently using mesh_new_params with the mesh parameters as specified in the wrap parameters. If you could bump p4est to the current develop, I can adapt this PR to the changes.

scottaiton commented 5 months ago

Updated to latest p4est in develop-3d. I also change this pull request to merge into develop-3d so I don't have to deal with two develop branches. If you can also remove the workaround in fclaw3d_patch_corner_neighbors, that would be appreciated.