victorliu / S4

Stanford Stratified Structure Solver - Electromagnetic simulator for layered periodic structures
http://www.stanford.edu/group/fan/S4/
GNU General Public License v2.0
131 stars 149 forks source link

Adaptive fequency sampling #116

Closed noteasybutsimple closed 6 months ago

noteasybutsimple commented 6 months ago

Hi everyone, I want to calculate a transmission spectrum of a photonic crystal slab from 0.1 THz to 0.9 THz with a fine sampling interval (about 1000 frequency samples). Should I use S: setFrequency() at every frequency sample in a loop? It seems to be time-consuming and inefficient. If there is any to just calculate the results at a small number of discrete frequenise and then get a broadband spectrum by interpolation? The COMSOL or CST STUDIO SUITE has an adaptive frequency sampling technology realized by the Fast reduced order model method to reduce the simulation time, i think. Dose the S4.SpectrumSampler have the similar function?

noteasybutsimple commented 6 months ago

The S4.SpectrumSampler can solve this issue. I found some examples at S4/examples/convergence/1d/binary_grating.lua and S4/examples/convergence/resonance_pos/ref.lua.