COMP: tecio : move out of thirdparty

This commit is contained in:
mattijs
2011-02-16 13:44:26 +00:00
parent d9ef40762b
commit de564957bc
108 changed files with 40069 additions and 2 deletions

View File

@ -0,0 +1,11 @@
# Set to appropriate C++ compiler
CPP=g++
CPPFLAGS=-I../../tecsrc ../../tecio.a
EXECUTABLE=comtest
FILES=$(EXECUTABLE).c
build:
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
clean:
rm -f $(EXECUTABLE)

View File

@ -0,0 +1,492 @@
/*
* Complex example C program to write a
* binary data file for Tecplot. This example
* does the following:
*
* 1. Open a data file called "field.plt."
* 2. Open a data file called "line.plt."
* 3. Assign values for X, Y and P. These will be used
* in both the ordered and finite-element data files.
* 4. Write out an ordered zone dimensioned 4 x 5 to "field.plt."
* 5. Assign values for XL and YL arrays.
* 6. Write out data for line plot to "line.plt." Make the data
* use double precision.
* 7. Write out a finite-element zone to "field.plt."
* 8. Write out a text record to "field.plt."
* 9. Write out a geometry (circle) record to "field.plt."
* 10. Close file 1.
* 11. Close file 2.
*/
#include <stdio.h>
#include <math.h>
#include "TECIO.h"
int main(void)
{
float X[5][4], Y[5][4], P[5][4];
double XL[50], YL[50];
double SolTime;
INTEGER4 Debug, I, J, K, L, III, NPts, NElm, DIsDouble, VIsDouble, IMax, JMax, KMax;
INTEGER4 ICellMax, JCellMax, KCellMax, ZoneType, Clipping;
INTEGER4 StrandID, ParentZn, FieldFileType, LineFileType;
INTEGER4 SharingZone[3] = {0, 0, 0};
INTEGER4 IsBlock, NumFaceConnections, FaceNeighborMode, ShareConnectivityFromZone;
INTEGER4 NM[12][4];
double XP, YP, ZP, FH, LineSpacing, PatternLength;
double BoxMargin, BoxLineThickness, TextAngle;
INTEGER4 AttachToZone, Zone, Scope, PositionCoordSys, FontType, HeightUnits;
INTEGER4 IsFilled, GeomType, LinePattern, NumEllipsePts;
INTEGER4 Anchor, BoxType, BoxColor, BoxFillColor, TextColor, Color, FillColor;
INTEGER4 ArrowheadStyle, ArrowheadAttachment, NumSegments, NumSegPts[1];
double LineThickness, ArrowheadSize, ArrowheadAngle;
float XGeomData[1], YGeomData[1], ZGeomData[1];
enum FileType { FULL = 0, GRID = 1, SOLUTION = 2 };
Debug = 2;
VIsDouble = 0;
DIsDouble = 0;
FieldFileType = FULL;
LineFileType = FULL;
/*
* Open order.plt and write the header information.
*/
I = TECINI112((char*)"DATASET WITH ONE ORDERED ZONE AND ONE FE-QUAD ZONE OVER 2 TIME STEPS",
(char*)"X Y P",
(char*)"field.plt",
(char*)".",
&FieldFileType,
&Debug,
&VIsDouble);
/*
* Open line.plt and write the header information.
*/
VIsDouble = 1;
I = TECINI112((char*)"DATASET WITH ONE I-ORDERED ZONE",
(char*)"X Y",
(char*)"line.plt",
(char*)".",
&LineFileType,
&Debug,
&VIsDouble);
/*
* Calculate values for the field variables.
*/
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
X[J][I] = (float)(I + 1);
Y[J][I] = (float)(J + 1);
P[J][I] = (float)((I + 1) * (J + 1));
}
/*
* Make sure writing to file #1.
*/
III = 1;
I = TECFIL112(&III);
/*
* Write the zone header information for the ordered zone.
*/
IMax = 4;
JMax = 5;
KMax = 1;
ICellMax = 0;
JCellMax = 0;
KCellMax = 0;
ZoneType = 0;
SolTime = 10.0;
StrandID = 1;
ParentZn = 0;
IsBlock = 1;
NumFaceConnections = 0;
FaceNeighborMode = 0;
ShareConnectivityFromZone = 0;
I = TECZNE112((char*)"Ordered Zone 1",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
NULL, /* PassiveVarList */
NULL, /* ValueLocation */
NULL, /* ShareVarFromZone */
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
&ShareConnectivityFromZone);
/*
* Write out the field data for the ordered zone.
*/
III = IMax * JMax;
I = TECDAT112(&III, &X[0][0], &DIsDouble);
I = TECDAT112(&III, &Y[0][0], &DIsDouble);
I = TECDAT112(&III, &P[0][0], &DIsDouble);
/*
* Calculate values for the I-ordered zone.
*/
for (I = 0; I < 50; I++)
{
XL[I] = I + 1;
YL[I] = sin((double)(I + 1) / 20.0);
}
/*
* Switch to the "line.plt" file (file number 2)
* and write out the line plot data.
*/
III = 2;
I = TECFIL112(&III);
/*
* Write the zone header information for the XY-data.
*/
IMax = 50;
JMax = 1;
KMax = 1;
SolTime = 0.0;
StrandID = 0; /* StaticZone */
I = TECZNE112((char*)"XY Line plot",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL, /* PassiveVarList */
NULL, /* ValueLocation */
NULL, /* ShareVarFromZone */
&ShareConnectivityFromZone);
/*
* Write out the line plot.
*/
DIsDouble = 1;
III = IMax;
I = TECDAT112(&III, (float *) & XL[0], &DIsDouble);
I = TECDAT112(&III, (float *) & YL[0], &DIsDouble);
/*
* Switch back to the field plot file and write out
* the finite-element zone.
*/
III = 1;
I = TECFIL112(&III);
/*
* Move the coordinates so this zone's not on top of the other
*/
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
X[J][I] = (float)(I + 6);
Y[J][I] = (float)(J + 1);
P[J][I] = (float)((I + 1) * (J + 1));
}
/*
* Write the zone header information for the finite-element zone.
*/
ZoneType = 3; /* FEQuad */
NPts = 20; /* Number of points */
NElm = 12; /* Number of elements */
KMax = 0; /* Unused */
SolTime = 10.0;
StrandID = 2;
I = TECZNE112((char*)"Finite Zone 1",
&ZoneType,
&NPts,
&NElm,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL, /* PassiveVarList */
NULL, /* ValueLocation */
NULL, /* ShareVarFromZone */
&ShareConnectivityFromZone);
/*
* Write out the field data for the finite-element zone.
*/
IMax = 4;
JMax = 5;
III = IMax * JMax;
DIsDouble = 0;
I = TECDAT112(&III, &X[0][0], &DIsDouble);
I = TECDAT112(&III, &Y[0][0], &DIsDouble);
I = TECDAT112(&III, &P[0][0], &DIsDouble);
/*
* Calculate and then write out the connectivity list.
* Note: The NM array references cells starting with
* offset of 1.
*/
for (I = 1; I < IMax; I++)
for (J = 1; J < JMax; J++)
{
K = I + (J - 1) * (IMax - 1);
L = I + (J - 1) * IMax;
NM[K-1][0] = L;
NM[K-1][1] = L + 1;
NM[K-1][2] = L + IMax + 1;
NM[K-1][3] = L + IMax;
}
I = TECNOD112((INTEGER4 *)NM);
/*
* Calculate values for the new solution variable.
*/
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
P[J][I] = (float)(2.0 * (I + 1) * (J + 1));
}
/*
* Write the zone header information for time step 2
*/
ZoneType = 0;
IMax = 4;
JMax = 5;
KMax = 1;
SolTime = 20.0;
StrandID = 1;
SharingZone[0] = 1;
SharingZone[1] = 1;
SharingZone[2] = 0; /* solution variable is not shared */
ShareConnectivityFromZone = 0;
I = TECZNE112((char*)"Ordered Zone 2",
&ZoneType,
&IMax,
&JMax,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL,
NULL,
SharingZone,
&ShareConnectivityFromZone);
/*
* Write out the solution variable the grid variables are shared.
*/
IMax = 4;
JMax = 5;
III = IMax * JMax;
DIsDouble = 0;
I = TECDAT112(&III, &P[0][0], &DIsDouble);
/*
* Calculate values for the new solution variable.
*/
for (J = 0; J < 5; J++)
for (I = 0; I < 4; I++)
{
P[J][I] = (float)(3.0 * (I + 1) * (J + 1));
}
/*
* Write another time step for the FEZone and share from the first
*/
ZoneType = 3;
SolTime = 20.0;
StrandID = 2;
KMax = 0;
SharingZone[0] = 2;
SharingZone[1] = 2;
SharingZone[2] = 0; /* solution variable is not shared */
ShareConnectivityFromZone = 2;
I = TECZNE112((char*)"Finite Zone 2",
&ZoneType,
&NPts,
&NElm,
&KMax,
&ICellMax,
&JCellMax,
&KCellMax,
&SolTime,
&StrandID,
&ParentZn,
&IsBlock,
&NumFaceConnections,
&FaceNeighborMode,
0, /* TotalNumFaceNodes */
0, /* NumConnectedBoundaryFaces */
0, /* TotalNumBoundaryConnections */
NULL, /* PassiveVarList */
NULL, /* ValueLocation */
SharingZone,
&ShareConnectivityFromZone);
/*
* Write out the solution variable the grid variables are shared.
*/
IMax = 4;
JMax = 5;
III = IMax * JMax;
DIsDouble = 0;
I = TECDAT112(&III, &P[0][0], &DIsDouble);
/*
* Prepare to write out text record. Text is positioned
* at 0.5, 0.5 in frame units and has a height
* of 0.05 frame units.
*/
XP = 50.0;
YP = 50.0;
ZP = 0.0;
FH = 5.0;
Scope = 1; /* Local */
Clipping = 1; /* Clip to frame */
PositionCoordSys = 1; /* Frame */
FontType = 1; /* Helv Bold */
HeightUnits = 1; /* Frame */
AttachToZone = 0;
Zone = 0;
BoxType = 0; /* None */
BoxMargin = 5.0;
BoxLineThickness = 0.5;
BoxColor = 3;
BoxFillColor = 7;
TextAngle = 0.0;
Anchor = 0; /* Left */
LineSpacing = 1.0;
TextColor = 0; /* Black */
III = TECTXT112(&XP,
&YP,
&ZP,
&PositionCoordSys,
&AttachToZone,
&Zone,
&FontType,
&HeightUnits,
&FH,
&BoxType,
&BoxMargin,
&BoxLineThickness,
&BoxColor,
&BoxFillColor,
&TextAngle,
&Anchor,
&LineSpacing,
&TextColor,
&Scope,
&Clipping,
(char*)"Hi Mom",
(char*)"");
/*
* Prepare to write out geometry record (circle). Circle is
* positioned at 25, 25 (in frame units) and has a radius of
* 20 percent. Circle is drawn using a dashed line.
*/
XP = 25.0;
YP = 25.0;
ZP = 0.0;
IsFilled = 0;
Color = 0;
FillColor = 7;
GeomType = 3; /* Circle */
LinePattern = 1; /* Dashed */
LineThickness = 0.3;
PatternLength = 1.5;
NumEllipsePts = 72;
ArrowheadStyle = 0;
ArrowheadAttachment = 0;
ArrowheadSize = 0.1;
ArrowheadAngle = 15.0;
NumSegments = 1;
NumSegPts[0] = 1;
XGeomData[0] = 20.0;
YGeomData[0] = 0.0;
ZGeomData[0] = 0.0;
III = TECGEO112(&XP,
&YP,
&ZP,
&PositionCoordSys,
&AttachToZone,
&Zone,
&Color,
&FillColor,
&IsFilled,
&GeomType,
&LinePattern,
&PatternLength,
&LineThickness,
&NumEllipsePts,
&ArrowheadStyle,
&ArrowheadAttachment,
&ArrowheadSize,
&ArrowheadAngle,
&Scope,
&Clipping,
&NumSegments,
NumSegPts,
&XGeomData[0],
&YGeomData[0],
&ZGeomData[0],
(char*)"");
/*
* Close out file 1.
*/
I = TECEND112();
/*
* Close out file 2.
*/
III = 2;
I = TECFIL112(&III);
I = TECEND112();
return 0;
}

View File

@ -0,0 +1,467 @@
C
C Complex example FORTRAN program to write a
C binary data file for Tecplot. This example
C does the following:
C
C 1. Open a data file called "field.plt."
C 2. Open a data file called "line.plt."
C 3. Assign values for X, Y and P. These will be used
C in both the ordered and FE data files.
C 4. Write out an ordered zone dimensioned 4 x 5 to "field.plt."
C 5. Assign values for XL and YL arrays.
C 6. Write out data for line plot to "line.plt." Make the data
C use double precision.
C 7. Write out a finite element zone to "field.plt."
C 8. Write out a text record to "field.plt."
C 9. Write out a geometry (circle) record to "field.plt."
C 10. Close file 1.
C 11. Close file 2.
C
Program ComplexTest
Include "tecio.inc"
REAL*4 X(4,5), Y(4,5), P(4,5)
REAL*8 XL(50), YL(50)
REAL*4 XLDummy(1), YLDummy(1)
EQUIVALENCE (XLDummy(1), XL(1))
EQUIVALENCE (YLDummy(1), YL(1))
REAL*8 SolTime
INTEGER*4 Debug,I,J,K,L,III,NPts,NElm,DIsDouble,VIsDouble
INTEGER*4 IMax,JMax,KMax,NM(4,12),FileType
INTEGER*4 StrandID,ParentZn
INTEGER*4 SharingZone(3)
REAL*8 XP, YP, ZP, FH, LineSpacing, PatternLength
REAL*8 BoxMargin, BoxLineThickness, TextAngle
INTEGER*4 AttachToZone, Zone, Scope, PositionCoordSys
INTEGER*4 Clipping
INTEGER*4 FontType, HeightUnits, Anchor, BoxType
INTEGER*4 IsFilled, GeomType, LinePattern, NumEllipsePts
INTEGER*4 BoxColor, BoxFillColor, TextColor, Color, FillColor
INTEGER*4 ArrowheadStyle, ArrowheadAttachment, NumSegments
INTEGER*4 NumSegPts(1)
REAL*8 LineThickness, ArrowheadSize, ArrowheadAngle
REAL*4 XGeomData(1), YGeomData(1), ZGeomData(1)
CHARACTER*1 NULCHAR
INTEGER*4 Zero
POINTER (NullPtr,Null)
INTEGER*4 Null(*)
Debug = 2
VIsDouble = 0
FileType = 0
DIsDouble = 0
NULCHAR = CHAR(0)
Zero = 0
NullPtr = 0
C
C Open field.plt and write the header information.
C
I = TECINI112('DATASET WITH 1 ORDERED ZONE, '//
& '1 QUAD ZONE OVER 2 TIME STEPS'//NULCHAR,
& 'X Y P'//NULCHAR,
& 'field.plt'//NULCHAR,
& '.'//NULCHAR,
& FileType,
& Debug,
& VIsDouble)
C
C Open line.plt and write the header information.
C
VIsDouble = 1
I = TECINI112('DATASET WITH ONE I-ORDERED ZONE'//NULCHAR,
& 'X Y'//NULCHAR,
& 'line.plt'//NULCHAR,
& '.'//NULCHAR,
& FileType,
& Debug,
& VIsDouble)
C
C Calculate values for the field variables.
C
Do 10 J = 1,5
Do 10 I = 1,4
X(I,J) = I
Y(I,J) = J
P(I,J) = I*J
10 Continue
C
C Make sure writing to file #1.
C
III = 1
I = TECFIL112(III)
C
C Write the zone header information for the ordered zone.
C
IMax = 4
JMax = 5
KMax = 1
SolTime = 10.0
StrandID = 1
ParentZn = 0
I = TECZNE112('Ordered Zone 1'//NULCHAR,
& 0, ! ZONETYPE
& IMax,
& JMax,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1, ! ISBLOCK
& 0, ! NumFaceConnections
& 0, ! FaceNeighborMode
& 0, ! TotalNumFaceNodes
& 0, ! NumConnectedBoundaryFaces
& 0, ! TotalNumBoundaryConnections
& Null, ! PassiveVarList
& Null, ! ValueLocation
& Null, ! ShareVarFromZone
& 0) ! ShareConnectivityFromZone)
C
C Write out the field data for the ordered zone.
C
III = IMax*JMax
I = TECDAT112(III,X,DIsDouble)
I = TECDAT112(III,Y,DIsDouble)
I = TECDAT112(III,P,DIsDouble)
C
C Calculate values for the I-ordered zone.
C
Do 20 I = 1,50
XL(I) = I
YL(I) = sin(I/20.0)
20 Continue
C
C Switch to the 'line.plt' file (file number 2)
C and write out the line plot data.
C
III = 2
I = TECFIL112(III)
C
C Write the zone header information for the XY-data.
C
IMax = 50
JMax = 1
KMax = 1
SolTime = 0.0
StrandID = 0
I = TECZNE112('XY Line plot'//NULCHAR,
& 0,
& IMax,
& JMax,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1,
& 0,
& 0,
& 0,
& 0,
& 0,
& Null,
& Null,
& Null,
& 0)
C
C Write out the line plot.
C
DIsDouble = 1
III = IMax
I = TECDAT112(III,XLDummy,DIsDouble)
I = TECDAT112(III,YLDummy,DIsDouble)
C
C Switch back to the field plot file and write out
C the finite-element zone.
C
III = 1
I = TECFIL112(III)
C
C Move the coordinates so this zone's not on top of the other
C
Do 30 J = 1,5
Do 30 I = 1,4
X(I,J) = I+5
Y(I,J) = J
P(I,J) = I*J
30 Continue
C
C Write the zone header information for the finite-element zone.
C
NPts = 20
NElm = 12
KMax = 1
SolTime = 10.0
StrandID = 2
I = TECZNE112('Finite Zone 1'//NULCHAR,
& 3, ! FEQUADRILATERAL
& NPts,
& NElm,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1,
& 0,
& 0,
& 0,
& 0,
& 0,
& Null,
& Null,
& Null,
& 0)
C
C Write out the field data for the finite-element zone.
C
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,X,DIsDouble)
I = TECDAT112(III,Y,DIsDouble)
I = TECDAT112(III,P,DIsDouble)
C
C Calculate and then write out the connectivity list.
C Note: The NM array references cells starting with
C offset of 1.
C
Do 40 I = 1,IMax-1
Do 40 J = 1,JMax-1
K = I+(J-1)*(IMax-1)
L = I+(J-1)*IMax
NM(1,K) = L
NM(2,K) = L+1
NM(3,K) = L+IMax+1
NM(4,K) = L+IMax
40 Continue
I = TECNOD112(NM)
C
C Calculate vlues for the new solution variable.
C
Do 50 J = 1,5
Do 50 I = 1,4
P(I,J) = 2*I*J
50 Continue
C
C Write the zone header information for time step 2
C
IMax = 4
JMax = 5
KMax = 1
SolTime = 20.0
StrandID = 1
SharingZone(1) = 1
SharingZone(2) = 1
SharingZone(3) = 0
I = TECZNE112('Ordered Zone 2'//NULCHAR,
& 0, ! ORDERED
& IMax,
& JMax,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1,
& 0,
& 0,
& 0,
& 0,
& 0,
& Null,
& Null,
& SharingZone,
& 0)
C
C Write out the solution variable the grid variables are shared.
C
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,P,DIsDouble)
C
C Calculate values for the new solution variable.
C
Do 60 J = 1,5
Do 60 I = 1,4
P(I,J) = 3*I*J
60 Continue
C
C Write another time step for the FEZone and share from the first
C
SolTime = 20.0
StrandID = 2
KMax = 0
SharingZone(1) = 2
SharingZone(2) = 2
SharingZone(3) = 0
I = TECZNE112('Finite Zone 2'//NULCHAR,
& 3, ! FEQUADRILATERAL
& NPts,
& NElm,
& KMax,
& 0,
& 0,
& 0,
& SolTime,
& StrandID,
& ParentZn,
& 1,
& 0,
& 0,
& 0,
& 0,
& 0,
& Null,
& Null,
& SharingZone,
& 2)
C
C Write out the solution variable the grid variables are shared.
C
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,P,DIsDouble)
C
C Prepare to write out text record. Text is positioned
C at 50, 50 in frame units and has a height 5 frame units.
C
XP = 50
YP = 50
FH = 5
Scope = 1
Clipping = 0
PositionCoordSys = 1
FontType = 1
HeightUnits = 1
AttachToZone = 0
Zone = 0
BoxType = 0
BoxMargin = 5.0
BoxLineThickness = 0.5
BoxColor = 3
BoxFillColor = 7
TextAngle = 0.0
Anchor = 0
LineSpacing = 1.5
TextColor = 0
III = TECTXT112(XP,
& YP,
& 0.0d0,
& PositionCoordSys,
& AttachToZone,
& Zone,
& FontType,
& HeightUnits,
& FH,
& BoxType,
& BoxMargin,
& BoxLineThickness,
& BoxColor,
& BoxFillColor,
& TextAngle,
& Anchor,
& LineSpacing,
& TextColor,
& Scope,
& Clipping,
& 'Hi Mom'//NULCHAR,
& NULCHAR)
C
C Prepare to write out geometry record (circle). Circle is
C positioned at 25, 25 in frame units and has a radius of 30.
C Circle is drawn using a dashed line pattern.
C
XP = 25
YP = 25
ZP = 0.0
IsFilled = 0
Color = 0
FillColor = 7
GeomType = 2
LinePattern = 1
LineThickness = 0.3
PatternLength = 1
NumEllipsePts = 72
ArrowheadStyle = 0
ArrowheadAttachment = 0
ArrowheadSize = 0.0
ArrowheadAngle = 15.0
NumSegments = 1
NumSegPts(1) = 1
XGeomData(1) = 30
YGeomData(1) = 0.0
ZGeomData(1) = 0.0
III = TECGEO112(XP,
& YP,
& ZP,
& PositionCoordSys,
& AttachToZone,
& Zone,
& Color,
& FillColor,
& IsFilled,
& GeomType,
& LinePattern,
& PatternLength,
& LineThickness,
& NumEllipsePts,
& ArrowheadStyle,
& ArrowheadAttachment,
& ArrowheadSize,
& ArrowheadAngle,
& Scope,
& Clipping,
& NumSegments,
& NumSegPts,
& XGeomData,
& YGeomData,
& ZGeomData,
& NULCHAR)
C
C Close out file 1.
C
I = TECEND112()
C
C Close out file 2.
C
III = 2
I = TECFIL112(III)
I = TECEND112()
STOP
END

