class dielectric_function


A class that handles the storage of the wavelength dependence of the dielectric constant or optical constant. It can either be assigned a single constant or a table of values. For the case of a table of values, the optical constant is linearly interpolated between the tabulated points. The table values can be obtained from a text file.

Include file:

#include "dielfunc.h"

Source code:

dielfunc.cpp

See also:

SCATMECH Home,   Conventions,   dielectric_constant,   optical_constant,   Table

Definition of public elements:

class dielectric_function {
        dielectric_function();
        dielectric_function(const string& filename);
        dielectric_function(const optical_constant& nn);
        dielectric_function& operator=(const dielectric_function& df);
        void read(const string& filename);
        dielectric_constant epsilon(double l) const;
        optical_constant index(double l) const;
        double e1(double l) const;
        double e2(double l) const;
        double n(double l) const;
        double k(double l) const;
        static dielectric_function AskUser(const string& query,
                                           const string& deflt);
        static dielectric_function AskUser(const string& query,
                                           const optical_constant& deflt);
        void force_nonabsorbing();
        void set_n(double _n);
        void set_k(double _k);
        double get_n() const;
        double get_k() const;
};

dielectric_function()
dielectric_function(const string& filename)
dielectric_function(const optical_constant& nn)

The class constructors. When called with no argument, the class must be assigned a value (either through read or with operator=) before other functions can be called. When called with a pointer to a string containing the name of a file, the constructor will call the function read using that file. When called with an optical_constant, the class will be constructed with constant optical constants.

Top of Page

dielectric_function& operator=(const dielectric_function& df)

This function allows for assignment.

Top of Page

void read(const string& filename)

This routine will read a file whose name is pointed to by filename. The file format must contain three whitespace-delimited columns:

Column   Description
1   Wavelength
2   Real part of refractive index (n)
3   Imaginary part of refractive index (k)
 
Example
0.3   1.56   0.01  
0.4   1.54   0.00  
0.5   1.53   0.00  
0.6   1.51   0.00  

Outside of the specified range, the class will assume the optical constants are constant at the extreme value given. That is, for the example, the class will assume that at a wavelength of 0.7 (in whatever units one is working), the optical constants are 1.50 and 0.0, respectively. A file containing only a single line will be assumed to represent constant refractive index.

Top of Page

dielectric_constant epsilon(double l) const

Function which returns the dielectric_constant of the material at wavelength l.

Top of Page

optical_constant index(double l) const

Function which returns the optical_constant of the material at wavelength l.

Top of Page

double e1(double l) const
double e2(double l) const

Functions that return either the real part (e1) or the imaginary part (e2) of the dielectric constant.

Top of Page

double n(double l) const
double k(double l) const

Functions that return either the real part (n) or the imaginary part (k) of the complex index of refraction.

Top of Page

static dielectric_function AskUser(const string& query,const string& deflt)
static dielectric_function AskUser(const string& query,const optical_constant& deflt)

Functions which query the user for a value. The first argument is the query, while the second is the default response. If the second argument is a pointer to a string, the default is interpreted as a filename. If the second argument is an optical_constant, the default is a constant function with that value. The response by the user can be either a filename or a value. If the response is a number, it will assumed to be the real part of the optical constant, and the user will be asked for a second value, which will be interpreted as the imaginary part of the optical constant. If the initial response cannot be interpreted as a number, then the function will assume the response is the name of a file.

Examples:

dielectric_function eps;
eps = dielectric_function::AskUser("Enter eps","silicon.dat");
eps = dielectric_function::AskUser("Enter eps",optical_constant(4.15,0.05));

See Console Interface for more information.

Top of Page

void force_nonabsorbing()

This function forces the material to be non-absorbing by setting the imaginary part of the index of refraction to zero.

Top of Page

void set_n(double _n)
void set_k(double _k)
double get_n() const
double get_k() const

Functions to set and get the optical constants of the material. When one sets n or k using these functions, the respective function is assumed to be henceforth constant. The get functions return the value corresponding to the last wavelength for the which the optical function has been evaluated.

Top of Page


For More Information

SCATMECH Technical Information and Questions
Optical Technology Division (OTD) Home Page
OTD Technical Inquiries
OTD Website Comments

Current SCATMECH version: 6.00 (February 2008)
This page first online: Version 3.00 (December 2001)
This page last modified: Version 6.00 (February 2008)