more fix on Ec/Ev.
[gss-tcad.git] / src / include / mesh.h
blob42f9647ba1ffa8980e6ce0c63e8190a1f47772b6
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: Apr 13, 2006 */
14 /* */
15 /* Gong Ding */
16 /* gdiso@ustc.edu */
17 /* NINT, No.69 P.O.Box, Xi'an City, China */
18 /* */
19 /*****************************************************************************/
21 #ifndef _mesh_h_
22 #define _mesh_h_
24 #include <iostream>
25 #include <string>
26 #include <vector>
27 #include <queue>
28 #include <algorithm>
29 #include "element.h"
30 #include "interface.h"
31 #include "zone.h"
32 #include "cmdbuf.h"
34 using namespace std;
36 class MESH
38 protected:
40 char basename[32]; //cgns base name
41 double mesh_scale; //this value will be mul to coordinate
42 int bc_num; //total bc num summed by each zone num
43 vector<GNode> gnode; //these are global mesh structure
44 vector<Tri> gtri;
45 vector<GSegment> gsegment; //used for mesh refine
46 public:
47 int zone_num;
48 ZONE *zone;
49 ZoneInterface zinterface;
51 protected:
52 //variables and functions for drawing mesh
53 double xMin; // minimum value of x coordinate
54 double xMax; // maximum value of x coordinate
55 double yMin; // minimum value of y coordinate
56 double yMax; // maximum value of y coordinate
57 protected:
58 ZONE* Get_zone(const char *);
59 ZONE* Get_zone(const int);
60 int Get_zone_index(const char *);
61 Segment* Get_segment(const int);
62 int* reorder_zone(int); //needed only by solver.
63 public:
64 int import_cgns(const char *cgnsfile);
65 void export_mesh(const char *cgnsfile);
66 void build_zone();
67 int zone_to_field();
68 int field_to_zone();
69 void reorder_mesh();
70 void clear_mesh();
71 public:
73 MESH ():mesh_scale(1e6),bc_num(0),zone_num(0),zone(0)
74 {xMin = +1.0e100; yMin = +1.0e100; xMax = -1.0e100; yMax = -1.0e100;}
75 ~MESH () {delete [] zone;}
76 void set_mesh_scale(double scale) {mesh_scale = scale;}
80 #endif