View File

@ -0,0 +1,467 @@
!
! Complex example FORTRAN program to write a
! binary data file for Tecplot. This example
! does the following:
!
! 1. Open a data file called "field.plt."
! 2. Open a data file called "line.plt."
! 3. Assign values for X, Y and P. These will be used
! in both the ordered and FE data files.
! 4. Write out an ordered zone dimensioned 4 x 5 to "field.plt."
! 5. Assign values for XL and YL arrays.
! 6. Write out data for line plot to "line.plt." Make the data
! use double precision.
! 7. Write out a finite element zone to "field.plt."
! 8. Write out a text record to "field.plt."
! 9. Write out a geometry (circle) record to "field.plt."
! 10. Close file 1.
! 11. Close file 2.
!
Program ComplexTest
Include "tecio.f90"
REAL*4 X(4,5), Y(4,5), P(4,5)
REAL*8 XL(50), YL(50)
REAL*4 XLDummy(1), YLDummy(1)
EQUIVALENCE (XLDummy(1), XL(1))
EQUIVALENCE (YLDummy(1), YL(1))
REAL*8 SolTime
INTEGER*4 Debug,I,J,K,L,III,NPts,NElm,DIsDouble,VIsDouble,FileType
INTEGER*4 IMax,JMax,KMax,NM(4,12)
INTEGER*4 StrandID,ParentZn
INTEGER*4 SharingZone(3)
REAL*8 XP, YP, ZP, FH, LineSpacing, PatternLength
REAL*8 BoxMargin, BoxLineThickness, TextAngle
INTEGER*4 AttachToZone, Zone, Scope, PositionCoordSys
INTEGER*4 Clipping
INTEGER*4 FontType, HeightUnits, Anchor, BoxType
INTEGER*4 IsFilled, GeomType, LinePattern, NumEllipsePts
INTEGER*4 BoxColor, BoxFillColor, TextColor, Color, FillColor
INTEGER*4 ArrowheadStyle, ArrowheadAttachment, NumSegments
INTEGER*4 NumSegPts(1)
REAL*8 LineThickness, ArrowheadSize, ArrowheadAngle
REAL*4 XGeomData(1), YGeomData(1), ZGeomData(1)
CHARACTER*1 NULCHAR
INTEGER*4 Zero
POINTER (NullPtr,Null)
INTEGER*4 Null(*)
Debug = 2
VIsDouble = 0
FileType = 0
DIsDouble = 0
NULCHAR = CHAR(0)
Zero = 0
NullPtr = 0
!
! Open field.plt and write the header information.
!
I = TECINI112('DATASET WITH 1 ORDERED ZONE, '// &
'1 QUAD ZONE OVER 2 TIME STEPS'//NULCHAR, &
'X Y P'//NULCHAR, &
'field.plt'//NULCHAR, &
'.'//NULCHAR, &
FileType, &
Debug, &
VIsDouble)
!
! Open line.plt and write the header information.
!
VIsDouble = 1
I = TECINI112('DATASET WITH ONE I-ORDERED ZONE'//NULCHAR, &
'X Y'//NULCHAR, &
'line.plt'//NULCHAR, &
'.'//NULCHAR, &
FileType, &
Debug, &
VIsDouble)
!
! Calculate values for the field variables.
!
Do 10 J = 1,5
Do 10 I = 1,4
X(I,J) = I
Y(I,J) = J
P(I,J) = I*J
10 Continue
!
! Make sure writing to file #1.
!
III = 1
I = TECFIL112(III)
!
! Write the zone header information for the ordered zone.
!
IMax = 4
JMax = 5
KMax = 1
SolTime = 10.0
StrandID = 1
ParentZn = 0
I = TECZNE112('Ordered Zone 1'//NULCHAR, &
0, & ! ZONETYPE
IMax, &
JMax, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, & ! ISBLOCK
0, & ! NumFaceConnections
0, & ! FaceNeighborMode
0, & ! TotalNumFaceNodes
0, & ! NumConnectedBoundaryFaces
0, & ! TotalNumBoundaryConnections
Null, & ! PassiveVarList
Null, & ! ValueLocation
Null, & ! ShareVarFromZone
0) ! ShareConnectivityFromZone)
!
! Write out the field data for the ordered zone.
!
III = IMax*JMax
I = TECDAT112(III,X,DIsDouble)
I = TECDAT112(III,Y,DIsDouble)
I = TECDAT112(III,P,DIsDouble)
!
! Calculate values for the I-ordered zone.
!
Do 20 I = 1,50
XL(I) = I
YL(I) = sin(I/20.0)
20 Continue
!
! Switch to the 'line.plt' file (file number 2)
! and write out the line plot data.
!
III = 2
I = TECFIL112(III)
!
! Write the zone header information for the XY-data.
!
IMax = 50
JMax = 1
KMax = 1
SolTime = 0.0
StrandID = 0
I = TECZNE112('XY Line plot'//NULCHAR, &
0, &
IMax, &
JMax, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, &
0, &
0, &
0, &
0, &
0, &
Null, &
Null, &
Null, &
0)
!
! Write out the line plot.
!
DIsDouble = 1
III = IMax
I = TECDAT112(III,XLDummy,DIsDouble)
I = TECDAT112(III,YLDummy,DIsDouble)
!
! Switch back to the field plot file and write out
! the finite-element zone.
!
III = 1
I = TECFIL112(III)
!
! Move the coordinates so this zone's not on top of the other
!
Do 30 J = 1,5
Do 30 I = 1,4
X(I,J) = I+5
Y(I,J) = J
P(I,J) = I*J
30 Continue
!
! Write the zone header information for the finite-element zone.
!
NPts = 20
NElm = 12
KMax = 1
SolTime = 10.0
StrandID = 2
I = TECZNE112('Finite Zone 1'//NULCHAR, &
3, & ! FEQUADRILATERAL
NPts, &
NElm, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, &
0, &
0, &
0, &
0, &
0, &
Null, &
Null, &
Null, &
0)
!
! Write out the field data for the finite-element zone.
!
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,X,DIsDouble)
I = TECDAT112(III,Y,DIsDouble)
I = TECDAT112(III,P,DIsDouble)
!
! Calculate and then write out the connectivity list.
! Note: The NM array references cells starting with
! offset of 1.
!
Do 40 I = 1,IMax-1
Do 40 J = 1,JMax-1
K = I+(J-1)*(IMax-1)
L = I+(J-1)*IMax
NM(1,K) = L
NM(2,K) = L+1
NM(3,K) = L+IMax+1
NM(4,K) = L+IMax
40 Continue
I = TECNOD112(NM)
!
! Calculate vlues for the new solution variable.
!
Do 50 J = 1,5
Do 50 I = 1,4
P(I,J) = 2*I*J
50 Continue
!
! Write the zone header information for time step 2
!
IMax = 4
JMax = 5
KMax = 1
SolTime = 20.0
StrandID = 1
SharingZone(1) = 1
SharingZone(2) = 1
SharingZone(3) = 0
I = TECZNE112('Ordered Zone 2'//NULCHAR, &
0, & ! ORDERED
IMax, &
JMax, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, &
0, &
0, &
0, &
0, &
0, &
Null, &
Null, &
SharingZone, &
0)
!
! Write out the solution variable the grid variables are shared.
!
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,P,DIsDouble)
!
! Calculate values for the new solution variable.
!
Do 60 J = 1,5
Do 60 I = 1,4
P(I,J) = 3*I*J
60 Continue
!
! Write another time step for the FEZone and share from the first
!
SolTime = 20.0
StrandID = 2
KMax = 0
SharingZone(1) = 2
SharingZone(2) = 2
SharingZone(3) = 0
I = TECZNE112('Finite Zone 2'//NULCHAR, &
3, & ! FEQUADRILATERAL
NPts, &
NElm, &
KMax, &
0, &
0, &
0, &
SolTime, &
StrandID, &
ParentZn, &
1, &
0, &
0, &
0, &
0, &
0, &
Null, &
Null, &
SharingZone, &
2)
!
! Write out the solution variable the grid variables are shared.
!
IMax = 4
JMax = 5
III = IMax*JMax
DIsDouble = 0
I = TECDAT112(III,P,DIsDouble)
!
! Prepare to write out text record. Text is positioned
! at 50, 50 in frame units and has a height 5 frame units.
!
XP = 50
YP = 50
FH = 5
Scope = 1
Clipping = 0
PositionCoordSys = 1
FontType = 1
HeightUnits = 1
AttachToZone = 0
Zone = 0
BoxType = 0
BoxMargin = 5.0
BoxLineThickness = 0.5
BoxColor = 3
BoxFillColor = 7
TextAngle = 0.0
Anchor = 0
LineSpacing = 1.5
TextColor = 0
III = TECTXT112(XP, &
YP, &
0.0d0, &
PositionCoordSys, &
AttachToZone, &
Zone, &
FontType, &
HeightUnits, &
FH, &
BoxType, &
BoxMargin, &
BoxLineThickness, &
BoxColor, &
BoxFillColor, &
TextAngle, &
Anchor, &
LineSpacing, &
TextColor, &
Scope, &
Clipping, &
'Hi Mom'//NULCHAR, &
NULCHAR)
!
! Prepare to write out geometry record (circle). Circle is
! positioned at 25, 25 in frame units and has a radius of 30.
! Circle is drawn using a dashed line pattern.
!
XP = 25
YP = 25
ZP = 0.0
IsFilled = 0
Color = 0
FillColor = 7
GeomType = 2
LinePattern = 1
LineThickness = 0.3
PatternLength = 1
NumEllipsePts = 72
ArrowheadStyle = 0
ArrowheadAttachment = 0
ArrowheadSize = 0.0
ArrowheadAngle = 15.0
NumSegments = 1
NumSegPts(1) = 1
XGeomData(1) = 30
YGeomData(1) = 0.0
ZGeomData(1) = 0.0
III = TECGEO112(XP, &
YP, &
ZP, &
PositionCoordSys, &
AttachToZone, &
Zone, &
Color, &
FillColor, &
IsFilled, &
GeomType, &
LinePattern, &
PatternLength, &
LineThickness, &
NumEllipsePts, &
ArrowheadStyle, &
ArrowheadAttachment, &
ArrowheadSize, &
ArrowheadAngle, &
Scope, &
Clipping, &
NumSegments, &
NumSegPts, &
XGeomData, &
YGeomData, &
ZGeomData, &
NULCHAR)
!
! Close out file 1.
!
I = TECEND112()
!
! Close out file 2.
!
III = 2
I = TECFIL112(III)
I = TECEND112()
STOP
END

