/S4

Stanford Stratified Structure Solver - Electromagnetic simulator for layered periodic structures

Primary LanguageC++GNU General Public License v2.0GPL-2.0

Introduction

S4: Stanford Stratified Structure Solver (http://fan.group.stanford.edu/S4/)

A program for computing electromagnetic fields in periodic, layered structures, developed by Victor Liu (victorliu@alumni.stanford.edu) of the Fan group in the Stanford Electrical Engineering Department.

See the S4 manual, in doc/index.html, for a complete description of the package and its user interface, as well as installation instructions, the license and copyright, contact addresses, and other important information.

This fork of the original S4 repository solves some of the problems found in building the Python extension for macOS with M1 processors.

Compilation instructions (MacOS - M1 architecture):

Key steps:

git clone https://github.com/zia-lab/S4
cd S4
envName="S4env"
export CONDA_ALWAYS_YES="true"
conda create -n $envName
conda activate $envName
conda config --env --set subdir osx-arm64
conda install python=3.10.4 numpy
conda install -c conda-forge/osx-arm64 boost fftw openblas lapack suitesparse
make S4_pyext --file="Makefile.m1"
python example.py
unset CONDA_ALWAYS_YES

After compilation the S4 directory can be deleted.

Compilation instructions (CCV linux cluster):

Key steps:

git clone https://github.com/zia-lab/S4
cd S4
envName="S4env"
export CONDA_ALWAYS_YES="true"
conda create -n $envName
conda activate $envName
conda install python=3.6 numpy
conda install -c conda-forge fftw openblas suitesparse
python setup.py install
python example.py
unset CONDA_ALWAYS_YES