edmundsj / rcwa

Rigorous Coupled Wave Analysis for the calculation of Photonic Crystal R/T spectra
MIT License
93 stars 29 forks source link

Allow Solver to handle array of any objects #24

Closed edmundsj closed 2 years ago

edmundsj commented 2 years ago

Currently, only an array of wavelengths (or a single wavelength) may be passed into the Solve() function. However, it may be desirable (especially when designing things) to have an arbitrary combination of input parameters to allow for easy running of sweeps. This may require considerable refactoring.

At a high level, there are only 3 inputs to the Solver: a LayerStack, a Source, and the number of harmonics. The number of harmonics will in the future be varied for purposes of convergence testing, so that leaves only two things which can be conceptually varied: a Source and a LayerStack. Supporting varying these directly I think would be a good idea.

Perhaps there could be an additional argument to Solve(): call it sweep_kwargs, which is an arbitrary number of keyword arguments that correspond to some attribute of the Source or the LayerStack. While LayerStack would be a little trickier, varying arguments for the Source should be straightforward, there are only so many things that can be changed, and only a single source for a given simulation.

edmundsj commented 2 years ago

Fixed to allow arbitrary combinations of Source parameters in 22383ff. Tabling parameterizing other things for now.