[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Since CAMFR is a frequency domain method, working with dispersive materials is in a sense trivial: just do a different simulation for each wavelength with adjusted material parameters.
There are however a few convenience functions to help you work with materials whose refractive index is specified in an external file. A popular format among material scientists is a text file consisting of three columns: the wavelength in nm, the real part of the index, the imaginary part of the index where a positive value means loss. The following code shows how to use such a file, automatically adapting it to the CAMFR conventions (i.e. wavelength in micron and loss corresponding to a negative imaginary index):
SiO2_factory = Dispersive_Material_Factory('SiO2.txt') for wavelength in arange(1,2,0.1): set_lambda(wavelength) m = SiO2_factory() print m() |
This assumes that a file SiO2.txt
is present in your current location. Note how you first need to set the wavelength, and then let the factory object create a new material object for you to use in the rest of your calculations. Changing the wavelength after the structure is created will NOT change the refractive index.
In case your refractive index data is tabulated in a different way, have a look at material.py
in the CAMFR source code at the implementation of Dispersive_Material_Factory
to see how to adapt it.
Sometimes, the refractive index is given by a formula. In this case, you can write your own factory object like this:
class ZnS_Factory: def __call__(self): eps = 5.164 + 0.1208 / (get_lambda().real **2 - 0.27055**2) return Material(sqrt(eps)) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by root on August, 27 2008 using texi2html 1.76.