foam to Tecplot360 converter
[OpenFOAM-1.6.x.git] / applications / utilities / postProcessing / dataConversion / foamToTecplot360 / tecio / examples / ij_ordered / ij_ordered.cpp
blob2f13c1f4a37f46f00483d38184f1c3e036b9acf9
1 /* This example creates a simple set of IJ-ordered zones */
2 /* DOCSTART:ij_ordered.txt*/
3 #include "TECIO.h"
4 #include "MASTER.h" /* for defintion of NULL */
6 int main()
8 INTEGER4 Debug = 1;
9 INTEGER4 VIsDouble = 0;
10 INTEGER4 FileType = 0;
11 INTEGER4 I = 0; /* Used to track return codes */
14 * Open the file and write the tecplot datafile
15 * header information
17 I = TECINI112((char*)"IJ Ordered Zones", /* Name of the entire
18 * dataset.
20 (char*)"X Y P", /* Defines the variables for the data
21 * file. Each zone must contain each of
22 * the variables listed here. The order
23 * of the variables in the list is used
24 * to define the variable number (e.g.
25 * X is Var 1).
27 (char*)"ij_ordered.plt",
28 (char*)".", /* Scratch Directory */
29 &FileType,
30 &Debug,
31 &VIsDouble);
33 float X1[4];
34 float Y1[4];
35 float P1[4];
36 float X2[4];
37 float Y2[4];
38 float P2[4];
40 INTEGER4 ICellMax = 0;
41 INTEGER4 JCellMax = 0;
42 INTEGER4 KCellMax = 0;
43 INTEGER4 DIsDouble = 0;
44 double SolTime = 360.0;
45 INTEGER4 StrandID = 0; /* StaticZone */
46 INTEGER4 ParentZn = 0;
47 INTEGER4 IsBlock = 1; /* Block */
48 INTEGER4 NFConns = 0;
49 INTEGER4 FNMode = 0;
50 INTEGER4 TotalNumFaceNodes = 1;
51 INTEGER4 TotalNumBndryFaces = 1;
52 INTEGER4 TotalNumBndryConnections = 1;
53 INTEGER4 ShrConn = 0;
55 /*Ordered Zone Parameters*/
56 INTEGER4 IMax = 2;
57 INTEGER4 JMax = 2;
58 INTEGER4 KMax = 1;
60 X1[0] = .125;
61 Y1[0] = .5;
62 P1[0] = 5;
64 X1[1] = .625;
65 Y1[1] = .5;
66 P1[1] = 7.5;
68 X1[2] = .125;
69 Y1[2] = .875;
70 P1[2] = 10;
72 X1[3] = .625;
73 Y1[3] = .875;
74 P1[3] = 7.5;
76 X2[0] = .375;
77 Y2[0] = .125;
78 P2[0] = 5;
80 X2[1] = .875;
81 Y2[1] = .125;
82 P2[1] = 7.5;
84 X2[2] = .375;
85 Y2[2] = .5;
86 P2[2] = 10;
88 X2[3] = .875;
89 Y2[3] = .5;
90 P2[3] = 7.5;
92 /* Ordered Zone */
93 INTEGER4 ZoneType = 0;
94 I = TECZNE112((char*)"Ordered Zone",
95 &ZoneType,
96 &IMax,
97 &JMax,
98 &KMax,
99 &ICellMax,
100 &JCellMax,
101 &KCellMax,
102 &SolTime,
103 &StrandID,
104 &ParentZn,
105 &IsBlock,
106 &NFConns,
107 &FNMode,
108 &TotalNumFaceNodes,
109 &TotalNumBndryFaces,
110 &TotalNumBndryConnections,
111 NULL,
112 NULL,
113 NULL,
114 &ShrConn);
115 INTEGER4 III = IMax * JMax * KMax;
116 I = TECDAT112(&III, X1, &DIsDouble);
117 I = TECDAT112(&III, Y1, &DIsDouble);
118 I = TECDAT112(&III, P1, &DIsDouble);
120 I = TECZNE112((char*)"Ordered Zone2",
121 &ZoneType,
122 &IMax,
123 &JMax,
124 &KMax,
125 &ICellMax,
126 &JCellMax,
127 &KCellMax,
128 &SolTime,
129 &StrandID,
130 &ParentZn,
131 &IsBlock,
132 &NFConns,
133 &FNMode,
134 &TotalNumFaceNodes,
135 &TotalNumBndryFaces,
136 &TotalNumBndryConnections,
137 NULL,
138 NULL,
139 NULL,
140 &ShrConn);
142 I = TECDAT112(&III, X2, &DIsDouble);
143 I = TECDAT112(&III, Y2, &DIsDouble);
144 I = TECDAT112(&III, P2, &DIsDouble);
146 I = TECEND112();
147 return 0;
149 /* DOCEND */