TransWikia.com

Partition mesh into predetermined submeshes

Computational Science Asked by Zoltán Csáti on December 27, 2020

I have a mesh already partitioned into disjoint groups of cells. What I want to achieve is the following.

  1. Obtain the adjacency graph for the cell groups.
  2. Partition the mesh, i.e. generate submeshes from the cell groups in such a way that cells among the interfaces (boundaries of the cell groups) are no longer connected. This leads to new node numbers.

Notes:

  1. I do not need to know to adjacency graph of the mesh cells, rather the adjacency of the cell groups.
  2. Ideally, I am looking for ready software solutions, so that I don’t need to reinvent the wheel.
  3. Python solutions are preferred.
  4. I work in two spatial dimensions with a single cell type (either fully triangular or fully quadrilateral).
  5. Efficiency is not my primary concern.
  6. Typically, in my application, the number of cells is at most 100k, while the number of cell groups is about 250.

One Answer

For your first question, constructing the adjacency graph of the "partitions" (what you call "cell groups"): Let's say you have an array $p_K$ in which you store for each cell $K$ which partition $p$ it belongs to. Also assume that you have a (sparse) array $a_{KL}$ whose entries are true if cells $K$ and $L$ are neighbors ("adjacent"). Then partition $s$ is "adjacent" to partition $t$ if $t$ is in the set $$ left( bigcup_{K, p_K=s} ; bigcup_{L, a_{KL}=text{true}} left{p_Lright} right)setminus {s}. $$ (In other words, we loop over all cells $K$ in partition $s$, then over all neighbors $L$ of these $K$, and collect their partition indices. This union contains all partition indices that partition $s$ is adjacent to, but will likely include $s$ itself -- so we throw away $s$ at the end.

For your second question, visualization -- this is typically done in the following way:

  • For each partition $s$, compute its center of mass $mathbf x_s$, for example by taking the average of the centers of the cells in this partition.
  • Compute the center of mass of the entire domain $mathbf {hat x}$, for example by taking the average of the centers of all cells.
  • When visualizing the mesh, you draw each triangle with an offset $alpha (mathbf x_s - mathbf {hat x})$ with a small $alpha$ -- say, $alpha=0.05$. In essence, what this does is move each partition outward from the global center of mass by a distance that is proportional to how far that partition already is from the center of mass. Some visualization programs can already do that for you -- the option is typically called "explode".

Correct answer by Wolfgang Bangerth on December 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP