1 /*****************************************************************************/
2 /* 8888888 88888888 88888888 */
5 /* 8 88888888 88888888 */
8 /* 888888 888888888 888888888 */
10 /* A Two-Dimensional General Purpose Semiconductor Simulator. */
13 /* Last update: Jan 19, 2006 */
17 /* NINT, No.69 P.O.Box, Xi'an City, China */
19 /*****************************************************************************/
32 class EM_FEM_Solver
: virtual public BSolver
35 int N
; // the scale if matrix
36 int total_nodes
; // node number of all zones
37 PetscScalar v
; //insert variable
38 PetscInt its
; // iteration number
39 PetscInt
*rows
,count
; //variables for add dirichlet boundary condition
43 KSPConvergedReason reason
;
46 //vector<int> zofs; // the offset value of each zone in solution vector
48 int eleNode
[3]; //store nodes' global number of each element
49 PetscScalar eleA
[3]; //assistant variables
52 PetscScalar eleMatrix
[3][3]; //element matrix
53 PetscScalar eleV
[3]; //element right vector
55 PetscScalar RealAlphaX
; //only used for PML zone
56 PetscScalar RealAlphaY
;
58 PetscScalar ImageAlphaX
;
59 PetscScalar ImageAlphaY
;
60 PetscScalar ImageBeta
;
61 PetscScalar Electri0
; //only used for PML zone
67 PetscScalar RealPermi
; //Real part of permitivity
68 PetscScalar ImagePermi
; //Image part ```````
71 PetscScalar SourceAlpha
;
74 Vec x
,b
; // solution and right vectors
75 //Vectors to save Ex,Ey,Hx,Hy in complex form
76 vector
<PetscScalar
> TMEZ
,TMHX
,TMHY
,TEHZ
,TEEX
,TEEY
;
77 PetscScalar
*TM
; //Needle of TM mode for output the result
80 PetscScalar XLeft
; //minimun value of x in the whole model
84 PetscScalar VacXMax
; //Find max X in vacuum zone
87 PetscScalar VacYMin
; //These 4 variable is used to find 4 corners of vacuum zone
88 PetscScalar lamda
; //wave length of incidence light
89 PetscScalar power
; //intensity of incidence light
90 PetscScalar WeightOfTE
; //weight of TE mode in incidence light
91 PetscScalar WeightOfTM
;
92 PetscScalar OptAngle
; //incident angle of light --degree
93 PetscScalar OptTheta
; //incident angle of light --radian
94 PetscScalar eta
; //quantum efficiency of semiconductor material
95 PetscScalar WaveVector0
; //wave vector in vacuum
96 PetscScalar SourceTM
; //Source term for TM mode
98 PetscScalar DeltaX
; //variable to scale grid size
99 int m
; //constant used in PML
101 PetscScalar EpsInVac
; //Variables used when changing power to field
105 int init_solver(SolveDefine
&sv
);
106 int do_solve(SolveDefine
&sv
);
107 int TM_solution_update(SolveDefine
&sv
);
108 int TE_solution_update(SolveDefine
&sv
);
109 int field_calculation(SolveDefine
&sv
);
110 int generation_cal(SolveDefine
&sv
);
111 int destroy_solver(SolveDefine
&sv
);