meshmode icon indicating copy to clipboard operation
meshmode copied to clipboard

Permutation connection

Open jonathan-macart opened this issue 1 year ago • 1 comments

Added:

  1. get_reordering_by_pymetis: Compute mesh element reorderings (permutations) via Metis's nested dissection algorithm.
  2. make_element_permutation_connection: First attempt at generating a connection that permutes the elements of an existing mesh, say from_mesh, to those of a new mesh, to_mesh, using the ND-generated permutation. The goal is to be able to pass to_mesh to a CFD solver. I do not need the mesh nodes to be reordered. My understanding is that all_elements_perm should contain the permuted element tags of from_mesh, though this could be completely incorrect.

Currently, (2) returns a discretization connection containing two identical discretizations/meshes. A few thoughts/questions:

  • Is constructing to_discr = from_discr.copy() a problem? My understanding is that this creates an exact replica of from_discr.mesh, which is not the goal. to_discr.mesh should contain the same nodes and elements of from_discr.mesh, but with the mesh ordering permuted using perm.
  • Is a discretization connection a mapping between two "immutable" meshes? Or is to_discr.mesh actually changed upon creation of the connection?
  • If the answer to the last question is "no," how do I construct a copy of from_discr.mesh with the elements permuted?

Any advice would be appreciated! Thank you!

jonathan-macart avatar Dec 06 '24 21:12 jonathan-macart

Side note: please disregard the RUF052 (https://github.com/astral-sh/ruff/issues/14796) and pylint linter failures (https://github.com/pylint-dev/pylint/issues/10000#issuecomment-2519899671).

inducer avatar Dec 06 '24 22:12 inducer