2.1.1. Introduction to Meshing and Partitioning
2.1.1.1. Meshing
Python mesh construction starts with MeshGenerator. Calling
Execute() completes the generator pipeline and returns the
MeshContinuum used by a problem.
The pyopensn.mesh module provides these mesh generators:
OrthogonalMeshGeneratorcreates one-, two-, or three-dimensional orthogonal meshes from coordinate-node sets.FromFileMeshGeneratorimports an externally generated mesh.ExtruderMeshGeneratorturns a two-dimensional input mesh into a layered three-dimensional mesh.SplitFileMeshGeneratorwrites or reads rank-specific binary mesh partitions for reuse.DistributedMeshGeneratorpartitions a mesh on rank zero and distributes the resulting partitions to the MPI ranks.
FromFileMeshGenerator accepts meshes in the following formats:
msh(Gmsh)vtuandpvtu(VTK unstructured grids)e(Exodus II)case(Ensight Gold)obj(Wavefront surface meshes, for two-dimensional meshing)
Imported meshes can carry block IDs for materials and volumetric sources and boundary IDs for
boundary conditions and sources. IDs can also be assigned after generation using the methods on
MeshContinuum.
Mesh generators can be chained through their inputs parameter, allowing one generator to
transform the output of another.
2.1.1.2. Partitioning
For parallel simulations, each mesh generator accepts a
GraphPartitioner. OpenSn provides:
PETScGraphPartitioner, using either ParMETIS or PT-Scotch through PETSc. This is the default, with ParMETIS selected unless configured otherwise.KBAGraphPartitioner, which places cuts along coordinate axes and is especially useful for orthogonal grids.LinearGraphPartitioner, a simple index-based partitioner intended primarily for tests.
See the Python API reference for all generator and partitioner parameters.