meshmode
meshmode copied to clipboard
Permutation connection
Added:
-
get_reordering_by_pymetis: Compute mesh element reorderings (permutations) via Metis's nested dissection algorithm. -
make_element_permutation_connection: First attempt at generating a connection that permutes the elements of an existing mesh, sayfrom_mesh, to those of a new mesh,to_mesh, using the ND-generated permutation. The goal is to be able to passto_meshto a CFD solver. I do not need the mesh nodes to be reordered. My understanding is thatall_elements_permshould contain the permuted element tags offrom_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 offrom_discr.mesh, which is not the goal.to_discr.meshshould contain the same nodes and elements offrom_discr.mesh, but with the mesh ordering permuted usingperm. - Is a discretization connection a mapping between two "immutable" meshes? Or is
to_discr.meshactually changed upon creation of the connection? - If the answer to the last question is "no," how do I construct a copy of
from_discr.meshwith the elements permuted?
Any advice would be appreciated! Thank you!
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).