pyopensn.mesh.SplitFileMeshGenerator

class pyopensn.mesh.SplitFileMeshGenerator

Split file mesh generator.

Wrapper of opensn::SplitFileMeshGenerator.

Generates the mesh only on rank 0. After partitioning, the mesh is not broadcast to other ranks; instead, a binary mesh file for each is written .

Execute(self: pyopensn.mesh.MeshGenerator) → pyopensn.mesh.Mesh

Build the mesh and partition it over the ranks.

Collective: every rank must call it. Rank 0 partitions the mesh. A pyopensn.mesh.DistributedMeshGenerator or pyopensn.mesh.SplitFileMeshGenerator also builds the mesh on rank 0 only.

Raises:

RuntimeError – On every rank, when partitioning the mesh fails on rank 0, or when a pyopensn.mesh.DistributedMeshGenerator or pyopensn.mesh.SplitFileMeshGenerator fails to build or write the mesh on rank 0, for example because the mesh is folded or has an inverted cell. Other generators build the mesh on every rank, and a build error is raised on each rank where it occurs.

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

Construct a split-file mesh generator.

Parameters:
  • scale (float, default=1.0) – Uniform scale to apply to the mesh after reading.

  • inputs (List[pyopensn.mesh.MeshGenerator], default=[]) – A list of MeshGenerator objects.

  • partitioner (pyopensn.mesh.GraphPartitioner, default=None) – Handle to a GraphPartitioner object to use for parallel partitioning. This will default to PETScGraphPartitioner with a “parmetis” setting.

  • replicated_mesh (bool, default=False) – Flag, when set, makes the mesh appear in full fidelity on each process.

  • num_partitions (int, default=0) – The number of partitions to generate. If zero, it will default to the number of MPI processes. Automatically ignored if the number of MPI processes greater 1.

  • split_mesh_dir_path (str, default='split_mesh') – Path of the directory to be created for containing the split meshes.

  • file_prefix (str, default='') – Prefix to use for all split mesh files. If not provided, it default to the input path’s folder.

  • read_only (bool, default=False) – Controls whether the split mesh is recreated or just read.

  • verbosity_level (int, default=1) – Verbosity level. 1 will report each 10% complete. 2 will print each part and the number of local cells it wrote.