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 01, 2006 */
17 /* NINT, No.69 P.O.Box, Xi'an City, China */
19 /*****************************************************************************/
21 #include "interface.h"
24 int Interface::Find_neighbor_zone_index(int z
)
26 if (z
==zone1
) return zone2
;
27 if (z
==zone2
) return zone1
;
31 ZONE
* Interface::Get_neighbor_zone_pointer(int z
)
33 if (z
==zone1
) return pzone2
;
34 if (z
==zone2
) return pzone1
;
38 int Interface::Find_neighbor_node_index(int z
, int n
)
42 for(int i
=0;i
<index_array1
.size();i
++)
43 if(index_array1
[i
]==n
) return index_array2
[i
];
48 for(int i
=0;i
<index_array2
.size();i
++)
49 if(index_array2
[i
]==n
) return index_array1
[i
];
54 void Interface::clear()
61 //------------------------------------------------------------------
63 int ZoneInterface::Find(const char *conn
)
65 if(interface
.size()==0) return -1;
66 for(int i
=0;i
<interface
.size();i
++)
68 if(!strcmp(interface
[i
].conn_name
,conn
))
75 int ZoneInterface::IsBelong(int inf
,int z
)
77 if(interface
[inf
].zone1
== z
) return 1;
78 else if(interface
[inf
].zone2
== z
) return 1;
82 vector
<int> * ZoneInterface::Get_node_array(int inf
,int z
)
84 if(interface
[inf
].zone1
== z
)
85 return &interface
[inf
].index_array1
;
86 else if(interface
[inf
].zone2
== z
)
87 return &interface
[inf
].index_array2
;
88 return (vector
<int> *)0; //prevent warning of complier