Skip to content

remove mesh.init()#4201

Merged
ksagiyam merged 1 commit intomasterfrom
ksagiyam/remove_mesh_init
Jul 22, 2025
Merged

remove mesh.init()#4201
ksagiyam merged 1 commit intomasterfrom
ksagiyam/remove_mesh_init

Conversation

@ksagiyam
Copy link
Contributor

@ksagiyam ksagiyam commented Apr 4, 2025

Remove mesh.init().

We currently distribute mesh at mesh construction time, and later separately call mesh.init() to add partition overlap. We add partition overlap separately as we want to do that after mesh refinement whenever refinement is needed. This means that we change state of the mesh object, which has caused confusion/inconvenience.

In this PR we let mesh constructor fully construct the mesh (distribute + overlap), while reconstructing mesh without overlap from the overlapped mesh using Submesh wherever necessary; i.e., MeshHierarchy now takes overlapped mesh as argument.

Requires:

PETSc:
https://gitlab.com/petsc/petsc/-/merge_requests/8353. Merged.
https://gitlab.com/petsc/petsc/-/merge_requests/8539. Merged.

ngsPETSc:
NGSolve/ngsPETSc#78. Merged.

@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch from 93bd80d to a20b73d Compare April 15, 2025 15:09
@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch 3 times, most recently from 3370faf to d43d152 Compare May 8, 2025 10:17
@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch from d43d152 to 528b546 Compare June 20, 2025 01:59
@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch 14 times, most recently from a5616cc to 57f3349 Compare July 8, 2025 16:46
@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch 4 times, most recently from 9ba80c7 to 01e6515 Compare July 9, 2025 14:35
@ksagiyam ksagiyam marked this pull request as ready for review July 9, 2025 14:35
@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch from 01e6515 to 92870c4 Compare July 10, 2025 14:03
Copy link
Contributor

@connorjward connorjward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am basically very happy with this.

mesh_with_overlap = mesh
dm_cell_type, = mesh_with_overlap.dm_cell_types
tdim = mesh_with_overlap.topology_dm.getDimension()
# Effectively "invert" addOverlap(). This is algorithmically guaranteed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a particularly informative/clear comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added more words.

@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch from aee09eb to 0d09227 Compare July 10, 2025 16:53
@ksagiyam
Copy link
Contributor Author

@connorjward Slightly simplified notations according to the earlier changes.

@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch from 0d09227 to e690ba1 Compare July 10, 2025 20:03
connorjward
connorjward previously approved these changes Jul 11, 2025
Copy link
Contributor

@connorjward connorjward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this.

@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch from e690ba1 to 5e62f09 Compare July 18, 2025 07:34
Co-authored-by: Connor Ward <c.ward20@imperial.ac.uk>
@ksagiyam ksagiyam force-pushed the ksagiyam/remove_mesh_init branch 2 times, most recently from c2120b5 to 69d26c3 Compare July 22, 2025 13:08
@ksagiyam
Copy link
Contributor Author

CI passed except documentation links: https://github.com/firedrakeproject/firedrake/actions/runs/16443083990/job/46468241307.

Merging.

@ksagiyam ksagiyam merged commit ad518e5 into master Jul 22, 2025
2 of 4 checks passed
@ksagiyam ksagiyam deleted the ksagiyam/remove_mesh_init branch July 22, 2025 13:10
alexfikl added a commit to alexfikl/meshmode that referenced this pull request Oct 5, 2025
inducer pushed a commit to inducer/meshmode that referenced this pull request Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants