S4: Stanford Stratified Structure Solver

S4 is a frequency domain code to solve layered periodic structures. Internally, it uses Rigorous Coupled Wave Analysis (RCWA; also called the Fourier Modal Method (FMM)) and the S-matrix algorithm. S4 was developed by Victor Liu of the Fan Group in the Stanford Electrical Engineering Department.

A schematic representation of the types of structures that can be solved is shown below.

3D structure schematic

Download

The bundles here are not necessarily up-to-date. Look in the GitHub repository (below) for the latest updates.

Note: Mac OS X versions are not thoroughly tested due to the lack of a real Mac development machine.

Current version: 1.0.0

  • Source - Includes documentation and examples.
  • Windows EXE - EXE only, no documentation or examples.
  • Mac OS X binary - Compiled on OS X 10.6.8, no documentation or examples.

Source repository

S4 is hosted on GitHub: https://github.com/victorliu/S4.

Installation instructions

From source

When compiling from source (the recommended way), installation proceeds with the typical

./configure; make; make install

Without make install, the executable is in the src/ directory.

Alternatively, there is now a Makefile.custom and a config.h.custom (in the src/ directory) for instances in which the configure process fails (typically on Mac OS X, where Fortran is not found). Simply copy config.h.custom into config.h, and modify it accordingly. Similarly, copy Makefile.custom into Makefile and modify the flags accordingly. This all assumes, of course, that you know what you are doing, but it still tends to be simpler than debugging configure failures.

S4 has the following dependencies:

  • Lua 5.1, both headers and libraries (Note that version 5.2 will NOT work).
  • BLAS, or equivalent, library only.
  • LAPACK (optional, 3.2 or later), library only.
  • Pthreads (optional), both headers and libraries.
  • FFTW3 (optional, 3.x), both headers and libraries.
  • CHOLMOD (optional), both headers and libraries.

Windows EXE or Mac binaries

Simply extract the binaries into a particular directory, and optionally ensure the directory is in your PATH.

Contact

Please email Victor Liu (vkl at stanford dot edu) for questions, complaints, and minor grievances.