MLegS: Modernized and Parallelized Mapped Legendre Spectral Method Code

MLegS (Mapped Legendre Spectral Method Code) is a code package based on a modernized and parallelized spectral method for numerical simulations in a radially unbounded domain.

Based on the numerical algorithm proposed by T. Matsushima and P. S. Marcus (1997)1, MLegS incorporates scalable multiprocessing interfaces for high-performance computing. MLegS is written in Modern Fortran; the code package is open-source under a BSD license.

The latest release adds guarded Fourier de-aliasing and a conservative tail-energy spectral vanishing-viscosity filter for the vortex example. It also supports the Homebrew GNU Fortran/OpenMPI toolchain on macOS; see the prerequisites and 3D vortical-flow pages for setup and stability controls. A consolidated list of corrections, validation gates, and numerical limitations is available in the Update Notes.

Prior to its open-source release, MLegS was successfully used in several vortex dynamics studies in the context of wake vortices in the atmosphere. One example is S. Lee and P. S. Marcus (2023)2, where one can find the detailed mathematical formulation of the mapped Legendre (pseudo-)spectral method.


Contributors


  1. Matsushima, T., & Marcus, P. S. (1997). A spectral method for unbounded domains. Journal of Computational Physics, 137(2), 321–345. https://doi.org/10.1006/jcph.1997.5804 

  2. Lee, S., & Marcus, P. S. (2023). Linear stability analysis of wake vortices by a spectral method using mapped Legendre functions. Journal of Fluid Mechanics, 967, A2. https://doi.org/10.1017/jfm.2023.455 


Back to top

© 2026 Sangjoon Lee, Jinge Wang and UC Berkeley CFD Lab.