Skip to content

pyLSET: an open-source Python package for level set simulations

Håkan Hallberg

cond-mat.mtrl-sci

Abstract

pyLSET is an open-source Python package for level set simulations of evolving interface networks in 2D and 3D, with grain boundaries in polycrystals as the primary application. Each grain, or other region, is represented by a signed distance function on a fixed Cartesian grid. The package is built on PyTorch, which means that the same code runs on CPUs and GPUs, in single or double floating point precision. pyLSET provides the main components of multi-level set modeling of microstructure evolution. These comprise signed distance construction from voxelized label maps, such as grain maps from diffraction contrast tomography, several reinitialization methods, graph coloring with dynamic recoloring to limit the memory use and interaction corrections that restore a partition of space at junctions. Interface mobility and energy can be local and anisotropic, and stored energy and prescribed velocity fields can be added as driving forces. Immobile regions can represent free surfaces, particles or inclusions. A scalar field, such as a temperature, can be solved on the same grid, with the interface properties depending on it. Simulation data can be written to various formats suitable for further processing in dedicated visualization codes. The underlying level set formulation and its implementation are detailed, and examples are provided to verify the code against analytical solutions and to illustrate its performance, including a 3D grain growth simulation with more than 30\,000 grains on a single GPU.

Create a lesson