1 /*****************************************************************************/
2 /* 8888888 88888888 88888888 */
5 /* 8 88888888 88888888 */
8 /* 888888 888888888 888888888 */
10 /* A Two-Dimensional General Purpose Semiconductor Simulator. */
13 /* Last update: March 29, 2006 */
17 /* NINT, No.69 P.O.Box, Xi'an City, China */
19 /*****************************************************************************/
26 const int Uniform
= 1011;
27 const int Gauss
= 1012;
30 const double DONOR
= 1.0;
31 const double ACCEPTOR
= -1.0;
33 enum PROFILE_CARD_ERROR
36 PROFILE_UNKNOW_PARAMETER
,
41 PROFILE_NEGTIVE_CONCENTR
,
42 PROFILE_DOPING_CHAR_LENGTH
49 double ion
; // N-ion or P-ion
50 double xmin
; // bound box
55 virtual double profile(double x
,double y
)=0;
58 class UniformDopingFunc
: public DopingFunc
62 UniformDopingFunc(double xleft
, double xright
, double ytop
, double ybottom
, double doping_ion
, double N
)
71 double profile(double x
,double y
)
73 if(x
>=xmin
-1e-6 && x
<=xmax
+1e-6 && y
>=ymin
-1e-6 &&y
<=ymax
+1e-6)
80 class GaussDopingFunc
: public DopingFunc
86 GaussDopingFunc(double xleft
, double xright
, double ytop
, double ybottom
,
87 double doping_ion
, double N
, double ax
, double ay
)
98 double profile(double x
,double y
)
102 dx
= exp(-(x
-xmin
)*(x
-xmin
)/(XCHAR
*XCHAR
));
103 else if(x
>=xmin
&&x
<=xmax
)
106 dx
= exp(-(x
-xmax
)*(x
-xmax
)/(XCHAR
*XCHAR
));
109 dy
= exp(-(y
-ymin
)*(y
-ymin
)/(YCHAR
*YCHAR
));
110 else if(y
>=ymin
&&y
<=ymax
)
113 dy
= exp(-(y
-ymax
)*(y
-ymin
)/(YCHAR
*YCHAR
));
115 return ion
*PEAK
*dx
*dy
;
119 class ErfDopingFunc
: public DopingFunc
125 ErfDopingFunc(double xleft
, double xright
, double ytop
, double ybottom
,
126 double doping_ion
, double N
, double ax
, double ay
)
137 double profile(double x
,double y
)
140 dx
= (erfc((x
-xmax
)/XCHAR
)-erfc((x
-xmin
)/XCHAR
))/2;
142 dy
= exp(-(y
-ymin
)*(y
-ymin
)/(YCHAR
*YCHAR
));
143 else if(y
>=ymin
&&y
<=ymax
)
146 dy
= exp(-(y
-ymax
)*(y
-ymin
)/(YCHAR
*YCHAR
));
147 return ion
*PEAK
*dx
*dy
;