2 * Simple example c program to write a
3 * binary datafile for tecplot. This example
6 * 1. Open a datafile called "t.plt"
7 * 2. Assign values for X,Y, and P
8 * 3. Write out a zone dimensioned 4x5
9 * 4. Close the datafile.
18 enum FileType
{ FULL
= 0, GRID
= 1, SOLUTION
= 2 };
22 float X
[5][4], Y
[5][4], P
[5][4];
24 INTEGER4 Debug
, I
, J
, III
, DIsDouble
, VIsDouble
, IMax
, JMax
, KMax
, ZoneType
, StrandID
, ParentZn
, IsBlock
;
25 INTEGER4 ICellMax
, JCellMax
, KCellMax
, NFConns
, FNMode
, ShrConn
, FileType
;
33 ZoneType
= 0; /* Ordered */
35 StrandID
= 0; /* StaticZone */
36 ParentZn
= 0; /* No Parent */
37 IsBlock
= 1; /* Block */
47 * Open the file and write the tecplot datafile
50 I
= TECINI112((char*)"SIMPLE DATASET",
58 for (J
= 0; J
< 5; J
++)
59 for (I
= 0; I
< 4; I
++)
61 X
[J
][I
] = (float)(I
+ 1);
62 Y
[J
][I
] = (float)(J
+ 1);
63 P
[J
][I
] = (float)((I
+ 1) * (J
+ 1));
66 * Write the zone header information.
68 I
= TECZNE112((char*)"Simple Zone",
82 0, /* TotalNumFaceNodes */
83 0, /* NumConnectedBoundaryFaces */
84 0, /* TotalNumBoundaryConnections */
85 NULL
, /* PassiveVarList */
86 NULL
, /* ValueLocation = Nodal */
87 NULL
, /* SharVarFromZone */
90 * Write out the field data.
93 I
= TECDAT112(&III
, &X
[0][0], &DIsDouble
);
94 I
= TECDAT112(&III
, &Y
[0][0], &DIsDouble
);
95 I
= TECDAT112(&III
, &P
[0][0], &DIsDouble
);