View File

@ -0,0 +1,346 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="comtestc"
ProjectGUID="{723FBFD1-5AF2-4154-B77A-CE3849EAFCA2}"
RootNamespace="comtestc"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="..\TecIO_Examples.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath=".\comtest.c"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectCreator="Intel Fortran" Keyword="Console Application" Version="9.10" ProjectIdGuid="{861BC05F-1E95-401A-A80E-7589ADD1C79E}">
<Platforms>
<Platform Name="Win32"/></Platforms>
<Configurations>
<Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.exe;$(TargetPath)">
<Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" AdditionalIncludeDirectories="$(TEC_360_2009)/Include" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug" CompileOnly="true"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFLinkerTool" OutputFile="$(OUTDIR)/comtestf.exe" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(TEC_360_2009)/Bin" GenerateDebugInformation="true" ProgramDatabaseFile="$(OUTDIR)/comtestf.pdb" SubSystem="subSystemConsole" AdditionalDependencies="tecio.lib"/>
<Tool Name="VFResourceCompilerTool" ResourceOutputFileName="$(IntDir)/$(InputName).res"/>
<Tool Name="VFPreLinkEventTool"/></Configuration>
<Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)$(PlatformName)/$(ConfigurationName)" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.exe;$(TargetPath)" MustRebuild="true">
<Tool Name="VFMidlTool" SwitchesHaveChanged="true" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFFortranCompilerTool" SwitchesHaveChanged="true" SuppressStartupBanner="true" AdditionalIncludeDirectories="$(TEC_360_2009)/Include" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreaded" CompileOnly="true"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFLinkerTool" SwitchesHaveChanged="true" MustRebuild="true" OutputFile="$(OUTDIR)/comtestf.exe" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(TEC_360_2009)/Bin" SubSystem="subSystemConsole" AdditionalDependencies="tecio.lib"/>
<Tool Name="VFResourceCompilerTool" SwitchesHaveChanged="true" ResourceOutputFileName="$(IntDir)/$(InputName).res"/>
<Tool Name="VFPreLinkEventTool"/></Configuration></Configurations>
<Files>
<File RelativePath="comtest.f90"/></Files>
<Globals/></VisualStudioProject>