pyopensn.mesh.KBAGraphPartitioner

class pyopensn.mesh.KBAGraphPartitioner

Koch, Baker and Alcouffe based partitioning.

This is an overlayed ortho-grid based partitioner.

Wrapper of opensn::KBAGraphPartitioner.

__init__(self: pyopensn.mesh.KBAGraphPartitioner, **kwargs) → None

Construct a KBA graph partitioner.

Parameters:
  • nx (int, default=1) – Number of partitions in x.

  • ny (int, default=1) – Number of partitions in y.

  • nz (int, default=1) – Number of partitions in z.

  • xcuts (List[float], default=[]) – Location of the internal x-cuts. Requires nx - 1 entries.

  • ycuts (List[float], default=[]) – Location of the internal y-cuts. Requires ny - 1 entries.

  • zcuts (List[float], default=[]) – Location of the internal z-cuts. Requires nz - 1 entries.

Notes

The cuts divide the domain into an nx x ny x nz array of brick-shaped cellsets. Each cell goes to the cellset that contains its centroid. A centroid that lies on a cut goes to the cellset above it.

Each axis needs n - 1 cuts that are finite and strictly increasing, and the constructor raises ValueError otherwise. Every slab between cuts must contain cell centroids. An axis on which the mesh has no extent must have one partition. A 2D mesh needs nz=1, and a 1D mesh, which lies along z, needs nx=1 and ny=1. These rules depend on the mesh, so Execute of the mesh generator raises RuntimeError on every rank when one of them is broken.

With nx * ny * nz equal to the number of MPI ranks, the rank-level sweep graph is acyclic for every direction. With more cellsets than ranks, each rank owns an equal brick-shaped subdomain of cellsets when the cellset counts allow one. Otherwise, ranks take consecutive cellsets and a warning is logged.