initial checkin, based on GSS 0.46 CVS
[gss-tcad.git] / src / material / InN / InN_Optical.cc
blob929e2e77b1469ef9084fd2e4a268590765a374ca
1 /*****************************************************************************/
2 /* */
3 /* 8888888 88888888 88888888 */
4 /* 8 8 8 */
5 /* 8 8 8 */
6 /* 8 88888888 88888888 */
7 /* 8 8888 8 8 */
8 /* 8 8 8 8 */
9 /* 888888 888888888 888888888 */
10 /* */
11 /* A Two-Dimensional General Purpose Semiconductor GaAsmulator. */
12 /* */
13 /* GSS material database Version 0.4 */
14 /* Last update: Feb 17, 2006 */
15 /* */
16 /* Gong Ding */
17 /* gdiso@ustc.edu */
18 /* NINT, No.69 P.O.Box, Xi'an City, China */
19 /* */
20 /*****************************************************************************/
22 // Material Type: InN
25 #include "PMI.h"
27 typedef struct
29 PetscScalar wavelength;
30 PetscScalar RefractionIndexRe;
31 PetscScalar RefractionIndexIm;
32 } table;
35 static table InN[] = {
36 //i can't find any reflection data for InN...
39 class GSS_InN_Optical : public PMIS_Optical
41 private:
42 int table_size;
43 public:
44 complex<PetscScalar> RefractionIndex(PetscScalar lamda, PetscScalar Eg=1.12, PetscScalar Tl=1.0) const
46 complex<PetscScalar> n(1.0,0.0);
47 if(!table_size) return n;
48 if(lamda<InN[0].wavelength)
49 return complex<PetscScalar> (InN[0].RefractionIndexRe,InN[0].RefractionIndexIm);
50 if(lamda>InN[table_size-1].wavelength)
51 return complex<PetscScalar> (InN[table_size-1].RefractionIndexRe,InN[table_size-1].RefractionIndexIm);
52 for(int i=0;i<table_size-1;i++)
54 if(lamda>=InN[i].wavelength && lamda<=InN[i+1].wavelength)
56 complex<PetscScalar> n1(InN[i].RefractionIndexRe,InN[i].RefractionIndexIm);
57 complex<PetscScalar> n2(InN[i+1].RefractionIndexRe,InN[i+1].RefractionIndexIm);
58 PetscScalar d1 = lamda-InN[i].wavelength;
59 PetscScalar d2 = InN[i+1].wavelength-lamda;
60 n = (n1*d2 + n2*d1)/(d1+d2);
61 break;
64 return n;
67 // constructions
68 public:
69 GSS_InN_Optical(const PMIS_Environment &env):PMIS_Optical(env)
71 table_size = sizeof(InN)/sizeof(table);
72 //the wave length should be scaled
73 for(int i=0;i<table_size;i++)
75 InN[i].wavelength*=um;
79 ~GSS_InN_Optical()
84 extern "C"
86 PMIS_Optical* PMIS_InN_Optical_Default (const PMIS_Environment& env)
88 return new GSS_InN_Optical(env);