1 /*****************************************************************************/
2 /* 8888888 88888888 88888888 */
5 /* 8 88888888 88888888 */
8 /* 888888 888888888 888888888 */
10 /* A Two-Dimensional General Purpose Semiconductor Simulator. */
13 /* Last update: Nov 29, 2005 */
17 /* NINT, No.69 P.O.Box, Xi'an City, China */
19 /*****************************************************************************/
31 double x
,y
; // x and y coordinate
32 int bc_index
; // the index to boundary of the node
33 int zone_index
; // the zone index;
34 int g_index
; // the index of this node in gnode structure
37 class GNode
:public Node
// global node
40 int local_index
; // the index in the zone
44 class Edge
// boundary edge
49 int tri_index
; // this segment edge belongs to which triangle
53 class Segment
// segment(the group of boundary edges)
56 char label
[32]; // the label of this segment
57 int bc_index
; // boundary index
58 int interface
; // -1 means a boundary segment,>=0 is the interface index
59 int zone_index
; // this segment belongs to which zone
60 int g_index
; // the index of this segment in GSegment structure
62 vector
<Edge
> edge_array
; // segment edges.
63 vector
<int> node_array
; // segment nodes.
64 void set_node_array(); // convert edge_array to node_array here
65 int get_edge_bc_index(int, int);
68 class GSegment
:public Segment
// global segment
71 int local_index
; // the index in the zone
79 int node
[3]; // three nodes, local index
80 int g_node
[3]; // the global index of 3 nodes
81 double edge_len
[3]; // the length of 3 edges: a,b and c
82 double angle
[3]; // the degree of 3 angles: A, B abd C
83 double xc
,yc
; // the location of circle center
84 double d
[3]; // the distance from circle center to each edge: da, db and dc
85 double s
[3]; // partial area of each region seperated by da, db and dc
86 int bc
[3]; // the bc index of 3 edge
87 double area
; // the area of triangle
88 int zone_index
; // the zone index
89 int local_index
; // the tri index in the zone
94 class VEdge
// Voronoi edge
99 int c1_nb
; //cell2 index in cell 1's nb_array
100 int c2_nb
; //cell1 index in cell 2's nb_array
107 class VoronoiCell
//VoronoiCell
110 double x
,y
; //cell centre
112 int *nb_array
; //it's neighbor nodes
113 int *inb_array
; //inverse index of neighbor nodes
119 int bc_index
; //the index to boundary of the node
120 double sa
,sb
,sc
; //for get gradian by least-squares method
122 VoronoiCell(const VoronoiCell
&);