more fix on Ec/Ev.
[gss-tcad.git] / src / include / qddm_nt1e.h
blob49733439f0aa74b4c4e21bc6f3b9317a8abb61ff
1 /*****************************************************************************/
2 /* 8888888 88888888 88888888 */
3 /* 8 8 8 */
4 /* 8 8 8 */
5 /* 8 88888888 88888888 */
6 /* 8 8888 8 8 */
7 /* 8 8 8 8 */
8 /* 888888 888888888 888888888 */
9 /* */
10 /* A Two-Dimensional General Purpose Semiconductor Simulator. */
11 /* */
12 /* GSS 0.4x */
13 /* Last update: Jan 19, 2006 */
14 /* */
15 /* Gong Ding */
16 /* gdiso@ustc.edu */
17 /* NINT, No.69 P.O.Box, Xi'an City, China */
18 /* */
19 /*****************************************************************************/
21 #ifndef _qddm_nt1e_h_
22 #define _qddm_nt1e_h_
24 #include "petscts.h"
25 #include "petscsnes.h"
26 #include "bsolver.h"
29 class QDDM_Solver_L1E : virtual public BSolver
31 private:
32 vector<int> zofs; // the offset value of each zone in solution vector
33 PetscTruth mf_flg;
34 SNESConvergedReason reason;
35 void solver_pre_compute() ;
36 void solver_post_compute() ;
37 void solution_update() ;
38 void diverged_recovery() ;
39 public:
40 int N; // the scale of matrix
41 SNES snes; // nonlinear solver context
42 KSP ksp; // linear solver context
43 PC pc; // preconditioner context
44 Vec x,r; // solution, residual vectors
45 Mat J,JPrec,JTmp; // Jacobian matrix
46 PetscInt its; // iteration number
47 PetscReal norm;
49 PetscReal relative_toler;
50 PetscReal toler_relax;
52 PetscReal possion_abs_toler;
53 PetscReal elec_continuty_abs_toler;
54 PetscReal hole_continuty_abs_toler;
55 PetscReal elec_quantum_abs_toler;
56 PetscReal hole_quantum_abs_toler;
57 PetscReal electrode_abs_toler;
59 PetscReal possion_norm;
60 PetscReal elec_continuty_norm;
61 PetscReal hole_continuty_norm;
62 PetscReal elec_quantum_norm;
63 PetscReal hole_quantum_norm;
64 PetscReal electrode_norm;
66 public:
67 int init_solver(SolveDefine &s) ;
68 int do_solve(SolveDefine &s) ;
69 int solve_equ(SolveDefine &s) ;
70 int solve_steadystate(SolveDefine &s) ;
71 int solve_dcsweep(SolveDefine &s) ;
72 int solve_transient(SolveDefine &s) ;
73 int destroy_solver(SolveDefine &s) ;
74 QDDM_Solver_L1E() ;
75 void form_function_pn_1Q(PetscScalar *,PetscScalar *) ;
76 void form_jacobian_pn_1Q(PetscScalar *, Mat *,Mat *) ;
77 void error_norm_pn_1Q(PetscScalar *,PetscScalar *) ;
81 #endif