mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into pairPatchAgglomeration
This commit is contained in:
@ -104,6 +104,11 @@
|
|||||||
taking film into account
|
taking film into account
|
||||||
+ Parallel aware
|
+ Parallel aware
|
||||||
*** *New* ptscotch decomposition method
|
*** *New* ptscotch decomposition method
|
||||||
|
*** *Updated* scotch decomposition method to run in parallel by doing
|
||||||
|
decomposition on the master. Unfortunately scotch and ptscotch cannot
|
||||||
|
be linked in to the same executable.
|
||||||
|
*** *Updated* simple decomposition method to run in parallel by doing
|
||||||
|
decomposition on the master.
|
||||||
*** *Updated* decomposePar maps polyPatches instead of recreating them so
|
*** *Updated* decomposePar maps polyPatches instead of recreating them so
|
||||||
polyPatches holding data can map the data.
|
polyPatches holding data can map the data.
|
||||||
*** *Updated* particle tracking algorithm
|
*** *Updated* particle tracking algorithm
|
||||||
@ -183,6 +188,9 @@
|
|||||||
e.g. pitzDailyDirectMapped tutorial.
|
e.g. pitzDailyDirectMapped tutorial.
|
||||||
+ =setSet=: allows time range (e.g. 0:100) in combination with -batch argument
|
+ =setSet=: allows time range (e.g. 0:100) in combination with -batch argument
|
||||||
to execute the commands for multiple times.
|
to execute the commands for multiple times.
|
||||||
|
+ =extrudeMesh=:
|
||||||
|
- option to add extrusion to existing mesh.
|
||||||
|
- works in parallel
|
||||||
* Post-processing
|
* Post-processing
|
||||||
+ =paraFoam=, =foamToVTK=: full support for polyhedral cell type in recent
|
+ =paraFoam=, =foamToVTK=: full support for polyhedral cell type in recent
|
||||||
Paraview versions.
|
Paraview versions.
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
word scheme("div(phi,alpha)");
|
word scheme("div(phi,alpha)");
|
||||||
word schemer("div(phir,alpha)");
|
word schemer("div(phir,alpha)");
|
||||||
|
|
||||||
surfaceScalarField phic(phi);
|
surfaceScalarField phic("phic", phi);
|
||||||
surfaceScalarField phir(phia - phib);
|
surfaceScalarField phir("phir", phia - phib);
|
||||||
|
|
||||||
if (g0.value() > 0.0)
|
if (g0.value() > 0.0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -31,6 +31,7 @@ Description
|
|||||||
|
|
||||||
#include "IStringStream.H"
|
#include "IStringStream.H"
|
||||||
#include "Polynomial.H"
|
#include "Polynomial.H"
|
||||||
|
#include "polynomialFunction.H"
|
||||||
#include "Random.H"
|
#include "Random.H"
|
||||||
#include "cpuTime.H"
|
#include "cpuTime.H"
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ using namespace Foam;
|
|||||||
|
|
||||||
const int PolySize = 8;
|
const int PolySize = 8;
|
||||||
const scalar coeff[] = { 0.11, 0.45, -0.94, 1.58, -2.58, 0.08, 3.15, -4.78 };
|
const scalar coeff[] = { 0.11, 0.45, -0.94, 1.58, -2.58, 0.08, 3.15, -4.78 };
|
||||||
const char* polyDef = "testPoly (0.11 0.45 -0.94 1.58 -2.58 0.08 3.15 -4.78)";
|
const char* polyDef = "(0.11 0.45 -0.94 1.58 -2.58 0.08 3.15 -4.78)";
|
||||||
|
|
||||||
|
|
||||||
scalar polyValue(const scalar x)
|
scalar polyValue(const scalar x)
|
||||||
@ -58,7 +59,7 @@ scalar polyValue(const scalar x)
|
|||||||
|
|
||||||
scalar intPolyValue(const scalar x)
|
scalar intPolyValue(const scalar x)
|
||||||
{
|
{
|
||||||
// Hard-coded integrated form of above polynomial
|
// Hard-coded integral form of above polynomial
|
||||||
return
|
return
|
||||||
coeff[0]*x
|
coeff[0]*x
|
||||||
+ coeff[1]/2.0*sqr(x)
|
+ coeff[1]/2.0*sqr(x)
|
||||||
@ -109,27 +110,44 @@ int main(int argc, char *argv[])
|
|||||||
const label nIters = 1000;
|
const label nIters = 1000;
|
||||||
scalar sum = 0.0;
|
scalar sum = 0.0;
|
||||||
|
|
||||||
Info<< "null poly = " << (Polynomial<8>()) << nl << endl;
|
Info<< "null poly = " << (Polynomial<8>()) << nl
|
||||||
|
<< "null poly = " << (polynomialFunction(8)) << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
// Polynomial<8> poly("testPoly", IStringStream(polyDef)());
|
|
||||||
Polynomial<8> poly(coeff);
|
Polynomial<8> poly(coeff);
|
||||||
Polynomial<9> intPoly(poly.integrate(0.0));
|
Polynomial<9> intPoly(poly.integral(0.0));
|
||||||
|
|
||||||
Info<< "poly = " << poly << endl;
|
IStringStream is(polyDef);
|
||||||
Info<< "intPoly = " << intPoly << nl << endl;
|
polynomialFunction polyfunc(is);
|
||||||
|
|
||||||
Info<< "2*poly = " << 2*poly << endl;
|
Info<< "poly = " << poly << nl
|
||||||
Info<< "poly+poly = " << poly + poly << nl << endl;
|
<< "intPoly = " << intPoly << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
Info<< "3*poly = " << 3*poly << endl;
|
Info<< "2*poly = " << 2*poly << nl
|
||||||
Info<< "poly+poly+poly = " << poly + poly + poly << nl << endl;
|
<< "poly+poly = " << poly + poly << nl
|
||||||
|
<< "3*poly = " << 3*poly << nl
|
||||||
|
<< "poly+poly+poly = " << poly + poly + poly << nl
|
||||||
|
<< "3*poly - 2*poly = " << 3*poly - 2*poly << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
Info<< nl << "--- as polynomialFunction" << nl << endl;
|
||||||
|
Info<< "polyf = " << polyfunc << nl
|
||||||
|
<< "intPoly = " << poly.integral(0.0) << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
Info<< "2*polyf = " << 2*polyfunc << nl
|
||||||
|
<< "polyf+polyf = " << polyfunc + polyfunc << nl
|
||||||
|
<< "3*polyf = " << 3*polyfunc << nl
|
||||||
|
<< "polyf+polyf+polyf = " << polyfunc + polyfunc + polyfunc << nl
|
||||||
|
<< "3*polyf - 2*polyf = " << 3*polyfunc - 2*polyfunc << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
Info<< "3*poly - 2*poly = " << 3*poly - 2*poly << nl << endl;
|
|
||||||
|
|
||||||
Polynomial<8> polyCopy = poly;
|
Polynomial<8> polyCopy = poly;
|
||||||
Info<< "poly, polyCopy = " << poly << ", " << polyCopy << nl << endl;
|
Info<< "poly, polyCopy = " << poly << ", " << polyCopy << nl << endl;
|
||||||
polyCopy = 2.5*poly;
|
polyCopy = 2.5*poly;
|
||||||
Info<< "2.5*polyCopy = " << polyCopy << nl << endl;
|
Info<< "2.5*poly = " << polyCopy << nl << endl;
|
||||||
|
|
||||||
Random rnd(123456);
|
Random rnd(123456);
|
||||||
for (int i=0; i<10; i++)
|
for (int i=0; i<10; i++)
|
||||||
@ -139,8 +157,8 @@ int main(int argc, char *argv[])
|
|||||||
scalar px = polyValue(x);
|
scalar px = polyValue(x);
|
||||||
scalar ipx = intPolyValue(x);
|
scalar ipx = intPolyValue(x);
|
||||||
|
|
||||||
scalar pxTest = poly.evaluate(x);
|
scalar pxTest = poly.value(x);
|
||||||
scalar ipxTest = intPoly.evaluate(x);
|
scalar ipxTest = intPoly.value(x);
|
||||||
|
|
||||||
Info<<"\nx = " << x << endl;
|
Info<<"\nx = " << x << endl;
|
||||||
Info<< " px, pxTest = " << px << ", " << pxTest << endl;
|
Info<< " px, pxTest = " << px << ", " << pxTest << endl;
|
||||||
@ -173,10 +191,21 @@ int main(int argc, char *argv[])
|
|||||||
sum = 0.0;
|
sum = 0.0;
|
||||||
for (label iter = 0; iter < nIters; ++iter)
|
for (label iter = 0; iter < nIters; ++iter)
|
||||||
{
|
{
|
||||||
sum += poly.evaluate(loop+iter);
|
sum += poly.value(loop+iter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Info<< "evaluate: " << sum
|
Info<< "value: " << sum
|
||||||
|
<< " in " << timer.cpuTimeIncrement() << " s\n";
|
||||||
|
|
||||||
|
for (int loop = 0; loop < n; ++loop)
|
||||||
|
{
|
||||||
|
sum = 0.0;
|
||||||
|
for (label iter = 0; iter < nIters; ++iter)
|
||||||
|
{
|
||||||
|
sum += polyfunc.value(loop+iter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Info<< "via function: " << sum
|
||||||
<< " in " << timer.cpuTimeIncrement() << " s\n";
|
<< " in " << timer.cpuTimeIncrement() << " s\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -210,7 +210,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
|||||||
{
|
{
|
||||||
// Create some data. Use slightly perturbed positions.
|
// Create some data. Use slightly perturbed positions.
|
||||||
Map<point> sparseData;
|
Map<point> sparseData;
|
||||||
pointField fullData(mesh.nPoints(), point::max);
|
pointField fullData(mesh.nPoints(), point(GREAT, GREAT, GREAT));
|
||||||
|
|
||||||
forAll(localPoints, i)
|
forAll(localPoints, i)
|
||||||
{
|
{
|
||||||
@ -236,7 +236,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
|||||||
mesh,
|
mesh,
|
||||||
fullData,
|
fullData,
|
||||||
minMagSqrEqOp<point>(),
|
minMagSqrEqOp<point>(),
|
||||||
point::max
|
point(GREAT, GREAT, GREAT)
|
||||||
// true // apply separation
|
// true // apply separation
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
|||||||
{
|
{
|
||||||
const point& fullPt = fullData[meshPointI];
|
const point& fullPt = fullData[meshPointI];
|
||||||
|
|
||||||
if (fullPt != point::max)
|
if (fullPt != point(GREAT, GREAT, GREAT))
|
||||||
{
|
{
|
||||||
const point& sparsePt = sparseData[meshPointI];
|
const point& sparsePt = sparseData[meshPointI];
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
|||||||
{
|
{
|
||||||
// Create some data. Use slightly perturbed positions.
|
// Create some data. Use slightly perturbed positions.
|
||||||
EdgeMap<point> sparseData;
|
EdgeMap<point> sparseData;
|
||||||
pointField fullData(mesh.nEdges(), point::max);
|
pointField fullData(mesh.nEdges(), point(GREAT, GREAT, GREAT));
|
||||||
|
|
||||||
const edgeList& edges = allBoundary.edges();
|
const edgeList& edges = allBoundary.edges();
|
||||||
const labelList meshEdges = allBoundary.meshEdges
|
const labelList meshEdges = allBoundary.meshEdges
|
||||||
@ -320,7 +320,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
|||||||
mesh,
|
mesh,
|
||||||
fullData,
|
fullData,
|
||||||
minMagSqrEqOp<point>(),
|
minMagSqrEqOp<point>(),
|
||||||
point::max
|
point(GREAT, GREAT, GREAT)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Compare.
|
// Compare.
|
||||||
@ -329,7 +329,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
|||||||
{
|
{
|
||||||
const point& fullPt = fullData[meshEdgeI];
|
const point& fullPt = fullData[meshEdgeI];
|
||||||
|
|
||||||
if (fullPt != point::max)
|
if (fullPt != point(GREAT, GREAT, GREAT))
|
||||||
{
|
{
|
||||||
const point& sparsePt = sparseData[mesh.edges()[meshEdgeI]];
|
const point& sparsePt = sparseData[mesh.edges()[meshEdgeI]];
|
||||||
|
|
||||||
@ -385,7 +385,7 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
|
|||||||
mesh,
|
mesh,
|
||||||
syncedPoints,
|
syncedPoints,
|
||||||
minMagSqrEqOp<point>(),
|
minMagSqrEqOp<point>(),
|
||||||
point::max
|
point(GREAT, GREAT, GREAT)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(syncedPoints, pointI)
|
forAll(syncedPoints, pointI)
|
||||||
@ -461,7 +461,7 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
|
|||||||
mesh,
|
mesh,
|
||||||
syncedMids,
|
syncedMids,
|
||||||
minMagSqrEqOp<point>(),
|
minMagSqrEqOp<point>(),
|
||||||
point::max
|
point(GREAT, GREAT, GREAT)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(syncedMids, edgeI)
|
forAll(syncedMids, edgeI)
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Usage
|
|||||||
|
|
||||||
Note
|
Note
|
||||||
The cellTable information available in the files
|
The cellTable information available in the files
|
||||||
\c constant/cellTable and @c constant/polyMesh/cellTableId
|
\c constant/cellTable and \c constant/polyMesh/cellTableId
|
||||||
will be used if available. Otherwise the cellZones are used when
|
will be used if available. Otherwise the cellZones are used when
|
||||||
creating the cellTable information.
|
creating the cellTable information.
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,7 @@ Description
|
|||||||
#include "addPatchCellLayer.H"
|
#include "addPatchCellLayer.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "MeshedSurfaces.H"
|
#include "MeshedSurfaces.H"
|
||||||
|
#include "globalIndex.H"
|
||||||
|
|
||||||
#include "extrudedMesh.H"
|
#include "extrudedMesh.H"
|
||||||
#include "extrudeModel.H"
|
#include "extrudeModel.H"
|
||||||
@ -261,6 +262,12 @@ int main(int argc, char *argv[])
|
|||||||
sourceCasePath.expand();
|
sourceCasePath.expand();
|
||||||
fileName sourceRootDir = sourceCasePath.path();
|
fileName sourceRootDir = sourceCasePath.path();
|
||||||
fileName sourceCaseDir = sourceCasePath.name();
|
fileName sourceCaseDir = sourceCasePath.name();
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
sourceCaseDir =
|
||||||
|
sourceCaseDir
|
||||||
|
/"processor" + Foam::name(Pstream::myProcNo());
|
||||||
|
}
|
||||||
wordList sourcePatches;
|
wordList sourcePatches;
|
||||||
dict.lookup("sourcePatches") >> sourcePatches;
|
dict.lookup("sourcePatches") >> sourcePatches;
|
||||||
|
|
||||||
@ -279,54 +286,173 @@ int main(int argc, char *argv[])
|
|||||||
sourceRootDir,
|
sourceRootDir,
|
||||||
sourceCaseDir
|
sourceCaseDir
|
||||||
);
|
);
|
||||||
|
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
|
|
||||||
// Topo change container. Either copy an existing mesh or start
|
|
||||||
// with empty storage (number of patches only needed for checking)
|
|
||||||
autoPtr<polyTopoChange> meshMod
|
|
||||||
(
|
|
||||||
(
|
|
||||||
mode == MESH
|
|
||||||
? new polyTopoChange(mesh)
|
|
||||||
: new polyTopoChange(patches.size())
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Extrusion engine. Either adding to existing mesh or
|
// Extrusion engine. Either adding to existing mesh or
|
||||||
// creating separate mesh.
|
// creating separate mesh.
|
||||||
addPatchCellLayer layerExtrude(mesh, (mode == MESH));
|
addPatchCellLayer layerExtrude(mesh, (mode == MESH));
|
||||||
|
|
||||||
|
const labelList meshFaces(patchFaces(patches, sourcePatches));
|
||||||
indirectPrimitivePatch extrudePatch
|
indirectPrimitivePatch extrudePatch
|
||||||
(
|
(
|
||||||
IndirectList<face>
|
IndirectList<face>
|
||||||
(
|
(
|
||||||
mesh.faces(),
|
mesh.faces(),
|
||||||
patchFaces(patches, sourcePatches)
|
meshFaces
|
||||||
),
|
),
|
||||||
mesh.points()
|
mesh.points()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Determine extrudePatch normal
|
||||||
|
pointField extrudePatchPointNormals
|
||||||
|
(
|
||||||
|
PatchTools::pointNormals //calcNormals
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
extrudePatch,
|
||||||
|
meshFaces
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Precalculate mesh edges for pp.edges.
|
||||||
|
const labelList meshEdges
|
||||||
|
(
|
||||||
|
extrudePatch.meshEdges
|
||||||
|
(
|
||||||
|
mesh.edges(),
|
||||||
|
mesh.pointEdges()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Global face indices engine
|
||||||
|
const globalIndex globalFaces(mesh.nFaces());
|
||||||
|
|
||||||
|
// Determine extrudePatch.edgeFaces in global numbering (so across
|
||||||
|
// coupled patches)
|
||||||
|
labelListList edgeGlobalFaces
|
||||||
|
(
|
||||||
|
addPatchCellLayer::globalEdgeFaces
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
globalFaces,
|
||||||
|
extrudePatch
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Determine what patches boundary edges need to get extruded into.
|
||||||
|
// This might actually cause edge-connected processors to become
|
||||||
|
// face-connected so might need to introduce new processor boundaries.
|
||||||
|
// Calculates:
|
||||||
|
// - per pp.edge the patch to extrude into
|
||||||
|
// - any additional processor boundaries (patchToNbrProc = map from
|
||||||
|
// new patchID to neighbour processor)
|
||||||
|
// - number of new patches (nPatches)
|
||||||
|
|
||||||
|
labelList sidePatchID;
|
||||||
|
label nPatches;
|
||||||
|
Map<label> nbrProcToPatch;
|
||||||
|
Map<label> patchToNbrProc;
|
||||||
|
addPatchCellLayer::calcSidePatch
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
globalFaces,
|
||||||
|
edgeGlobalFaces,
|
||||||
|
extrudePatch,
|
||||||
|
|
||||||
|
sidePatchID,
|
||||||
|
nPatches,
|
||||||
|
nbrProcToPatch,
|
||||||
|
patchToNbrProc
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Add any patches.
|
||||||
|
|
||||||
|
label nAdded = nPatches - mesh.boundaryMesh().size();
|
||||||
|
reduce(nAdded, sumOp<label>());
|
||||||
|
|
||||||
|
Info<< "Adding overall " << nAdded << " processor patches." << endl;
|
||||||
|
|
||||||
|
if (nAdded > 0)
|
||||||
|
{
|
||||||
|
DynamicList<polyPatch*> newPatches(nPatches);
|
||||||
|
forAll(mesh.boundaryMesh(), patchI)
|
||||||
|
{
|
||||||
|
newPatches.append
|
||||||
|
(
|
||||||
|
mesh.boundaryMesh()[patchI].clone
|
||||||
|
(
|
||||||
|
mesh.boundaryMesh()
|
||||||
|
).ptr()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
for
|
||||||
|
(
|
||||||
|
label patchI = mesh.boundaryMesh().size();
|
||||||
|
patchI < nPatches;
|
||||||
|
patchI++
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label nbrProcI = patchToNbrProc[patchI];
|
||||||
|
word name =
|
||||||
|
"procBoundary"
|
||||||
|
+ Foam::name(Pstream::myProcNo())
|
||||||
|
+ "to"
|
||||||
|
+ Foam::name(nbrProcI);
|
||||||
|
|
||||||
|
Pout<< "Adding patch " << patchI
|
||||||
|
<< " name:" << name
|
||||||
|
<< " between " << Pstream::myProcNo()
|
||||||
|
<< " and " << nbrProcI
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
|
newPatches.append
|
||||||
|
(
|
||||||
|
new processorPolyPatch
|
||||||
|
(
|
||||||
|
name,
|
||||||
|
0, // size
|
||||||
|
mesh.nFaces(), // start
|
||||||
|
patchI, // index
|
||||||
|
mesh.boundaryMesh(),// polyBoundaryMesh
|
||||||
|
Pstream::myProcNo(),// myProcNo
|
||||||
|
nbrProcI // neighbProcNo
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add patches. Do no parallel updates.
|
||||||
|
mesh.removeFvBoundary();
|
||||||
|
mesh.addFvPatches(newPatches, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Only used for addPatchCellLayer into new mesh
|
// Only used for addPatchCellLayer into new mesh
|
||||||
labelList exposedPatchIDs;
|
labelList exposedPatchID;
|
||||||
if (mode == PATCH)
|
if (mode == PATCH)
|
||||||
{
|
{
|
||||||
dict.lookup("exposedPatchName") >> backPatchName;
|
dict.lookup("exposedPatchName") >> backPatchName;
|
||||||
exposedPatchIDs.setSize
|
exposedPatchID.setSize
|
||||||
(
|
(
|
||||||
extrudePatch.size(),
|
extrudePatch.size(),
|
||||||
findPatchID(patches, backPatchName)
|
findPatchID(patches, backPatchName)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine points and extrusion
|
||||||
pointField layer0Points(extrudePatch.nPoints());
|
pointField layer0Points(extrudePatch.nPoints());
|
||||||
pointField displacement(extrudePatch.nPoints());
|
pointField displacement(extrudePatch.nPoints());
|
||||||
forAll(displacement, pointI)
|
forAll(displacement, pointI)
|
||||||
{
|
{
|
||||||
const vector& patchNormal = extrudePatch.pointNormals()[pointI];
|
const vector& patchNormal = extrudePatchPointNormals[pointI];
|
||||||
|
|
||||||
// layer0 point
|
// layer0 point
|
||||||
layer0Points[pointI] = model()
|
layer0Points[pointI] = model()
|
||||||
@ -373,15 +499,31 @@ int main(int argc, char *argv[])
|
|||||||
// Layers per point
|
// Layers per point
|
||||||
labelList nPointLayers(extrudePatch.nPoints(), model().nLayers());
|
labelList nPointLayers(extrudePatch.nPoints(), model().nLayers());
|
||||||
// Displacement for first layer
|
// Displacement for first layer
|
||||||
vectorField firstLayerDisp(displacement*model().sumThickness(1));
|
vectorField firstLayerDisp = displacement*model().sumThickness(1);
|
||||||
|
|
||||||
// Expansion ratio not used.
|
// Expansion ratio not used.
|
||||||
scalarField ratio(extrudePatch.nPoints(), 1.0);
|
scalarField ratio(extrudePatch.nPoints(), 1.0);
|
||||||
|
|
||||||
|
// Topo change container. Either copy an existing mesh or start
|
||||||
|
// with empty storage (number of patches only needed for checking)
|
||||||
|
autoPtr<polyTopoChange> meshMod
|
||||||
|
(
|
||||||
|
(
|
||||||
|
mode == MESH
|
||||||
|
? new polyTopoChange(mesh)
|
||||||
|
: new polyTopoChange(patches.size())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
layerExtrude.setRefinement
|
layerExtrude.setRefinement
|
||||||
(
|
(
|
||||||
|
globalFaces,
|
||||||
|
edgeGlobalFaces,
|
||||||
|
|
||||||
ratio, // expansion ratio
|
ratio, // expansion ratio
|
||||||
extrudePatch, // patch faces to extrude
|
extrudePatch, // patch faces to extrude
|
||||||
exposedPatchIDs, // if new mesh: patches for exposed faces
|
sidePatchID, // if boundary edge: patch to use
|
||||||
|
exposedPatchID, // if new mesh: patches for exposed faces
|
||||||
nFaceLayers,
|
nFaceLayers,
|
||||||
nPointLayers,
|
nPointLayers,
|
||||||
firstLayerDisp,
|
firstLayerDisp,
|
||||||
@ -401,7 +543,7 @@ int main(int argc, char *argv[])
|
|||||||
model()
|
model()
|
||||||
(
|
(
|
||||||
extrudePatch.localPoints()[pointI],
|
extrudePatch.localPoints()[pointI],
|
||||||
extrudePatch.pointNormals()[pointI],
|
extrudePatchPointNormals[pointI],
|
||||||
pPointI+1 // layer
|
pPointI+1 // layer
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -22,8 +22,8 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Picks up cells with cell centre 'inside' of surface. Requires surface
|
Picks up cells with cell centre 'inside' of surface.
|
||||||
to be closed and singly connected.
|
Requires surface to be closed and singly connected.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -42,9 +42,16 @@ using namespace Foam;
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
argList::addNote
|
||||||
|
(
|
||||||
|
"Create a cellSet for cells with their centres inside the defined "
|
||||||
|
"surface.\n"
|
||||||
|
"Surface must be closed and singly connected."
|
||||||
|
);
|
||||||
|
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("surface file");
|
argList::validArgs.append("surfaceFile");
|
||||||
argList::validArgs.append("destination cellSet");
|
argList::validArgs.append("cellSet");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -75,14 +82,13 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Info<< "Selected " << insideCells.size()
|
Info<< "Selected " << insideCells.size() << " of " << mesh.nCells()
|
||||||
<< " cells out of " << mesh.nCells() << endl
|
<< " cells" << nl << nl
|
||||||
<< endl
|
|
||||||
<< "Writing selected cells to cellSet " << insideCells.name()
|
<< "Writing selected cells to cellSet " << insideCells.name()
|
||||||
<< endl << endl
|
<< nl << nl
|
||||||
<< "Use this cellSet e.g. with subsetMesh : " << endl << endl
|
<< "Use this cellSet e.g. with subsetMesh : " << nl << nl
|
||||||
<< " subsetMesh <root> <case> " << insideCells.name()
|
<< " subsetMesh " << insideCells.name()
|
||||||
<< endl << endl;
|
<< nl << endl;
|
||||||
|
|
||||||
insideCells.write();
|
insideCells.write();
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lautoMesh \
|
-lautoMesh \
|
||||||
-lbarotropicCompressibilityModel \
|
-lbarotropicCompressibilityModel \
|
||||||
|
-lbasicSolidThermo \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lblockMesh \
|
-lblockMesh \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
@ -11,15 +12,19 @@ EXE_LIBS = \
|
|||||||
-lconversion \
|
-lconversion \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-ldieselSpray \
|
-ldieselSpray \
|
||||||
|
-ldistributed \
|
||||||
|
-ldistributionModels \
|
||||||
-ldsmc \
|
-ldsmc \
|
||||||
-ldynamicFvMesh \
|
-ldynamicFvMesh \
|
||||||
-ldynamicMesh \
|
-ldynamicMesh \
|
||||||
-ledgeMesh \
|
-ledgeMesh \
|
||||||
-lengine \
|
-lengine \
|
||||||
-lerrorEstimation \
|
-lerrorEstimation \
|
||||||
|
-lextrudeModel \
|
||||||
-lfieldFunctionObjects \
|
-lfieldFunctionObjects \
|
||||||
-lfileFormats \
|
-lfileFormats \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
-lfoamCalcFunctions \
|
||||||
-lforces \
|
-lforces \
|
||||||
-lfvMotionSolvers \
|
-lfvMotionSolvers \
|
||||||
-lgenericPatchFields \
|
-lgenericPatchFields \
|
||||||
@ -29,6 +34,8 @@ EXE_LIBS = \
|
|||||||
-lincompressibleTurbulenceModel \
|
-lincompressibleTurbulenceModel \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-lIOFunctionObjects \
|
-lIOFunctionObjects \
|
||||||
|
-ljobControl \
|
||||||
|
-lkineticTheoryModel \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels \
|
||||||
@ -37,22 +44,29 @@ EXE_LIBS = \
|
|||||||
-lliquidMixtureProperties \
|
-lliquidMixtureProperties \
|
||||||
-lliquidProperties \
|
-lliquidProperties \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
|
-lMGridGenGAMGAgglomeration \
|
||||||
-lmolecularMeasurements \
|
-lmolecularMeasurements \
|
||||||
-lmolecule \
|
-lmolecule \
|
||||||
|
-lmultiphaseInterFoam \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lOpenFOAM \
|
-lOpenFOAM \
|
||||||
-ldistributionModels \
|
-lphaseModel \
|
||||||
-lpotential \
|
-lpotential \
|
||||||
-lradiationModels \
|
-lradiationModels \
|
||||||
-lrandomProcesses \
|
-lrandomProcesses \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
|
-lreconstruct \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
|
-lSLGThermo \
|
||||||
-lsolidMixtureProperties \
|
-lsolidMixtureProperties \
|
||||||
-lsolidParticle \
|
-lsolidParticle \
|
||||||
-lsolidProperties \
|
-lsolidProperties \
|
||||||
|
-lsolid \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
|
-lsurfaceFilmModels \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
-lsystemCall \
|
-lsystemCall \
|
||||||
|
-ltabulatedWallFunctions \
|
||||||
-lthermalPorousZone \
|
-lthermalPorousZone \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-ltopoChangerFvMesh \
|
-ltopoChangerFvMesh \
|
||||||
|
|||||||
@ -73,8 +73,8 @@ autoPtr<fvMesh> createMesh
|
|||||||
const bool haveMesh
|
const bool haveMesh
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Pout<< "Create mesh for time = "
|
//Pout<< "Create mesh for time = "
|
||||||
<< runTime.timeName() << nl << endl;
|
// << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
IOobject io
|
IOobject io
|
||||||
(
|
(
|
||||||
@ -98,12 +98,12 @@ autoPtr<fvMesh> createMesh
|
|||||||
xferCopy(labelList()),
|
xferCopy(labelList()),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath()
|
//Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath()
|
||||||
<< endl;
|
// << endl;
|
||||||
dummyMesh.write();
|
dummyMesh.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
Pout<< "Reading mesh from " << io.objectPath() << endl;
|
//Pout<< "Reading mesh from " << io.objectPath() << endl;
|
||||||
autoPtr<fvMesh> meshPtr(new fvMesh(io));
|
autoPtr<fvMesh> meshPtr(new fvMesh(io));
|
||||||
fvMesh& mesh = meshPtr();
|
fvMesh& mesh = meshPtr();
|
||||||
|
|
||||||
@ -201,9 +201,8 @@ autoPtr<fvMesh> createMesh
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Pout<< "Adding patch:" << nPatches
|
//Pout<< "Adding patch:" << nPatches
|
||||||
<< " name:" << name
|
// << " name:" << name << " type:" << type << endl;
|
||||||
<< " type:" << type << endl;
|
|
||||||
|
|
||||||
dictionary patchDict(e.dict());
|
dictionary patchDict(e.dict());
|
||||||
patchDict.remove("nFaces");
|
patchDict.remove("nFaces");
|
||||||
@ -282,8 +281,7 @@ autoPtr<fvMesh> createMesh
|
|||||||
if (!haveMesh)
|
if (!haveMesh)
|
||||||
{
|
{
|
||||||
// We created a dummy mesh file above. Delete it.
|
// We created a dummy mesh file above. Delete it.
|
||||||
Pout<< "Removing dummy mesh " << io.objectPath()
|
//Pout<< "Removing dummy mesh " << io.objectPath() << endl;
|
||||||
<< endl;
|
|
||||||
rmDir(io.objectPath());
|
rmDir(io.objectPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,17 +349,19 @@ scalar getMergeDistance
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void printMeshData(Ostream& os, const polyMesh& mesh)
|
//void printMeshData(Ostream& os, const polyMesh& mesh)
|
||||||
{
|
//{
|
||||||
os << "Number of points: " << mesh.points().size() << nl
|
// os << "Number of points: " << mesh.points().size() << nl
|
||||||
<< " faces: " << mesh.faces().size() << nl
|
// << " faces: " << mesh.faces().size() << nl
|
||||||
<< " internal faces: " << mesh.faceNeighbour().size() << nl
|
// << " internal faces: " << mesh.faceNeighbour().size() << nl
|
||||||
<< " cells: " << mesh.cells().size() << nl
|
// << " cells: " << mesh.cells().size() << nl
|
||||||
<< " boundary patches: " << mesh.boundaryMesh().size() << nl
|
// << " boundary patches: " << mesh.boundaryMesh().size() << nl
|
||||||
<< " point zones: " << mesh.pointZones().size() << nl
|
// << " point zones: " << mesh.pointZones().size() << nl
|
||||||
<< " face zones: " << mesh.faceZones().size() << nl
|
// << " face zones: " << mesh.faceZones().size() << nl
|
||||||
<< " cell zones: " << mesh.cellZones().size() << nl;
|
// << " cell zones: " << mesh.cellZones().size() << nl;
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
void printMeshData(const polyMesh& mesh)
|
void printMeshData(const polyMesh& mesh)
|
||||||
{
|
{
|
||||||
// Collect all data on master
|
// Collect all data on master
|
||||||
@ -525,6 +525,7 @@ void readFields
|
|||||||
|
|
||||||
// Receive field
|
// Receive field
|
||||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
||||||
|
dictionary fieldDict(fromMaster);
|
||||||
|
|
||||||
fields.set
|
fields.set
|
||||||
(
|
(
|
||||||
@ -540,7 +541,7 @@ void readFields
|
|||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
fromMaster
|
fieldDict
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -916,8 +917,8 @@ int main(int argc, char *argv[])
|
|||||||
// Mesh distribution engine
|
// Mesh distribution engine
|
||||||
fvMeshDistribute distributor(mesh, tolDim);
|
fvMeshDistribute distributor(mesh, tolDim);
|
||||||
|
|
||||||
Pout<< "Wanted distribution:"
|
//Pout<< "Wanted distribution:"
|
||||||
<< distributor.countCells(finalDecomp) << nl << endl;
|
// << distributor.countCells(finalDecomp) << nl << endl;
|
||||||
|
|
||||||
// Do actual sending/receiving of mesh
|
// Do actual sending/receiving of mesh
|
||||||
autoPtr<mapDistributePolyMesh> map = distributor.distribute(finalDecomp);
|
autoPtr<mapDistributePolyMesh> map = distributor.distribute(finalDecomp);
|
||||||
@ -987,7 +988,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< endl;
|
Info<< endl;
|
||||||
|
|
||||||
|
|
||||||
Pout<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Build optional components (eg, may depend on third-party libraries)
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# build tecio
|
||||||
|
wmake libso tecio/tecsrc
|
||||||
|
|
||||||
|
# build converter
|
||||||
|
wmake
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
||||||
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(WM_THIRD_PARTY_DIR)/tecio/tecsrc/lnInclude \
|
-Itecio/tecsrc/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
@ -10,4 +10,4 @@ EXE_LIBS = \
|
|||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lgenericPatchFields \
|
-lgenericPatchFields \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-L$(FOAM_EXT_LIBBIN) -ltecio
|
-ltecio
|
||||||
|
|||||||
@ -0,0 +1,277 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
MAKEWHAT=
|
||||||
|
EXTRAFLAGS=
|
||||||
|
STRIPFLAG=-s
|
||||||
|
isrelease=n
|
||||||
|
skipcompile=n
|
||||||
|
if test $# -ge 1 ; then
|
||||||
|
Platname=$1
|
||||||
|
shift
|
||||||
|
while test $# -ge 1
|
||||||
|
do
|
||||||
|
if test "$1" = "-release" ; then
|
||||||
|
isrelease=y
|
||||||
|
elif test "$1" = "-skipcompile" ; then
|
||||||
|
skipcompile=y
|
||||||
|
elif test "$1" = "-tecio" ; then
|
||||||
|
MAKEWHAT=tecio.a
|
||||||
|
else
|
||||||
|
EXTRAFLAGS="$EXTRAFLAGS $1"
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "Choose platform:"
|
||||||
|
echo " "
|
||||||
|
echo " macux.104"
|
||||||
|
echo " macix64.105"
|
||||||
|
echo " sgix.62"
|
||||||
|
echo " sgix3.62"
|
||||||
|
echo " sgix.65"
|
||||||
|
echo " sgix64.65"
|
||||||
|
echo " sgix2.65"
|
||||||
|
echo " sun4.57"
|
||||||
|
echo " sun464.57"
|
||||||
|
echo " sun86.54"
|
||||||
|
echo " ibmx.43"
|
||||||
|
echo " ibmx64.43"
|
||||||
|
echo " ibmx.51"
|
||||||
|
echo " ibmx64.51"
|
||||||
|
echo " ibmx64.53"
|
||||||
|
echo " decalpha.32"
|
||||||
|
echo " compaq.51"
|
||||||
|
echo " hp7xx.11"
|
||||||
|
echo " hp7xx64.11"
|
||||||
|
echo " hpi64.11"
|
||||||
|
echo " linux.24"
|
||||||
|
echo " linuxi64.24"
|
||||||
|
echo " linux.22"
|
||||||
|
echo " linuxa.22"
|
||||||
|
echo " linuxg248x64.26"
|
||||||
|
echo " linuxg27x64.26"
|
||||||
|
echo " crayc90"
|
||||||
|
echo "->\c"
|
||||||
|
read Platname
|
||||||
|
|
||||||
|
echo "Choose:"
|
||||||
|
echo " 1. Make tecio.a only"
|
||||||
|
echo " 2. Make tecio.a and pltview"
|
||||||
|
|
||||||
|
read choice
|
||||||
|
|
||||||
|
if test $choice -eq 1 ;then
|
||||||
|
MAKEWHAT=tecio.a
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
MAKECMD=make
|
||||||
|
LINKFLAGS=
|
||||||
|
LINKLIBS=
|
||||||
|
AR=ar
|
||||||
|
ARFLAGS=qv
|
||||||
|
DISTSUBDIR2=
|
||||||
|
|
||||||
|
case $Platname in
|
||||||
|
mac*) CCOMP=g++
|
||||||
|
FINALCFLAGS="-arch ppc -arch i386 -arch ppc64 -arch x86_64 -DDARWIN -DLONGIS64 -I/usr/X11R6/include"
|
||||||
|
STRIPFLAG=-Wl,-x
|
||||||
|
LINKFLAGS="-arch ppc -arch i386 -arch ppc64 -arch x86_64"
|
||||||
|
;;
|
||||||
|
sgix.65-64) CCOMP=CC
|
||||||
|
FINALCFLAGS="-DIRISX -DLONGIS64 -mips4 -64"
|
||||||
|
LINKFLAGS="-mips4 -64"
|
||||||
|
;;
|
||||||
|
sgix64.65) CCOMP=CC
|
||||||
|
FINALCFLAGS="-DIRISX -DLONGIS64 -mips4 -64"
|
||||||
|
LINKFLAGS="-mips4 -64"
|
||||||
|
;;
|
||||||
|
sgix.65) CCOMP=CC
|
||||||
|
FINALCFLAGS="-DIRISX -mips4 -n32"
|
||||||
|
LINKFLAGS="-mips4 -n32"
|
||||||
|
;;
|
||||||
|
sgix2.65) CCOMP=CC
|
||||||
|
FINALCFLAGS="-DIRISX -o32"
|
||||||
|
LINKFLAGS="-o32"
|
||||||
|
;;
|
||||||
|
sgix.62-64) CCOMP=CC
|
||||||
|
FINALCFLAGS="-DIRISX -DIRIX62 -DLONGIS64 -mips4 -64"
|
||||||
|
LINKFLAGS="-mips4 -64"
|
||||||
|
;;
|
||||||
|
sgix.62) CCOMP=CC
|
||||||
|
FINALCFLAGS="-DIRISX -DIRIX62 -mips4 -n32"
|
||||||
|
LINKFLAGS="-mips4 -n32"
|
||||||
|
;;
|
||||||
|
sgix1.62) CCOMP=CC
|
||||||
|
FINALCFLAGS="-DIRISX -DIRIX62 -mips1 -32"
|
||||||
|
LINKFLAGS="-mips1 -32"
|
||||||
|
;;
|
||||||
|
sgix3.62) CCOMP=CC
|
||||||
|
FINALCFLAGS="-DIRISX -DIRIX62 -mips3 -n32"
|
||||||
|
LINKFLAGS="-mips3 -n32"
|
||||||
|
;;
|
||||||
|
ibmx.*) CCOMP=xlC
|
||||||
|
FINALCFLAGS=-DIBMRS6000X
|
||||||
|
;;
|
||||||
|
ibmx64.*) CCOMP=xlC
|
||||||
|
FINALCFLAGS="-DIBMRS6000X -DLONGIS64 -q64"
|
||||||
|
ARFLAGS="-X64 qv"
|
||||||
|
;;
|
||||||
|
compaq.51) CCOMP=cxx
|
||||||
|
FINALCFLAGS="-DCOMPAQX -I/usr/include -ieee_with_inexact"
|
||||||
|
;;
|
||||||
|
decalpha.32)CCOMP=cc
|
||||||
|
FINALCFLAGS="-DDECALPHAX -I/usr/include -ieee_with_inexact"
|
||||||
|
;;
|
||||||
|
hp7xx.*-64) CCOMP=aCC
|
||||||
|
FINALCFLAGS="+DD64 +DS2.0 -AA -DHPX -DLONGIS64 -I/usr/include/X11R6 -I/usr/include/Motif2.1"
|
||||||
|
LINKFLAGS="+DA2.0W +DD64 +DS2.0W"
|
||||||
|
;;
|
||||||
|
hp7xx64.11) CCOMP=aCC
|
||||||
|
FINALCFLAGS="+DA2.0W +DD64 +DS2.0W -AA -DHPX -DLONGIS64 -I/usr/include/X11R6 -I/usr/include/Motif2.1"
|
||||||
|
LINKFLAGS="+DA2.0W +DD64 +DS2.0W"
|
||||||
|
;;
|
||||||
|
hpi64.11) CCOMP=aCC
|
||||||
|
FINALCFLAGS="+DD64 -AA -DHPX -DLONGIS64 -I/usr/include/X11R6 -I/usr/include/Motif2.1"
|
||||||
|
LINKFLAGS="+DD64"
|
||||||
|
;;
|
||||||
|
hp7xx.11) CCOMP=aCC
|
||||||
|
FINALCFLAGS="+DAportable -AA -DHPX -I/usr/include/X11R6 -I/usr/include/Motif2.1"
|
||||||
|
LINKFLAGS="+DAportable"
|
||||||
|
;;
|
||||||
|
crayc90) CCOMP=cc
|
||||||
|
FINALCFLAGS="-DCRAY -DUNIXX"
|
||||||
|
;;
|
||||||
|
linux*i64.*)CCOMP=g++
|
||||||
|
FINALCFLAGS="-fPIC -DLINUX -DLINUXI64"
|
||||||
|
;;
|
||||||
|
linux*64.*) CCOMP=g++
|
||||||
|
FINALCFLAGS="-fPIC -DLINUX -DLINUX64"
|
||||||
|
;;
|
||||||
|
linux*) CCOMP=g++
|
||||||
|
FINALCFLAGS="-fPIC -DLINUX"
|
||||||
|
;;
|
||||||
|
sun4.54) CCOMP=/opt/SUNWspro/bin/CC
|
||||||
|
FINALCFLAGS="-DSUN -DSUNSOLARISX -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
|
||||||
|
LINKFLAGS="-library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
|
||||||
|
MAKECMD=/usr/ccs/bin/make
|
||||||
|
AR=/opt/SUNWspro/bin/CC
|
||||||
|
ARFLAGS="-xar -o"
|
||||||
|
;;
|
||||||
|
sun4.55) CCOMP=/opt/SUNWspro/bin/CC
|
||||||
|
FINALCFLAGS="-DSUN -DSUNSOLARISX -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
|
||||||
|
LINKFLAGS="-library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
|
||||||
|
MAKECMD=/usr/ccs/bin/make
|
||||||
|
AR=/opt/SUNWspro/bin/CC
|
||||||
|
ARFLAGS="-xar -o"
|
||||||
|
;;
|
||||||
|
sun4.57) CCOMP=/opt/SUNWspro/bin/CC
|
||||||
|
FINALCFLAGS="-DSUNSOLARISX -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
|
||||||
|
LINKFLAGS="-library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
|
||||||
|
MAKECMD=/usr/ccs/bin/make
|
||||||
|
AR=/opt/SUNWspro/bin/CC
|
||||||
|
ARFLAGS="-xar -o"
|
||||||
|
;;
|
||||||
|
sun4.57-64) CCOMP=/opt/SUNWspro/bin/CC
|
||||||
|
FINALCFLAGS="-DSUNSOLARISX -DLONGIS64 -KPIC -xarch=v9 -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
|
||||||
|
LINKFLAGS="-KPIC -xarch=v9 -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
|
||||||
|
MAKECMD=/usr/ccs/bin/make
|
||||||
|
AR=/opt/SUNWspro/bin/CC
|
||||||
|
ARFLAGS="-xar -o"
|
||||||
|
;;
|
||||||
|
sun464.57) CCOMP=/opt/SUNWspro/bin/CC
|
||||||
|
FINALCFLAGS="-DSUNSOLARISX -DLONGIS64 -KPIC -xarch=v9 -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
|
||||||
|
LINKFLAGS="-KPIC -xarch=v9 -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
|
||||||
|
MAKECMD=/usr/ccs/bin/make
|
||||||
|
AR=/opt/SUNWspro/bin/CC
|
||||||
|
ARFLAGS="-xar -o"
|
||||||
|
;;
|
||||||
|
sun464.59) CCOMP=/opt/SUNWspro/bin/CC
|
||||||
|
FINALCFLAGS="-DSUNSOLARISX -DLONGIS64 -KPIC -m64 -xarch=generic -I/usr/openwin/include -I/usr/dt/include -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg -xO1"
|
||||||
|
LINKFLAGS="-KPIC -m64 -xarch=generic -library=libC -library=Cstd -library=no%rwtools7 -library=no%rwtools7_dbg"
|
||||||
|
MAKECMD=/usr/ccs/bin/make
|
||||||
|
AR=/opt/SUNWspro/bin/CC
|
||||||
|
ARFLAGS="-xar -o"
|
||||||
|
;;
|
||||||
|
sun86.54) CCOMP=/opt/SUNWspro/bin/CC
|
||||||
|
FINALCFLAGS="-DSUN -DSUNSOLARISX -I/usr/openwin/include -I/usr/dt/include"
|
||||||
|
MAKECMD=/usr/ccs/bin/make
|
||||||
|
AR=/opt/SUNWspro/bin/CC
|
||||||
|
ARFLAGS="-xar -o"
|
||||||
|
;;
|
||||||
|
*) echo "Err: Invalid platform"
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test "$isrelease" = "y" ; then
|
||||||
|
EXTRAFLAGS="$EXTRAFLAGS -DNO_ASSERTS"
|
||||||
|
else
|
||||||
|
STRIPFLAG=
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$skipcompile" = "n" ; then
|
||||||
|
rm -f *.o */*.o *.a > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f *.a > /dev/null 2>&1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FINALCFLAGS="$FINALCFLAGS $EXTRAFLAGS -DUSEENUM -DTHREED"
|
||||||
|
#
|
||||||
|
# NOTE: Used to use make here but had problems with using remsh to run
|
||||||
|
# make multiple times to get 64 bit and 32 bit versions of libraries....
|
||||||
|
#
|
||||||
|
# $MAKECMD $MAKEWHAT AR=$AR CC=$CCOMP LINKFLAGS="$LINKFLAGS" STRIPFLAG=$STRIPFLAG CFLAGS="$EXTRAFLAGS -DUSEENUM -DTHREED $FINALCFLAGS"
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
cd tecsrc
|
||||||
|
|
||||||
|
BASELIST=`/bin/ls -1 *.cpp`
|
||||||
|
|
||||||
|
OBJLIST=
|
||||||
|
for file in $BASELIST
|
||||||
|
do
|
||||||
|
OBJNAME=`echo $file | sed 's/\.cpp/.o/'`
|
||||||
|
OBJLIST="$OBJLIST tecsrc/$OBJNAME"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if test "$skipcompile" = "n" ; then
|
||||||
|
for file in $BASELIST
|
||||||
|
do
|
||||||
|
case $file in
|
||||||
|
tecxxx.cpp) ARCHIVEFLAG=-DMAKEARCHIVE;;
|
||||||
|
arrlist.cpp) ARCHIVEFLAG=-DMAKEARCHIVE;;
|
||||||
|
datautil.cpp) ARCHIVEFLAG=-DMAKEARCHIVE;;
|
||||||
|
*) ARCHIVEFLAG= ;;
|
||||||
|
esac
|
||||||
|
echo "$CCOMP $FINALCFLAGS $ARCHIVEFLAG -c $file"
|
||||||
|
$CCOMP $FINALCFLAGS $ARCHIVEFLAG -c $file
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
pwd
|
||||||
|
|
||||||
|
|
||||||
|
echo "$AR $ARFLAGS tecio.a $OBJLIST"
|
||||||
|
$AR $ARFLAGS tecio.a $OBJLIST
|
||||||
|
if test -f /bin/ranlib ; then
|
||||||
|
/bin/ranlib tecio.a;
|
||||||
|
elif test -f /usr/bin/ranlib ; then
|
||||||
|
/usr/bin/ranlib tecio.a;
|
||||||
|
elif test -f /usr/ucb/ranlib ; then
|
||||||
|
/usr/ucb/ranlib tecio.a;
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$CCOMP -I./tecsrc -DMAKEARCHIVE $FINALCFLAGS -c pltview.cpp"
|
||||||
|
$CCOMP -I./tecsrc -DMAKEARCHIVE $FINALCFLAGS -c pltview.cpp
|
||||||
|
|
||||||
|
echo "$CCOMP $FINALCFLAGS pltview.o tecio.a $LINKFLAGS $LINKLIBS $STRIPFLAG -lm -o pltview"
|
||||||
|
$CCOMP $FINALCFLAGS pltview.o tecio.a $LINKFLAGS $LINKLIBS $STRIPFLAG -lm -o pltview
|
||||||
Binary file not shown.
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=arrow
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,530 @@
|
|||||||
|
/* This example creates two simple polyhedral zones in the shape
|
||||||
|
* of a three-dimensional arrow. Obscured boundary faces are used.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "TECIO.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
/* DOCSTART:arrow_tecini.txt*/
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 1;
|
||||||
|
INTEGER4 FileType = 0;
|
||||||
|
INTEGER4 I;
|
||||||
|
|
||||||
|
/* Open the file and write the Tecplot datafile
|
||||||
|
* header information
|
||||||
|
*/
|
||||||
|
I = TECINI112((char*)"Multiple polyhedral zones", /* Name of the entire
|
||||||
|
* dataset.
|
||||||
|
*/
|
||||||
|
(char*)"X Y Z P", /* Defines the variables for the data
|
||||||
|
* file. Each zone must contain each of
|
||||||
|
* the variables listed here. The order
|
||||||
|
* of the variables in the list is used
|
||||||
|
* to define the variable number (e.g.
|
||||||
|
* X is Var 1).
|
||||||
|
*/
|
||||||
|
(char*)"Arrow.plt",
|
||||||
|
(char*)".", /* Scratch Directory */
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
|
||||||
|
/* After TECINI is called, call TECZNE to create one or more
|
||||||
|
* zones for your data file. In this example, Zone 1 contains a
|
||||||
|
* single rectangular solid created as a face-based finite-element
|
||||||
|
* (i.e. polyhedral zone). The zone has eight points (or nodes),
|
||||||
|
* six faces and one element.
|
||||||
|
*/
|
||||||
|
/* DOCSTART:arrow_teczne_rect.txt*/
|
||||||
|
/* TECZNE Parameters */
|
||||||
|
INTEGER4 ZoneType = 7; /* sets the zone type
|
||||||
|
* to polyhedral */
|
||||||
|
INTEGER4 NumPts_Rect = 8;
|
||||||
|
INTEGER4 NumElems_Rect = 1;
|
||||||
|
INTEGER4 NumFaces_Rect = 6;
|
||||||
|
INTEGER4 ICellMax = 0; /* not used */
|
||||||
|
INTEGER4 JCellMax = 0; /* not used */
|
||||||
|
INTEGER4 KCellMax = 0; /* not used */
|
||||||
|
double SolutionTime = 0.0;
|
||||||
|
INTEGER4 StrandID = 0;
|
||||||
|
INTEGER4 ParentZone = 0;
|
||||||
|
INTEGER4 IsBlock = 1;
|
||||||
|
INTEGER4 NumFaceConnections = 0; /* not used */
|
||||||
|
INTEGER4 FaceNeighborMode = 1; /* not used */
|
||||||
|
INTEGER4 SharConn = 0;
|
||||||
|
|
||||||
|
/* In a rectangular solid, each face is composed of four nodes.
|
||||||
|
* As such, the total number of face nodes is twenty-four (four
|
||||||
|
* nodes for each of the six faces).
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumFaceNodes_Rect = 24;
|
||||||
|
|
||||||
|
/* There is one connected boundary face in this zone (the face on
|
||||||
|
* the rectangle adjacent to the arrowhead). Refer to the Data
|
||||||
|
* Format Guide for additional information. */
|
||||||
|
INTEGER4 NumConnBndryFaces_Rect = 1;
|
||||||
|
|
||||||
|
/* The connected boundary face has one connection, the face on
|
||||||
|
* the bottom of the arrowhead. A connection is an element-zone
|
||||||
|
* tuple that indicates a neighboring element (and its zone) when
|
||||||
|
* the neighboring element is in a different zone. Generally,
|
||||||
|
* there will be one boundary connection for each boundary face.
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumBndryConns_Rect = 1;
|
||||||
|
|
||||||
|
/* For illustrative purposes, the grid variables (X, Y, and Z)
|
||||||
|
* are nodal variables (i.e. ValueLocation = 1), and the pressure
|
||||||
|
* variable (P) is a cell-centered variable (i.e.
|
||||||
|
* ValueLocation = 0).
|
||||||
|
*/
|
||||||
|
INTEGER4 ValueLocation[4] = { 1, 1, 1, 0 };
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Zone 1: Rectangular Solid",
|
||||||
|
&ZoneType,
|
||||||
|
&NumPts_Rect,
|
||||||
|
&NumElems_Rect,
|
||||||
|
&NumFaces_Rect,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolutionTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZone,
|
||||||
|
&IsBlock,
|
||||||
|
&NumFaceConnections,
|
||||||
|
&FaceNeighborMode,
|
||||||
|
&TotalNumFaceNodes_Rect,
|
||||||
|
&NumConnBndryFaces_Rect,
|
||||||
|
&TotalNumBndryConns_Rect,
|
||||||
|
NULL,
|
||||||
|
ValueLocation,
|
||||||
|
NULL,
|
||||||
|
&SharConn);
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_tecdat_rect.txt*/
|
||||||
|
//set variable values (X_Rect, Y_Rect, Z_Rect & P_Rect)
|
||||||
|
double *X_Rect = new double[NumPts_Rect];
|
||||||
|
double *Y_Rect = new double[NumPts_Rect];
|
||||||
|
double *Z_Rect = new double[NumPts_Rect];
|
||||||
|
double *P_Rect = new double[NumElems_Rect];
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 0; ii <= NumPts_Rect / 2; ii += 4)
|
||||||
|
{
|
||||||
|
X_Rect[ii] = 0;
|
||||||
|
X_Rect[ii+1] = 3;
|
||||||
|
X_Rect[ii+2] = 3;
|
||||||
|
X_Rect[ii+3] = 0;
|
||||||
|
|
||||||
|
Y_Rect[ii] = 3;
|
||||||
|
Y_Rect[ii+1] = 3;
|
||||||
|
Y_Rect[ii+2] = 1;
|
||||||
|
Y_Rect[ii+3] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 0; ii < 4; ii++)
|
||||||
|
Z_Rect[ii] = 0;
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 4; ii < NumPts_Rect; ii++)
|
||||||
|
Z_Rect[ii] = -2;
|
||||||
|
|
||||||
|
P_Rect[0] = 10;
|
||||||
|
|
||||||
|
|
||||||
|
INTEGER4 IsDouble = 1;
|
||||||
|
I = TECDAT112(&NumPts_Rect, X_Rect, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts_Rect, Y_Rect, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts_Rect, Z_Rect, &IsDouble);
|
||||||
|
I = TECDAT112(&NumElems_Rect, P_Rect, &IsDouble);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_facenodes_rect.txt*/
|
||||||
|
|
||||||
|
/* The FaceNodeCounts array is used to describe the number of
|
||||||
|
* nodes in each face of the zone. The first value in the array
|
||||||
|
* is the number of nodes in Face 1, the second value is the
|
||||||
|
* number of nodes in Face 2 and so forth. In this example, each
|
||||||
|
* face of the zone has four nodes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 *FaceNodeCounts_Rect = new INTEGER4[NumFaces_Rect];
|
||||||
|
//For this particular zone, each face has the 4 nodes
|
||||||
|
for (INTEGER4 ii = 0; ii < NumFaces_Rect; ii++)
|
||||||
|
FaceNodeCounts_Rect[ii] = 4;
|
||||||
|
|
||||||
|
/* The FaceNodes array is used to specify the nodes that compose
|
||||||
|
* each face. For each face (n of N), the number of nodes used
|
||||||
|
* to define the face is specified by the nth value in the
|
||||||
|
* FaceNodeCounts array. For example, if the first value in the
|
||||||
|
* FaceNodeCounts array is 4 (indicating Face 1 is composed of
|
||||||
|
* four nodes), the first four values in the FaceNodes array are
|
||||||
|
* the node numbers of the nodes in Face 1.
|
||||||
|
*
|
||||||
|
* ------------
|
||||||
|
* WARNING
|
||||||
|
* When providing the node numbers for each face, you must
|
||||||
|
* provide the node numbers in a consistent order (either
|
||||||
|
* clockwise or counter-clockwise. Providing the node numbers
|
||||||
|
* out of order results in contorted faces.
|
||||||
|
* ------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 *FaceNodes_Rect = new INTEGER4[TotalNumFaceNodes_Rect];
|
||||||
|
|
||||||
|
//Nodes for Face 1
|
||||||
|
FaceNodes_Rect[0] = 1;
|
||||||
|
FaceNodes_Rect[1] = 2;
|
||||||
|
FaceNodes_Rect[2] = 3;
|
||||||
|
FaceNodes_Rect[3] = 4;
|
||||||
|
|
||||||
|
//Nodes for Face 2
|
||||||
|
FaceNodes_Rect[4] = 1;
|
||||||
|
FaceNodes_Rect[5] = 4;
|
||||||
|
FaceNodes_Rect[6] = 8;
|
||||||
|
FaceNodes_Rect[7] = 5;
|
||||||
|
|
||||||
|
//Nodes for Face 3
|
||||||
|
FaceNodes_Rect[8] = 5;
|
||||||
|
FaceNodes_Rect[9] = 8;
|
||||||
|
FaceNodes_Rect[10] = 7;
|
||||||
|
FaceNodes_Rect[11] = 6;
|
||||||
|
|
||||||
|
//Nodes for Face 4
|
||||||
|
FaceNodes_Rect[12] = 2;
|
||||||
|
FaceNodes_Rect[13] = 6;
|
||||||
|
FaceNodes_Rect[14] = 7;
|
||||||
|
FaceNodes_Rect[15] = 3;
|
||||||
|
|
||||||
|
//Nodes for Face 5
|
||||||
|
FaceNodes_Rect[16] = 6;
|
||||||
|
FaceNodes_Rect[17] = 2;
|
||||||
|
FaceNodes_Rect[18] = 1;
|
||||||
|
FaceNodes_Rect[19] = 5;
|
||||||
|
|
||||||
|
//Nodes for Face 6
|
||||||
|
FaceNodes_Rect[20] = 3;
|
||||||
|
FaceNodes_Rect[21] = 7;
|
||||||
|
FaceNodes_Rect[22] = 8;
|
||||||
|
FaceNodes_Rect[23] = 4;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_neighbors_rect.txt*/
|
||||||
|
INTEGER4 *FaceLeftElems_Rect = new INTEGER4[NumFaces_Rect];
|
||||||
|
INTEGER4 *FaceRightElems_Rect = new INTEGER4[NumFaces_Rect];
|
||||||
|
|
||||||
|
/* Since this zone has just one element, all leftelems are
|
||||||
|
* NoNeighboring Element and all right elems are itself
|
||||||
|
*/
|
||||||
|
for (INTEGER4 ii = 0; ii < NumFaces_Rect; ii++)
|
||||||
|
{
|
||||||
|
FaceRightElems_Rect[ii] = 1;
|
||||||
|
FaceLeftElems_Rect[ii] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The negative value in the FaceLeftElems array indicates that
|
||||||
|
* the face is connected to an element in another zone. In this
|
||||||
|
* case, Face 4 is connected to a face in Zone 2 (to be defined
|
||||||
|
* later in the example). The FaceBoundaryConnectionElems array
|
||||||
|
* lists all of the element numbers in other zones that the
|
||||||
|
* current zone shares boundary connections with. Similarly, the
|
||||||
|
* FaceBoundaryConnectionZones array lists all of the zone numbers
|
||||||
|
* with which the current zone shares boundaries. A negative
|
||||||
|
* value in the FaceLeftElems or FaceRightElems array indicates
|
||||||
|
* the position within these arrays that defines the neighboring
|
||||||
|
* element and zone for a face.
|
||||||
|
*
|
||||||
|
* For example, if the FaceBoundaryConnectionElems array is:
|
||||||
|
* [1 8 2] and the FaceBoundaryConnectionZones array is: [2 5 3],
|
||||||
|
* a FaceLeftElems or FaceRightElems value of -2 indicates that
|
||||||
|
* the face in question has a boundary connection with Element 8
|
||||||
|
* in Zone 5.
|
||||||
|
*/
|
||||||
|
FaceLeftElems_Rect[3] = -1;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_tecpoly_rect.txt*/
|
||||||
|
/* The FaceBndryConnectionCounts array is used to define the
|
||||||
|
* number of boundary connections for each face that has a
|
||||||
|
* boundary connection. For example, if a zone has three boundary
|
||||||
|
* connections in total (NumConnectedBoundaryFaces), two of those
|
||||||
|
* boundary connections are in one face, and the remaining
|
||||||
|
* boundary connection is in a second face, the
|
||||||
|
* FaceBndryConnectionCounts array would be: [2 1].
|
||||||
|
* In this example, the total number of connected boundary faces
|
||||||
|
* (specified via TECZNE) is equal to one, so the
|
||||||
|
* FaceBoundaryConnectionCounts array contains a single value (1).
|
||||||
|
*/
|
||||||
|
INTEGER4 *FaceBndryConnCounts_Rect = new INTEGER4[NumConnBndryFaces_Rect];
|
||||||
|
FaceBndryConnCounts_Rect[0] = 1;
|
||||||
|
|
||||||
|
/* The value(s) in the FaceBndryConnectionElems and
|
||||||
|
* FaceBndryConnectionZones arrays specify the element number and
|
||||||
|
* zone number, respectively, that a given boundary connection is
|
||||||
|
* connected to. In this case, the boundary connection face is
|
||||||
|
* connected to Element 1 in Zone 2.
|
||||||
|
*/
|
||||||
|
INTEGER4 *FaceBndryConnElems_Rect = new INTEGER4[TotalNumBndryConns_Rect];
|
||||||
|
INTEGER4 *FaceBndryConnZones_Rect = new INTEGER4[TotalNumBndryConns_Rect];
|
||||||
|
|
||||||
|
FaceBndryConnElems_Rect[0] = 1;
|
||||||
|
FaceBndryConnZones_Rect[0] = 2;
|
||||||
|
|
||||||
|
I = TECPOLY112(FaceNodeCounts_Rect,
|
||||||
|
FaceNodes_Rect,
|
||||||
|
FaceLeftElems_Rect,
|
||||||
|
FaceRightElems_Rect,
|
||||||
|
FaceBndryConnCounts_Rect,
|
||||||
|
FaceBndryConnElems_Rect,
|
||||||
|
FaceBndryConnZones_Rect);
|
||||||
|
|
||||||
|
/* cleanup */
|
||||||
|
delete X_Rect;
|
||||||
|
delete Y_Rect;
|
||||||
|
delete Z_Rect;
|
||||||
|
delete P_Rect;
|
||||||
|
delete FaceNodeCounts_Rect;
|
||||||
|
delete FaceNodes_Rect;
|
||||||
|
delete FaceLeftElems_Rect;
|
||||||
|
delete FaceRightElems_Rect;
|
||||||
|
delete FaceBndryConnCounts_Rect;
|
||||||
|
delete FaceBndryConnElems_Rect;
|
||||||
|
delete FaceBndryConnZones_Rect;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* The data for Zone 1 has been written to the data file, so we
|
||||||
|
* are ready to create Zone 2. For simplicity, we will reuse many
|
||||||
|
* of the variables created for the rectangular zone that are not
|
||||||
|
* relevant to this tutorial. */
|
||||||
|
|
||||||
|
/* Zone 2 (the arrowhead or prism) has a single element composed
|
||||||
|
* of six nodes and five faces.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_teczne_prism.txt*/
|
||||||
|
//TECZNE Parameters
|
||||||
|
INTEGER4 NumPts_Prism = 6;
|
||||||
|
INTEGER4 NumElems_Prism = 1;
|
||||||
|
INTEGER4 NumFaces_Prism = 5;
|
||||||
|
|
||||||
|
/* The prism is composed of two triangular faces and three
|
||||||
|
* rectangular faces. The total number of face nodes is the sum
|
||||||
|
* of the nodes in each triangular face (2 times 3) and the nodes
|
||||||
|
* in each rectangular face (3 times 4).
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumFaceNodes_Prism = 18;
|
||||||
|
|
||||||
|
/* As with Zone 1, Zone 2 has one connected boundary face, the
|
||||||
|
* face that is connected to Zone 1.
|
||||||
|
*/
|
||||||
|
INTEGER4 NumConnBndryFaces_Prism = 1;
|
||||||
|
|
||||||
|
/* In this case, we have set the total number of boundary
|
||||||
|
* connections for the connected face to two. The first boundary
|
||||||
|
* connection is the connection to Zone 1. The second boundary
|
||||||
|
* connection is used to indicate that the face is only partially
|
||||||
|
* obscured by the face from Zone 1. If we omitted the second
|
||||||
|
* boundary connection, the connected face of the prism would
|
||||||
|
* disappear if the rectangular zone was deactivated.
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumBndryConns_Prism = 2;
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Zone 2: Prism",
|
||||||
|
&ZoneType,
|
||||||
|
&NumPts_Prism,
|
||||||
|
&NumElems_Prism,
|
||||||
|
&NumFaces_Prism,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolutionTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZone,
|
||||||
|
&IsBlock,
|
||||||
|
&NumFaceConnections,
|
||||||
|
&FaceNeighborMode,
|
||||||
|
&TotalNumFaceNodes_Prism,
|
||||||
|
&NumConnBndryFaces_Prism,
|
||||||
|
&TotalNumBndryConns_Prism,
|
||||||
|
NULL,
|
||||||
|
ValueLocation,
|
||||||
|
NULL,
|
||||||
|
&SharConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_tecdat_prism.txt*/
|
||||||
|
|
||||||
|
|
||||||
|
double *X_Prism = new double[NumPts_Prism];
|
||||||
|
double *Y_Prism = new double[NumPts_Prism];
|
||||||
|
double *Z_Prism = new double[NumPts_Prism];
|
||||||
|
|
||||||
|
|
||||||
|
/* Set the X and Y variable values, one z-plane at a time */
|
||||||
|
double ZVal = 0;
|
||||||
|
for (INTEGER4 ii = 0; ii < 2; ii++)
|
||||||
|
{
|
||||||
|
// triangle in Z=ZVal plane
|
||||||
|
X_Prism[3*ii] = 3;
|
||||||
|
Y_Prism[3*ii] = 4;
|
||||||
|
Z_Prism[3*ii] = ZVal;
|
||||||
|
|
||||||
|
X_Prism[3*ii+1] = 7;
|
||||||
|
Y_Prism[3*ii+1] = 2;
|
||||||
|
Z_Prism[3*ii+1] = ZVal;
|
||||||
|
|
||||||
|
X_Prism[3*ii+2] = 3;
|
||||||
|
Y_Prism[3*ii+2] = 0;
|
||||||
|
Z_Prism[3*ii+2] = ZVal;
|
||||||
|
|
||||||
|
ZVal = ZVal - 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When we called TecZne, we specified that the variable 4
|
||||||
|
* (pressure) is cell-centered. As such, only NumElements number
|
||||||
|
* of values needs to be written to the data file for the pressure
|
||||||
|
* variable.
|
||||||
|
*/
|
||||||
|
double *P_Prism = new double[NumElems_Prism];
|
||||||
|
P_Prism[0] = 20;
|
||||||
|
|
||||||
|
I = TECDAT112(&NumPts_Prism, X_Prism, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts_Prism, Y_Prism, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts_Prism, Z_Prism, &IsDouble);
|
||||||
|
I = TECDAT112(&NumElems_Prism, P_Prism, &IsDouble);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_facemap_prism.txt*/
|
||||||
|
INTEGER4 *FaceNodeCounts_Prism = new INTEGER4[NumFaces_Prism];
|
||||||
|
INTEGER4 *FaceNodes_Prism = new INTEGER4[TotalNumFaceNodes_Prism];
|
||||||
|
|
||||||
|
/* Because of the way we chose to number our faces, the first
|
||||||
|
* three faces are rectangular and the last two are triangular.
|
||||||
|
* The numbering of the faces is arbitrary, but the faces must
|
||||||
|
* be referred to consistently.
|
||||||
|
*/
|
||||||
|
for (INTEGER4 ii = 0; ii < 3; ii++)
|
||||||
|
FaceNodeCounts_Prism[ii] = 4;
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 3; ii < NumFaces_Prism; ii++)
|
||||||
|
FaceNodeCounts_Prism[ii] = 3;
|
||||||
|
|
||||||
|
//Nodes for Face 1
|
||||||
|
FaceNodes_Prism[0] = 1;
|
||||||
|
FaceNodes_Prism[1] = 3;
|
||||||
|
FaceNodes_Prism[2] = 6;
|
||||||
|
FaceNodes_Prism[3] = 4;
|
||||||
|
|
||||||
|
//Nodes for Face 2
|
||||||
|
FaceNodes_Prism[4] = 1;
|
||||||
|
FaceNodes_Prism[5] = 4;
|
||||||
|
FaceNodes_Prism[6] = 5;
|
||||||
|
FaceNodes_Prism[7] = 2;
|
||||||
|
|
||||||
|
//Nodes for Face 3
|
||||||
|
FaceNodes_Prism[8] = 3;
|
||||||
|
FaceNodes_Prism[9] = 2;
|
||||||
|
FaceNodes_Prism[10] = 5;
|
||||||
|
FaceNodes_Prism[11] = 6;
|
||||||
|
|
||||||
|
//Nodes for Face 4
|
||||||
|
FaceNodes_Prism[12] = 5;
|
||||||
|
FaceNodes_Prism[13] = 4;
|
||||||
|
FaceNodes_Prism[14] = 6;
|
||||||
|
|
||||||
|
//Nodes for Face 5
|
||||||
|
FaceNodes_Prism[15] = 1;
|
||||||
|
FaceNodes_Prism[16] = 2;
|
||||||
|
FaceNodes_Prism[17] = 3;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_neighbors_prism.txt*/
|
||||||
|
/* Since this zone has just one element, all leftelems are
|
||||||
|
* NoNeighboring Element and all right elems are itself.
|
||||||
|
*/
|
||||||
|
INTEGER4 *FaceLeftElems_Prism = new INTEGER4[NumFaces_Prism];
|
||||||
|
INTEGER4 *FaceRightElems_Prism = new INTEGER4[NumFaces_Prism];
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 0; ii < NumFaces_Prism; ii++)
|
||||||
|
{
|
||||||
|
FaceRightElems_Prism[ii] = 1;
|
||||||
|
FaceLeftElems_Prism[ii] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* The negative value in the FaceLeftElems array indicates that
|
||||||
|
* the face is connected to an element in another zone. In this
|
||||||
|
* case, Face 1 is connected to a face in Zone 1 (as indicated in
|
||||||
|
* Line 6). The FaceBoundaryConnectionElems array lists all of
|
||||||
|
* the element numbers in other zones that the current zone shares
|
||||||
|
* boundary connections with. Similarly, the
|
||||||
|
* FaceBoundaryConnectionZones array lists all of the zone numbers
|
||||||
|
* with which the current zone shares boundaries. A negative
|
||||||
|
* value in the FaceLeftElems or FaceRightElems array indicates
|
||||||
|
* the position within these arrays that defines the neighboring
|
||||||
|
* element and zone for a face.
|
||||||
|
*/
|
||||||
|
FaceLeftElems_Prism[0] = -1;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_tecpoly_prism.txt*/
|
||||||
|
|
||||||
|
INTEGER4 *FaceBndryConnCounts_Prism = new INTEGER4[NumConnBndryFaces_Prism];
|
||||||
|
FaceBndryConnCounts_Prism[0] = 2;
|
||||||
|
|
||||||
|
INTEGER4 *FaceBndryConnElems_Prism = new INTEGER4[TotalNumBndryConns_Prism];
|
||||||
|
INTEGER4 *FaceBndryConnZones_Prism = new INTEGER4[TotalNumBndryConns_Prism];
|
||||||
|
|
||||||
|
/* As previously mentioned, a connected boundary face is a face
|
||||||
|
* that has either multiple neighboring faces or neighbor(s) that
|
||||||
|
* belong to another zone. Those cases are sufficient when the
|
||||||
|
* combination of all of the face<63>s neighbors completely cover the
|
||||||
|
* face. However, there are some cases (such as the bottom of the
|
||||||
|
* arrowhead) where the face is not completely covered by its
|
||||||
|
* neighbors. In those cases the face is referred to as <20>partially
|
||||||
|
* obscured<65>. A partially obscured face is indicated by
|
||||||
|
* incrementing the value in TotalNumConnectedBoundaryFaces and
|
||||||
|
* entering a value of 0 in both the FaceBndryConnectionElems and
|
||||||
|
* FaceBoundaryConnectionZones arrays for the boundary connection
|
||||||
|
* for the partially obscured face.
|
||||||
|
*/
|
||||||
|
FaceBndryConnElems_Prism[0] = 0;
|
||||||
|
FaceBndryConnZones_Prism[0] = 0;
|
||||||
|
|
||||||
|
/* Indicates that Face 1 is connected to Element 1 in Zone 1. */
|
||||||
|
FaceBndryConnElems_Prism[1] = 1;
|
||||||
|
FaceBndryConnZones_Prism[1] = 1;
|
||||||
|
|
||||||
|
I = TECPOLY112(FaceNodeCounts_Prism,
|
||||||
|
FaceNodes_Prism,
|
||||||
|
FaceLeftElems_Prism,
|
||||||
|
FaceRightElems_Prism,
|
||||||
|
FaceBndryConnCounts_Prism,
|
||||||
|
FaceBndryConnElems_Prism,
|
||||||
|
FaceBndryConnZones_Prism);
|
||||||
|
|
||||||
|
/* cleanup */
|
||||||
|
delete X_Prism;
|
||||||
|
delete Y_Prism;
|
||||||
|
delete Z_Prism;
|
||||||
|
delete P_Prism;
|
||||||
|
delete FaceNodeCounts_Prism;
|
||||||
|
delete FaceNodes_Prism;
|
||||||
|
delete FaceLeftElems_Prism;
|
||||||
|
delete FaceRightElems_Prism;
|
||||||
|
delete FaceBndryConnCounts_Prism;
|
||||||
|
delete FaceBndryConnElems_Prism;
|
||||||
|
delete FaceBndryConnZones_Prism;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:arrow_tecend.txt*/
|
||||||
|
I = TECEND112();
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="arrow"
|
||||||
|
ProjectGUID="{3C1105D7-5690-48E0-9402-111CBDC84B42}"
|
||||||
|
RootNamespace="arrow"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\arrow.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -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)
|
||||||
@ -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;
|
||||||
|
}
|
||||||
@ -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
|
||||||
@ -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
|
||||||
@ -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>
|
||||||
@ -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>
|
||||||
Binary file not shown.
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=faceneighbors
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,354 @@
|
|||||||
|
/* This example illustrates how to create two simple
|
||||||
|
* FE-quadilateral zones and create a face neighbor
|
||||||
|
* connection between the two zones. In order to keep the
|
||||||
|
* example as simple as possible, error checking is not included.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include "MASTER.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
/* Initialize the Data File using TECINI. TECINI is required
|
||||||
|
* for all data files. It is used to: open the data file and
|
||||||
|
* initialize the file header information (name the data file,
|
||||||
|
* the variables for the data file, and the file type).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:faceneighbors_tecini.txt*/
|
||||||
|
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 0;
|
||||||
|
INTEGER4 FileType = 0;
|
||||||
|
INTEGER4 I = 0; /* Used to track return codes */
|
||||||
|
|
||||||
|
I = TECINI112((char*)"Face Neighbors Example", /* Specifies the name
|
||||||
|
* of the entire
|
||||||
|
* dataset
|
||||||
|
*/
|
||||||
|
(char*)"X Y P", /* Defines the
|
||||||
|
* variables for the
|
||||||
|
* data file. Each
|
||||||
|
* zone must contain
|
||||||
|
* each of the vars
|
||||||
|
* listed. The order
|
||||||
|
* of the variables in
|
||||||
|
* the list is used to
|
||||||
|
* define the variable
|
||||||
|
* number (e.g. X is
|
||||||
|
* Var 1.)
|
||||||
|
*/
|
||||||
|
|
||||||
|
(char*)"FaceNeighbors.plt", /* Specifies the
|
||||||
|
* file name.
|
||||||
|
*/
|
||||||
|
(char*)".",
|
||||||
|
&FileType, /* The FileType is set to
|
||||||
|
* zero, indicating it is
|
||||||
|
* a full file (containing
|
||||||
|
* both grid and solution
|
||||||
|
* data).
|
||||||
|
*/
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* After TECINI is called, call TECZNE to create one or
|
||||||
|
* more zones for your data file.
|
||||||
|
*/
|
||||||
|
/* DOCSTART:faceneighbors_teczne1.txt*/
|
||||||
|
INTEGER4 ZoneType = 3; /* set the zone type to
|
||||||
|
* FEQuadrilateral
|
||||||
|
*/
|
||||||
|
INTEGER4 NumPts = 6;
|
||||||
|
INTEGER4 NumElems = 2;
|
||||||
|
INTEGER4 NumFaces = 8;
|
||||||
|
INTEGER4 ICellMax = 0; /* not used */
|
||||||
|
INTEGER4 JCellMax = 0; /* not used */
|
||||||
|
INTEGER4 KCellMax = 0; /* not used */
|
||||||
|
double SolTime = 360.0;
|
||||||
|
INTEGER4 StrandID = 0; /* StaticZone */
|
||||||
|
INTEGER4 ParentZn = 0;
|
||||||
|
INTEGER4 IsBlock = 1; /* Block */
|
||||||
|
INTEGER4 NFConns = 1; /* Specify the number of Face
|
||||||
|
* Neighbor Connections in the
|
||||||
|
* Zone. When this value is
|
||||||
|
* greater than zero, TECFACE must
|
||||||
|
* be called prior to creating the
|
||||||
|
* next zone or ending the file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Specify the Face Neighbor Mode.
|
||||||
|
* A value of 2 indicated that the face neighbor mode is global
|
||||||
|
* one-to-one. The scope of the face neighbors (local or
|
||||||
|
* global) is with respect to the zones. A value of global
|
||||||
|
* indicates that the face neighbor(s) is/are shared aross zones;
|
||||||
|
* a value of local indicates that the face neighbor(s) are
|
||||||
|
* shared within the current zone. The terms one-to-one and
|
||||||
|
* one-to-many are used to indicate whether the face in question
|
||||||
|
* is shared with one cell or several cells.
|
||||||
|
* For example, if your data is arranged as follows:
|
||||||
|
|
||||||
|
-----------------------
|
||||||
|
| | | |
|
||||||
|
| 1 | 2 | 3 |
|
||||||
|
| | | |
|
||||||
|
-----------------------
|
||||||
|
| | |
|
||||||
|
| 4 | 5 |
|
||||||
|
| | |
|
||||||
|
-----------------------
|
||||||
|
* The face between 1 & 4 is local-one-to-one. The face between
|
||||||
|
* 5 and (2 & 3) is local one-to-many.
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 FNMode = 2;
|
||||||
|
|
||||||
|
INTEGER4 TotalNumFaceNodes = 1; /* Not used for
|
||||||
|
* FEQuad zones*/
|
||||||
|
INTEGER4 NumConnectedBoundaryFaces = 1; /* Not used for
|
||||||
|
* FEQuad zones*/
|
||||||
|
INTEGER4 TotalNumBoundaryConnections = 1; /* Not used for
|
||||||
|
* FEQuad zones*/
|
||||||
|
INTEGER4 ShrConn = 0;
|
||||||
|
|
||||||
|
INTEGER4 ValueLocation[3] = {1, 1, 1}; /* Specify the variable
|
||||||
|
* values at the nodes.
|
||||||
|
* NOTE: Because all of
|
||||||
|
* the variables are
|
||||||
|
* defined at the nodes,
|
||||||
|
* we can just pass
|
||||||
|
* NULL for this array.
|
||||||
|
* We are providing the
|
||||||
|
* array for illustration
|
||||||
|
* purposes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Zone 1",
|
||||||
|
&ZoneType,
|
||||||
|
&NumPts,
|
||||||
|
&NumElems,
|
||||||
|
&NumFaces,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZn,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
&TotalNumFaceNodes,
|
||||||
|
&NumConnectedBoundaryFaces,
|
||||||
|
&TotalNumBoundaryConnections,
|
||||||
|
NULL,
|
||||||
|
ValueLocation,
|
||||||
|
NULL,
|
||||||
|
&ShrConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Set up the variable values. The variable values will be
|
||||||
|
* written to the file using TECDAT. Because we are specifying
|
||||||
|
* nodal variables (as specified via the ValueLocation
|
||||||
|
* parameter in TECZNE, each variable is dimensioned by the
|
||||||
|
* number of points (NumPts) in the Zone. You have the option
|
||||||
|
* to specify some variables with nodal values and some with
|
||||||
|
* cell-centered values. Refer to the Binary Function
|
||||||
|
* Reference for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:faceneighbors_tecdat1.txt*/
|
||||||
|
float *X = new float[NumPts];
|
||||||
|
float *Y = new float[NumPts];
|
||||||
|
float *P = new float[NumPts];
|
||||||
|
|
||||||
|
/* For this example, we will create 2 rectangular cells in Zone
|
||||||
|
* 1. Before defining your variables, you must establish a
|
||||||
|
* consistent node numbering scheme for your data. Once the
|
||||||
|
* node numbers are defined, supply the variable values in the
|
||||||
|
* node numbering order. In this example, node 1 is defined at
|
||||||
|
* X = 0 and Y = 0. As such, the first value supplied for X
|
||||||
|
* (i.e. X[0]) is 0. Similarly, the first value supplied for Y
|
||||||
|
* is 0.
|
||||||
|
*
|
||||||
|
* It is important that you refer to node numbers consistently.
|
||||||
|
* The node numbers will be used later to define the
|
||||||
|
* connectivity for each element.
|
||||||
|
*/
|
||||||
|
|
||||||
|
X[0] = 0;
|
||||||
|
X[1] = 0;
|
||||||
|
X[2] = 1;
|
||||||
|
X[3] = 1;
|
||||||
|
X[4] = 2;
|
||||||
|
X[5] = 2;
|
||||||
|
|
||||||
|
Y[0] = 0;
|
||||||
|
Y[1] = 1;
|
||||||
|
Y[2] = 0;
|
||||||
|
Y[3] = 1;
|
||||||
|
Y[4] = 0;
|
||||||
|
Y[5] = 1;
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 0; ii < NumPts; ii++)
|
||||||
|
P[ii] = (float)(NumPts - ii);
|
||||||
|
|
||||||
|
INTEGER4 DIsDouble = 0; /* Set DIsDouble to zero to use
|
||||||
|
* variables in float format.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Call TECDAT once for each variable */
|
||||||
|
I = TECDAT112(&NumPts, &X[0], &DIsDouble);
|
||||||
|
I = TECDAT112(&NumPts, &Y[0], &DIsDouble);
|
||||||
|
I = TECDAT112(&NumPts, &P[0], &DIsDouble);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Define the face neighbors connections.
|
||||||
|
* The Connectivity List is used to specify the nodes that
|
||||||
|
* compose each element. When working with nodal variables, the
|
||||||
|
* numbering of the nodes is implicitly defined when the
|
||||||
|
* variables are declared. The first value of each variable is
|
||||||
|
* for node one, the second value for node two, and so on.
|
||||||
|
*
|
||||||
|
* Because this zone contains two quadilateral elements, we must
|
||||||
|
* supply 8 values in the connectivity list. The first four
|
||||||
|
* values define the nodes that form element 1. Similarly, the
|
||||||
|
* second four values define the nodes that form element 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:faceneighbors_tecnod1.txt*/
|
||||||
|
INTEGER4 ConnList[8] = {1, 3, 4, 2,
|
||||||
|
3, 5, 6, 4
|
||||||
|
};
|
||||||
|
I = TECNOD112(ConnList);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* TIP! It is important to provide the node list in either a
|
||||||
|
* clockwise or counter-clockwise order. Otherwise, your
|
||||||
|
* elements will be misformed. For example, if the first two
|
||||||
|
* numbers in the above connectivity list, the zone would
|
||||||
|
* appear as follows:
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Now that TECNOD has been called, the creation of Zone 1
|
||||||
|
* is complete. However, in this example, we will define a
|
||||||
|
* face neighbor between Zone 1 and Zone 2 (to be created
|
||||||
|
* later in the example). Face Neighbor connections are used
|
||||||
|
* to define connections that are not created via the
|
||||||
|
* connectivity list. For example, local face neighbors may
|
||||||
|
* need to be defined when a zone wraps itself and global face
|
||||||
|
* neighbors may need to be defined to smooth edges across
|
||||||
|
* zones. Face Neighbors are used when deriving variables and
|
||||||
|
* drawing contours.
|
||||||
|
*
|
||||||
|
* In this example, we are creating a face neighbor connection
|
||||||
|
* between cell 2 in Zone 1 and cell 1 in Zone 2. The
|
||||||
|
* information required when specifying face neighbors
|
||||||
|
* depends upon the type of connection.
|
||||||
|
*
|
||||||
|
* In this case, we must supply (in this order):
|
||||||
|
* - the cell number in the current zone that contains the
|
||||||
|
* - the number of the face in that cell that contains the
|
||||||
|
* face neighbor
|
||||||
|
* - the number of the other zone to which the face is
|
||||||
|
* connected
|
||||||
|
* - the number of the cell in the other zone to which the
|
||||||
|
* face is connected
|
||||||
|
* The face numbering for cell-based finite elements is
|
||||||
|
* defined using the picture displayed in the Data Format
|
||||||
|
* Guide. In this example, face 2 in cell 2 in the current
|
||||||
|
* zone is connected to cell 1 in zone 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:faceneighbors_tecface1.txt*/
|
||||||
|
INTEGER4 FaceConn[4] = {2, 2, 2, 1};
|
||||||
|
I = TECFACE112(FaceConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* The creation of Zone 1 is complete. We are ready to create
|
||||||
|
* Zone 2. For simplicity, Zone 2 is a copy of Zone 1 shifted
|
||||||
|
* along the X-axis. As such, many of the variables used to
|
||||||
|
* create Zone 1 are re-used here.
|
||||||
|
*/
|
||||||
|
/* DOCSTART:faceneighbors_teczne2.txt*/
|
||||||
|
/* Call TECZNE to create Zone 2 */
|
||||||
|
I = TECZNE112((char*)"Zone 2",
|
||||||
|
&ZoneType,
|
||||||
|
&NumPts,
|
||||||
|
&NumElems,
|
||||||
|
&NumFaces,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZn,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
&TotalNumFaceNodes,
|
||||||
|
&NumConnectedBoundaryFaces,
|
||||||
|
&TotalNumBoundaryConnections,
|
||||||
|
NULL,
|
||||||
|
ValueLocation,
|
||||||
|
NULL,
|
||||||
|
&ShrConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Define the variables for Zone 2. Because Zone 2 is a copy
|
||||||
|
* of Zone 1, shifted along the X-axis, we can share the Y
|
||||||
|
* variable definition used to Zone. We will also create a
|
||||||
|
* second pressure variable for Zone 2 (P2).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:faceneighbors_tecdat2.txt*/
|
||||||
|
float *X2 = new float[NumPts];
|
||||||
|
float *P2 = new float[NumPts];
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 0; ii < NumPts; ii++)
|
||||||
|
{
|
||||||
|
X2[ii] = X[ii] + 2;
|
||||||
|
P2[ii] = 2 * (float)ii;
|
||||||
|
}
|
||||||
|
|
||||||
|
I = TECDAT112(&NumPts, &X2[0], &DIsDouble);
|
||||||
|
I = TECDAT112(&NumPts, &Y[0], &DIsDouble);
|
||||||
|
I = TECDAT112(&NumPts, &P2[0], &DIsDouble);
|
||||||
|
|
||||||
|
delete X;
|
||||||
|
delete Y;
|
||||||
|
delete P;
|
||||||
|
delete X2;
|
||||||
|
delete P2;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* As with Zone 1, we must define the connectivity list for
|
||||||
|
* Zone 2. Because, the node numbering restarts at one for each
|
||||||
|
* new zone and the nodal arrangement is identical between the
|
||||||
|
* two zones, we may reuse the connectivity list from Zone 1.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:faceneighbors_tecnod2.txt*/
|
||||||
|
I = TECNOD112(ConnList);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* We will now specify the face neighbor connection with
|
||||||
|
* respect to our new current zone of Zone 2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:faceneighbors_tecface2.txt*/
|
||||||
|
INTEGER4 FaceConn2[4] = {1, 4, 1, 2}; /* cell 1, face 4 in
|
||||||
|
* current zone is a
|
||||||
|
* neighbor to cell 2 in
|
||||||
|
* zone 1.
|
||||||
|
*/
|
||||||
|
I = TECFACE112(FaceConn2);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Call TECEND to close the file */
|
||||||
|
/* DOCSTART:faceneighbors_tecend.txt*/
|
||||||
|
I = TECEND112();
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="faceneighbors"
|
||||||
|
ProjectGUID="{1074FD63-4831-4D1B-8A27-94A3AC33A509}"
|
||||||
|
RootNamespace="faceneighbors"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\faceneighbors.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=gridsolution
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,376 @@
|
|||||||
|
/* This example illustrates using separate grid
|
||||||
|
* and solution files.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include "MASTER.h" /* for defintion of NULL */
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
/* DOCSTART:gridsolution_grid_tecini.txt*/
|
||||||
|
INTEGER4 I; /* use to check return values */
|
||||||
|
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 0;
|
||||||
|
INTEGER4 FileType = 1; /* 1 = grid file. */
|
||||||
|
|
||||||
|
I = TECINI112((char*)"Example: Separate grid and solution files",
|
||||||
|
(char*)"X Y Z", /* Defines the variables for the data file.
|
||||||
|
* Each zone must contain each of the vars
|
||||||
|
* listed here. The order of the variables
|
||||||
|
* in the list is used to define the
|
||||||
|
* variable number (e.g. X is Variable 1).
|
||||||
|
* When referring to variables in other
|
||||||
|
* TecIO functions, you will refer to the
|
||||||
|
* variable by its number.
|
||||||
|
*/
|
||||||
|
(char*)"grid.plt",
|
||||||
|
(char*)".", /* scratch directory */
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_grid_teczne.txt*/
|
||||||
|
/* TECZNE Parameters */
|
||||||
|
INTEGER4 ZoneType = 7; /* FE Polyhedron */
|
||||||
|
INTEGER4 NumPts = 20; /* the number of unique
|
||||||
|
* nodes in the zone.
|
||||||
|
*/
|
||||||
|
INTEGER4 NumElems = 1;
|
||||||
|
INTEGER4 NumFaces = 12; /* the number of unique
|
||||||
|
* faces in the zone.
|
||||||
|
*/
|
||||||
|
INTEGER4 ICellMax = 0; /* not used */
|
||||||
|
INTEGER4 JCellMax = 0; /* not used */
|
||||||
|
INTEGER4 KCellMax = 0; /* not used */
|
||||||
|
double SolutionTime = 0.0;
|
||||||
|
INTEGER4 StrandID = 1; /* time strand for
|
||||||
|
* unsteady solution.
|
||||||
|
*/
|
||||||
|
INTEGER4 ParentZone = 0;
|
||||||
|
INTEGER4 IsBlock = 1;
|
||||||
|
INTEGER4 NumFaceConnections = 0;
|
||||||
|
INTEGER4 FaceNeighborMode = 1;
|
||||||
|
INTEGER4 SharConn = 0;
|
||||||
|
|
||||||
|
/* For this zone, the total number of face nodes is
|
||||||
|
* five times number of faces, because each face
|
||||||
|
* is a pentagon.
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumFaceNodes = 5 * NumFaces;
|
||||||
|
|
||||||
|
/* This zone has no connected boundary faces.
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumBndryFaces = 0;
|
||||||
|
INTEGER4 TotalNumBndryConns = 0;
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Dodecahedron", /* Name of the zone. */
|
||||||
|
&ZoneType,
|
||||||
|
&NumPts,
|
||||||
|
&NumElems,
|
||||||
|
&NumFaces,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolutionTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZone,
|
||||||
|
&IsBlock,
|
||||||
|
&NumFaceConnections,
|
||||||
|
&FaceNeighborMode,
|
||||||
|
&TotalNumFaceNodes,
|
||||||
|
&TotalNumBndryFaces,
|
||||||
|
&TotalNumBndryConns,
|
||||||
|
NULL,
|
||||||
|
NULL, /* All nodal variables */
|
||||||
|
NULL,
|
||||||
|
&SharConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_grid_tecdat.txt*/
|
||||||
|
|
||||||
|
/* TECDAT Parameters */
|
||||||
|
double Phi = 0.5 * (1.0 + sqrt(5.0));
|
||||||
|
double Pi = 3.141592653578;
|
||||||
|
double *X = new double[NumPts];
|
||||||
|
double *Y = new double[NumPts];
|
||||||
|
double *Z = new double[NumPts];
|
||||||
|
int Count = 0;
|
||||||
|
|
||||||
|
for(int J = 0; J <= 4; J++)
|
||||||
|
{
|
||||||
|
X[Count] = 2.0 * cos(2.0 / 5.0 * Pi * J);
|
||||||
|
Y[Count] = 2.0 * sin(2.0 / 5.0 * Pi * J);
|
||||||
|
Z[Count] = Phi + 1.0;
|
||||||
|
Count++;
|
||||||
|
|
||||||
|
X[Count] = -X[Count - 1];
|
||||||
|
Y[Count] = -Y[Count - 1];
|
||||||
|
Z[Count] = -Z[Count - 1];
|
||||||
|
Count++;
|
||||||
|
|
||||||
|
X[Count] = 2.0 * Phi * cos(2.0 / 5.0 * Pi * J);
|
||||||
|
Y[Count] = 2.0 * Phi * sin(2.0 / 5.0 * Pi * J);
|
||||||
|
Z[Count] = Phi - 1.0;
|
||||||
|
Count++;
|
||||||
|
|
||||||
|
X[Count] = -X[Count - 1];
|
||||||
|
Y[Count] = -Y[Count - 1];
|
||||||
|
Z[Count] = -Z[Count - 1];
|
||||||
|
Count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
INTEGER4 IsDouble = 1;
|
||||||
|
|
||||||
|
I = TECDAT112(&NumPts, X, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts, Y, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts, Z, &IsDouble);
|
||||||
|
|
||||||
|
delete X;
|
||||||
|
delete Y;
|
||||||
|
delete Z;
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_grid_facenodes.txt*/
|
||||||
|
/* TecPoly Parameters */
|
||||||
|
|
||||||
|
/* Create a FaceNodes array, dimensioned by the total number
|
||||||
|
* of face nodes in the zone.
|
||||||
|
*/
|
||||||
|
INTEGER4 *FaceNodes = new INTEGER4[TotalNumFaceNodes];
|
||||||
|
int n = 0;
|
||||||
|
|
||||||
|
/* Face Nodes for face 1 of the dodecahedron */
|
||||||
|
FaceNodes[n++] = 2;
|
||||||
|
FaceNodes[n++] = 6;
|
||||||
|
FaceNodes[n++] = 10;
|
||||||
|
FaceNodes[n++] = 14;
|
||||||
|
FaceNodes[n++] = 18;
|
||||||
|
|
||||||
|
/* Face Nodes for face 2 */
|
||||||
|
FaceNodes[n++] = 6;
|
||||||
|
FaceNodes[n++] = 8;
|
||||||
|
FaceNodes[n++] = 19;
|
||||||
|
FaceNodes[n++] = 12;
|
||||||
|
FaceNodes[n++] = 10;
|
||||||
|
|
||||||
|
/* Face Nodes for face 3 */
|
||||||
|
FaceNodes[n++] = 3;
|
||||||
|
FaceNodes[n++] = 12;
|
||||||
|
FaceNodes[n++] = 10;
|
||||||
|
FaceNodes[n++] = 14;
|
||||||
|
FaceNodes[n++] = 16;
|
||||||
|
|
||||||
|
/* Face Nodes for face 4 */
|
||||||
|
FaceNodes[n++] = 7;
|
||||||
|
FaceNodes[n++] = 16;
|
||||||
|
FaceNodes[n++] = 14;
|
||||||
|
FaceNodes[n++] = 18;
|
||||||
|
FaceNodes[n++] = 20;
|
||||||
|
|
||||||
|
/* Face Nodes for face 5 */
|
||||||
|
FaceNodes[n++] = 2;
|
||||||
|
FaceNodes[n++] = 4;
|
||||||
|
FaceNodes[n++] = 11;
|
||||||
|
FaceNodes[n++] = 20;
|
||||||
|
FaceNodes[n++] = 18;
|
||||||
|
|
||||||
|
/* Face Nodes for face 6 */
|
||||||
|
FaceNodes[n++] = 2;
|
||||||
|
FaceNodes[n++] = 4;
|
||||||
|
FaceNodes[n++] = 15;
|
||||||
|
FaceNodes[n++] = 8;
|
||||||
|
FaceNodes[n++] = 6;
|
||||||
|
|
||||||
|
/* Face Nodes for face 7 */
|
||||||
|
FaceNodes[n++] = 1;
|
||||||
|
FaceNodes[n++] = 3;
|
||||||
|
FaceNodes[n++] = 12;
|
||||||
|
FaceNodes[n++] = 19;
|
||||||
|
FaceNodes[n++] = 17;
|
||||||
|
|
||||||
|
/* Face Nodes for face 8 */
|
||||||
|
FaceNodes[n++] = 1;
|
||||||
|
FaceNodes[n++] = 3;
|
||||||
|
FaceNodes[n++] = 16;
|
||||||
|
FaceNodes[n++] = 7;
|
||||||
|
FaceNodes[n++] = 5;
|
||||||
|
|
||||||
|
/* Face Nodes for face 9 */
|
||||||
|
FaceNodes[n++] = 5;
|
||||||
|
FaceNodes[n++] = 7;
|
||||||
|
FaceNodes[n++] = 20;
|
||||||
|
FaceNodes[n++] = 11;
|
||||||
|
FaceNodes[n++] = 9;
|
||||||
|
|
||||||
|
/* Face Nodes for face 10 */
|
||||||
|
FaceNodes[n++] = 4;
|
||||||
|
FaceNodes[n++] = 11;
|
||||||
|
FaceNodes[n++] = 9;
|
||||||
|
FaceNodes[n++] = 13;
|
||||||
|
FaceNodes[n++] = 15;
|
||||||
|
|
||||||
|
/* Face Nodes for face 11 */
|
||||||
|
FaceNodes[n++] = 8;
|
||||||
|
FaceNodes[n++] = 15;
|
||||||
|
FaceNodes[n++] = 13;
|
||||||
|
FaceNodes[n++] = 17;
|
||||||
|
FaceNodes[n++] = 19;
|
||||||
|
|
||||||
|
/* Face Nodes for face 12 */
|
||||||
|
FaceNodes[n++] = 1;
|
||||||
|
FaceNodes[n++] = 5;
|
||||||
|
FaceNodes[n++] = 9;
|
||||||
|
FaceNodes[n++] = 13;
|
||||||
|
FaceNodes[n++] = 17;
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Specify the number of nodes for each face, and the right and
|
||||||
|
* left neighboring elements. The neighboring elements can be
|
||||||
|
* determined using the right-hand rule. For each face, curl
|
||||||
|
* the fingers of your right hand in the direction of
|
||||||
|
* incrementing node numbers (i.e. from Node 1 to Node 2 and
|
||||||
|
* so on). Your thumb will point toward the right element.
|
||||||
|
* A value of zero indicates that there is no
|
||||||
|
* neighboring element on that side. A negative value
|
||||||
|
* indicates that the neighboring element is in another zone.
|
||||||
|
* In that case, the number is a pointer into the
|
||||||
|
* FaceBndryConnectionElems and FaceBndryConnectionZones arrays.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_grid_tecpoly.txt*/
|
||||||
|
INTEGER4 *FaceNodeCounts = new INTEGER4[NumFaces];
|
||||||
|
INTEGER4 *FaceLeftElems = new INTEGER4[NumFaces];
|
||||||
|
INTEGER4 *FaceRightElems = new INTEGER4[NumFaces];
|
||||||
|
|
||||||
|
/* For this particular zone, each face has the 5 nodes. */
|
||||||
|
for(int J = 0; J < NumFaces; J++)
|
||||||
|
FaceNodeCounts[J] = 5;
|
||||||
|
|
||||||
|
/* Set the right and left elements for each face. */
|
||||||
|
FaceRightElems[0] = 1;
|
||||||
|
FaceRightElems[1] = 1;
|
||||||
|
FaceRightElems[2] = 0;
|
||||||
|
FaceRightElems[3] = 0;
|
||||||
|
FaceRightElems[4] = 0;
|
||||||
|
FaceRightElems[5] = 1;
|
||||||
|
FaceRightElems[6] = 1;
|
||||||
|
FaceRightElems[7] = 0;
|
||||||
|
FaceRightElems[8] = 0;
|
||||||
|
FaceRightElems[9] = 1;
|
||||||
|
FaceRightElems[10] = 1;
|
||||||
|
FaceRightElems[11] = 0;
|
||||||
|
|
||||||
|
FaceLeftElems[0] = 0;
|
||||||
|
FaceLeftElems[1] = 0;
|
||||||
|
FaceLeftElems[2] = 1;
|
||||||
|
FaceLeftElems[3] = 1;
|
||||||
|
FaceLeftElems[4] = 1;
|
||||||
|
FaceLeftElems[5] = 0;
|
||||||
|
FaceLeftElems[6] = 0;
|
||||||
|
FaceLeftElems[7] = 1;
|
||||||
|
FaceLeftElems[8] = 1;
|
||||||
|
FaceLeftElems[9] = 0;
|
||||||
|
FaceLeftElems[10] = 0;
|
||||||
|
FaceLeftElems[11] = 1;
|
||||||
|
|
||||||
|
I = TECPOLY112(FaceNodeCounts,
|
||||||
|
FaceNodes,
|
||||||
|
FaceLeftElems,
|
||||||
|
FaceRightElems,
|
||||||
|
NULL, /* No boundary connections. */
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
delete FaceNodes;
|
||||||
|
delete FaceLeftElems;
|
||||||
|
delete FaceRightElems;
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_grid_tecend.txt*/
|
||||||
|
I = TECEND112();
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_solution_tecini.txt*/
|
||||||
|
for(int J = 0; J < 5; J++)
|
||||||
|
{
|
||||||
|
char SolutionFileName[128];
|
||||||
|
sprintf(SolutionFileName, "solution%d.plt", J);
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_solution_tecini.txt*/
|
||||||
|
FileType = 2; /* 1 = solution file. */
|
||||||
|
|
||||||
|
I = TECINI112((char*)"Example: Separate grid and solution files",
|
||||||
|
(char*)"P T", /* Defines the variables for the solution file.
|
||||||
|
* Note that these are different variables from
|
||||||
|
* the grid file.
|
||||||
|
*/
|
||||||
|
SolutionFileName,
|
||||||
|
(char*)".", /* scratch directory */
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_solution_teczne.txt*/
|
||||||
|
/* TECZNE Parameters are mostly unchanged from creation of the grid file. */
|
||||||
|
TotalNumFaceNodes = 0;
|
||||||
|
SolutionTime = J;
|
||||||
|
|
||||||
|
char ZoneName[128];
|
||||||
|
sprintf(ZoneName, "Dodecahedron Time=%g", SolutionTime);
|
||||||
|
I = TECZNE112(ZoneName,
|
||||||
|
&ZoneType,
|
||||||
|
&NumPts,
|
||||||
|
&NumElems,
|
||||||
|
&NumFaces,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolutionTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZone,
|
||||||
|
&IsBlock,
|
||||||
|
&NumFaceConnections,
|
||||||
|
&FaceNeighborMode,
|
||||||
|
&TotalNumFaceNodes,
|
||||||
|
&TotalNumBndryFaces,
|
||||||
|
&TotalNumBndryConns,
|
||||||
|
NULL,
|
||||||
|
NULL, /* All nodal variables */
|
||||||
|
NULL,
|
||||||
|
&SharConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_solution_tecdat.txt*/
|
||||||
|
|
||||||
|
/* TECDAT Parameters */
|
||||||
|
double *P = new double[NumPts];
|
||||||
|
double *T = new double[NumPts];
|
||||||
|
|
||||||
|
for(int K = 0; K < NumPts; K++)
|
||||||
|
{
|
||||||
|
P[K] = (double)(K + J);
|
||||||
|
T[K] = 1.0 + K + K;
|
||||||
|
}
|
||||||
|
|
||||||
|
I = TECDAT112(&NumPts, P, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts, T, &IsDouble);
|
||||||
|
|
||||||
|
delete P;
|
||||||
|
delete T;
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:gridsolution_solution_tecend.txt*/
|
||||||
|
I = TECEND112();
|
||||||
|
/* DOCEND */
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@ -0,0 +1,321 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="gridsolution"
|
||||||
|
ProjectGUID="{D2747EA6-7807-42E1-984D-C946B3D97D95}"
|
||||||
|
RootNamespace="mulitplepolygons"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
<Platform
|
||||||
|
Name="x64"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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="Debug|x64"
|
||||||
|
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
TargetEnvironment="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|x64"
|
||||||
|
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
TargetEnvironment="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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=".\gridsolution.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=ij_ordered
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,149 @@
|
|||||||
|
/* This example creates a simple set of IJ-ordered zones */
|
||||||
|
/* DOCSTART:ij_ordered.txt*/
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include "MASTER.h" /* for defintion of NULL */
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 0;
|
||||||
|
INTEGER4 FileType = 0;
|
||||||
|
INTEGER4 I = 0; /* Used to track return codes */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Open the file and write the tecplot datafile
|
||||||
|
* header information
|
||||||
|
*/
|
||||||
|
I = TECINI112((char*)"IJ Ordered Zones", /* Name of the entire
|
||||||
|
* dataset.
|
||||||
|
*/
|
||||||
|
(char*)"X Y P", /* Defines the variables for the data
|
||||||
|
* file. Each zone must contain each of
|
||||||
|
* the variables listed here. The order
|
||||||
|
* of the variables in the list is used
|
||||||
|
* to define the variable number (e.g.
|
||||||
|
* X is Var 1).
|
||||||
|
*/
|
||||||
|
(char*)"ij_ordered.plt",
|
||||||
|
(char*)".", /* Scratch Directory */
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
|
||||||
|
float X1[4];
|
||||||
|
float Y1[4];
|
||||||
|
float P1[4];
|
||||||
|
float X2[4];
|
||||||
|
float Y2[4];
|
||||||
|
float P2[4];
|
||||||
|
|
||||||
|
INTEGER4 ICellMax = 0;
|
||||||
|
INTEGER4 JCellMax = 0;
|
||||||
|
INTEGER4 KCellMax = 0;
|
||||||
|
INTEGER4 DIsDouble = 0;
|
||||||
|
double SolTime = 360.0;
|
||||||
|
INTEGER4 StrandID = 0; /* StaticZone */
|
||||||
|
INTEGER4 ParentZn = 0;
|
||||||
|
INTEGER4 IsBlock = 1; /* Block */
|
||||||
|
INTEGER4 NFConns = 0;
|
||||||
|
INTEGER4 FNMode = 0;
|
||||||
|
INTEGER4 TotalNumFaceNodes = 1;
|
||||||
|
INTEGER4 TotalNumBndryFaces = 1;
|
||||||
|
INTEGER4 TotalNumBndryConnections = 1;
|
||||||
|
INTEGER4 ShrConn = 0;
|
||||||
|
|
||||||
|
/*Ordered Zone Parameters*/
|
||||||
|
INTEGER4 IMax = 2;
|
||||||
|
INTEGER4 JMax = 2;
|
||||||
|
INTEGER4 KMax = 1;
|
||||||
|
|
||||||
|
X1[0] = .125;
|
||||||
|
Y1[0] = .5;
|
||||||
|
P1[0] = 5;
|
||||||
|
|
||||||
|
X1[1] = .625;
|
||||||
|
Y1[1] = .5;
|
||||||
|
P1[1] = 7.5;
|
||||||
|
|
||||||
|
X1[2] = .125;
|
||||||
|
Y1[2] = .875;
|
||||||
|
P1[2] = 10;
|
||||||
|
|
||||||
|
X1[3] = .625;
|
||||||
|
Y1[3] = .875;
|
||||||
|
P1[3] = 7.5;
|
||||||
|
|
||||||
|
X2[0] = .375;
|
||||||
|
Y2[0] = .125;
|
||||||
|
P2[0] = 5;
|
||||||
|
|
||||||
|
X2[1] = .875;
|
||||||
|
Y2[1] = .125;
|
||||||
|
P2[1] = 7.5;
|
||||||
|
|
||||||
|
X2[2] = .375;
|
||||||
|
Y2[2] = .5;
|
||||||
|
P2[2] = 10;
|
||||||
|
|
||||||
|
X2[3] = .875;
|
||||||
|
Y2[3] = .5;
|
||||||
|
P2[3] = 7.5;
|
||||||
|
|
||||||
|
/* Ordered Zone */
|
||||||
|
INTEGER4 ZoneType = 0;
|
||||||
|
I = TECZNE112((char*)"Ordered Zone",
|
||||||
|
&ZoneType,
|
||||||
|
&IMax,
|
||||||
|
&JMax,
|
||||||
|
&KMax,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZn,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
&TotalNumFaceNodes,
|
||||||
|
&TotalNumBndryFaces,
|
||||||
|
&TotalNumBndryConnections,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&ShrConn);
|
||||||
|
INTEGER4 III = IMax * JMax * KMax;
|
||||||
|
I = TECDAT112(&III, X1, &DIsDouble);
|
||||||
|
I = TECDAT112(&III, Y1, &DIsDouble);
|
||||||
|
I = TECDAT112(&III, P1, &DIsDouble);
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Ordered Zone2",
|
||||||
|
&ZoneType,
|
||||||
|
&IMax,
|
||||||
|
&JMax,
|
||||||
|
&KMax,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZn,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
&TotalNumFaceNodes,
|
||||||
|
&TotalNumBndryFaces,
|
||||||
|
&TotalNumBndryConnections,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&ShrConn);
|
||||||
|
|
||||||
|
I = TECDAT112(&III, X2, &DIsDouble);
|
||||||
|
I = TECDAT112(&III, Y2, &DIsDouble);
|
||||||
|
I = TECDAT112(&III, P2, &DIsDouble);
|
||||||
|
|
||||||
|
I = TECEND112();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/* DOCEND */
|
||||||
Binary file not shown.
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="ij_ordered"
|
||||||
|
ProjectGUID="{47556A00-C441-4B9A-8920-91CA63AC1595}"
|
||||||
|
RootNamespace="ij_ordered"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ij_ordered.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=multiplefiles
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,214 @@
|
|||||||
|
/* This example illustrates working with TecFil to create multiple
|
||||||
|
* plt files simultaneously.
|
||||||
|
*/
|
||||||
|
#if defined _MSC_VER
|
||||||
|
#pragma warning (disable: 4996) /* Windows strcpy warning off */
|
||||||
|
#endif
|
||||||
|
/* DOCSTART:mulitplefiles.txt */
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include "MASTER.h" /* for defintion of NULL */
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Open the file and write the tecplot datafile
|
||||||
|
* header information
|
||||||
|
*/
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 0;
|
||||||
|
INTEGER4 FileType = 0;
|
||||||
|
INTEGER4 I = 0; /* Used to check the return value */
|
||||||
|
|
||||||
|
I = TECINI112((char*)"SIMPLE DATASET", /* Name of the entire dataset.*/
|
||||||
|
|
||||||
|
(char*)"X1 Y1 P1", /* Defines the variables for the data
|
||||||
|
* file. Each zone must contain each of
|
||||||
|
* the variables listed here. The order
|
||||||
|
* of the variables in the list is used
|
||||||
|
* to define the variable number (e.g.
|
||||||
|
* X1 is Var 1).
|
||||||
|
*/
|
||||||
|
(char*)"file1.plt",
|
||||||
|
(char*)".", /* Scratch Directory */
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
|
||||||
|
/* Set the parameters for TecZne */
|
||||||
|
INTEGER4 ZoneType = 0; /* sets the zone type to
|
||||||
|
* ordered
|
||||||
|
*/
|
||||||
|
INTEGER4 IMax = 2; /* Create an IJ-ordered zone,
|
||||||
|
* by using IMax and JMax
|
||||||
|
* values that are greater
|
||||||
|
* than one, and setting KMax
|
||||||
|
* to one.
|
||||||
|
*/
|
||||||
|
INTEGER4 JMax = 2;
|
||||||
|
INTEGER4 KMax = 1;
|
||||||
|
|
||||||
|
double SolTime = 0;
|
||||||
|
INTEGER4 StrandID = 0; /* StaticZone */
|
||||||
|
INTEGER4 ParentZn = 0; /* used for surface streams */
|
||||||
|
|
||||||
|
INTEGER4 ICellMax = 0; /* not used */
|
||||||
|
INTEGER4 JCellMax = 0; /* not used */
|
||||||
|
INTEGER4 KCellMax = 0; /* not used */
|
||||||
|
|
||||||
|
INTEGER4 IsBlock = 1; /* Block */
|
||||||
|
|
||||||
|
INTEGER4 NFConns = 0; /* this example does not use
|
||||||
|
* face neighbors */
|
||||||
|
INTEGER4 FNMode = 0;
|
||||||
|
INTEGER4 TotalNumFaceNodes = 1;
|
||||||
|
INTEGER4 TotalNumBndryFaces = 1;
|
||||||
|
INTEGER4 TotalNumBndryConn = 1;
|
||||||
|
INTEGER4 ShrConn = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/* Create an Ordered Zone */
|
||||||
|
I = TECZNE112((char*)"Ordered Zone",
|
||||||
|
&ZoneType,
|
||||||
|
&IMax,
|
||||||
|
&JMax,
|
||||||
|
&KMax,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZn,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
&TotalNumFaceNodes,
|
||||||
|
&TotalNumBndryFaces,
|
||||||
|
&TotalNumBndryConn,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&ShrConn);
|
||||||
|
|
||||||
|
/* Set the variable values for the ordered zone. */
|
||||||
|
float X1[4];
|
||||||
|
float Y1[4];
|
||||||
|
float P1[4];
|
||||||
|
|
||||||
|
X1[0] = 0.125;
|
||||||
|
Y1[0] = 0.5;
|
||||||
|
P1[0] = 7.5;
|
||||||
|
|
||||||
|
X1[1] = 0.625;
|
||||||
|
Y1[1] = 0.5;
|
||||||
|
P1[1] = 10.0;
|
||||||
|
|
||||||
|
X1[2] = 0.125;
|
||||||
|
Y1[2] = 0.875;
|
||||||
|
P1[2] = 5.0;
|
||||||
|
|
||||||
|
X1[3] = 0.625;
|
||||||
|
Y1[3] = 0.875;
|
||||||
|
P1[3] = 7.5;
|
||||||
|
|
||||||
|
INTEGER4 DIsDouble = 0; /* set DIsDouble to 0, for float
|
||||||
|
* values.
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 III = IMax * JMax * KMax;
|
||||||
|
I = TECDAT112(&III, X1, &DIsDouble);
|
||||||
|
I = TECDAT112(&III, Y1, &DIsDouble);
|
||||||
|
I = TECDAT112(&III, P1, &DIsDouble);
|
||||||
|
|
||||||
|
/* Open a new data file. note: the first file is still open
|
||||||
|
* because TecEnd was not called.
|
||||||
|
*/
|
||||||
|
I = TECINI112((char*)"Auxiliary Data",
|
||||||
|
(char*)"X1 Y1 P1",
|
||||||
|
(char*)"file2.plt",
|
||||||
|
(char*)".",
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
|
||||||
|
/* Switch the active file to the newly created data file
|
||||||
|
* (file2.plt) which is the second file opened with TECINI112
|
||||||
|
* so we use 2.
|
||||||
|
*/
|
||||||
|
INTEGER4 WhichFile = 2;
|
||||||
|
I = TECFIL112(&WhichFile);
|
||||||
|
|
||||||
|
/* Create a second zone, using many of the values from the first
|
||||||
|
* zone, and write it to the second data file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Ordered Zone2",
|
||||||
|
&ZoneType,
|
||||||
|
&IMax,
|
||||||
|
&JMax,
|
||||||
|
&KMax,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZn,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
&TotalNumFaceNodes,
|
||||||
|
&TotalNumBndryFaces,
|
||||||
|
&TotalNumBndryConn,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&ShrConn);
|
||||||
|
/* set the variable values for the second zone */
|
||||||
|
float X2[4];
|
||||||
|
float Y2[4];
|
||||||
|
float P2[4];
|
||||||
|
|
||||||
|
X2[0] = 0.375;
|
||||||
|
Y2[0] = 0.125;
|
||||||
|
P2[0] = 5;
|
||||||
|
|
||||||
|
X2[1] = 0.875;
|
||||||
|
Y2[1] = 0.125;
|
||||||
|
P2[1] = 7.5;
|
||||||
|
|
||||||
|
X2[2] = 0.375;
|
||||||
|
Y2[2] = 0.5;
|
||||||
|
P2[2] = 10;
|
||||||
|
|
||||||
|
Y2[3] = 0.5;
|
||||||
|
X2[3] = 0.875;
|
||||||
|
P2[3] = 7.5;
|
||||||
|
|
||||||
|
III = IMax * JMax * KMax;
|
||||||
|
I = TECDAT112(&III, X2, &DIsDouble);
|
||||||
|
I = TECDAT112(&III, Y2, &DIsDouble);
|
||||||
|
I = TECDAT112(&III, P2, &DIsDouble);
|
||||||
|
|
||||||
|
/* Switch to the first file. */
|
||||||
|
WhichFile = 1;
|
||||||
|
I = TECFIL112(&WhichFile);
|
||||||
|
|
||||||
|
/* Create an auxiliary data value and write it to the file */
|
||||||
|
char DeformationValue[128];
|
||||||
|
strcpy(DeformationValue, "0.98");
|
||||||
|
|
||||||
|
I = TECAUXSTR112((char*)"DeformationValue",
|
||||||
|
DeformationValue);
|
||||||
|
/* Close the first file */
|
||||||
|
I = TECEND112();
|
||||||
|
|
||||||
|
/* The remaining file will become the active file. As such,
|
||||||
|
* TecFil does not need to be called again to close the second
|
||||||
|
* file.
|
||||||
|
*/
|
||||||
|
I = TECEND112();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="multiplefiles"
|
||||||
|
ProjectGUID="{93CB23B2-530F-4D6F-900F-893815299C7F}"
|
||||||
|
RootNamespace="multiplefiles"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\multiplefiles.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
Binary file not shown.
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=multiplepolygons
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,569 @@
|
|||||||
|
/* This example illustrates using TecPoly to create two polygonal
|
||||||
|
* zones. The first zone contains six hexagons, and the second
|
||||||
|
* zone contains a hexagon and an octagon. Refer to the Data
|
||||||
|
* Format Guide for a picture of the configuration, including node
|
||||||
|
* and face numbers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include "MASTER.h" /* for defintion of NULL */
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
/* DOCSTART:hexagons_tecini.txt*/
|
||||||
|
INTEGER4 I; /* use to check return values */
|
||||||
|
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 0;
|
||||||
|
INTEGER4 FileType = 0;
|
||||||
|
|
||||||
|
I = TECINI112((char*)"Example: Multiple polygonal zones",
|
||||||
|
(char*)"X Y P", /* Defines the variables for the data file.
|
||||||
|
* Each zone must contain each of the vars
|
||||||
|
* listed here. The order of the variables
|
||||||
|
* in the list is used to define the
|
||||||
|
* variable number (e.g. X is Variable 1).
|
||||||
|
* When referring to variables in other
|
||||||
|
* TecIO functions, you will refer to the
|
||||||
|
* variable by its number.
|
||||||
|
*/
|
||||||
|
(char*)"HexagonsAndOctagon.plt",
|
||||||
|
(char*)".", /* scratch directory */
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:hexagons_zone1_teczne.txt*/
|
||||||
|
/* TECZNE Parameters */
|
||||||
|
INTEGER4 ZoneType = 6; /* FE Polygon */
|
||||||
|
INTEGER4 NumPts_Z1 = 13; /* the number of unique
|
||||||
|
* nodes in the zone.
|
||||||
|
*/
|
||||||
|
INTEGER4 NumElems_Z1 = 3;
|
||||||
|
INTEGER4 NumFaces_Z1 = 15; /* the number of unique
|
||||||
|
* faces in the zone.
|
||||||
|
*/
|
||||||
|
INTEGER4 ICellMax = 0; /* not used */
|
||||||
|
INTEGER4 JCellMax = 0; /* not used */
|
||||||
|
INTEGER4 KCellMax = 0; /* not used */
|
||||||
|
double SolutionTime = 0.0;
|
||||||
|
INTEGER4 StrandID = 0;
|
||||||
|
INTEGER4 ParentZone = 0;
|
||||||
|
INTEGER4 IsBlock = 1;
|
||||||
|
INTEGER4 NumFaceConnections = 0;
|
||||||
|
INTEGER4 FaceNeighborMode = 1;
|
||||||
|
INTEGER4 SharConn = 0;
|
||||||
|
|
||||||
|
INTEGER4 ValueLocation[3] = { 1, 1, 0 };
|
||||||
|
|
||||||
|
/* For a polygonal zone, the total number of face nodes is
|
||||||
|
* twice the total number of faces. This is because each face
|
||||||
|
* is composed of exactly two nodes.
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumFaceNodes_Z1 = 2 * NumFaces_Z1;
|
||||||
|
|
||||||
|
/* A boundary face is a face that is neighbored by an element
|
||||||
|
* or elements in another zone or zone(s). In Zone 1, Face 9,
|
||||||
|
* Face 10 and Face 12 have a neighbor in Zone 2. Therefore,
|
||||||
|
* the total number of boundary faces is <20>3<EFBFBD>.
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumBndryFaces_Z1 = 3;
|
||||||
|
|
||||||
|
/* Each boundary face has one or more boundary connections. A
|
||||||
|
* boundary connection is defined as another element in another
|
||||||
|
* zone. Face 9 has a boundary connection with Element 1 in
|
||||||
|
* Zone 2. In this example, each boundary face is connected to
|
||||||
|
* one other element, so the total number of boundary
|
||||||
|
* connections is equivalent to the total number of boundary
|
||||||
|
* faces (3).
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumBndryConns_Z1 = 3;
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Zone 1: 3 Hexagons", /* Specifies the name of
|
||||||
|
* the entire dataset. When
|
||||||
|
* the file is loaded into
|
||||||
|
* Tecplot, the value is
|
||||||
|
* available via the Data
|
||||||
|
* Set Info dialog.
|
||||||
|
*/
|
||||||
|
&ZoneType,
|
||||||
|
&NumPts_Z1,
|
||||||
|
&NumElems_Z1,
|
||||||
|
&NumFaces_Z1,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolutionTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZone,
|
||||||
|
&IsBlock,
|
||||||
|
&NumFaceConnections,
|
||||||
|
&FaceNeighborMode,
|
||||||
|
&TotalNumFaceNodes_Z1,
|
||||||
|
&TotalNumBndryFaces_Z1,
|
||||||
|
&TotalNumBndryConns_Z1,
|
||||||
|
NULL,
|
||||||
|
ValueLocation,
|
||||||
|
NULL,
|
||||||
|
&SharConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:hexagons_zone1_tecdat.txt*/
|
||||||
|
|
||||||
|
/* TECDAT Parameters */
|
||||||
|
double *X_Z1 = new double[NumPts_Z1];
|
||||||
|
double *Y_Z1 = new double[NumPts_Z1];
|
||||||
|
|
||||||
|
X_Z1[0] = 1;
|
||||||
|
Y_Z1[0] = 6;
|
||||||
|
|
||||||
|
X_Z1[1] = 2;
|
||||||
|
Y_Z1[1] = 6;
|
||||||
|
|
||||||
|
X_Z1[2] = 3;
|
||||||
|
Y_Z1[2] = 5;
|
||||||
|
|
||||||
|
X_Z1[3] = 2;
|
||||||
|
Y_Z1[3] = 4;
|
||||||
|
|
||||||
|
X_Z1[4] = 1;
|
||||||
|
Y_Z1[4] = 4;
|
||||||
|
|
||||||
|
X_Z1[5] = 0;
|
||||||
|
Y_Z1[5] = 5;
|
||||||
|
|
||||||
|
X_Z1[6] = 4;
|
||||||
|
Y_Z1[6] = 5;
|
||||||
|
|
||||||
|
X_Z1[7] = 5;
|
||||||
|
Y_Z1[7] = 4;
|
||||||
|
|
||||||
|
X_Z1[8] = 4;
|
||||||
|
Y_Z1[8] = 3;
|
||||||
|
|
||||||
|
X_Z1[9] = 3;
|
||||||
|
Y_Z1[9] = 3;
|
||||||
|
|
||||||
|
X_Z1[10] = 2;
|
||||||
|
Y_Z1[10] = 2;
|
||||||
|
|
||||||
|
X_Z1[11] = 1;
|
||||||
|
Y_Z1[11] = 2;
|
||||||
|
|
||||||
|
X_Z1[12] = 0;
|
||||||
|
Y_Z1[12] = 3;
|
||||||
|
|
||||||
|
|
||||||
|
double *P_Z1 = new double[NumElems_Z1];
|
||||||
|
P_Z1[0] = 2;
|
||||||
|
P_Z1[1] = 4;
|
||||||
|
P_Z1[2] = 5;
|
||||||
|
|
||||||
|
|
||||||
|
INTEGER4 IsDouble = 1;
|
||||||
|
I = TECDAT112(&NumPts_Z1, X_Z1, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts_Z1, Y_Z1, &IsDouble);
|
||||||
|
I = TECDAT112(&NumElems_Z1, P_Z1, &IsDouble);
|
||||||
|
delete X_Z1;
|
||||||
|
delete Y_Z1;
|
||||||
|
delete P_Z1;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:hexagons_zone1_facenodes.txt*/
|
||||||
|
/* TecPoly Parameters */
|
||||||
|
|
||||||
|
/* Create a FaceNodes array, dimensioned by the total number
|
||||||
|
* of face nodes in the zone.
|
||||||
|
*/
|
||||||
|
INTEGER4 *FaceNodes_Z1 = new INTEGER4[TotalNumFaceNodes_Z1];
|
||||||
|
|
||||||
|
/* Face Nodes for Element 1 */
|
||||||
|
FaceNodes_Z1[0] = 1;
|
||||||
|
FaceNodes_Z1[1] = 2;
|
||||||
|
|
||||||
|
FaceNodes_Z1[2] = 2;
|
||||||
|
FaceNodes_Z1[3] = 3;
|
||||||
|
|
||||||
|
FaceNodes_Z1[4] = 3;
|
||||||
|
FaceNodes_Z1[5] = 4;
|
||||||
|
|
||||||
|
FaceNodes_Z1[6] = 4;
|
||||||
|
FaceNodes_Z1[7] = 5;
|
||||||
|
|
||||||
|
FaceNodes_Z1[8] = 5;
|
||||||
|
FaceNodes_Z1[9] = 6;
|
||||||
|
|
||||||
|
FaceNodes_Z1[10] = 6;
|
||||||
|
FaceNodes_Z1[11] = 1;
|
||||||
|
|
||||||
|
/* Face Nodes for Element 2 */
|
||||||
|
FaceNodes_Z1[12] = 3;
|
||||||
|
FaceNodes_Z1[13] = 7;
|
||||||
|
|
||||||
|
FaceNodes_Z1[14] = 7;
|
||||||
|
FaceNodes_Z1[15] = 8;
|
||||||
|
|
||||||
|
FaceNodes_Z1[16] = 8;
|
||||||
|
FaceNodes_Z1[17] = 9;
|
||||||
|
|
||||||
|
FaceNodes_Z1[18] = 9;
|
||||||
|
FaceNodes_Z1[19] = 10;
|
||||||
|
|
||||||
|
FaceNodes_Z1[20] = 10;
|
||||||
|
FaceNodes_Z1[21] = 4;
|
||||||
|
|
||||||
|
/* Face Nodes for Element 3 */
|
||||||
|
FaceNodes_Z1[22] = 10;
|
||||||
|
FaceNodes_Z1[23] = 11;
|
||||||
|
|
||||||
|
FaceNodes_Z1[24] = 11;
|
||||||
|
FaceNodes_Z1[25] = 12;
|
||||||
|
|
||||||
|
FaceNodes_Z1[26] = 12;
|
||||||
|
FaceNodes_Z1[27] = 13;
|
||||||
|
|
||||||
|
FaceNodes_Z1[28] = 13;
|
||||||
|
FaceNodes_Z1[29] = 5;
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Specify the right and left neighboring elements.
|
||||||
|
* The neighboring elements can be determined using the
|
||||||
|
* right-hand rule. For each face, place your right-hand along
|
||||||
|
* the face with your fingers pointing the direction of
|
||||||
|
* incrementing node numbers (i.e. from Node 1 to Node 2). The
|
||||||
|
* right side of your hand will indicate the right element,
|
||||||
|
* and the left side of your hand will indicate the left
|
||||||
|
* element. A value of zero indicates that there is no
|
||||||
|
* neighboring element on that side. A negative value
|
||||||
|
* indicates that the neighboring element is in another zone.
|
||||||
|
* The number is a pointer into the FaceBndryConnectionElems
|
||||||
|
* and FaceBndryConnectionZones arrays.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DOCSTART:hexagons_zone1_neighbors.txt*/
|
||||||
|
INTEGER4 *FaceLeftElems_Z1 = new INTEGER4[NumFaces_Z1];
|
||||||
|
INTEGER4 *FaceRightElems_Z1 = new INTEGER4[NumFaces_Z1];
|
||||||
|
|
||||||
|
/* Left Face Elems for Element 1 */
|
||||||
|
FaceLeftElems_Z1[0] = 0;
|
||||||
|
FaceLeftElems_Z1[1] = 0;
|
||||||
|
FaceLeftElems_Z1[2] = 2;
|
||||||
|
FaceLeftElems_Z1[3] = 3;
|
||||||
|
FaceLeftElems_Z1[4] = 0;
|
||||||
|
|
||||||
|
/* Left Face Elems for Element 2 */
|
||||||
|
FaceLeftElems_Z1[5] = 0;
|
||||||
|
FaceLeftElems_Z1[6] = 0;
|
||||||
|
FaceLeftElems_Z1[7] = 0;
|
||||||
|
FaceLeftElems_Z1[8] = -1;
|
||||||
|
FaceLeftElems_Z1[9] = -2;
|
||||||
|
FaceLeftElems_Z1[10] = 2;
|
||||||
|
|
||||||
|
/* Left Face Elems for Element 3 */
|
||||||
|
FaceLeftElems_Z1[11] = -3;
|
||||||
|
FaceLeftElems_Z1[12] = 0;
|
||||||
|
FaceLeftElems_Z1[13] = 0;
|
||||||
|
FaceLeftElems_Z1[14] = 0;
|
||||||
|
|
||||||
|
/* Set Right Face Elems. Because of the way we numbered the
|
||||||
|
* nodes and faces, the right element for every face is the
|
||||||
|
* element itself.
|
||||||
|
*/
|
||||||
|
for (INTEGER4 ii = 0; ii < 6; ii++)
|
||||||
|
FaceRightElems_Z1[ii] = 1;
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 6; ii < 10; ii++)
|
||||||
|
FaceRightElems_Z1[ii] = 2;
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 10; ii <= 14; ii++)
|
||||||
|
FaceRightElems_Z1[ii] = 3;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:hexagons_zone1_tecpoly.txt */
|
||||||
|
|
||||||
|
/* The FaceBndryConnectionCounts array is used to define the
|
||||||
|
* number of boundary connections for each face that has a
|
||||||
|
* boundary connection. For example, if a zone has three
|
||||||
|
* boundary connections in total (NumConnectedBoundaryFaces),
|
||||||
|
* two of those boundary connections are in one face, and the
|
||||||
|
* remaining boundary connection is in a second face, the
|
||||||
|
* FaceBndryConnectionCounts array would be: [2 1].
|
||||||
|
*
|
||||||
|
* In this example, the total number of connected boundary
|
||||||
|
* faces (specified via TECZNE) is equal to three. Each
|
||||||
|
* boundary face is connected to only one other element,
|
||||||
|
* so the FaceBoundaryConnectionCounts array is (1, 1, 1).
|
||||||
|
*/
|
||||||
|
INTEGER4 FaceBndryConnectionCounts_Z1[3] = {1, 1, 1};
|
||||||
|
|
||||||
|
/* The value(s) in the FaceBndryConnectionElems and
|
||||||
|
* FaceBndryConnectionZones arrays specifies the element number
|
||||||
|
* and zone number, respectively, that a given boundary
|
||||||
|
* connection is connected to. In this case, the first
|
||||||
|
* boundary connection face is connected to Element 1 in Zone 2
|
||||||
|
* and the remaining connection is to Element 2 in Zone 2.
|
||||||
|
*/
|
||||||
|
INTEGER4 FaceBndryConnectionElems_Z1[3] = {1, 2, 2};
|
||||||
|
INTEGER4 FaceBndryConnectionZones_Z1[3] = {2, 2, 2};
|
||||||
|
|
||||||
|
|
||||||
|
I = TECPOLY112(NULL, /* Not used for polygon zones */
|
||||||
|
FaceNodes_Z1,
|
||||||
|
FaceLeftElems_Z1,
|
||||||
|
FaceRightElems_Z1,
|
||||||
|
FaceBndryConnectionCounts_Z1,
|
||||||
|
FaceBndryConnectionElems_Z1,
|
||||||
|
FaceBndryConnectionZones_Z1);
|
||||||
|
|
||||||
|
delete FaceNodes_Z1;
|
||||||
|
delete FaceLeftElems_Z1;
|
||||||
|
delete FaceRightElems_Z1;
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Define Zone 2. Zone 2 contains an octagon and a hexagon. */
|
||||||
|
/* TECZNE Parameters */
|
||||||
|
/* DOCSTART:hexagons_zone2_teczne.txt*/
|
||||||
|
INTEGER4 NumPts_Z2 = 12; /* number of unique
|
||||||
|
* nodes in the zone
|
||||||
|
*/
|
||||||
|
INTEGER4 NumElems_Z2 = 2;
|
||||||
|
INTEGER4 NumFaces_Z2 = 13; /* number of unique
|
||||||
|
* faces in the zone
|
||||||
|
*/
|
||||||
|
INTEGER4 NumFaceConnections_Z2 = 0;
|
||||||
|
/* In polygonal zones, each face has exactly two nodes */
|
||||||
|
INTEGER4 TotalNumFaceNodes_Z2 = NumFaces_Z2 * 2;
|
||||||
|
|
||||||
|
/* A boundary face is a face that is neighbored by an element or
|
||||||
|
* elements from another zone or zone(s). In Zone 2, Face 6,
|
||||||
|
* Face 7 and Face 13 have a neighbor in Zone 1. Therefore, the
|
||||||
|
* total number of boundary faces is <20>3<EFBFBD>.
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumBndryFaces_Z2 = 3;
|
||||||
|
|
||||||
|
/* Each boundary face has one or more boundary connections. In
|
||||||
|
* this example, each boundary face is connected to one other
|
||||||
|
* element (i.e. the number of boundary faces and the number of
|
||||||
|
* boundary connections is one-to-one).
|
||||||
|
*/
|
||||||
|
INTEGER4 TotalNumBndryConns_Z2 = 3;
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Zone 2: 1 Hexagon and 1 Octagon",
|
||||||
|
&ZoneType,
|
||||||
|
&NumPts_Z2,
|
||||||
|
&NumElems_Z2,
|
||||||
|
&NumFaces_Z2,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolutionTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZone,
|
||||||
|
&IsBlock,
|
||||||
|
&NumFaceConnections_Z2,
|
||||||
|
&FaceNeighborMode,
|
||||||
|
&TotalNumFaceNodes_Z2,
|
||||||
|
&TotalNumBndryFaces_Z2,
|
||||||
|
&TotalNumBndryConns_Z2,
|
||||||
|
NULL,
|
||||||
|
ValueLocation,
|
||||||
|
NULL,
|
||||||
|
&SharConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* TECDAT Parameters */
|
||||||
|
/* DOCSTART:hexagons_zone2_tecdat.txt*/
|
||||||
|
double *X_Z2 = new double[NumPts_Z2];
|
||||||
|
double *Y_Z2 = new double[NumPts_Z2];
|
||||||
|
|
||||||
|
X_Z2[0] = 5;
|
||||||
|
Y_Z2[0] = 4;
|
||||||
|
|
||||||
|
X_Z2[1] = 6;
|
||||||
|
Y_Z2[1] = 4;
|
||||||
|
|
||||||
|
X_Z2[2] = 7;
|
||||||
|
Y_Z2[2] = 3;
|
||||||
|
|
||||||
|
X_Z2[3] = 6;
|
||||||
|
Y_Z2[3] = 2;
|
||||||
|
|
||||||
|
X_Z2[4] = 5;
|
||||||
|
Y_Z2[4] = 2;
|
||||||
|
|
||||||
|
X_Z2[5] = 4;
|
||||||
|
Y_Z2[5] = 3;
|
||||||
|
|
||||||
|
|
||||||
|
X_Z2[6] = 3;
|
||||||
|
Y_Z2[6] = 3;
|
||||||
|
|
||||||
|
X_Z2[7] = 5;
|
||||||
|
Y_Z2[7] = 1;
|
||||||
|
|
||||||
|
X_Z2[8] = 4;
|
||||||
|
Y_Z2[8] = 0;
|
||||||
|
|
||||||
|
X_Z2[9] = 3;
|
||||||
|
Y_Z2[9] = 0;
|
||||||
|
|
||||||
|
X_Z2[10] = 2;
|
||||||
|
Y_Z2[10] = 1;
|
||||||
|
|
||||||
|
X_Z2[11] = 2;
|
||||||
|
Y_Z2[11] = 2;
|
||||||
|
|
||||||
|
/* In the call to TecZne, P was set to a cell centered variable.
|
||||||
|
* As such, only two values need to be defined.
|
||||||
|
*/
|
||||||
|
double *P_Z2 = new double[NumPts_Z2];
|
||||||
|
|
||||||
|
P_Z2[0] = 8;
|
||||||
|
P_Z2[1] = 6;
|
||||||
|
|
||||||
|
I = TECDAT112(&NumPts_Z2, X_Z2, &IsDouble);
|
||||||
|
I = TECDAT112(&NumPts_Z2, Y_Z2, &IsDouble);
|
||||||
|
I = TECDAT112(&NumElems_Z2, P_Z2, &IsDouble);
|
||||||
|
|
||||||
|
delete X_Z2;
|
||||||
|
delete Y_Z2;
|
||||||
|
delete P_Z2;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* TecPoly Parameters */
|
||||||
|
/* DOCSTART:hexagons_zone2_facemap.txt*/
|
||||||
|
INTEGER4 *FaceNodes_Z2;
|
||||||
|
FaceNodes_Z2 = new INTEGER4[TotalNumFaceNodes_Z2];
|
||||||
|
|
||||||
|
/* Face Nodes for Element 1 */
|
||||||
|
FaceNodes_Z2[0] = 1;
|
||||||
|
FaceNodes_Z2[1] = 2;
|
||||||
|
|
||||||
|
FaceNodes_Z2[2] = 2;
|
||||||
|
FaceNodes_Z2[3] = 3;
|
||||||
|
|
||||||
|
FaceNodes_Z2[4] = 3;
|
||||||
|
FaceNodes_Z2[5] = 4;
|
||||||
|
|
||||||
|
FaceNodes_Z2[6] = 4;
|
||||||
|
FaceNodes_Z2[7] = 5;
|
||||||
|
|
||||||
|
FaceNodes_Z2[8] = 5;
|
||||||
|
FaceNodes_Z2[9] = 6;
|
||||||
|
|
||||||
|
FaceNodes_Z2[10] = 6;
|
||||||
|
FaceNodes_Z2[11] = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/* Face Nodes for Element 2 */
|
||||||
|
FaceNodes_Z2[12] = 7;
|
||||||
|
FaceNodes_Z2[13] = 6;
|
||||||
|
|
||||||
|
FaceNodes_Z2[14] = 5;
|
||||||
|
FaceNodes_Z2[15] = 8;
|
||||||
|
|
||||||
|
FaceNodes_Z2[16] = 8;
|
||||||
|
FaceNodes_Z2[17] = 9;
|
||||||
|
|
||||||
|
FaceNodes_Z2[18] = 9;
|
||||||
|
FaceNodes_Z2[19] = 10;
|
||||||
|
|
||||||
|
FaceNodes_Z2[20] = 10;
|
||||||
|
FaceNodes_Z2[21] = 11;
|
||||||
|
|
||||||
|
FaceNodes_Z2[22] = 11;
|
||||||
|
FaceNodes_Z2[23] = 12;
|
||||||
|
|
||||||
|
FaceNodes_Z2[24] = 12;
|
||||||
|
FaceNodes_Z2[25] = 7;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
|
||||||
|
/* DOCSTART:hexagons_zone2_tecpoly.txt*/
|
||||||
|
/* Specify the right and left neighboring elements.
|
||||||
|
* The neighboring elements can be determined using the
|
||||||
|
* right-hand rule. For each face, place your right-hand along
|
||||||
|
* the face with your fingers pointing the direction of
|
||||||
|
* incrementing node numbers (i.e. from Node 1 to Node 2). The
|
||||||
|
* right side of your hand will indicate the right element,
|
||||||
|
* and the left side of your hand will indicate the left
|
||||||
|
* element. A value of zero indicates that there is no
|
||||||
|
* neighboring element on that side. A negative value
|
||||||
|
* indicates that the neighboring element is in another zone.
|
||||||
|
* The number is a pointer into the FaceBndryConnectionElems
|
||||||
|
* and FaceBndryConnectionZones arrays.
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 *FaceLeftElems_Z2 = new INTEGER4[NumFaces_Z2];
|
||||||
|
INTEGER4 *FaceRightElems_Z2 = new INTEGER4[NumFaces_Z2];
|
||||||
|
|
||||||
|
/* Left Face Elems for Element 1 */
|
||||||
|
FaceLeftElems_Z2[0] = 0;
|
||||||
|
FaceLeftElems_Z2[1] = 0;
|
||||||
|
FaceLeftElems_Z2[2] = 0;
|
||||||
|
FaceLeftElems_Z2[3] = 0;
|
||||||
|
FaceLeftElems_Z2[4] = 2;
|
||||||
|
FaceLeftElems_Z2[5] = -1;
|
||||||
|
|
||||||
|
/* Left Face Elems for Element 2 */
|
||||||
|
FaceLeftElems_Z2[6] = -2;
|
||||||
|
FaceLeftElems_Z2[7] = 0;
|
||||||
|
FaceLeftElems_Z2[8] = 0;
|
||||||
|
FaceLeftElems_Z2[9] = 0;
|
||||||
|
FaceLeftElems_Z2[10] = 0;
|
||||||
|
FaceLeftElems_Z2[11] = 0;
|
||||||
|
FaceLeftElems_Z2[12] = -3;
|
||||||
|
|
||||||
|
/* Set Right Face Elems. Because of the way we numbered the
|
||||||
|
* nodes and faces, the right element for every face is the
|
||||||
|
* element itself. */
|
||||||
|
for (INTEGER4 ii = 0; ii < 6; ii++)
|
||||||
|
FaceRightElems_Z2[ii] = 1;
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 6; ii < 13; ii++)
|
||||||
|
FaceRightElems_Z2[ii] = 2;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:hexagons_zone2_tecpoly.txt*/
|
||||||
|
/* The FaceBndryConnectionCounts array is used to define the
|
||||||
|
* number of boundary connections for each face that has a
|
||||||
|
* boundary connection. In this example, the total number of
|
||||||
|
* connected boundary faces (specified via TECZNE) is equal to
|
||||||
|
* three. Each boundary face is connected to only one other
|
||||||
|
* element, so the FaceBoundaryConnectionCounts array is
|
||||||
|
* (1, 1, 1).
|
||||||
|
*/
|
||||||
|
INTEGER4 FaceBndryConnectionCounts_Z2[3] = {1, 1, 1};
|
||||||
|
|
||||||
|
/* The value(s) in the FaceBndryConnectionElems and
|
||||||
|
* FaceBndryConnectionZones arrays specifies that element
|
||||||
|
* number and zone number, respectively, that a given boundary
|
||||||
|
* connection is connected to. In this case, the first boundary
|
||||||
|
* connection face is connected to Element 2 in Zone 1 and the
|
||||||
|
* remaining connections are Element 3 in Zone 1.
|
||||||
|
*/
|
||||||
|
INTEGER4 FaceBndryConnectionElems_Z2[3] = {2, 3, 3};
|
||||||
|
INTEGER4 FaceBndryConnectionZones_Z2[3] = {1, 1, 1};
|
||||||
|
|
||||||
|
I = TECPOLY112(NULL,
|
||||||
|
FaceNodes_Z2,
|
||||||
|
FaceLeftElems_Z2,
|
||||||
|
FaceRightElems_Z2,
|
||||||
|
FaceBndryConnectionCounts_Z2,
|
||||||
|
FaceBndryConnectionElems_Z2,
|
||||||
|
FaceBndryConnectionZones_Z2);
|
||||||
|
|
||||||
|
delete FaceNodes_Z2;
|
||||||
|
delete FaceLeftElems_Z2;
|
||||||
|
delete FaceRightElems_Z2;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* DOCSTART:hexagons_tecend.txt*/
|
||||||
|
I = TECEND112();
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="multiplepolygons"
|
||||||
|
ProjectGUID="{D2747EA6-7807-42E1-984D-C946B3D97D95}"
|
||||||
|
RootNamespace="mulitplepolygons"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\multiplepolygons.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=octagon
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
Binary file not shown.
@ -0,0 +1,248 @@
|
|||||||
|
/* This example illustrates how to create a zone with a single
|
||||||
|
* polygonal cell. Please refer to the Data Format Guide for
|
||||||
|
* additional information, including figures that display node
|
||||||
|
* numbering.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include "MASTER.h" /* for defintion of NULL */
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
/* DOCSTART:octagon_tecini.txt*/
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 0;
|
||||||
|
INTEGER4 FileType = 0;
|
||||||
|
INTEGER4 I; /* used to check return codes */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Open the file and write the Tecplot datafile
|
||||||
|
* header information
|
||||||
|
*/
|
||||||
|
|
||||||
|
I = TECINI112((char*)"Octagon",
|
||||||
|
(char*)"X Y P", /* Defines the variables for the data
|
||||||
|
* file. Each zone must contain each
|
||||||
|
* of the vars listed here. The order
|
||||||
|
* of the variables in the list is
|
||||||
|
* used to define the variable number
|
||||||
|
* (e.g. X is Variable 1). When
|
||||||
|
* referring to variables in other
|
||||||
|
* TecIO functions, you will refer to
|
||||||
|
* thevariable by its number.
|
||||||
|
*/
|
||||||
|
(char*)"Octagon.plt",
|
||||||
|
(char*)".", /* scratch directory */
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Declare TECZNE variables */
|
||||||
|
/* DOCSTART:octagon_teczne.txt*/
|
||||||
|
/* In this example, we will create a single octagonal cell in
|
||||||
|
* Tecplot 360's polyhedral file format.
|
||||||
|
*/
|
||||||
|
INTEGER4 ZoneType = 6; /* FEPolygon */
|
||||||
|
INTEGER4 NumNodes = 8; /* Number of nodes in the octagon.*/
|
||||||
|
INTEGER4 NumElems = 1; /* Number of octagonal elements. */
|
||||||
|
INTEGER4 NumFaces = 8; /* Number of faces in the octagon.*/
|
||||||
|
INTEGER4 ICellMax = 0; /* Not Used */
|
||||||
|
INTEGER4 JCellMax = 0; /* Not Used */
|
||||||
|
INTEGER4 KCellMax = 0; /* Not Used */
|
||||||
|
double SolTime = 360.0;
|
||||||
|
INTEGER4 StrandID = 0; /* Static Zone */
|
||||||
|
INTEGER4 ParentZn = 0; /* No Parent Zone */
|
||||||
|
INTEGER4 IsBlock = 1; /* Block */
|
||||||
|
INTEGER4 NFConns = 0;
|
||||||
|
INTEGER4 FNMode = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/* For polygonal zones, the total number of face nodes is equal
|
||||||
|
* to twice the number of nodes. This is because, each face
|
||||||
|
* has exactly two nodes.
|
||||||
|
*/
|
||||||
|
INTEGER4 NumFaceNodes = 2 * NumNodes;
|
||||||
|
/* Boundary Faces and Boundary Connections are not used in this
|
||||||
|
* example.
|
||||||
|
*/
|
||||||
|
INTEGER4 NumBFaces = 0;
|
||||||
|
INTEGER4 NumBConnections = 0;
|
||||||
|
|
||||||
|
INTEGER4 ShrConn = 0;
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Octagonal Zone",
|
||||||
|
&ZoneType,
|
||||||
|
&NumNodes,
|
||||||
|
&NumElems,
|
||||||
|
&NumFaces,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZn,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
&NumFaceNodes,
|
||||||
|
&NumBFaces,
|
||||||
|
&NumBConnections,
|
||||||
|
NULL,
|
||||||
|
NULL, /* When Value Location is not specified,
|
||||||
|
* Tecplot will treat all variables as
|
||||||
|
* nodal variables.
|
||||||
|
*/
|
||||||
|
NULL,
|
||||||
|
&ShrConn);
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Establish numbering.
|
||||||
|
* For this example, we will a single octagonal cell.
|
||||||
|
* Before defining your variables, you must establish a
|
||||||
|
* consistent node numbering scheme for your data. Once the
|
||||||
|
* node numbers are defined, supply the variable values in the
|
||||||
|
* node numbering order. In this example, node 1 is defined at
|
||||||
|
* X = 0 and Y = 0. As such, the first value supplied for X
|
||||||
|
* (i.e. X[0]) is 0. Similarly, the first value supplied for
|
||||||
|
* Y is 0.
|
||||||
|
*
|
||||||
|
* It is important that you refer to node numbers consistently.
|
||||||
|
* The node numbers will be used later to define the
|
||||||
|
* connectivity for each element.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* TECDAT Variables */
|
||||||
|
/* Set up the variable values. The variable values will be
|
||||||
|
* written to the file using TECDAT. Because we are specifying
|
||||||
|
* nodal variables (as specified via the ValueLocation
|
||||||
|
* parameter in TECZNE, each variable is dimensioned by the
|
||||||
|
* number of points (NumPts) in the Zone. You have the option
|
||||||
|
* to specify some variables with nodal values and some with
|
||||||
|
* cell-centered values. Refer to the Binary Function Reference
|
||||||
|
* for details.
|
||||||
|
*/
|
||||||
|
/* DOCSTART:octagon_tecdat.txt*/
|
||||||
|
float *X = new float[NumNodes];
|
||||||
|
float *Y = new float[NumNodes];
|
||||||
|
float *P = new float[NumNodes];
|
||||||
|
|
||||||
|
//Define the grid values.
|
||||||
|
X[0] = 0.25;
|
||||||
|
Y[0] = 0.0;
|
||||||
|
|
||||||
|
X[1] = 0.75;
|
||||||
|
Y[1] = 0.0;
|
||||||
|
|
||||||
|
X[2] = 1.0;
|
||||||
|
Y[2] = 0.25;
|
||||||
|
|
||||||
|
X[3] = 1.0;
|
||||||
|
Y[3] = 0.75;
|
||||||
|
|
||||||
|
X[4] = 0.75;
|
||||||
|
Y[4] = 1.0;
|
||||||
|
|
||||||
|
X[5] = 0.25;
|
||||||
|
Y[5] = 1.0;
|
||||||
|
|
||||||
|
X[6] = 0.0;
|
||||||
|
Y[6] = 0.75;
|
||||||
|
|
||||||
|
X[7] = 0.0;
|
||||||
|
Y[7] = 0.25;
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 0; ii < 8; ii++)
|
||||||
|
P[ii] = .5;
|
||||||
|
|
||||||
|
/* Write out the field data using TECDAT */
|
||||||
|
INTEGER4 DIsDouble = 0; /* set IsDouble to 0 to use float
|
||||||
|
* variables. */
|
||||||
|
|
||||||
|
I = TECDAT112(&NumNodes, X, &DIsDouble);
|
||||||
|
I = TECDAT112(&NumNodes, Y, &DIsDouble);
|
||||||
|
I = TECDAT112(&NumNodes, P, &DIsDouble);
|
||||||
|
|
||||||
|
delete X;
|
||||||
|
delete Y;
|
||||||
|
delete P;
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
/* Define the Face Nodes.
|
||||||
|
|
||||||
|
* The FaceNodes array is used to indicate which nodes define
|
||||||
|
* which face. As mentioned earlier, the number of the nodes is
|
||||||
|
* implicitly defined by the order in which the nodal data is
|
||||||
|
* provided. The first value of each nodal variable describes
|
||||||
|
* node 1, the second value describes node 2, and so on.
|
||||||
|
*
|
||||||
|
* The face numbering is implicitly defined. Because there are
|
||||||
|
* two nodes in each face, the first two nodes provided define
|
||||||
|
* face 1, the next two define face 2 and so on. If there was
|
||||||
|
* a variable number of nodes used to define the faces, the
|
||||||
|
* array would be more complicated.
|
||||||
|
*/
|
||||||
|
/* DOCSTART:octagon_facenodes.txt*/
|
||||||
|
INTEGER4 *FaceNodes = new INTEGER4[NumFaceNodes];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Loop over number of sides, and set each side to two
|
||||||
|
* consecutive nodes.
|
||||||
|
*/
|
||||||
|
for (INTEGER4 ii = 0; ii < 8; ii++)
|
||||||
|
{
|
||||||
|
FaceNodes[2*ii] = ii + 1;
|
||||||
|
FaceNodes[2*ii+1] = ii + 2;
|
||||||
|
}
|
||||||
|
FaceNodes[15] = 1;
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
|
/* Define the right and left elements of each face.
|
||||||
|
|
||||||
|
* The last step for writing out the polyhedral data is to
|
||||||
|
* define the right and left neighboring elements for each
|
||||||
|
* face. The neighboring elements can be determined using the
|
||||||
|
* right-hand rule. For each face, place your right-hand along
|
||||||
|
* the face which your fingers pointing the direction of
|
||||||
|
* incrementing node numbers (i.e. from node 1 to node 2).
|
||||||
|
* Your right thumb will point towards the right element; the
|
||||||
|
* element on the other side of your hand is the left element.
|
||||||
|
*
|
||||||
|
* The number zero is used to indicate that there isn't an
|
||||||
|
* element on that side of the face.
|
||||||
|
*
|
||||||
|
* Because of the way we numbered the nodes and faces, the
|
||||||
|
* right element for every face is the element itself
|
||||||
|
* (element 1) and the left element is "no-neighboring element"
|
||||||
|
* (element 0).
|
||||||
|
*/
|
||||||
|
/* DOCSTART:octagon_rightleft.txt*/
|
||||||
|
INTEGER4 *FaceLeftElems = new INTEGER4[NumFaces];
|
||||||
|
INTEGER4 *FaceRightElems = new INTEGER4[NumFaces];
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 0; ii < NumFaces; ii++)
|
||||||
|
{
|
||||||
|
FaceLeftElems[ii] = 0;
|
||||||
|
FaceRightElems[ii] = 1;
|
||||||
|
}
|
||||||
|
/* DOCEND */
|
||||||
|
/* Write the polyhedral data to the file. */
|
||||||
|
/* DOCSTART:octagon_tecpoly.txt*/
|
||||||
|
I = TECPOLY112(NULL,
|
||||||
|
FaceNodes,
|
||||||
|
FaceLeftElems,
|
||||||
|
FaceRightElems,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
delete FaceNodes;
|
||||||
|
delete FaceLeftElems;
|
||||||
|
delete FaceRightElems;
|
||||||
|
/* DOCEND */
|
||||||
|
/* DOCSTART:octagon_tecend.txt*/
|
||||||
|
I = TECEND112();
|
||||||
|
/* DOCEND */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="octagon"
|
||||||
|
ProjectGUID="{C4BEE7D4-6449-468F-81CC-3BEFDA554F31}"
|
||||||
|
RootNamespace="octagon"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\octagon.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=pyramid
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,222 @@
|
|||||||
|
/* This example creates a zone with a single polyhedral cell. */
|
||||||
|
|
||||||
|
/* DOCSTART:pyramid.txt*/
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include "MASTER.h" /* for defintion of NULL */
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
/* Call TECINI112 */
|
||||||
|
INTEGER4 FileType = 0; /* 0 for full file */
|
||||||
|
INTEGER4 Debug = 0;
|
||||||
|
INTEGER4 VIsDouble = 1;
|
||||||
|
INTEGER4 I = 0; /* use to check return codes */
|
||||||
|
|
||||||
|
I = TECINI112((char*)"Pyramid", /* Data Set Title */
|
||||||
|
(char*)"X Y Z", /* Variable List */
|
||||||
|
(char*)"pyramid.plt", /* File Name */
|
||||||
|
(char*)".", /* Scratch Directory */
|
||||||
|
&(FileType),
|
||||||
|
&(Debug),
|
||||||
|
&(VIsDouble));
|
||||||
|
|
||||||
|
|
||||||
|
/* Call TECZNE112 */
|
||||||
|
INTEGER4 ZoneType = 7; /* 7 for FEPolyhedron */
|
||||||
|
INTEGER4 NumNodes = 5; /* number of unique nodes */
|
||||||
|
INTEGER4 NumElems = 1; /* number of elements */
|
||||||
|
INTEGER4 NumFaces = 5; /* number of unique faces */
|
||||||
|
|
||||||
|
INTEGER4 ICellMax = 0; /* Not Used, set to zero */
|
||||||
|
INTEGER4 JCellMax = 0; /* Not Used, set to zero */
|
||||||
|
INTEGER4 KCellMax = 0; /* Not Used, set to zero */
|
||||||
|
|
||||||
|
double SolTime = 12.65; /* solution time */
|
||||||
|
INTEGER4 StrandID = 0; /* static zone */
|
||||||
|
INTEGER4 ParentZone = 0; /* no parent zone */
|
||||||
|
|
||||||
|
INTEGER4 IsBlock = 1; /* block format */
|
||||||
|
|
||||||
|
INTEGER4 NFConns = 0; /* not used for FEPolyhedron
|
||||||
|
* zones
|
||||||
|
*/
|
||||||
|
INTEGER4 FNMode = 0; /* not used for FEPolyhedron
|
||||||
|
* zones
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 *PassiveVarArray = NULL;
|
||||||
|
INTEGER4 *ValueLocArray = NULL;
|
||||||
|
INTEGER4 *VarShareArray = NULL;
|
||||||
|
|
||||||
|
INTEGER4 ShrConn = 0;
|
||||||
|
|
||||||
|
/* The number of face nodes in the zone. This example creates
|
||||||
|
* a zone with a single pyramidal cell. This cell has four
|
||||||
|
* triangular faces and one rectangular face, yielding a total
|
||||||
|
* of 16 face nodes.
|
||||||
|
*/
|
||||||
|
INTEGER4 NumFaceNodes = 16;
|
||||||
|
INTEGER4 NumBConns = 0; /* No Boundary Connections */
|
||||||
|
INTEGER4 NumBItems = 0; /* No Boundary Items */
|
||||||
|
|
||||||
|
I = TECZNE112((char*)"Polyhedral Zone (Octahedron)",
|
||||||
|
&ZoneType,
|
||||||
|
&NumNodes,
|
||||||
|
&NumElems,
|
||||||
|
&NumFaces,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZone,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
&NumFaceNodes,
|
||||||
|
&NumBConns,
|
||||||
|
&NumBItems,
|
||||||
|
PassiveVarArray,
|
||||||
|
ValueLocArray,
|
||||||
|
VarShareArray,
|
||||||
|
&ShrConn);
|
||||||
|
|
||||||
|
/* Initialize arrays of nodal data */
|
||||||
|
double *X = new double[NumNodes];
|
||||||
|
double *Y = new double[NumNodes];
|
||||||
|
double *Z = new double[NumNodes];
|
||||||
|
|
||||||
|
X[0] = 0;
|
||||||
|
Y[0] = 0;
|
||||||
|
Z[0] = 0;
|
||||||
|
|
||||||
|
X[1] = 1;
|
||||||
|
Y[1] = 1;
|
||||||
|
Z[1] = 2;
|
||||||
|
|
||||||
|
X[2] = 2;
|
||||||
|
Y[2] = 0;
|
||||||
|
Z[2] = 0;
|
||||||
|
|
||||||
|
X[3] = 2;
|
||||||
|
Y[3] = 2;
|
||||||
|
Z[3] = 0;
|
||||||
|
|
||||||
|
X[4] = 0;
|
||||||
|
Y[4] = 2;
|
||||||
|
Z[4] = 0;
|
||||||
|
|
||||||
|
/* Write the data (using TECDAT112) */
|
||||||
|
INTEGER4 DIsDouble = 1; /* One for double precision */
|
||||||
|
I = TECDAT112(&NumNodes, X, &DIsDouble);
|
||||||
|
I = TECDAT112(&NumNodes, Y, &DIsDouble);
|
||||||
|
I = TECDAT112(&NumNodes, Z, &DIsDouble);
|
||||||
|
|
||||||
|
delete X;
|
||||||
|
delete Y;
|
||||||
|
delete Z;
|
||||||
|
|
||||||
|
/* Define the Face Nodes.
|
||||||
|
|
||||||
|
* The FaceNodes array is used to indicate which nodes define
|
||||||
|
* which face. As mentioned earlier, the number of the nodes is
|
||||||
|
* implicitly defined by the order in which the nodal data is
|
||||||
|
* provided. The first value of each nodal variable describes
|
||||||
|
* node 1, the second value describes node 2, and so on.
|
||||||
|
*
|
||||||
|
* The face numbering is implicitly defined. Because there are
|
||||||
|
* two nodes in each face, the first two nodes provided define
|
||||||
|
* face 1, the next two define face 2 and so on. If there was
|
||||||
|
* a variable number of nodes used to define the faces, the
|
||||||
|
* array would be more complicated.
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 *FaceNodeCounts = new INTEGER4[NumFaces];
|
||||||
|
/* The first four faces are triangular, i.e. have three nodes.
|
||||||
|
* The fifth face is rectangular, i.e. has four nodes. */
|
||||||
|
FaceNodeCounts[0] = 3;
|
||||||
|
FaceNodeCounts[1] = 3;
|
||||||
|
FaceNodeCounts[2] = 3;
|
||||||
|
FaceNodeCounts[3] = 3;
|
||||||
|
FaceNodeCounts[4] = 4;
|
||||||
|
|
||||||
|
INTEGER4 *FaceNodes = new INTEGER4[NumFaceNodes];
|
||||||
|
/* Face Nodes for Face 1 */
|
||||||
|
FaceNodes[0] = 1;
|
||||||
|
FaceNodes[1] = 2;
|
||||||
|
FaceNodes[2] = 3;
|
||||||
|
|
||||||
|
/* Face Nodes for Face 2 */
|
||||||
|
FaceNodes[3] = 3;
|
||||||
|
FaceNodes[4] = 2;
|
||||||
|
FaceNodes[5] = 4;
|
||||||
|
|
||||||
|
/* Face Nodes for Face 3 */
|
||||||
|
FaceNodes[6] = 5;
|
||||||
|
FaceNodes[7] = 2;
|
||||||
|
FaceNodes[8] = 4;
|
||||||
|
|
||||||
|
/* Face Nodes for Face 4 */
|
||||||
|
FaceNodes[9] = 1;
|
||||||
|
FaceNodes[10] = 2;
|
||||||
|
FaceNodes[11] = 5;
|
||||||
|
|
||||||
|
/* Face Nodes for Face 5 */
|
||||||
|
FaceNodes[12] = 1;
|
||||||
|
FaceNodes[13] = 5;
|
||||||
|
FaceNodes[14] = 4;
|
||||||
|
FaceNodes[15] = 3;
|
||||||
|
|
||||||
|
/* Define the right and left elements of each face.
|
||||||
|
*
|
||||||
|
* The last step for writing out the polyhedral data is to
|
||||||
|
* define the right and left neighboring elements for each
|
||||||
|
* face. The neighboring elements can be determined using the
|
||||||
|
* right-hand rule. For each face, place your right-hand along
|
||||||
|
* the face which your fingers pointing the direction of
|
||||||
|
* incrementing node numbers (i.e. from node 1 to node 2).
|
||||||
|
* Your right thumb will point towards the right element; the
|
||||||
|
* element on the other side of your hand is the left element.
|
||||||
|
*
|
||||||
|
* The number zero is used to indicate that there isn't an
|
||||||
|
* element on that side of the face.
|
||||||
|
*
|
||||||
|
* Because of the way we numbered the nodes and faces, the
|
||||||
|
* right element for every face is the element itself
|
||||||
|
* (element 1) and the left element is "no-neighboring element"
|
||||||
|
* (element 0).
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 *FaceLeftElems = new INTEGER4[NumFaces];
|
||||||
|
FaceLeftElems[0] = 1;
|
||||||
|
FaceLeftElems[1] = 1;
|
||||||
|
FaceLeftElems[2] = 0;
|
||||||
|
FaceLeftElems[3] = 0;
|
||||||
|
FaceLeftElems[4] = 0;
|
||||||
|
|
||||||
|
INTEGER4 *FaceRightElems = new INTEGER4[NumFaces];
|
||||||
|
FaceRightElems[0] = 0;
|
||||||
|
FaceRightElems[1] = 0;
|
||||||
|
FaceRightElems[2] = 1;
|
||||||
|
FaceRightElems[3] = 1;
|
||||||
|
FaceRightElems[4] = 1;
|
||||||
|
|
||||||
|
/* Write the face map (created above) using TECPOLY112. */
|
||||||
|
I = TECPOLY112(FaceNodeCounts, /* The face node counts array */
|
||||||
|
FaceNodes, /* The face nodes array */
|
||||||
|
FaceLeftElems, /* The left elements array */
|
||||||
|
FaceRightElems, /* The right elements array */
|
||||||
|
NULL, /* No boundary connection counts */
|
||||||
|
NULL, /* No boundary connection elements */
|
||||||
|
NULL); /* No boundary connection zones */
|
||||||
|
|
||||||
|
delete FaceNodeCounts;
|
||||||
|
delete FaceNodes;
|
||||||
|
delete FaceLeftElems;
|
||||||
|
delete FaceRightElems;
|
||||||
|
|
||||||
|
I = TECEND112();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
Binary file not shown.
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="pyramid"
|
||||||
|
ProjectGUID="{CFED06AE-48C6-491C-AE5F-E1B7882A44E9}"
|
||||||
|
RootNamespace="pyramid"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\pyramid.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=simtest
|
||||||
|
FILES=$(EXECUTABLE).c
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
* Simple example c program to write a
|
||||||
|
* binary datafile for tecplot. This example
|
||||||
|
* does the following:
|
||||||
|
*
|
||||||
|
* 1. Open a datafile called "t.plt"
|
||||||
|
* 2. Assign values for X,Y, and P
|
||||||
|
* 3. Write out a zone dimensioned 4x5
|
||||||
|
* 4. Close the datafile.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "TECIO.h"
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
enum FileType { FULL = 0, GRID = 1, SOLUTION = 2 };
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
float X[5][4], Y[5][4], P[5][4];
|
||||||
|
double SolTime;
|
||||||
|
INTEGER4 Debug, I, J, III, DIsDouble, VIsDouble, IMax, JMax, KMax, ZoneType, StrandID, ParentZn, IsBlock;
|
||||||
|
INTEGER4 ICellMax, JCellMax, KCellMax, NFConns, FNMode, ShrConn, FileType;
|
||||||
|
|
||||||
|
Debug = 1;
|
||||||
|
VIsDouble = 0;
|
||||||
|
DIsDouble = 0;
|
||||||
|
IMax = 4;
|
||||||
|
JMax = 5;
|
||||||
|
KMax = 1;
|
||||||
|
ZoneType = 0; /* Ordered */
|
||||||
|
SolTime = 360.0;
|
||||||
|
StrandID = 0; /* StaticZone */
|
||||||
|
ParentZn = 0; /* No Parent */
|
||||||
|
IsBlock = 1; /* Block */
|
||||||
|
ICellMax = 0;
|
||||||
|
JCellMax = 0;
|
||||||
|
KCellMax = 0;
|
||||||
|
NFConns = 0;
|
||||||
|
FNMode = 0;
|
||||||
|
ShrConn = 0;
|
||||||
|
FileType = FULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Open the file and write the tecplot datafile
|
||||||
|
* header information
|
||||||
|
*/
|
||||||
|
I = TECINI112((char*)"SIMPLE DATASET",
|
||||||
|
(char*)"X Y P",
|
||||||
|
(char*)"t.plt",
|
||||||
|
(char*)".",
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Write the zone header information.
|
||||||
|
*/
|
||||||
|
I = TECZNE112((char*)"Simple Zone",
|
||||||
|
&ZoneType,
|
||||||
|
&IMax,
|
||||||
|
&JMax,
|
||||||
|
&KMax,
|
||||||
|
&ICellMax,
|
||||||
|
&JCellMax,
|
||||||
|
&KCellMax,
|
||||||
|
&SolTime,
|
||||||
|
&StrandID,
|
||||||
|
&ParentZn,
|
||||||
|
&IsBlock,
|
||||||
|
&NFConns,
|
||||||
|
&FNMode,
|
||||||
|
0, /* TotalNumFaceNodes */
|
||||||
|
0, /* NumConnectedBoundaryFaces */
|
||||||
|
0, /* TotalNumBoundaryConnections */
|
||||||
|
NULL, /* PassiveVarList */
|
||||||
|
NULL, /* ValueLocation = Nodal */
|
||||||
|
NULL, /* SharVarFromZone */
|
||||||
|
&ShrConn);
|
||||||
|
/*
|
||||||
|
* Write out the field data.
|
||||||
|
*/
|
||||||
|
III = IMax * JMax;
|
||||||
|
I = TECDAT112(&III, &X[0][0], &DIsDouble);
|
||||||
|
I = TECDAT112(&III, &Y[0][0], &DIsDouble);
|
||||||
|
I = TECDAT112(&III, &P[0][0], &DIsDouble);
|
||||||
|
|
||||||
|
I = TECEND112();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
C
|
||||||
|
C Simple example fortran program to write a
|
||||||
|
C binary datafile for tecplot. This example
|
||||||
|
C does the following:
|
||||||
|
C
|
||||||
|
C 1. Open a datafile called "t.plt"
|
||||||
|
C 2. Assign values for X,Y, and P
|
||||||
|
C 3. Write out a zone dimensioned 4x5
|
||||||
|
C 4. Close the datafile.
|
||||||
|
C
|
||||||
|
C
|
||||||
|
program test
|
||||||
|
|
||||||
|
INCLUDE 'tecio.inc'
|
||||||
|
|
||||||
|
character*1 NULLCHR
|
||||||
|
Integer*4 Debug,III,NPts,NElm
|
||||||
|
|
||||||
|
Dimension X(4,5), Y(4,5), P(4,5)
|
||||||
|
Real*8 SolTime
|
||||||
|
Integer*4 VIsDouble, FileType
|
||||||
|
Integer*4 ZoneType,StrandID,ParentZn,IsBlock
|
||||||
|
Integer*4 ICellMax,JCellMax,KCellMax,NFConns,FNMode,ShrConn
|
||||||
|
POINTER (NullPtr,Null)
|
||||||
|
Integer*4 Null(*)
|
||||||
|
|
||||||
|
NULLCHR = CHAR(0)
|
||||||
|
NullPtr = 0
|
||||||
|
Debug = 1
|
||||||
|
FileType = 0
|
||||||
|
VIsDouble = 0
|
||||||
|
IMax = 4
|
||||||
|
JMax = 5
|
||||||
|
KMax = 1
|
||||||
|
ZoneType = 0
|
||||||
|
SolTime = 360.0
|
||||||
|
StrandID = 0
|
||||||
|
ParentZn = 0
|
||||||
|
IsBlock = 1
|
||||||
|
ICellMax = 0
|
||||||
|
JCellMax = 0
|
||||||
|
KCellMax = 0
|
||||||
|
NFConns = 0
|
||||||
|
FNMode = 0
|
||||||
|
ShrConn = 0
|
||||||
|
C
|
||||||
|
C... Open the file and write the tecplot datafile
|
||||||
|
C... header information.
|
||||||
|
C
|
||||||
|
I = TecIni112('SIMPLE DATASET'//NULLCHR,
|
||||||
|
& 'X Y P'//NULLCHR,
|
||||||
|
& 't.plt'//NULLCHR,
|
||||||
|
& '.'//NULLCHR,
|
||||||
|
& FileType,
|
||||||
|
& Debug,
|
||||||
|
& VIsDouble)
|
||||||
|
|
||||||
|
Do 10 I = 1,4
|
||||||
|
Do 10 J = 1,5
|
||||||
|
X(I,J) = I
|
||||||
|
Y(I,J) = J
|
||||||
|
P(I,J) = I*J
|
||||||
|
10 Continue
|
||||||
|
C
|
||||||
|
C... Write the zone header information.
|
||||||
|
C
|
||||||
|
I = TecZne112('Simple Zone'//NULLCHR,
|
||||||
|
& ZoneType,
|
||||||
|
& IMax,
|
||||||
|
& JMax,
|
||||||
|
& KMax,
|
||||||
|
& ICellMax,
|
||||||
|
& JCellMax,
|
||||||
|
& KCellMax,
|
||||||
|
& SolTime,
|
||||||
|
& StrandID,
|
||||||
|
& ParentZn,
|
||||||
|
& IsBlock,
|
||||||
|
& NFConns,
|
||||||
|
& FNMode,
|
||||||
|
& 0,
|
||||||
|
& 0,
|
||||||
|
& 0,
|
||||||
|
& Null,
|
||||||
|
& Null,
|
||||||
|
& Null,
|
||||||
|
& ShrConn)
|
||||||
|
C
|
||||||
|
C... Write out the field data.
|
||||||
|
C
|
||||||
|
III = IMax*JMax
|
||||||
|
I = TecDat112(III,X,0)
|
||||||
|
I = TecDat112(III,Y,0)
|
||||||
|
I = TecDat112(III,P,0)
|
||||||
|
|
||||||
|
I = TecEnd112()
|
||||||
|
Stop
|
||||||
|
End
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
!
|
||||||
|
! Simple example fortran program to write a
|
||||||
|
! binary datafile for tecplot. This example
|
||||||
|
! does the following:
|
||||||
|
!
|
||||||
|
! 1. Open a datafile called "t.plt"
|
||||||
|
! 2. Assign values for X,Y, and P
|
||||||
|
! 3. Write out a zone dimensioned 4x5
|
||||||
|
! 4. Close the datafile.
|
||||||
|
!
|
||||||
|
!
|
||||||
|
program test
|
||||||
|
|
||||||
|
INCLUDE 'tecio.f90'
|
||||||
|
|
||||||
|
character*1 NULLCHR
|
||||||
|
Integer*4 Debug,III,NPts,NElm
|
||||||
|
|
||||||
|
Dimension X(4,5), Y(4,5), P(4,5)
|
||||||
|
Real*8 SolTime
|
||||||
|
Integer*4 VIsDouble, FileType
|
||||||
|
Integer*4 ZoneType,StrandID,ParentZn,IsBlock
|
||||||
|
Integer*4 ICellMax,JCellMax,KCellMax,NFConns,FNMode,ShrConn
|
||||||
|
POINTER (NullPtr,Null)
|
||||||
|
Integer*4 Null(*)
|
||||||
|
|
||||||
|
NULLCHR = CHAR(0)
|
||||||
|
NullPtr = 0
|
||||||
|
Debug = 1
|
||||||
|
FileType = 0
|
||||||
|
VIsDouble = 0
|
||||||
|
IMax = 4
|
||||||
|
JMax = 5
|
||||||
|
KMax = 1
|
||||||
|
ZoneType = 0
|
||||||
|
SolTime = 360.0
|
||||||
|
StrandID = 0
|
||||||
|
ParentZn = 0
|
||||||
|
IsBlock = 1
|
||||||
|
ICellMax = 0
|
||||||
|
JCellMax = 0
|
||||||
|
KCellMax = 0
|
||||||
|
NFConns = 0
|
||||||
|
FNMode = 0
|
||||||
|
ShrConn = 0
|
||||||
|
!
|
||||||
|
!... Open the file and write the tecplot datafile
|
||||||
|
!... header information.
|
||||||
|
!
|
||||||
|
I = TecIni112('SIMPLE DATASET'//NULLCHR, &
|
||||||
|
'X Y P'//NULLCHR, &
|
||||||
|
't.plt'//NULLCHR, &
|
||||||
|
'.'//NULLCHR, &
|
||||||
|
FileType, &
|
||||||
|
Debug, &
|
||||||
|
VIsDouble)
|
||||||
|
|
||||||
|
Do 10 I = 1,4
|
||||||
|
Do 10 J = 1,5
|
||||||
|
X(I,J) = I
|
||||||
|
Y(I,J) = J
|
||||||
|
P(I,J) = I*J
|
||||||
|
10 Continue
|
||||||
|
!
|
||||||
|
!... Write the zone header information.
|
||||||
|
!
|
||||||
|
I = TecZne112('Simple Zone'//NULLCHR, &
|
||||||
|
ZoneType, &
|
||||||
|
IMax, &
|
||||||
|
JMax, &
|
||||||
|
KMax, &
|
||||||
|
ICellMax, &
|
||||||
|
JCellMax, &
|
||||||
|
KCellMax, &
|
||||||
|
SolTime, &
|
||||||
|
StrandID, &
|
||||||
|
ParentZn, &
|
||||||
|
IsBlock, &
|
||||||
|
NFConns, &
|
||||||
|
FNMode, &
|
||||||
|
0, &
|
||||||
|
0, &
|
||||||
|
0, &
|
||||||
|
Null, &
|
||||||
|
Null, &
|
||||||
|
Null, &
|
||||||
|
ShrConn)
|
||||||
|
!
|
||||||
|
!... Write out the field data.
|
||||||
|
!
|
||||||
|
III = IMax*JMax
|
||||||
|
I = TecDat112(III,X,0)
|
||||||
|
I = TecDat112(III,Y,0)
|
||||||
|
I = TecDat112(III,P,0)
|
||||||
|
|
||||||
|
I = TecEnd112()
|
||||||
|
Stop
|
||||||
|
End
|
||||||
@ -0,0 +1,346 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="simtestc"
|
||||||
|
ProjectGUID="{62FA6E8C-388E-4047-BC9D-574B470B94DE}"
|
||||||
|
RootNamespace="simtestc"
|
||||||
|
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=".\simtest.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -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="VFPostBuildEventTool"/>
|
||||||
|
<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="VFCustomBuildTool"/>
|
||||||
|
<Tool Name="VFLinkerTool" OutputFile="$(OUTDIR)/simtestf.exe" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(TEC_360_2009)/Bin" GenerateDebugInformation="true" ProgramDatabaseFile="$(OUTDIR)/simtestf.pdb" SubSystem="subSystemConsole" AdditionalDependencies="tecio.lib"/>
|
||||||
|
<Tool Name="VFPreLinkEventTool"/>
|
||||||
|
<Tool Name="VFResourceCompilerTool" ResourceOutputFileName="$(IntDir)/$(InputName).res"/></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)">
|
||||||
|
<Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>
|
||||||
|
<Tool Name="VFPreBuildEventTool"/>
|
||||||
|
<Tool Name="VFPostBuildEventTool"/>
|
||||||
|
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" AdditionalIncludeDirectories="$(TEC_360_2009)/Include" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreaded" CompileOnly="true"/>
|
||||||
|
<Tool Name="VFCustomBuildTool"/>
|
||||||
|
<Tool Name="VFLinkerTool" OutputFile="$(OUTDIR)/simtestf.exe" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(TEC_360_2009)/Bin" SubSystem="subSystemConsole" AdditionalDependencies="tecio.lib"/>
|
||||||
|
<Tool Name="VFPreLinkEventTool"/>
|
||||||
|
<Tool Name="VFResourceCompilerTool" ResourceOutputFileName="$(IntDir)/$(InputName).res"/></Configuration></Configurations>
|
||||||
|
<Files>
|
||||||
|
<File RelativePath="simtest.f90"/></Files>
|
||||||
|
<Globals/></VisualStudioProject>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=squares
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,124 @@
|
|||||||
|
/* This example creates a group of square geometries, each with a
|
||||||
|
* different fill color */
|
||||||
|
#if defined _MSC_VER
|
||||||
|
#pragma warning (disable: 4996) /* Windows strcpy warning off */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* DOCSTART:tecgeo.txt*/
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 0;
|
||||||
|
INTEGER4 FileType = 0;
|
||||||
|
INTEGER4 I = 0; /* use to check return values */
|
||||||
|
|
||||||
|
|
||||||
|
/* Open the file and write the tecplot datafile
|
||||||
|
* header information
|
||||||
|
*/
|
||||||
|
I = TECINI112((char*)"Square Geometries",
|
||||||
|
(char*)"X Y P",
|
||||||
|
(char*)"squares.plt",
|
||||||
|
(char*)".",
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
|
||||||
|
double ZPos = 0.0; /* N/A for squares */
|
||||||
|
double XPos;
|
||||||
|
double YPos;
|
||||||
|
|
||||||
|
INTEGER4 PosCoordMode = 0; /* use grid coordinates */
|
||||||
|
|
||||||
|
/* opt not to attach the text to a given zone. When text is
|
||||||
|
* attached to a given zone, it is displayed only when the zone
|
||||||
|
* is displayed.
|
||||||
|
*/
|
||||||
|
INTEGER4 AttachToZone = 0;
|
||||||
|
INTEGER4 Zone = 1;
|
||||||
|
|
||||||
|
/* Set the Geometry Style Values */
|
||||||
|
INTEGER4 Color = 0; /* set the outline color to
|
||||||
|
* black
|
||||||
|
*/
|
||||||
|
INTEGER4 IsFilled = 1;
|
||||||
|
INTEGER4 GeomType = 2; /* set the geometry type to
|
||||||
|
* square
|
||||||
|
*/
|
||||||
|
INTEGER4 LinePattern = 5; /* set the line pattern to
|
||||||
|
* DashDotDot
|
||||||
|
*/
|
||||||
|
double PatternLength = .1;
|
||||||
|
double LineThick = .2;
|
||||||
|
|
||||||
|
/* N/A for square geometries */
|
||||||
|
INTEGER4 NumPts = 100;
|
||||||
|
INTEGER4 ArrowStyle = 1;
|
||||||
|
INTEGER4 ArrowAttach = 0;
|
||||||
|
double ArrowSize = 1;
|
||||||
|
double ArrowAngle = 30;
|
||||||
|
INTEGER4 NumSegments = 15;
|
||||||
|
INTEGER4 NumSegPts = 25;
|
||||||
|
|
||||||
|
|
||||||
|
INTEGER4 Scope = 1; /* set the text to "local", i.e.
|
||||||
|
* available in the current frame
|
||||||
|
* only.
|
||||||
|
*/
|
||||||
|
INTEGER4 Clipping = 1;
|
||||||
|
|
||||||
|
/* Specify the length of a side of the square. The units used
|
||||||
|
* are those defined with PosCoordMode.
|
||||||
|
*/
|
||||||
|
float XGeomData = 2.5;
|
||||||
|
|
||||||
|
float YGeomData = 0; /* N/A for square geometries */
|
||||||
|
float ZGeomData = 0; /* N/A for square geometries */
|
||||||
|
|
||||||
|
char * MFC = new char[128];
|
||||||
|
strcpy(MFC, "SQUARE");
|
||||||
|
|
||||||
|
for (INTEGER4 ii = 0; ii <= 7; ii++)
|
||||||
|
{
|
||||||
|
INTEGER4 FillColor = ii;
|
||||||
|
XPos = (double) ii;
|
||||||
|
YPos = (double) ii;
|
||||||
|
|
||||||
|
I = TECGEO112(&XPos,
|
||||||
|
&YPos,
|
||||||
|
&ZPos,
|
||||||
|
&PosCoordMode,
|
||||||
|
&AttachToZone,
|
||||||
|
&Zone,
|
||||||
|
&Color,
|
||||||
|
&FillColor,
|
||||||
|
&IsFilled,
|
||||||
|
&GeomType,
|
||||||
|
&LinePattern,
|
||||||
|
&PatternLength,
|
||||||
|
&LineThick,
|
||||||
|
&NumPts,
|
||||||
|
&ArrowStyle,
|
||||||
|
&ArrowAttach,
|
||||||
|
&ArrowSize,
|
||||||
|
&ArrowAngle,
|
||||||
|
&Scope,
|
||||||
|
&Clipping,
|
||||||
|
&NumSegments,
|
||||||
|
&NumSegPts,
|
||||||
|
&XGeomData,
|
||||||
|
&YGeomData,
|
||||||
|
&ZGeomData,
|
||||||
|
MFC);
|
||||||
|
}
|
||||||
|
|
||||||
|
I = TECEND112();
|
||||||
|
|
||||||
|
delete MFC;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
Binary file not shown.
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="squares"
|
||||||
|
ProjectGUID="{2E5EC0A5-5902-4A66-8A67-A61EC9EB0855}"
|
||||||
|
RootNamespace="squares"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\squares.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
# Set to appropriate C++ compiler
|
||||||
|
CPP=g++
|
||||||
|
CPPFLAGS=-I../../tecsrc ../../tecio.a
|
||||||
|
EXECUTABLE=text
|
||||||
|
FILES=$(EXECUTABLE).cpp
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(CPP) $(FILES) $(CPPFLAGS) -o $(EXECUTABLE)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXECUTABLE)
|
||||||
@ -0,0 +1,112 @@
|
|||||||
|
/* This example demonstrates adding a text object to a Tecplot
|
||||||
|
* data file.
|
||||||
|
*/
|
||||||
|
#if defined _MSC_VER
|
||||||
|
#pragma warning (disable: 4996) /* Windows strcpy warning off */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* DOCSTART:tectxt.txt*/
|
||||||
|
#include "TECIO.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
/* Open the file & write the datafile header information */
|
||||||
|
INTEGER4 Debug = 1;
|
||||||
|
INTEGER4 VIsDouble = 0;
|
||||||
|
INTEGER4 FileType = 0;
|
||||||
|
INTEGER4 I = 0; /* used to check the return value */
|
||||||
|
|
||||||
|
I = TECINI112((char*)"Text",
|
||||||
|
(char*)"X Y P",
|
||||||
|
(char*)"text.plt",
|
||||||
|
(char*)".",
|
||||||
|
&FileType,
|
||||||
|
&Debug,
|
||||||
|
&VIsDouble);
|
||||||
|
|
||||||
|
/* Specify the X, Y and Z position of the anchor point */
|
||||||
|
double XPos = 0.0;
|
||||||
|
double YPos = 1.0;
|
||||||
|
double ZPos = 0.0; /* N/A for 2D text */
|
||||||
|
|
||||||
|
INTEGER4 PosCoordMode = 0; /* use grid coordinates */
|
||||||
|
|
||||||
|
/* opt not to attach the text to a given zone. When text is
|
||||||
|
* attached to a given zone, it is displayed only when the zone
|
||||||
|
* is displayed.
|
||||||
|
*/
|
||||||
|
INTEGER4 AttachToZone = 0;
|
||||||
|
INTEGER4 Zone = 2;
|
||||||
|
|
||||||
|
|
||||||
|
/* Specify the font values */
|
||||||
|
INTEGER4 Font = 1; /* Helvetica Bold */
|
||||||
|
INTEGER4 FontHeightUnits = 2; /* in grid coordinates */
|
||||||
|
double FontHeight = 18;
|
||||||
|
|
||||||
|
/* Set the box style parameters */
|
||||||
|
INTEGER4 BoxType = 1; /* filled box */
|
||||||
|
double BoxMargin = .5; /* margin between the text
|
||||||
|
* and the text box
|
||||||
|
*/
|
||||||
|
double BoxLineThickness = .1;
|
||||||
|
INTEGER4 BoxColor = 0; /* set the box line color
|
||||||
|
* to black.
|
||||||
|
*/
|
||||||
|
INTEGER4 BoxFillColor = 1; /* set the box fill color
|
||||||
|
* to red.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* set the font properties */
|
||||||
|
double Angle = 30; /* angle of the text */
|
||||||
|
INTEGER4 Anchor = 1; /* set the anchor point to
|
||||||
|
* the center of the text
|
||||||
|
* box.
|
||||||
|
*/
|
||||||
|
double LineSpacing = 1.5;
|
||||||
|
INTEGER4 TextColor = 7; /* set the font color to
|
||||||
|
* white
|
||||||
|
*/
|
||||||
|
|
||||||
|
INTEGER4 Scope = 1; /* set the text to "local",
|
||||||
|
* i.e. available in the
|
||||||
|
* current frame only.
|
||||||
|
*/
|
||||||
|
INTEGER4 Clipping = 1;
|
||||||
|
|
||||||
|
|
||||||
|
char Text[60];
|
||||||
|
char MFC[24];
|
||||||
|
strcpy(Text, "Sample Text");
|
||||||
|
strcpy(MFC, "My Macro");
|
||||||
|
|
||||||
|
I = TECTXT112(&XPos,
|
||||||
|
&YPos,
|
||||||
|
&ZPos,
|
||||||
|
&PosCoordMode,
|
||||||
|
&AttachToZone,
|
||||||
|
&Zone,
|
||||||
|
&Font,
|
||||||
|
&FontHeightUnits,
|
||||||
|
&FontHeight,
|
||||||
|
&BoxType,
|
||||||
|
&BoxMargin,
|
||||||
|
&BoxLineThickness,
|
||||||
|
&BoxColor,
|
||||||
|
&BoxFillColor,
|
||||||
|
&Angle,
|
||||||
|
&Anchor,
|
||||||
|
&LineSpacing,
|
||||||
|
&TextColor,
|
||||||
|
&Scope,
|
||||||
|
&Clipping,
|
||||||
|
Text,
|
||||||
|
MFC);
|
||||||
|
|
||||||
|
I = TECEND112();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DOCEND */
|
||||||
Binary file not shown.
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="text"
|
||||||
|
ProjectGUID="{FE2A061A-1787-410B-ABA0-366D6EA603FB}"
|
||||||
|
RootNamespace="text"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="1"
|
||||||
|
InheritedPropertySheets="..\TecIO_Examples.vsprops"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
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>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<File
|
||||||
|
RelativePath=".\text.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
@ -0,0 +1,559 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) Copyright 2004-2006 by Tecplot, Inc. ********
|
||||||
|
****** (C) Copyright 1989-2003 by AMTEC ENGINEERING INC.********
|
||||||
|
******* All Rights Reserved. ********
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
****************************************************************
|
||||||
|
****************** BEGIN DEVELOPMENT NOTES *********************
|
||||||
|
****************************************************************
|
||||||
|
|
||||||
|
BEGIN CODELOG PLTVIEW
|
||||||
|
V 09/04/98
|
||||||
|
V ****************************************************************
|
||||||
|
V * Build 1.0 9-04-98 *
|
||||||
|
V ****************************************************************
|
||||||
|
END CODELOG
|
||||||
|
|
||||||
|
*********************************************************************
|
||||||
|
* IMPORTANT NOTE: Only development notes for "pltview" stand-alone *
|
||||||
|
* belong in this file. See "ADDONVER.h" for changes *
|
||||||
|
* related to the add-on. *
|
||||||
|
*********************************************************************
|
||||||
|
|
||||||
|
****************************************************************
|
||||||
|
* V in column 1 marks date information. *
|
||||||
|
* C in column 1 marks notes on new changes. *
|
||||||
|
* B in column 1 marks notes on bug fixes. *
|
||||||
|
****************************************************************
|
||||||
|
|
||||||
|
****************************************************************
|
||||||
|
****************** END DEVELOPMENT NOTES ***********************
|
||||||
|
****************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined ADDON
|
||||||
|
#include "TECADDON.h"
|
||||||
|
#include "GUIDEFS.h"
|
||||||
|
#include "GUI.h"
|
||||||
|
#define READTEC TecUtilReadBinaryData
|
||||||
|
#define SHOWINFO(S) TecGUITextAppendString(Output_T_D1,S);
|
||||||
|
#define ERRMSG(S) TecUtilDialogErrMsg(S)
|
||||||
|
#define ALLOC_ARRAY(N,Type,S) (Type *)TecUtilStringAlloc((N)*sizeof(Type),"debug info")
|
||||||
|
#define FREE_ARRAY(N,S) TecUtilStringDealloc((char **)&N)
|
||||||
|
#define STRINGLISTGETSTRING(S,N) TecUtilStringListGetString(S,N)
|
||||||
|
#define STRINGLISTGETCOUNT(S) TecUtilStringListGetCount(S)
|
||||||
|
#define STRINGLISTDEALLOC(S) TecUtilStringListDealloc(S)
|
||||||
|
#else
|
||||||
|
#include "MASTER.h"
|
||||||
|
#include "GLOBAL.h"
|
||||||
|
#include "TASSERT.h"
|
||||||
|
#define ALLOC_ARRAY(N,Type,S) (Type *)TecAlloc((N)*sizeof(Type))
|
||||||
|
#define FREE_ARRAY(N,S) TecFree((void *)N)
|
||||||
|
#include "ARRLIST.h"
|
||||||
|
#include "STRLIST.h"
|
||||||
|
#include "DATAUTIL.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include "TECADDON.h"
|
||||||
|
#include "TECXXX.h"
|
||||||
|
#include "DATAUTIL.h"
|
||||||
|
#include "STRLIST.h"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define READTEC ReadTec
|
||||||
|
#define SHOWINFO(S) printf("%s",S);
|
||||||
|
#define ERRMSG(S) printf("Err: %s\n",S);
|
||||||
|
#define STRINGLISTGETSTRING(S,N) StringListGetString(S,(N)-1)
|
||||||
|
#define STRINGLISTGETCOUNT(S) StringListCount(S)
|
||||||
|
#define STRINGLISTDEALLOC(S) StringListDealloc(S)
|
||||||
|
#define MaxCharsUserRec 500
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static int GetNumPtsPerCell(ZoneType_e ZoneType)
|
||||||
|
{
|
||||||
|
int NumPts = 0;
|
||||||
|
switch (ZoneType)
|
||||||
|
{
|
||||||
|
case ZoneType_FETriangle : NumPts = 3; break;
|
||||||
|
case ZoneType_FEQuad : NumPts = 4; break;
|
||||||
|
case ZoneType_FETetra : NumPts = 4; break;
|
||||||
|
case ZoneType_FEBrick : NumPts = 8; break;
|
||||||
|
default : NumPts = 0;
|
||||||
|
}
|
||||||
|
return (NumPts);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int GetNumPts(ZoneType_e ZoneType,
|
||||||
|
LgIndex_t NumPtsI,
|
||||||
|
LgIndex_t NumPtsJ,
|
||||||
|
LgIndex_t NumPtsK)
|
||||||
|
{
|
||||||
|
int NumPts = 0;
|
||||||
|
switch (ZoneType)
|
||||||
|
{
|
||||||
|
case ZoneType_FETriangle :
|
||||||
|
case ZoneType_FEQuad :
|
||||||
|
case ZoneType_FETetra :
|
||||||
|
case ZoneType_FEBrick :
|
||||||
|
case ZoneType_FEPolygon :
|
||||||
|
case ZoneType_FEPolyhedron: NumPts = NumPtsI; break;
|
||||||
|
default : NumPts = NumPtsI*NumPtsJ*NumPtsK;
|
||||||
|
}
|
||||||
|
return (NumPts);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void DeallocHeaderInfo(char **DataSetTitle,
|
||||||
|
StringList_pa *VarNames,
|
||||||
|
StringList_pa *ZoneNames,
|
||||||
|
LgIndex_t **NumPtsI,
|
||||||
|
LgIndex_t **NumPtsJ,
|
||||||
|
LgIndex_t **NumPtsK,
|
||||||
|
ZoneType_e **ZoneType,
|
||||||
|
StringList_pa *UserRec)
|
||||||
|
{
|
||||||
|
if (*DataSetTitle)
|
||||||
|
FREE_ARRAY(*DataSetTitle, "data set title");
|
||||||
|
if (*VarNames)
|
||||||
|
STRINGLISTDEALLOC(VarNames);
|
||||||
|
if (*ZoneNames)
|
||||||
|
STRINGLISTDEALLOC(ZoneNames);
|
||||||
|
if (*NumPtsI)
|
||||||
|
FREE_ARRAY(*NumPtsI, "NumPtsI Array");
|
||||||
|
if (*NumPtsJ)
|
||||||
|
FREE_ARRAY(*NumPtsJ, "NumPtsJ Array");
|
||||||
|
if (*NumPtsK)
|
||||||
|
FREE_ARRAY(*NumPtsK, "NumPtsK Array");
|
||||||
|
if (*ZoneType)
|
||||||
|
FREE_ARRAY(*ZoneType, "ZoneType Array");
|
||||||
|
if (*UserRec)
|
||||||
|
STRINGLISTDEALLOC(UserRec);
|
||||||
|
|
||||||
|
*DataSetTitle = NULL;
|
||||||
|
*VarNames = NULL;
|
||||||
|
*ZoneNames = NULL;
|
||||||
|
*NumPtsI = NULL;
|
||||||
|
*NumPtsJ = NULL;
|
||||||
|
*NumPtsK = NULL;
|
||||||
|
*ZoneType = NULL;
|
||||||
|
*UserRec = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define MAXCHARSINFOLINE 5000
|
||||||
|
|
||||||
|
|
||||||
|
void ReportFileInfo(char *FName,
|
||||||
|
Boolean_t LoadRawData,
|
||||||
|
Boolean_t AllocateRawDataSpaceLocally)
|
||||||
|
{
|
||||||
|
short IVersion;
|
||||||
|
EntIndex_t NumZones;
|
||||||
|
EntIndex_t NumVars;
|
||||||
|
char *DataSetTitle = NULL;
|
||||||
|
StringList_pa VarNames = NULL;
|
||||||
|
StringList_pa ZoneNames = NULL;
|
||||||
|
LgIndex_t *NumPtsI = NULL;
|
||||||
|
LgIndex_t *NumPtsJ = NULL;
|
||||||
|
LgIndex_t *NumPtsK = NULL;
|
||||||
|
ZoneType_e *ZoneType = NULL;
|
||||||
|
StringList_pa UserRec = NULL;
|
||||||
|
int CZ, CV;
|
||||||
|
char InfoLine[MAXCHARSINFOLINE+1];
|
||||||
|
double **VDataBase = NULL;
|
||||||
|
NodeMap_t **NodeMap = NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Load in the header information only.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!READTEC(TRUE,
|
||||||
|
FName,
|
||||||
|
&IVersion,
|
||||||
|
&DataSetTitle,
|
||||||
|
&NumZones,
|
||||||
|
&NumVars,
|
||||||
|
&VarNames,
|
||||||
|
&ZoneNames,
|
||||||
|
&NumPtsI,
|
||||||
|
&NumPtsJ,
|
||||||
|
&NumPtsK,
|
||||||
|
&ZoneType,
|
||||||
|
&UserRec,
|
||||||
|
FALSE,
|
||||||
|
(NodeMap_t ***)NULL,
|
||||||
|
(double ***)NULL))
|
||||||
|
{
|
||||||
|
sprintf(InfoLine, "Cannot read file \"%s\"\nor file is not a Tecplot binary data file.\n", FName);
|
||||||
|
ERRMSG(InfoLine);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Boolean_t IsOk = TRUE;
|
||||||
|
if (LoadRawData)
|
||||||
|
{
|
||||||
|
if (AllocateRawDataSpaceLocally)
|
||||||
|
{
|
||||||
|
int NumPts;
|
||||||
|
VDataBase = ALLOC_ARRAY(NumZones * NumVars, double *, "vdatabase array");
|
||||||
|
for (CZ = 0; CZ < NumZones; CZ++)
|
||||||
|
for (CV = 0; CV < NumVars; CV++)
|
||||||
|
{
|
||||||
|
NumPts = GetNumPts(ZoneType[CZ], NumPtsI[CZ], NumPtsJ[CZ], NumPtsK[CZ]);
|
||||||
|
if (NumPts >= 1)
|
||||||
|
VDataBase[CZ*NumVars+CV] = ALLOC_ARRAY(NumPts, double, "vdatabase array");
|
||||||
|
else
|
||||||
|
VDataBase[CZ*NumVars+CV] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
NodeMap = ALLOC_ARRAY(NumZones, NodeMap_t *, "nodemap array");
|
||||||
|
for (CZ = 0; CZ < NumZones; CZ++)
|
||||||
|
{
|
||||||
|
if (ZoneType[CZ] == ZoneType_Ordered)
|
||||||
|
NodeMap[CZ] = NULL;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int PtsPerCell = GetNumPtsPerCell(ZoneType[CZ]);
|
||||||
|
NodeMap[CZ] = ALLOC_ARRAY(PtsPerCell * NumPtsJ[CZ],
|
||||||
|
NodeMap_t, "zone nodemap");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VDataBase = NULL;
|
||||||
|
NodeMap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: If any of the above alloc's failed then no big deal. ReadTec
|
||||||
|
* itself "skips" vars if memory was not allocated for it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DeallocHeaderInfo(&DataSetTitle,
|
||||||
|
&VarNames,
|
||||||
|
&ZoneNames,
|
||||||
|
&NumPtsI,
|
||||||
|
&NumPtsJ,
|
||||||
|
&NumPtsK,
|
||||||
|
&ZoneType,
|
||||||
|
&UserRec);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reread the datafile. This time load in the header AND the raw data
|
||||||
|
* Note that VDataBase may be preallocated or may be left up to ReadTec
|
||||||
|
* to allocate (See AllocateRawDataSpaceLocally above).
|
||||||
|
*/
|
||||||
|
if (!READTEC(FALSE,
|
||||||
|
FName,
|
||||||
|
&IVersion,
|
||||||
|
&DataSetTitle,
|
||||||
|
&NumZones,
|
||||||
|
&NumVars,
|
||||||
|
&VarNames,
|
||||||
|
&ZoneNames,
|
||||||
|
&NumPtsI,
|
||||||
|
&NumPtsJ,
|
||||||
|
&NumPtsK,
|
||||||
|
&ZoneType,
|
||||||
|
&UserRec,
|
||||||
|
AllocateRawDataSpaceLocally,
|
||||||
|
&NodeMap,
|
||||||
|
&VDataBase))
|
||||||
|
{
|
||||||
|
if (IVersion > 99)
|
||||||
|
{
|
||||||
|
sprintf(InfoLine,
|
||||||
|
"Error: ***\n"
|
||||||
|
" This add-on can only display raw nodal data\n"
|
||||||
|
" and it appears to contain cell centered data.\n");
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf(InfoLine,
|
||||||
|
"Cannot Read File, %s.\n"
|
||||||
|
"File may not be a tecplot binary data file.",
|
||||||
|
FName);
|
||||||
|
ERRMSG(InfoLine);
|
||||||
|
}
|
||||||
|
IsOk = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SHOWINFO("\n");
|
||||||
|
sprintf(InfoLine, "FileName : %s\n", FName);
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
sprintf(InfoLine, "File Version: %3.1f\n", IVersion / 10.0);
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
|
||||||
|
/* if the file contains filetype, then retrieve that separately since ReadTec should not be changed */
|
||||||
|
if (IVersion >= 109)
|
||||||
|
{
|
||||||
|
DataFileType_e FileType = DataFileType_Full;
|
||||||
|
char FileTypeStr[32];
|
||||||
|
FILE *F = NULL;
|
||||||
|
|
||||||
|
/* open the file and get the filetype */
|
||||||
|
F = fopen(FName, "rb");
|
||||||
|
if (F)
|
||||||
|
{
|
||||||
|
char Buffer[8];
|
||||||
|
Int32_t One;
|
||||||
|
Int32_t FileTypeInt;
|
||||||
|
|
||||||
|
/* 8 bytes for magic# and version and 4 bytes for Int32 */
|
||||||
|
fread(Buffer, sizeof(Buffer[0]), 8, F);
|
||||||
|
fread(&One, sizeof(One), 1, F);
|
||||||
|
fread(&FileTypeInt, sizeof(FileTypeInt), 1, F);
|
||||||
|
FileType = (DataFileType_e)FileTypeInt;
|
||||||
|
fclose(F);
|
||||||
|
F = NULL;
|
||||||
|
}
|
||||||
|
/* map the filetype */
|
||||||
|
switch (FileType)
|
||||||
|
{
|
||||||
|
case DataFileType_Full:
|
||||||
|
strcpy(FileTypeStr, "Full");
|
||||||
|
break;
|
||||||
|
case DataFileType_Grid:
|
||||||
|
strcpy(FileTypeStr, "Grid");
|
||||||
|
break;
|
||||||
|
case DataFileType_Solution:
|
||||||
|
strcpy(FileTypeStr, "Solution");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
IsOk = FALSE;
|
||||||
|
CHECK(FALSE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sprintf(InfoLine, "File Type : %s\n", FileTypeStr);
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf(InfoLine, "DataSetTitle: %s\n", DataSetTitle ? DataSetTitle : " ");
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
sprintf(InfoLine, "NumZones : %d\n", (int)NumZones);
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
sprintf(InfoLine, "NumVars : %d\n", (int)NumVars);
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
if (IsOk && (NumZones > 0))
|
||||||
|
{
|
||||||
|
SHOWINFO("Var Names : ");
|
||||||
|
for (CZ = 0; CZ < NumVars; CZ++)
|
||||||
|
{
|
||||||
|
char *VarName = STRINGLISTGETSTRING(VarNames, CZ + 1);
|
||||||
|
sprintf(InfoLine, "%s", VarName ? VarName : "NULL");
|
||||||
|
if (CZ < NumVars - 1)
|
||||||
|
strcat(InfoLine, ",");
|
||||||
|
else
|
||||||
|
strcat(InfoLine, "\n\n");
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
if (VarName)
|
||||||
|
FREE_ARRAY(VarName, "VarName array");
|
||||||
|
}
|
||||||
|
SHOWINFO("ZoneName IMax JMax KMax Node Face Elmt EType\n");
|
||||||
|
SHOWINFO("-------------------------------------------------------------------------------\n");
|
||||||
|
|
||||||
|
for (CZ = 0; CZ < NumZones; CZ++)
|
||||||
|
{
|
||||||
|
char *ZoneName = STRINGLISTGETSTRING(ZoneNames, CZ + 1);
|
||||||
|
if (ZoneType[CZ] != ZoneType_Ordered)
|
||||||
|
{
|
||||||
|
if (ZoneType[CZ] == ZoneType_FEPolygon ||
|
||||||
|
ZoneType[CZ] == ZoneType_FEPolyhedron)
|
||||||
|
sprintf(InfoLine, "%-20s --- --- --- %-8ld %-8ld %-8ld ",
|
||||||
|
(ZoneName ? ZoneName : "NULL"),
|
||||||
|
(long)NumPtsI[CZ],
|
||||||
|
(long)NumPtsK[CZ],
|
||||||
|
(long)NumPtsJ[CZ]);
|
||||||
|
else
|
||||||
|
sprintf(InfoLine, "%-20s --- --- --- %-8ld --- %-8ld ",
|
||||||
|
(ZoneName ? ZoneName : "NULL"),
|
||||||
|
(long)NumPtsI[CZ],
|
||||||
|
(long)NumPtsJ[CZ]);
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
switch (ZoneType[CZ])
|
||||||
|
{
|
||||||
|
case ZoneType_FETriangle : SHOWINFO("Tri\n"); break;
|
||||||
|
case ZoneType_FEQuad : SHOWINFO("Quad\n"); break;
|
||||||
|
case ZoneType_FETetra : SHOWINFO("Tetra\n"); break;
|
||||||
|
case ZoneType_FEBrick : SHOWINFO("Brick\n"); break;
|
||||||
|
case ZoneType_FELineSeg : SHOWINFO("LineSeg\n"); break;
|
||||||
|
case ZoneType_FEPolygon : SHOWINFO("Polygon\n"); break;
|
||||||
|
case ZoneType_FEPolyhedron: SHOWINFO("Polyhed\n"); break;
|
||||||
|
default: CHECK(FALSE); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf(InfoLine, "%-20s %-7ld %-7ld %-7ld --- --- --- ---\n",
|
||||||
|
(ZoneName ? ZoneName : "NULL"),
|
||||||
|
(long)NumPtsI[CZ],
|
||||||
|
(long)NumPtsJ[CZ],
|
||||||
|
(long)NumPtsK[CZ]);
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
}
|
||||||
|
if (ZoneName)
|
||||||
|
FREE_ARRAY(ZoneName, "ZoneName Array");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsOk)
|
||||||
|
{
|
||||||
|
for (CZ = 1; CZ <= STRINGLISTGETCOUNT(UserRec); CZ++)
|
||||||
|
{
|
||||||
|
char *S = STRINGLISTGETSTRING(UserRec, CZ);
|
||||||
|
if (S)
|
||||||
|
{
|
||||||
|
int L;
|
||||||
|
strcpy(InfoLine, "UserRec: ");
|
||||||
|
L = (int)strlen(InfoLine);
|
||||||
|
strncat(&InfoLine[L], S, MAXCHARSINFOLINE - L - 2);
|
||||||
|
strcat(&InfoLine[strlen(InfoLine)], "\n");
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
FREE_ARRAY(S, "temp string");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (LoadRawData)
|
||||||
|
{
|
||||||
|
for (CZ = 0; CZ < NumZones; CZ++)
|
||||||
|
{
|
||||||
|
int CV;
|
||||||
|
for (CV = 0; CV < NumVars; CV++)
|
||||||
|
if (VDataBase[CZ*NumVars+CV])
|
||||||
|
{
|
||||||
|
int I;
|
||||||
|
int NumPts = GetNumPts(ZoneType[CZ], NumPtsI[CZ], NumPtsJ[CZ], NumPtsK[CZ]);
|
||||||
|
int SLen = 0;
|
||||||
|
sprintf(InfoLine, "\n\nVariable data for zone %d, Var %d\n", CZ + 1, CV + 1);
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
InfoLine[0] = '\0';
|
||||||
|
for (I = 0; I < NumPts; I++)
|
||||||
|
{
|
||||||
|
char PString[50];
|
||||||
|
if (SLen + 50 > MAXCHARSINFOLINE)
|
||||||
|
{
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
InfoLine[0] = '\0';
|
||||||
|
SLen = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf(PString, "%lG ", VDataBase[CZ*NumVars+CV][I]);
|
||||||
|
strcat(InfoLine, PString);
|
||||||
|
SLen += (int)strlen(PString);
|
||||||
|
|
||||||
|
if ((I % 5) == 4)
|
||||||
|
{
|
||||||
|
strcat(InfoLine, "\n");
|
||||||
|
SLen++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (*InfoLine)
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
FREE_ARRAY(VDataBase[CZ*NumVars+CV], "vdatabase double");
|
||||||
|
}
|
||||||
|
if (NodeMap[CZ])
|
||||||
|
{
|
||||||
|
int I, J;
|
||||||
|
int PtsPerCell = GetNumPtsPerCell(ZoneType[CZ]);
|
||||||
|
int SLen = 0;
|
||||||
|
SHOWINFO("\nConnectivity list:\n");
|
||||||
|
InfoLine[0] = '\0';
|
||||||
|
for (J = 0; J < NumPtsJ[CZ]; J++)
|
||||||
|
{
|
||||||
|
if (SLen + 200 > MAXCHARSINFOLINE)
|
||||||
|
{
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
InfoLine[0] = '\0';
|
||||||
|
SLen = 0;
|
||||||
|
}
|
||||||
|
for (I = 0; I < PtsPerCell; I++)
|
||||||
|
{
|
||||||
|
char NString[20];
|
||||||
|
sprintf(NString, "%u ", (unsigned int)NodeMap[CZ][J*PtsPerCell+I] + 1);
|
||||||
|
strcat(InfoLine, NString);
|
||||||
|
SLen += (int)strlen(NString);
|
||||||
|
}
|
||||||
|
strcat(InfoLine, "\n");
|
||||||
|
SLen++;
|
||||||
|
}
|
||||||
|
if (*InfoLine)
|
||||||
|
SHOWINFO(InfoLine);
|
||||||
|
FREE_ARRAY(NodeMap[CZ], "nodemap");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FREE_ARRAY(NodeMap, "Nodemap base array");
|
||||||
|
FREE_ARRAY(VDataBase, "vdatabase base array");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SHOWINFO("\n\n");
|
||||||
|
|
||||||
|
DeallocHeaderInfo(&DataSetTitle,
|
||||||
|
&VarNames,
|
||||||
|
&ZoneNames,
|
||||||
|
&NumPtsI,
|
||||||
|
&NumPtsJ,
|
||||||
|
&NumPtsK,
|
||||||
|
&ZoneType,
|
||||||
|
&UserRec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined ADDON
|
||||||
|
int main(int argc, char *(argv[]))
|
||||||
|
{
|
||||||
|
short CurFile;
|
||||||
|
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
printf("Err: Need: pltview file1 [file2] ...\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (CurFile = 1; CurFile < argc; CurFile++)
|
||||||
|
ReportFileInfo(argv[CurFile], FALSE, FALSE);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
***********************************************
|
||||||
|
** README **
|
||||||
|
***********************************************
|
||||||
|
|
||||||
|
To build the TecIO library and/or the pltview utility
|
||||||
|
simply run the Runmake script in this directory.
|
||||||
|
|
||||||
|
If customization is needed it will most likely be done
|
||||||
|
in GLOBAL.h (to identify machine as 64 bit) and/or in
|
||||||
|
dataio4.c. Just look for CRAY in dataio4.c and you
|
||||||
|
will find most of the critical areas. Note that the
|
||||||
|
existing code defined by CRAY is quite old and has
|
||||||
|
not been in use for some time.
|
||||||
|
|
||||||
|
Each example has its own Makefile. You may have to adjust
|
||||||
|
the variables at the top of the Makefile for your platform.
|
||||||
|
|
||||||
|
|
||||||
|
ReadTec()
|
||||||
|
|
||||||
|
The ReadTec() is included in the tecio library but is
|
||||||
|
not supported by Tecplot, Inc. ReadTec is used
|
||||||
|
to read Tecplot binary data files (all versions at or
|
||||||
|
older than the Tecplot version providing the tecio
|
||||||
|
library). See tecsrc/DATAUTIL.h for more information.
|
||||||
|
|
||||||
|
The pltview example app gives an example of using ReadTec
|
||||||
|
to read just the header from a file as well as loading all
|
||||||
|
field data from a file./*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
@ -0,0 +1,205 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2009 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
#ifndef ALLOC_H
|
||||||
|
#define ALLOC_H
|
||||||
|
|
||||||
|
#include "TASSERT.h"
|
||||||
|
#if defined __cplusplus
|
||||||
|
#include <new>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined __cplusplus
|
||||||
|
#define ALLOC_ARRAY(N,Type,str) (Type *)malloc((N)*sizeof(Type))
|
||||||
|
#define ALLOC_ITEM(Type,str) (Type *)malloc(sizeof(Type))
|
||||||
|
#ifdef _DEBUG
|
||||||
|
/* NOTE: the pointer is set to 0xFFFF after the free for debug */
|
||||||
|
/* versions in the hopes of catching invalid pointer usage */
|
||||||
|
#define FREE_ARRAY(X,str) do { free((void *)(X)); *((void **)&(X)) = (void *)0xFFFF; } while (0)
|
||||||
|
#define FREE_ITEM(X,str) do { free((void *)(X)); *((void **)&(X)) = (void *)0xFFFF; } while (0)
|
||||||
|
#else
|
||||||
|
#define FREE_ARRAY(X,str) free((void *)(X))
|
||||||
|
#define FREE_ITEM(X,str) free((void *)(X))
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#ifdef TRACK_MEMORY_USAGE
|
||||||
|
extern void initMemoryUsageTracking(void);
|
||||||
|
extern void cleanUpMemoryUsageTracking(void);
|
||||||
|
extern void trackMemoryAlloc(size_t size);
|
||||||
|
extern void trackMemoryFree(size_t size);
|
||||||
|
extern void trackMemoryClearHighMark(void);
|
||||||
|
extern void trackMemorySaveHighMark(void);
|
||||||
|
extern void getMemoryUsage(size_t* memoryInUse,
|
||||||
|
size_t* memoryCurrentHighMark,
|
||||||
|
size_t* memorySavedHighMark,
|
||||||
|
size_t* memoryTotalHighMark);
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* Create a version of new that returns NULL instead
|
||||||
|
* of throwing std::bad_alloc. A lot of code is written using
|
||||||
|
* ALLOC_ITEM and ALLOC_ARRAY that expect a return value of
|
||||||
|
* NULL on failure instead of the exception. 2008-05-08 CAM
|
||||||
|
*/
|
||||||
|
#if defined MSWIN && defined _DEBUG
|
||||||
|
template <typename T>
|
||||||
|
inline T *nonExceptionNew(size_t numItems,
|
||||||
|
const char* fileName,
|
||||||
|
int lineNumber)
|
||||||
|
{
|
||||||
|
REQUIRE(numItems > 0);
|
||||||
|
REQUIRE(VALID_REF(fileName));
|
||||||
|
REQUIRE(lineNumber > 0);
|
||||||
|
T* result;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
#ifdef DEBUG_NEW
|
||||||
|
#ifdef new
|
||||||
|
#undef new
|
||||||
|
#define USING_DEBUG_NEW
|
||||||
|
#endif
|
||||||
|
result = new(fileName, lineNumber) T[numItems];
|
||||||
|
#ifdef USING_DEBUG_NEW
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#undef USING_DEBUG_NEW
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
result = new T[numItems];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
catch (std::bad_alloc&)
|
||||||
|
{
|
||||||
|
result = NULL;
|
||||||
|
}
|
||||||
|
#ifdef TRACK_MEMORY_USAGE
|
||||||
|
if (result != NULL)
|
||||||
|
{
|
||||||
|
#ifdef MSWIN
|
||||||
|
trackMemoryAlloc(_msize(result));
|
||||||
|
#else
|
||||||
|
trackMemoryAlloc(malloc_usable_size(result));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
ENSURE(VALID_REF_OR_NULL(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#define ALLOC_ARRAY(N,Type,str) nonExceptionNew<Type>((N),__FILE__,__LINE__)
|
||||||
|
#else
|
||||||
|
template <typename T>
|
||||||
|
inline T *nonExceptionNew(size_t numItems)
|
||||||
|
{
|
||||||
|
REQUIRE(numItems > 0);
|
||||||
|
T *result;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
result = new T[numItems];
|
||||||
|
}
|
||||||
|
catch (std::bad_alloc&)
|
||||||
|
{
|
||||||
|
result = NULL;
|
||||||
|
}
|
||||||
|
#ifdef TRACK_MEMORY_USAGE
|
||||||
|
if (result != NULL)
|
||||||
|
{
|
||||||
|
#ifdef MSWIN
|
||||||
|
trackMemoryAlloc(_msize(result));
|
||||||
|
#else
|
||||||
|
trackMemoryAlloc(malloc_usable_size(result));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
ENSURE(VALID_REF_OR_NULL(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#define ALLOC_ARRAY(N,Type,str) nonExceptionNew<Type>((N))
|
||||||
|
#endif
|
||||||
|
#define ALLOC_ITEM(Type,str) ALLOC_ARRAY(1,Type,str)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Although delete doesn't throw exceptions, this function matches
|
||||||
|
* nonExceptionNew, and also reports the size of the block if we
|
||||||
|
* are tracking memory.
|
||||||
|
*/
|
||||||
|
template <typename T>
|
||||||
|
inline void nonExceptionDelete(T* &ptr)
|
||||||
|
{
|
||||||
|
#if defined MSWIN && !defined NO_ASSERTS
|
||||||
|
CHECK(!IsBadReadPtr((void*)ptr, 1));
|
||||||
|
#endif
|
||||||
|
#if defined TRACK_MEMORY_USAGE
|
||||||
|
if (ptr != NULL)
|
||||||
|
{
|
||||||
|
#ifdef MSWIN
|
||||||
|
trackMemoryFree(_msize(ptr));
|
||||||
|
#else
|
||||||
|
trackMemoryFree(malloc_usable_size(ptr));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
delete [] ptr;
|
||||||
|
#if !defined NO_ASSERTS
|
||||||
|
/*
|
||||||
|
* NOTE: the pointer is set to 0xFFFF after the free for asserted
|
||||||
|
* builds in the hopes of catching invalid pointer usage
|
||||||
|
*/
|
||||||
|
ptr = (T*)(void*)0xFFFF;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#define FREE_ARRAY(ptr,str) nonExceptionDelete((ptr))
|
||||||
|
#define FREE_ITEM(ptr,str) FREE_ARRAY(ptr,str)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following functor can be used to easily deallocate memory from containers
|
||||||
|
* that hold pointers to allocated objects. For example:
|
||||||
|
*
|
||||||
|
* vector<MyObject*> container;
|
||||||
|
* for (int ii = 0; ii < 10; ii++
|
||||||
|
* container.push_back(new MyObject);
|
||||||
|
* ... do something with the objects ...
|
||||||
|
* ... now we need to clean up ...
|
||||||
|
* for_each(container.begin(),
|
||||||
|
* container.end(),
|
||||||
|
* DeleteItem());
|
||||||
|
*/
|
||||||
|
struct DeleteItem
|
||||||
|
{
|
||||||
|
template<typename T>
|
||||||
|
void operator()(T*& object)
|
||||||
|
{
|
||||||
|
delete object;
|
||||||
|
object = NULL;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* ALLOC_H */
|
||||||
@ -0,0 +1,626 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
#if !defined ARRLIST_h
|
||||||
|
#define ARRLIST_h
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
# undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined ARRLISTMODULE
|
||||||
|
# define EXTERN
|
||||||
|
#else
|
||||||
|
# define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ArrayListType_UnsignedChar,
|
||||||
|
ArrayListType_UnsignedShort,
|
||||||
|
ArrayListType_UnsignedInt,
|
||||||
|
ArrayListType_UnsignedLong,
|
||||||
|
ArrayListType_Int64,
|
||||||
|
ArrayListType_Char,
|
||||||
|
ArrayListType_Short,
|
||||||
|
ArrayListType_Int,
|
||||||
|
ArrayListType_Long,
|
||||||
|
ArrayListType_Float,
|
||||||
|
ArrayListType_Double,
|
||||||
|
ArrayListType_LgIndex,
|
||||||
|
ArrayListType_EntIndex,
|
||||||
|
ArrayListType_SmInteger,
|
||||||
|
ArrayListType_Boolean,
|
||||||
|
ArrayListType_ArbParam,
|
||||||
|
ArrayListType_UnsignedCharPtr,
|
||||||
|
ArrayListType_UnsignedShortPtr,
|
||||||
|
ArrayListType_UnsignedIntPtr,
|
||||||
|
ArrayListType_UnsignedLongPtr,
|
||||||
|
ArrayListType_Int64Ptr,
|
||||||
|
ArrayListType_CharPtr,
|
||||||
|
ArrayListType_ShortPtr,
|
||||||
|
ArrayListType_IntPtr,
|
||||||
|
ArrayListType_LongPtr,
|
||||||
|
ArrayListType_FloatPtr,
|
||||||
|
ArrayListType_DoublePtr,
|
||||||
|
ArrayListType_LgIndexPtr,
|
||||||
|
ArrayListType_EntIndexPtr,
|
||||||
|
ArrayListType_SmIntegerPtr,
|
||||||
|
ArrayListType_BooleanPtr,
|
||||||
|
ArrayListType_ArbParamPtr,
|
||||||
|
ArrayListType_VoidPtr,
|
||||||
|
ArrayListType_FunctionPtr,
|
||||||
|
ArrayListType_Any,
|
||||||
|
END_ArrayListType_e,
|
||||||
|
ArrayListType_Invalid = BadEnumValue
|
||||||
|
} ArrayListType_e;
|
||||||
|
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
unsigned char UnsignedChar;
|
||||||
|
unsigned short UnsignedShort;
|
||||||
|
unsigned int UnsignedInt;
|
||||||
|
unsigned long UnsignedLong;
|
||||||
|
Int64_t Int64;
|
||||||
|
char Char;
|
||||||
|
short Short;
|
||||||
|
int Int;
|
||||||
|
long Long;
|
||||||
|
float Float;
|
||||||
|
double Double;
|
||||||
|
LgIndex_t LgIndex;
|
||||||
|
EntIndex_t EntIndex;
|
||||||
|
SmInteger_t SmInteger;
|
||||||
|
Boolean_t BBoolean; /* X-Windows uses Boolean */
|
||||||
|
ArbParam_t ArbParam;
|
||||||
|
unsigned char *UnsignedCharPtr;
|
||||||
|
unsigned short *UnsignedShortPtr;
|
||||||
|
unsigned int *UnsignedIntPtr;
|
||||||
|
unsigned long *UnsignedLongPtr;
|
||||||
|
Int64_t *Int64Ptr;
|
||||||
|
char *CharPtr;
|
||||||
|
short *ShortPtr;
|
||||||
|
int *IntPtr;
|
||||||
|
long *LongPtr;
|
||||||
|
float *FloatPtr;
|
||||||
|
double *DoublePtr;
|
||||||
|
LgIndex_t *LgIndexPtr;
|
||||||
|
EntIndex_t *EntIndexPtr;
|
||||||
|
SmInteger_t *SmIntegerPtr;
|
||||||
|
Boolean_t *BooleanPtr;
|
||||||
|
ArbParam_t *ArbParamPtr;
|
||||||
|
void *VoidPtr;
|
||||||
|
void (*FunctionPtr)(void);
|
||||||
|
} ArrayListItem_u;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NULL array list item for added convenience of inserting a NULL item without
|
||||||
|
* having to declare and assign one. Can be used as follows:
|
||||||
|
*
|
||||||
|
* IsOk = ArrayListInsertItem(SomeArrayList, SomeIndex, ArrayListNumItem);
|
||||||
|
*
|
||||||
|
* NOTE: This value must be set to zero before Tecplot uses array lists.
|
||||||
|
* memset(&ArrayListNullItem, 0, sizeof(ArrayListType_Any));
|
||||||
|
*/
|
||||||
|
EXTERN ArrayListItem_u ArrayListNullItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Visitor for traversing an array list. An iterator may not perform any
|
||||||
|
* operation that will adjust the size of the list. In other words it may not
|
||||||
|
* insert or delete items from the list. However an iterator may perform a get
|
||||||
|
* operation or a set operation that do not expand the list size.
|
||||||
|
*
|
||||||
|
* param ItemRef
|
||||||
|
* Reference to the array list item visited.
|
||||||
|
* param ClientData
|
||||||
|
* Any client data required for the visitor.
|
||||||
|
*
|
||||||
|
* return
|
||||||
|
* TRUE to continue visiting items, otherwise
|
||||||
|
* FALSE to discontinue visiting
|
||||||
|
*/
|
||||||
|
typedef Boolean_t (*ArrayListItemVisitor_pf)(void *ItemRef,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
#if 0 /* use this stub as a starting place */
|
||||||
|
{
|
||||||
|
REQUIRE(VALID_REF(TypeRef));
|
||||||
|
REQUIRE(VALID_REF(*TypeRef) || *TypeRef == NULL);
|
||||||
|
|
||||||
|
Boolean_t DoContinue = TRUE;
|
||||||
|
<type> *TypeRef = (<type> *)ItemRef;
|
||||||
|
|
||||||
|
ENSURE(VALID_BOOLEAN(DoContinue));
|
||||||
|
return DoContinue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destructor for cleaning up one or more array list items. If a destructor is
|
||||||
|
* not supplied then the array items are simply discarded.
|
||||||
|
*
|
||||||
|
* NOTE: The only change to ArrayListItemVisitor_pf is the policy which
|
||||||
|
* requires that the return value is TRUE.
|
||||||
|
*
|
||||||
|
* param ItemRef
|
||||||
|
* Reference to the array list item to cleanup.
|
||||||
|
* param ClientData
|
||||||
|
* Any client data required for cleanup.
|
||||||
|
*
|
||||||
|
* return
|
||||||
|
* TRUE is a requirement
|
||||||
|
*/
|
||||||
|
typedef ArrayListItemVisitor_pf ArrayListItemDestructor_pf;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Duplicator for copying one or more array list items. If a duplicator is not
|
||||||
|
* supplied then the array items are simply copied. For pointer types this
|
||||||
|
* means by reference. Note that if a duplicator is used the rules for
|
||||||
|
* duplication and subsequent cleanup are defined by the client.
|
||||||
|
*
|
||||||
|
* param TargetItemRef
|
||||||
|
* Reference to the array list to receive the duplicate.
|
||||||
|
* param SourceItemRef
|
||||||
|
* Reference to the array list item to duplicate.
|
||||||
|
* param ClientData
|
||||||
|
* Any client data required for duplication.
|
||||||
|
*
|
||||||
|
* return
|
||||||
|
* TRUE if the duplication was a success
|
||||||
|
* FALSE otherwise. If the duplication failed it
|
||||||
|
* is the client's responsibility to cleanup any
|
||||||
|
* partial duplication
|
||||||
|
*/
|
||||||
|
typedef Boolean_t (*ArrayListItemDuplicator_pf)(void *TargetItemRef,
|
||||||
|
void *SourceItemRef,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
#if 0 /* use this stub as a starting place */
|
||||||
|
{
|
||||||
|
REQUIRE(VALID_REF(TargetTypeRef));
|
||||||
|
REQUIRE(VALID_REF(SourceTypeRef));
|
||||||
|
REQUIRE(VALID_REF(*SourceTypeRef) || *SourceTypeRef == NULL);
|
||||||
|
|
||||||
|
Boolean_t IsOk = TRUE;
|
||||||
|
<type> *TargetTypeRef = (<type> *)TargetItemRef;
|
||||||
|
<type> *SourceTypeRef = (<type> *)SourceItemRef;
|
||||||
|
|
||||||
|
ENSURE(VALID_BOOLEAN(IsOk));
|
||||||
|
return IsOk;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adjusts the capacity request as necessary to minimize memory reallocations
|
||||||
|
* for large lists. Unless the request exceeds the maximum the adjusted
|
||||||
|
* capacity will be at least as big as requested however it may be larger if it
|
||||||
|
* is determined that the space requirement is growing faster. If the maximum
|
||||||
|
* is exceeded zero should be returned.
|
||||||
|
*
|
||||||
|
* param ArrayList
|
||||||
|
* Array list requesting the change in capacity.
|
||||||
|
* param CurrentCapacity
|
||||||
|
* Current capacity of the array list.
|
||||||
|
* param RequestedCapacity
|
||||||
|
* Capacity request or zero for default size.
|
||||||
|
* param ClientData
|
||||||
|
* Any client data needed for the adjustment.
|
||||||
|
*
|
||||||
|
* return
|
||||||
|
* Adjusted capacity that is at least as large as the request or zero if
|
||||||
|
* unable to satisfy the requested capacity.
|
||||||
|
*/
|
||||||
|
typedef LgIndex_t (*ArrayListCapacityRequestAdjuster_pf)(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t CurrentCapacity,
|
||||||
|
LgIndex_t RequestedCapacity,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
#if 0 /* use this stub as a starting place */
|
||||||
|
{
|
||||||
|
REQUIRE(ArrayListIsValid(ArrayList));
|
||||||
|
REQUIRE((RequestedCapacity == 0 && CurrentCapacity == 0) ||
|
||||||
|
RequestedCapacity > ArrayList->Capacity);
|
||||||
|
|
||||||
|
LgIndex_t Result;
|
||||||
|
|
||||||
|
ENSURE(Result == 0 || Result >= RequestedCapacity);
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* private ArrayList structure: only exposed so STRUTIL can use it */
|
||||||
|
typedef struct _ArrayList_s
|
||||||
|
{
|
||||||
|
char *Array; /* byte array for holding the items */
|
||||||
|
ArrayListType_e Type; /* type of array items */
|
||||||
|
SmInteger_t ItemSize; /* byte size of an individual item */
|
||||||
|
LgIndex_t Count; /* number of items in the array */
|
||||||
|
LgIndex_t Capacity; /* maximum holding capacity of the array */
|
||||||
|
Boolean_t IsVisitingItems; /* indicates if an iteration is in progress */
|
||||||
|
ArrayListCapacityRequestAdjuster_pf CapacityRequestAdjuster;
|
||||||
|
ArbParam_t CapacityRequestAdjusterClientData;
|
||||||
|
} ArrayList_s;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares two array list elements. Note that either string may be
|
||||||
|
* NULL as array lists allow for NULL elements.
|
||||||
|
*
|
||||||
|
* @param Item1
|
||||||
|
* Element to compare against Item2.
|
||||||
|
* @param Item2
|
||||||
|
* Element to compare against Item1.
|
||||||
|
* @param ClientData
|
||||||
|
* Contextual information that was passed to the 'ArrayListQSort' function.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - A value less than zero if Item1 is less than Item2.
|
||||||
|
* - A value of zero if Item1 is equal to Item2.
|
||||||
|
* - A value greater than zero if Item1 is greater than Item2.
|
||||||
|
*/
|
||||||
|
typedef int (STDCALL *ArrayListItemComparator_pf)(ArrayListItem_u Item1,
|
||||||
|
ArrayListItem_u Item2,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
|
||||||
|
EXTERN Boolean_t ArrayListIsValid(ArrayList_pa ArrayList);
|
||||||
|
EXTERN ArrayListType_e ArrayListGetType(ArrayList_pa ArrayList);
|
||||||
|
EXTERN Boolean_t ArrayListEnlargeCapacity(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t RequestedCapacity);
|
||||||
|
EXTERN ArrayList_pa ArrayListAlloc(LgIndex_t EstimatedCapacity,
|
||||||
|
ArrayListType_e Type,
|
||||||
|
ArrayListCapacityRequestAdjuster_pf CapacityRequestAdjuster,
|
||||||
|
ArbParam_t CapacityRequestAdjusterClientData);
|
||||||
|
EXTERN void ArrayListDealloc(ArrayList_pa *ArrayList,
|
||||||
|
ArrayListItemDestructor_pf ItemDestructor,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN void ArrayListDeleteAllItems(ArrayList_pa ArrayList,
|
||||||
|
ArrayListItemDestructor_pf ItemDestructor,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN void ArrayListDeleteItems(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset,
|
||||||
|
LgIndex_t Count,
|
||||||
|
ArrayListItemDestructor_pf ItemDestructor,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN void ArrayListDeleteItem(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset,
|
||||||
|
ArrayListItemDestructor_pf ItemDestructor,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN ArrayList_pa ArrayListRemoveItems(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset,
|
||||||
|
LgIndex_t Count);
|
||||||
|
EXTERN ArrayListItem_u ArrayListRemoveItem(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset);
|
||||||
|
EXTERN Boolean_t ArrayListInsertItem(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset,
|
||||||
|
ArrayListItem_u Item);
|
||||||
|
EXTERN Boolean_t ArrayListInsert(ArrayList_pa Target,
|
||||||
|
LgIndex_t ItemOffset,
|
||||||
|
ArrayList_pa Source);
|
||||||
|
EXTERN Boolean_t ArrayListVisitItems(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset,
|
||||||
|
LgIndex_t Count,
|
||||||
|
ArrayListItemVisitor_pf ItemVisitor,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN ArrayList_pa ArrayListGetItems(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset,
|
||||||
|
LgIndex_t Count);
|
||||||
|
EXTERN ArrayListItem_u ArrayListGetItem(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset);
|
||||||
|
EXTERN Boolean_t ArrayListSetItem(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset,
|
||||||
|
ArrayListItem_u Item,
|
||||||
|
ArrayListItemDestructor_pf ItemDestructor,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN Boolean_t ArrayListAppendItem(ArrayList_pa ArrayList,
|
||||||
|
ArrayListItem_u Item);
|
||||||
|
EXTERN Boolean_t ArrayListAppend(ArrayList_pa Target,
|
||||||
|
ArrayList_pa Source);
|
||||||
|
EXTERN ArrayList_pa ArrayListCopy(ArrayList_pa ArrayList,
|
||||||
|
ArrayListItemDuplicator_pf ItemDuplicator,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN void *ArrayListToArray(ArrayList_pa ArrayList,
|
||||||
|
ArrayListItemDuplicator_pf ItemDuplicator,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN ArrayList_pa ArrayListFromArray(void *Source,
|
||||||
|
LgIndex_t Count,
|
||||||
|
ArrayListType_e Type,
|
||||||
|
ArrayListItemDuplicator_pf ItemDuplicator,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
EXTERN void ArrayListQSort(ArrayList_pa ArrayList,
|
||||||
|
ArrayListItemComparator_pf Comparator,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
EXTERN Boolean_t ArrayListBSearch(ArrayList_pa ArrayList,
|
||||||
|
ArrayListItem_u Item,
|
||||||
|
ArrayListItemComparator_pf Comparator,
|
||||||
|
ArbParam_t ClientData,
|
||||||
|
LgIndex_t *ItemIndex);
|
||||||
|
|
||||||
|
#if defined USE_MACROS_FOR_FUNCTIONS
|
||||||
|
/**
|
||||||
|
* Gets the array list's internal buffer representation.
|
||||||
|
* Use ArrayListGetXxx accessors whenever possible as their
|
||||||
|
* implementation in the release build is as fast as using
|
||||||
|
* the array directly anyway.
|
||||||
|
*
|
||||||
|
* WARNING:
|
||||||
|
* Some array list functions modify the internal buffer.
|
||||||
|
* This will invalidate this reference however it is
|
||||||
|
* the client's responsibility not to make further use
|
||||||
|
* of it. In addition, this reference should never be
|
||||||
|
* deallocated directly as the array list assumes the
|
||||||
|
* responsible for the cleanup.
|
||||||
|
*
|
||||||
|
* param ArrayList
|
||||||
|
* Array list for which a reference to the internal
|
||||||
|
* buffer is desired.
|
||||||
|
*
|
||||||
|
* return
|
||||||
|
* Reference to the array list's internal buffer.
|
||||||
|
*/
|
||||||
|
# define ArrayListGetInternalRef ArrayListGetInternalRef_MACRO
|
||||||
|
/**
|
||||||
|
* Gets the item's internal reference at the specified offset in the list.
|
||||||
|
*
|
||||||
|
* WARNING:
|
||||||
|
* Some array list functions modify the internal buffer.
|
||||||
|
* This will invalidate this reference however it is
|
||||||
|
* the client's responsibility not to make further use
|
||||||
|
* of it. In addition, this reference should never be
|
||||||
|
* deallocated directly as the array list assumes the
|
||||||
|
* responsible for the cleanup.
|
||||||
|
*
|
||||||
|
* param ArrayList
|
||||||
|
* Array list containing the desired item.
|
||||||
|
* param ItemOffset
|
||||||
|
* Offset to the item in the list.
|
||||||
|
*
|
||||||
|
* return
|
||||||
|
* The internal reference to the requested item.
|
||||||
|
*/
|
||||||
|
# define ArrayListGetItemInternalRef ArrayListGetItemInternalRef_MACRO
|
||||||
|
# define ArrayListGetCount ArrayListGetCount_MACRO
|
||||||
|
|
||||||
|
# define ArrayListGetUnsignedChar(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, unsigned char)
|
||||||
|
# define ArrayListGetUnsignedShort(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, unsigned short)
|
||||||
|
# define ArrayListGetUnsignedInt(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, unsigned int)
|
||||||
|
# define ArrayListGetUnsignedLong(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, unsigned long)
|
||||||
|
# define ArrayListGetInt64(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, Int64_t)
|
||||||
|
# define ArrayListGetChar(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, char)
|
||||||
|
# define ArrayListGetShort(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, short)
|
||||||
|
# define ArrayListGetInt(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, int)
|
||||||
|
# define ArrayListGetLong(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, long)
|
||||||
|
# define ArrayListGetFloat(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, float)
|
||||||
|
# define ArrayListGetDouble(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, double)
|
||||||
|
# define ArrayListGetLgIndex(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, LgIndex_t)
|
||||||
|
# define ArrayListGetEntIndex(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, EntIndex_t)
|
||||||
|
# define ArrayListGetSmInteger(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, SmInteger_t)
|
||||||
|
# define ArrayListGetBoolean(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, Boolean_t)
|
||||||
|
# define ArrayListGetArbParam(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, ArbParam_t)
|
||||||
|
# define ArrayListGetUnsignedCharPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, unsigned char *)
|
||||||
|
# define ArrayListGetUnsignedShortPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, unsigned short *)
|
||||||
|
# define ArrayListGetUnsignedIntPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, unsigned int *)
|
||||||
|
# define ArrayListGetUnsignedLongPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, unsigned long *)
|
||||||
|
# define ArrayListGetInt64Ptr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, Int64_t *)
|
||||||
|
# define ArrayListGetCharPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, char *)
|
||||||
|
# define ArrayListGetShortPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, short *)
|
||||||
|
# define ArrayListGetIntPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, int *)
|
||||||
|
# define ArrayListGetLongPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, long *)
|
||||||
|
# define ArrayListGetFloatPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, float *)
|
||||||
|
# define ArrayListGetDoublePtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, double *)
|
||||||
|
# define ArrayListGetLgIndexPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, LgIndex_t *)
|
||||||
|
# define ArrayListGetEntIndexPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, EntIndex_t *)
|
||||||
|
# define ArrayListGetSmIntegerPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, SmInteger_t *)
|
||||||
|
# define ArrayListGetBooleanPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, Boolean_t *)
|
||||||
|
# define ArrayListGetArbParamPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, ArbParam_t *)
|
||||||
|
# define ArrayListGetVoidPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, void *)
|
||||||
|
# define ArrayListGetFunctionPtr(ArrayList, ItemOffset) ArrayListGetTypedItem(ArrayList, ItemOffset, (**)(void))
|
||||||
|
#else
|
||||||
|
# define ArrayListGetInternalRef ArrayListGetInternalRef_FUNC
|
||||||
|
# define ArrayListGetItemInternalRef ArrayListGetItemInternalRef_FUNC
|
||||||
|
# define ArrayListGetCount ArrayListGetCount_FUNC
|
||||||
|
|
||||||
|
# define ArrayListGetUnsignedChar(ArrayList, ItemOffset) (*((unsigned char *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetUnsignedShort(ArrayList, ItemOffset) (*((unsigned short *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetUnsignedInt(ArrayList, ItemOffset) (*((unsigned int *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetUnsignedLong(ArrayList, ItemOffset) (*((unsigned long *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetInt64(ArrayList, ItemOffset) (*((Int64_t *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetChar(ArrayList, ItemOffset) (*((char *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetShort(ArrayList, ItemOffset) (*((short *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetInt(ArrayList, ItemOffset) (*((int *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetLong(ArrayList, ItemOffset) (*((long *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetFloat(ArrayList, ItemOffset) (*((float *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetDouble(ArrayList, ItemOffset) (*((double *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetLgIndex(ArrayList, ItemOffset) (*((LgIndex_t *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetEntIndex(ArrayList, ItemOffset) (*((EntIndex_t *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetSmInteger(ArrayList, ItemOffset) (*((SmInteger_t *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetBoolean(ArrayList, ItemOffset) (*((Boolean_t *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetArbParam(ArrayList, ItemOffset) (*((ArbParam_t *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetUnsignedCharPtr(ArrayList, ItemOffset) (*((unsigned char * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetUnsignedShortPtr(ArrayList, ItemOffset) (*((unsigned short * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetUnsignedIntPtr(ArrayList, ItemOffset) (*((unsigned int * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetUnsignedLongPtr(ArrayList, ItemOffset) (*((unsigned long * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetInt64Ptr(ArrayList, ItemOffset) (*((Int64_t * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetCharPtr(ArrayList, ItemOffset) (*((char * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetShortPtr(ArrayList, ItemOffset) (*((short * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetIntPtr(ArrayList, ItemOffset) (*((int * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetLongPtr(ArrayList, ItemOffset) (*((long * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetFloatPtr(ArrayList, ItemOffset) (*((float * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetDoublePtr(ArrayList, ItemOffset) (*((double * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetLgIndexPtr(ArrayList, ItemOffset) (*((LgIndex_t * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetEntIndexPtr(ArrayList, ItemOffset) (*((EntIndex_t * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetSmIntegerPtr(ArrayList, ItemOffset) (*((SmInteger_t * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetBooleanPtr(ArrayList, ItemOffset) (*((Boolean_t * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetArbParamPtr(ArrayList, ItemOffset) (*((ArbParam_t * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetVoidPtr(ArrayList, ItemOffset) (*((void * *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
# define ArrayListGetFunctionPtr(ArrayList, ItemOffset) (*(((**)(void) *)ArrayListGetItemInternalRef_FUNC(ArrayList, ItemOffset)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined USE_MACROS_FOR_FUNCTIONS
|
||||||
|
EXTERN const void *ArrayListGetInternalRef_FUNC(ArrayList_pa ArrayList);
|
||||||
|
EXTERN const void *ArrayListGetItemInternalRef_FUNC(ArrayList_pa ArrayList,
|
||||||
|
LgIndex_t ItemOffset);
|
||||||
|
EXTERN LgIndex_t ArrayListGetCount_FUNC(ArrayList_pa ArrayList);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define ArrayListGetInternalRef_MACRO(ArrayList) ((const void *)((ArrayList)->Array))
|
||||||
|
#define ArrayListGetItemInternalRef_MACRO(ArrayList, ItemOffset) ((const void *)&((ArrayList)->Array[(ItemOffset)*(ArrayList)->ItemSize]))
|
||||||
|
#define ArrayListGetCount_MACRO(ArrayList) ((ArrayList)->Count)
|
||||||
|
#define ArrayListGetTypedArrayRef(ArrayList, NativeType) ((NativeType *)((ArrayList)->Array))
|
||||||
|
#define ArrayListGetTypedItem(ArrayList, ItemOffset, NativeType) (ArrayListGetTypedArrayRef(ArrayList,NativeType)[ItemOffset])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple macro to determine if the item offset is within the array list
|
||||||
|
* capacity. In the debug or checked builds we also perform a lower bound
|
||||||
|
* assertion check.
|
||||||
|
*/
|
||||||
|
#if defined NO_ASSERTS
|
||||||
|
# define ArrayListOffsetWithinCapacity(ArrayList, ItemOffset) ((ItemOffset) < (ArrayList)->Capacity)
|
||||||
|
#else
|
||||||
|
/**
|
||||||
|
* Using 'assert' rather than 'REQUIRE' because under Windows, REQUIRE (and ASSERT) trickles down to being a
|
||||||
|
* do-while loop, which doesn't jive well with the comma operator.
|
||||||
|
*/
|
||||||
|
# define ArrayListOffsetWithinCapacity(ArrayList, ItemOffset) ((assert((ItemOffset) >= 0),TRUE) && ((ItemOffset) < (ArrayList)->Capacity))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Places the item at the specified offset. If the offset is beyond the
|
||||||
|
* end of the list it is sized accordingly and the intervening items
|
||||||
|
* between the last item of the original state and the last item of the
|
||||||
|
* new state are guaranteed to be 0.
|
||||||
|
*
|
||||||
|
* This is the workhorse of the set and append convenience macros that follow.
|
||||||
|
* Please note that unlike ArrayListSetItem no destructor facility is provided
|
||||||
|
* therefore if an item previously occupied 'ItemOffset' it will be replaced.
|
||||||
|
*
|
||||||
|
* param ArrayList
|
||||||
|
* Array list target in which to set the item.
|
||||||
|
* param ItemOffset
|
||||||
|
* Offset of the item.
|
||||||
|
* param Item
|
||||||
|
* Item to set at the specified offset. Its native type must
|
||||||
|
* match 'NativeType'
|
||||||
|
* param NativeType
|
||||||
|
* Native type of 'Item'.
|
||||||
|
*
|
||||||
|
* return
|
||||||
|
* TRUE if sufficient memory permitted the operation, otherwise FALSE.
|
||||||
|
*/
|
||||||
|
#define ArrayListSetTypedItem(ArrayList, ItemOffset, Item, NativeType) \
|
||||||
|
((ArrayListOffsetWithinCapacity((ArrayList), (ItemOffset)) || \
|
||||||
|
ArrayListEnlargeCapacity((ArrayList), (ItemOffset)+1)) \
|
||||||
|
? (((((NativeType *)((ArrayList)->Array))[(ItemOffset)]) = (Item)), \
|
||||||
|
(((ItemOffset)+1 > (ArrayList)->Count) \
|
||||||
|
? (((ArrayList)->Count = (ItemOffset)+1), TRUE) \
|
||||||
|
: (TRUE))) \
|
||||||
|
: (FALSE))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This section provides macros for high speed setting and appending to an
|
||||||
|
* array list of a known type. The only additional overhead incurred versus just
|
||||||
|
* using a simple array is the cost of testing the array list capacity.
|
||||||
|
*/
|
||||||
|
#define ArrayListSetUnsignedChar(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, unsigned char)
|
||||||
|
#define ArrayListSetUnsignedShort(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, unsigned short)
|
||||||
|
#define ArrayListSetUnsignedInt(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, unsigned int)
|
||||||
|
#define ArrayListSetUnsignedLong(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, unsigned long)
|
||||||
|
#define ArrayListSetInt64(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, Int64_t)
|
||||||
|
#define ArrayListSetChar(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, char)
|
||||||
|
#define ArrayListSetShort(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, short)
|
||||||
|
#define ArrayListSetInt(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, int)
|
||||||
|
#define ArrayListSetLong(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, long)
|
||||||
|
#define ArrayListSetFloat(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, float)
|
||||||
|
#define ArrayListSetDouble(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, double)
|
||||||
|
#define ArrayListSetLgIndex(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, LgIndex_t)
|
||||||
|
#define ArrayListSetEntIndex(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, EntIndex_t)
|
||||||
|
#define ArrayListSetSmInteger(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, SmInteger_t)
|
||||||
|
#define ArrayListSetBoolean(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, Boolean_t)
|
||||||
|
#define ArrayListSetArbParam(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, ArbParam_t)
|
||||||
|
#define ArrayListSetUnsignedCharPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, unsigned char *)
|
||||||
|
#define ArrayListSetUnsignedShortPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, unsigned short *)
|
||||||
|
#define ArrayListSetUnsignedIntPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, unsigned int *)
|
||||||
|
#define ArrayListSetUnsignedLongPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, unsigned long *)
|
||||||
|
#define ArrayListSetInt64Ptr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, Int64_t *)
|
||||||
|
#define ArrayListSetCharPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, char *)
|
||||||
|
#define ArrayListSetShortPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, short *)
|
||||||
|
#define ArrayListSetIntPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, int *)
|
||||||
|
#define ArrayListSetLongPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, long *)
|
||||||
|
#define ArrayListSetFloatPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, float *)
|
||||||
|
#define ArrayListSetDoublePtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, double *)
|
||||||
|
#define ArrayListSetLgIndexPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, LgIndex_t *)
|
||||||
|
#define ArrayListSetEntIndexPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, EntIndex_t *)
|
||||||
|
#define ArrayListSetSmIntegerPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, SmInteger_t *)
|
||||||
|
#define ArrayListSetBooleanPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, Boolean_t *)
|
||||||
|
#define ArrayListSetArbParamPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, ArbParam_t *)
|
||||||
|
#define ArrayListSetVoidPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, void *)
|
||||||
|
#define ArrayListSetFunctionPtr(ArrayList, ItemOffset, Item) ArrayListSetTypedItem(ArrayList, ItemOffset, Item, (**)(void))
|
||||||
|
|
||||||
|
#define ArrayListAppendUnsignedChar(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, unsigned char)
|
||||||
|
#define ArrayListAppendUnsignedShort(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, unsigned short)
|
||||||
|
#define ArrayListAppendUnsignedInt(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, unsigned int)
|
||||||
|
#define ArrayListAppendUnsignedLong(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, unsigned long)
|
||||||
|
#define ArrayListAppendInt64(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, Int64_t)
|
||||||
|
#define ArrayListAppendChar(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, char)
|
||||||
|
#define ArrayListAppendShort(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, short)
|
||||||
|
#define ArrayListAppendInt(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, int)
|
||||||
|
#define ArrayListAppendLong(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, long)
|
||||||
|
#define ArrayListAppendFloat(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, float)
|
||||||
|
#define ArrayListAppendDouble(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, double)
|
||||||
|
#define ArrayListAppendLgIndex(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, LgIndex_t)
|
||||||
|
#define ArrayListAppendEntIndex(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, EntIndex_t)
|
||||||
|
#define ArrayListAppendSmInteger(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, SmInteger_t)
|
||||||
|
#define ArrayListAppendBoolean(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, Boolean_t)
|
||||||
|
#define ArrayListAppendArbParam(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, ArbParam_t)
|
||||||
|
#define ArrayListAppendUnsignedCharPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, unsigned char *)
|
||||||
|
#define ArrayListAppendUnsignedShortPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, unsigned short *)
|
||||||
|
#define ArrayListAppendUnsignedIntPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, unsigned int *)
|
||||||
|
#define ArrayListAppendUnsignedLongPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, unsigned long *)
|
||||||
|
#define ArrayListAppendInt64Ptr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, Int64_t *)
|
||||||
|
#define ArrayListAppendCharPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, char *)
|
||||||
|
#define ArrayListAppendShortPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, short *)
|
||||||
|
#define ArrayListAppendIntPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, int *)
|
||||||
|
#define ArrayListAppendLongPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, long *)
|
||||||
|
#define ArrayListAppendFloatPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, float *)
|
||||||
|
#define ArrayListAppendDoublePtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, double *)
|
||||||
|
#define ArrayListAppendLgIndexPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, LgIndex_t *)
|
||||||
|
#define ArrayListAppendEntIndexPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, EntIndex_t *)
|
||||||
|
#define ArrayListAppendSmIntegerPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, SmInteger_t *)
|
||||||
|
#define ArrayListAppendBooleanPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, Boolean_t *)
|
||||||
|
#define ArrayListAppendArbParamPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, ArbParam_t *)
|
||||||
|
#define ArrayListAppendVoidPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, void *)
|
||||||
|
#define ArrayListAppendFunctionPtr(ArrayList, Item) ArrayListSetTypedItem(ArrayList, (ArrayList)->Count, Item, (**)(void))
|
||||||
|
|
||||||
|
#endif /* ARRLIST_h */
|
||||||
@ -0,0 +1,130 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
#if !defined AUXDATA_h
|
||||||
|
#define AUXDATA_h
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
# undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined AUXDATAMODULE
|
||||||
|
# define EXTERN
|
||||||
|
#else
|
||||||
|
# define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataIsValidNameChar(char Char,
|
||||||
|
Boolean_t IsLeadChar);
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataIsValidName(const char *Name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN AuxData_pa AuxDataAlloc(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN void AuxDataDealloc(AuxData_pa *AuxData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataItemDestructor(void *ItemRef,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN AuxData_pa AuxDataCopy(AuxData_pa AuxData,
|
||||||
|
Boolean_t ConsiderRetain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN LgIndex_t AuxDataGetNumItems(AuxData_pa AuxData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataGetItemIndex(AuxData_pa AuxData,
|
||||||
|
const char *Name,
|
||||||
|
LgIndex_t *ItemIndex);
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN void AuxDataGetItemByIndex(AuxData_pa AuxData,
|
||||||
|
LgIndex_t Index,
|
||||||
|
const char **Name,
|
||||||
|
ArbParam_t *Value,
|
||||||
|
AuxDataType_e *Type,
|
||||||
|
Boolean_t *Retain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataGetItemByName(AuxData_pa AuxData,
|
||||||
|
const char *Name,
|
||||||
|
ArbParam_t *Value,
|
||||||
|
AuxDataType_e *Type,
|
||||||
|
Boolean_t *Retain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataGetBooleanItemByName(AuxData_pa AuxData,
|
||||||
|
const char *Name,
|
||||||
|
Boolean_t *Value,
|
||||||
|
AuxDataType_e *Type,
|
||||||
|
Boolean_t *Retain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataSetItem(AuxData_pa AuxData,
|
||||||
|
const char *Name,
|
||||||
|
ArbParam_t Value,
|
||||||
|
AuxDataType_e Type,
|
||||||
|
Boolean_t Retain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataDeleteItemByName(AuxData_pa AuxData,
|
||||||
|
const char *Name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AuxDataAppendItems(AuxData_pa TargetAuxData,
|
||||||
|
AuxData_pa SourceAuxData);
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN void AuxDataDeleteItemByIndex(AuxData_pa AuxData,
|
||||||
|
LgIndex_t Index);
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
|
||||||
|
#endif /* !defined AUXDATA_h */
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined DATAIOMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN Boolean_t OpenBinaryFileAndCheckMagicNumber(FileStream_s **FileStream,
|
||||||
|
char *FName,
|
||||||
|
FileOffset_t StartOffset,
|
||||||
|
short *IVersion);
|
||||||
|
|
||||||
|
EXTERN Boolean_t ReadDataFileHeader(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
Boolean_t ShowDataIOStatus,
|
||||||
|
EntIndex_t *NumZones,
|
||||||
|
EntIndex_t *NumVars,
|
||||||
|
SmInteger_t *NumCustomLabelSets,
|
||||||
|
char **DataSetTitle,
|
||||||
|
Text_s **BaseText,
|
||||||
|
Geom_s **BaseGeom,
|
||||||
|
StringList_pa **CustomLabelBase,
|
||||||
|
StringList_pa *UserRec,
|
||||||
|
AuxData_pa *DataSetAuxData,
|
||||||
|
Set_pa **IsVarCellCentered,
|
||||||
|
Boolean_t *HasText,
|
||||||
|
Boolean_t *HasGeoms,
|
||||||
|
ArrayList_pa *ZoneSpecList,
|
||||||
|
StringList_pa *VarNames,
|
||||||
|
ArrayList_pa *VarAuxDataList, /*<AuxData_pa>[NumVars]*/
|
||||||
|
Set_pa *IsRawFNAvailable, /* classic data only */
|
||||||
|
LgIndex_t **FNNumBndryConns, /* classic data only */
|
||||||
|
DataFileType_e *FileType);
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
@ -0,0 +1,213 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef DATAIO4_H
|
||||||
|
#define DATAIO4_H
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined DATAIO4MODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN double GetNextValue(FileStream_s *FileStream,
|
||||||
|
FieldDataType_e FieldDataType,
|
||||||
|
double Min,
|
||||||
|
double Max,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN LgIndex_t GetNextI(FileStream_s *FileStream,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN LgIndex_t GetIoFileInt(FileStream_s *FileStream,
|
||||||
|
short Version,
|
||||||
|
LgIndex_t Min,
|
||||||
|
LgIndex_t Max,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN Boolean_t ReadInString(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
int MaxCharacters,
|
||||||
|
char **S,
|
||||||
|
Boolean_t ProcessData);
|
||||||
|
EXTERN void ReadByteBlock(FileStream_s *FileStream,
|
||||||
|
Boolean_t DoRead,
|
||||||
|
Byte_t *Buffer,
|
||||||
|
HgIndex_t StartIndex,
|
||||||
|
HgIndex_t NumValues,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN void ReadInt16Block(FileStream_s *FileStream,
|
||||||
|
Boolean_t DoRead,
|
||||||
|
Int16_t *Buffer,
|
||||||
|
HgIndex_t StartIndex,
|
||||||
|
HgIndex_t NumValues,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN void ReadInt16BlockToInt32(FileStream_s *FileStream,
|
||||||
|
Boolean_t DoRead,
|
||||||
|
Int32_t *Buffer,
|
||||||
|
HgIndex_t StartIndex,
|
||||||
|
HgIndex_t NumValues,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN void ReadInt32Block(FileStream_s *FileStream,
|
||||||
|
Boolean_t DoRead,
|
||||||
|
Int32_t *Buffer,
|
||||||
|
HgIndex_t StartIndex,
|
||||||
|
HgIndex_t NumValues,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN void ReadPureBlock(FileStream_s *FileStream,
|
||||||
|
Boolean_t DoRead,
|
||||||
|
void *Buffer,
|
||||||
|
FieldDataType_e FieldDataType,
|
||||||
|
HgIndex_t StartIndex,
|
||||||
|
HgIndex_t NumValues,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN void ReadBlock(FileStream_s *FileStream,
|
||||||
|
FieldData_pa FieldData,
|
||||||
|
Boolean_t DoRead,
|
||||||
|
FieldDataType_e FieldDataTypeInFile,
|
||||||
|
HgIndex_t StartIndex,
|
||||||
|
HgIndex_t EndIndex,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN void ReadClassicOrderedCCBlock(FileStream_s *DataFileStream,
|
||||||
|
FieldData_pa FieldData,
|
||||||
|
FieldDataType_e FieldDataTypeInFile,
|
||||||
|
LgIndex_t NumIPtsInFile,
|
||||||
|
LgIndex_t NumJPtsInFile,
|
||||||
|
LgIndex_t NumKPtsInFile,
|
||||||
|
Boolean_t *IsOk);
|
||||||
|
EXTERN Boolean_t ReadInDataFileTypeTitleAndVarNames(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
char **DataSetTitle,
|
||||||
|
DataFileType_e *FileType,
|
||||||
|
int *NumVars,
|
||||||
|
StringList_pa *VarNames);
|
||||||
|
EXTERN Boolean_t ReadInZoneHeader(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
ZoneSpec_s *ZoneSpec,
|
||||||
|
Set_pa IsVarCellCentered,
|
||||||
|
EntIndex_t NumVars,
|
||||||
|
Boolean_t *IsRawFNAvailable,
|
||||||
|
LgIndex_t *FNNumBndryConns);
|
||||||
|
EXTERN Boolean_t ReadInCustomLabels(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
Boolean_t OkToLoad,
|
||||||
|
StringList_pa *CustomLabelBase);
|
||||||
|
EXTERN Boolean_t ReadInUserRec(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
int MaxCharactersAllowed,
|
||||||
|
char **UserRec);
|
||||||
|
EXTERN Boolean_t ReadInAuxData(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
AuxData_pa AuxData);
|
||||||
|
EXTERN Boolean_t ReadInGeometry(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
Boolean_t OkToLoad,
|
||||||
|
Geom_s *G,
|
||||||
|
LgIndex_t MaxDataPts);
|
||||||
|
EXTERN Boolean_t ReadInText(FileStream_s *FileStream,
|
||||||
|
short IVersion,
|
||||||
|
Boolean_t OkToLoad,
|
||||||
|
Text_s *T,
|
||||||
|
LgIndex_t MaxTextLen);
|
||||||
|
/*
|
||||||
|
* STDCALL since PreplotAsciiDatafile is sent to RegisterDataSetReader
|
||||||
|
* which can also be used by addons.
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t STDCALL PreplotAsciiDatafile(char *CurFName,
|
||||||
|
char *BinaryFName,
|
||||||
|
char **MessageString);
|
||||||
|
EXTERN short GetInputVersion(FileStream_s *FileStream);
|
||||||
|
|
||||||
|
EXTERN Boolean_t WriteBinaryInt16BlockUnaligned(FileStream_s *FileStream,
|
||||||
|
Byte_t *Int16Values,
|
||||||
|
HgIndex_t NumValues,
|
||||||
|
Boolean_t ValuesInNativeOrdering);
|
||||||
|
EXTERN Boolean_t WriteBinaryInt32BlockUnaligned(FileStream_s *FileStream,
|
||||||
|
Byte_t *Int32Values,
|
||||||
|
HgIndex_t NumValues,
|
||||||
|
Boolean_t ValuesInNativeOrdering);
|
||||||
|
EXTERN Boolean_t WriteBinaryByteBlock(FileStream_s *FileStream,
|
||||||
|
const Byte_t *ByteValues,
|
||||||
|
const HgIndex_t NumValues);
|
||||||
|
EXTERN Boolean_t WriteBinaryInt16(FileStream_s *FileStream,
|
||||||
|
Int16_t Value);
|
||||||
|
EXTERN Boolean_t WriteBinaryInt32(FileStream_s *FileStream,
|
||||||
|
Int32_t Value);
|
||||||
|
EXTERN Boolean_t WriteBinaryReal(FileStream_s *FileStream,
|
||||||
|
double RR,
|
||||||
|
FieldDataType_e FieldDataType);
|
||||||
|
EXTERN Boolean_t WriteFieldDataType(FileStream_s *FileStream,
|
||||||
|
FieldDataType_e FDT,
|
||||||
|
Boolean_t WriteBinary);
|
||||||
|
EXTERN Boolean_t WriteBinaryFieldDataBlock(FileStream_s *FileStream,
|
||||||
|
FieldData_pa D,
|
||||||
|
LgIndex_t StartI,
|
||||||
|
LgIndex_t NumValues);
|
||||||
|
EXTERN Boolean_t WriteCCFieldDataBlock(FileStream_s *FileStream,
|
||||||
|
FieldData_pa FieldData,
|
||||||
|
Boolean_t IsOrderedData,
|
||||||
|
LgIndex_t NumIPts,
|
||||||
|
LgIndex_t NumJPts,
|
||||||
|
LgIndex_t NumKPts,
|
||||||
|
Boolean_t WriteBinary,
|
||||||
|
SmInteger_t AsciiPrecision);
|
||||||
|
EXTERN Boolean_t DumpDatafileString(FileStream_s *FileStream,
|
||||||
|
const char *S,
|
||||||
|
Boolean_t WriteBinary);
|
||||||
|
bool DumpGeometry(FileStream_s* FileStream,
|
||||||
|
Geom_s const* Geom,
|
||||||
|
Boolean_t WriteBinary,
|
||||||
|
Boolean_t WriteGridDataAsPolar);
|
||||||
|
bool DumpText(FileStream_s* FileStream,
|
||||||
|
Text_s const* Text,
|
||||||
|
Boolean_t WriteBinary,
|
||||||
|
Boolean_t WriteGridDataAsPolar);
|
||||||
|
EXTERN Boolean_t DumpCustomAxisLabels(FileStream_s *FileStream,
|
||||||
|
Boolean_t WriteBinary,
|
||||||
|
StringList_pa LabelBase);
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN Boolean_t WriteBinaryMagic(FileStream_s *FileStream);
|
||||||
|
|
||||||
|
bool writeBinaryVersionNumber(FileStream_s& fileStream,
|
||||||
|
int versionNumber);
|
||||||
|
|
||||||
|
#endif //DATAIO4_H
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef DATASET_h__
|
||||||
|
#define DATASET_h__
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DataSet functions involving zones, vars and the
|
||||||
|
* DataSet_s structure. See dataset0.c for low level
|
||||||
|
* dataset functions and dataset2 for higher level
|
||||||
|
* functions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if defined USE_MACROS_FOR_FUNCTIONS
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
|
||||||
|
Boolean_t FieldDataItemDestructor(void *ItemRef,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
Boolean_t ZoneSpecItemDestructor(void *ItemRef,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
LgIndex_t ZoneOrVarListAdjustCapacityRequest(ArrayList_pa ZoneOrVarArrayList,
|
||||||
|
LgIndex_t CurrentCapacity,
|
||||||
|
LgIndex_t RequestedCapacity,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
void CleanoutZoneSpec(ZoneSpec_s *ZoneSpec);
|
||||||
|
void ZoneSpecExcludeBndryConnsFromMetrics(ZoneSpec_s* ZoneSpec);
|
||||||
|
ZoneSpec_s *ZoneSpecAlloc(void);
|
||||||
|
void ZoneSpecDealloc(ZoneSpec_s **ZoneSpec);
|
||||||
|
void SetZoneSpecDefaults(ZoneSpec_s *ZoneSpec);
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if defined USE_MACROS_FOR_FUNCTIONS
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define GetZoneSpec(ZoneSpecList,Zone) ((ZoneSpec_s *)ArrayListGetVoidPtr(ZoneSpecList,Zone))
|
||||||
|
#define GetZoneAuxData(DataSet, Zone) (GetZoneSpec((DataSet)->ZoneSpecList, (Zone))->AuxData)
|
||||||
|
#define GetVarSpec(VarSpecList,Var) ((VarSpec_s *)ArrayListGetVoidPtr(VarSpecList,Var))
|
||||||
|
#define GetVarAuxData(DataSet, Var) (GetVarSpec((DataSet)->VarSpecList, (Var))->AuxData)
|
||||||
|
#define GetStrandInfo(StrandInfoList, StrandID) ((StrandInfo_s *)ArrayListGetVoidPtr(StrandInfoList,StrandID))
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* defined TECPLOTKERNEL */
|
||||||
|
|
||||||
|
#endif // DATASET_h__
|
||||||
@ -0,0 +1,404 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined DATASET0MODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace tecplot
|
||||||
|
{
|
||||||
|
namespace io
|
||||||
|
{
|
||||||
|
class File;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EXTERN void OutOfMemoryMsg(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Turn on DEBUG_FIELDVALUES by default in any build with assertions on
|
||||||
|
* (including checked builds), but allow turning this off with
|
||||||
|
* NO_DEBUG_FIELDVALUES
|
||||||
|
*/
|
||||||
|
#if !defined NO_ASSERTS && !defined NO_DEBUG_FIELDVALUES && !defined DEBUG_FIELDVALUES
|
||||||
|
#define DEBUG_FIELDVALUES
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* FieldData_a is intentionally not defined to further
|
||||||
|
* deter usage of this private structure */
|
||||||
|
struct _FieldData_a
|
||||||
|
{
|
||||||
|
void *Data; /* ...placed first in the structure for fastest access */
|
||||||
|
# if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
# else
|
||||||
|
void *GetValueCallback[1]; /* ...this field is for TecIO only */
|
||||||
|
void *SetValueCallback[1]; /* ...this field is for TecIO only */
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* PRIVATE */
|
||||||
|
FieldDataType_e Type;
|
||||||
|
ValueLocation_e ValueLocation;
|
||||||
|
LgIndex_t RefCount;
|
||||||
|
LgIndex_t VarShareRefCount;
|
||||||
|
LgIndex_t NumValues;
|
||||||
|
# if defined TECPLOTKERNEL /* TecIO doesn't require these features yet. */
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
# endif
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* *
|
||||||
|
* * NOTE: "FieldData_pa" here is an "abstract type".
|
||||||
|
* * Any routines dealing with the internals workings
|
||||||
|
* * of FieldData_pa must be in the same file as these
|
||||||
|
* * routines
|
||||||
|
* */
|
||||||
|
|
||||||
|
#if defined USE_MACROS_FOR_FUNCTIONS
|
||||||
|
#define USE_MACROS_FOR_FIELD_DATA_FUNCTIONS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These are low-level (private) FD manipulation functions. In
|
||||||
|
* most cases, you should use some higher-level function. These
|
||||||
|
* macros are supplied for the dataset functions to use.
|
||||||
|
*/
|
||||||
|
#if defined USE_MACROS_FOR_FIELD_DATA_FUNCTIONS
|
||||||
|
#define GetFieldDataType GetFieldDataType_MACRO
|
||||||
|
#define GetFieldDataGetFunction GetFieldDataGetFunction_MACRO
|
||||||
|
#define GetFieldDataSetFunction GetFieldDataSetFunction_MACRO
|
||||||
|
#define GetFieldDataNumValues GetFieldDataNumValues_MACRO
|
||||||
|
#define GetFieldDataValueLocation GetFieldDataValueLocation_MACRO
|
||||||
|
#define IsFieldDataDirectAccessAllowed IsFieldDataDirectAccessAllowed_MACRO
|
||||||
|
#else
|
||||||
|
#define GetFieldDataType GetFieldDataType_FUNC
|
||||||
|
#define GetFieldDataGetFunction GetFieldDataGetFunction_FUNC
|
||||||
|
#define GetFieldDataSetFunction GetFieldDataSetFunction_FUNC
|
||||||
|
#define GetFieldDataNumValues GetFieldDataNumValues_FUNC
|
||||||
|
#define GetFieldDataValueLocation GetFieldDataValueLocation_FUNC
|
||||||
|
#define IsFieldDataDirectAccessAllowed IsFieldDataDirectAccessAllowed_FUNC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define GetFieldDataType_MACRO(FieldData) ((FieldData)->Type)
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#else /* ...for TecIO only */
|
||||||
|
#define GetFieldDataGetFunction_MACRO(FieldData) ((FieldValueGetFunction_pf)(FieldData)->GetValueCallback[0])
|
||||||
|
#define GetFieldDataSetFunction_MACRO(FieldData) ((FieldValueSetFunction_pf)(FieldData)->SetValueCallback[0])
|
||||||
|
#endif
|
||||||
|
#define GetFieldDataNumValues_MACRO(FieldData) ((FieldData)->NumValues)
|
||||||
|
#define GetFieldDataValueLocation_MACRO(FieldData) ((FieldData)->ValueLocation)
|
||||||
|
|
||||||
|
EXTERN double STDCALL GetFieldValueForFloat(const FieldData_pa fd, LgIndex_t pt);
|
||||||
|
EXTERN double STDCALL GetFieldValueForDouble(const FieldData_pa fd, LgIndex_t pt);
|
||||||
|
EXTERN double STDCALL GetFieldValueForInt32(const FieldData_pa fd, LgIndex_t pt);
|
||||||
|
EXTERN double STDCALL GetFieldValueForInt16(const FieldData_pa fd, LgIndex_t pt);
|
||||||
|
EXTERN double STDCALL GetFieldValueForByte(const FieldData_pa fd, LgIndex_t pt);
|
||||||
|
EXTERN double STDCALL GetFieldValueForBit(const FieldData_pa fd, LgIndex_t pt);
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#else
|
||||||
|
#define IsFieldDataDirectAccessAllowed_MACRO(FieldData) ((FieldData)->Data != NULL)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined USE_MACROS_FOR_FIELD_DATA_FUNCTIONS
|
||||||
|
EXTERN FieldDataType_e GetFieldDataType_FUNC(FieldData_pa FieldData);
|
||||||
|
EXTERN FieldValueGetFunction_pf GetFieldDataGetFunction_FUNC(FieldData_pa FieldData);
|
||||||
|
EXTERN FieldValueSetFunction_pf GetFieldDataSetFunction_FUNC(FieldData_pa FieldData);
|
||||||
|
EXTERN LgIndex_t GetFieldDataNumValues_FUNC(FieldData_pa FieldData);
|
||||||
|
EXTERN ValueLocation_e GetFieldDataValueLocation_FUNC(FieldData_pa FieldData);
|
||||||
|
EXTERN Boolean_t IsFieldDataDirectAccessAllowed_FUNC(FieldData_pa FieldData);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use separate types for reversed byte data than unreversed data so we
|
||||||
|
* have better compiler checking.
|
||||||
|
*/
|
||||||
|
typedef UInt32_t FloatRev_t;
|
||||||
|
typedef UInt64_t DoubleRev_t;
|
||||||
|
typedef UInt16_t Int16Rev_t;
|
||||||
|
typedef UInt32_t Int32Rev_t;
|
||||||
|
typedef UInt64_t Int64Rev_t;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: there are so many GetFieldData*Ptr functions because we
|
||||||
|
* want a bunch of error checking. The Type and TypeRev check
|
||||||
|
* for that type. The Byte, 2Byte, etc. just make sure it is
|
||||||
|
* that type.
|
||||||
|
* GetFieldDataVoidPtr checks nothing, and thus should only be
|
||||||
|
* used with extreme caution (that is, checking the alignment
|
||||||
|
* and byte order by hand).
|
||||||
|
*/
|
||||||
|
#if defined USE_MACROS_FOR_FIELD_DATA_FUNCTIONS
|
||||||
|
#define GetFieldDataFloatPtr GetFieldDataFloatPtr_MACRO
|
||||||
|
#define GetFieldDataFloatRevPtr GetFieldDataFloatRevPtr_MACRO
|
||||||
|
#define GetFieldDataDoublePtr GetFieldDataDoublePtr_MACRO
|
||||||
|
#define GetFieldDataDoubleRevPtr GetFieldDataDoubleRevPtr_MACRO
|
||||||
|
#define GetFieldDataInt64Ptr GetFieldDataInt64Ptr_MACRO
|
||||||
|
#define GetFieldDataInt64RevPtr GetFieldDataInt64RevPtr_MACRO
|
||||||
|
#define GetFieldDataInt32Ptr GetFieldDataInt32Ptr_MACRO
|
||||||
|
#define GetFieldDataInt32RevPtr GetFieldDataInt32RevPtr_MACRO
|
||||||
|
#define GetFieldDataInt16Ptr GetFieldDataInt16Ptr_MACRO
|
||||||
|
#define GetFieldDataInt16RevPtr GetFieldDataInt16RevPtr_MACRO
|
||||||
|
#define GetFieldDataBytePtr GetFieldDataBytePtr_MACRO
|
||||||
|
#define GetFieldData2BytePtr GetFieldData2BytePtr_MACRO
|
||||||
|
#define GetFieldData4BytePtr GetFieldData4BytePtr_MACRO
|
||||||
|
#define GetFieldData8BytePtr GetFieldData8BytePtr_MACRO
|
||||||
|
#define GetFieldDataVoidPtr GetFieldDataVoidPtr_MACRO /*danger:see above*/
|
||||||
|
#else
|
||||||
|
#define GetFieldDataFloatPtr GetFieldDataFloatPtr_FUNC
|
||||||
|
#define GetFieldDataFloatRevPtr GetFieldDataFloatRevPtr_FUNC
|
||||||
|
#define GetFieldDataDoublePtr GetFieldDataDoublePtr_FUNC
|
||||||
|
#define GetFieldDataDoubleRevPtr GetFieldDataDoubleRevPtr_FUNC
|
||||||
|
#define GetFieldDataInt64Ptr GetFieldDataInt64Ptr_FUNC
|
||||||
|
#define GetFieldDataInt64RevPtr GetFieldDataInt64RevPtr_FUNC
|
||||||
|
#define GetFieldDataInt32Ptr GetFieldDataInt32Ptr_FUNC
|
||||||
|
#define GetFieldDataInt32RevPtr GetFieldDataInt32RevPtr_FUNC
|
||||||
|
#define GetFieldDataInt16Ptr GetFieldDataInt16Ptr_FUNC
|
||||||
|
#define GetFieldDataInt16RevPtr GetFieldDataInt16RevPtr_FUNC
|
||||||
|
#define GetFieldDataBytePtr GetFieldDataBytePtr_FUNC
|
||||||
|
#define GetFieldData2BytePtr GetFieldData2BytePtr_FUNC
|
||||||
|
#define GetFieldData4BytePtr GetFieldData4BytePtr_FUNC
|
||||||
|
#define GetFieldData8BytePtr GetFieldData8BytePtr_FUNC
|
||||||
|
#define GetFieldDataVoidPtr GetFieldDataVoidPtr_FUNC /*danger:see above*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define GetFieldDataFloatPtr_MACRO(FieldData) ((float *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataFloatRevPtr_MACRO(FieldData) ((FloatRev_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataDoublePtr_MACRO(FieldData) ((double *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataDoubleRevPtr_MACRO(FieldData) ((DoubleRev_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataInt64Ptr_MACRO(FieldData) ((Int64_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataInt64RevPtr_MACRO(FieldData) ((Int64Rev_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataInt32Ptr_MACRO(FieldData) ((Int32_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataInt32RevPtr_MACRO(FieldData) ((Int32Rev_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataInt16Ptr_MACRO(FieldData) ((Int16_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataInt16RevPtr_MACRO(FieldData) ((Int16Rev_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataBytePtr_MACRO(FieldData) ((Byte_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldData2BytePtr_MACRO(FieldData) ((UInt16_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldData4BytePtr_MACRO(FieldData) ((UInt32_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldData8BytePtr_MACRO(FieldData) ((UInt64_t *)((FieldData)->Data))
|
||||||
|
#define GetFieldDataVoidPtr_MACRO(FieldData) ((void *)((FieldData)->Data)) /*danger:see above*/
|
||||||
|
|
||||||
|
#if !defined USE_MACROS_FOR_FIELD_DATA_FUNCTIONS
|
||||||
|
EXTERN float *GetFieldDataFloatPtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN FloatRev_t *GetFieldDataFloatRevPtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN double *GetFieldDataDoublePtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN DoubleRev_t *GetFieldDataDoubleRevPtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN Int64_t *GetFieldDataInt64Ptr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN Int64Rev_t *GetFieldDataInt64RevPtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN Int32_t *GetFieldDataInt32Ptr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN Int32Rev_t *GetFieldDataInt32RevPtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN Int16_t *GetFieldDataInt16Ptr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN Int16Rev_t *GetFieldDataInt16RevPtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN Byte_t *GetFieldDataBytePtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN UInt16_t *GetFieldData2BytePtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN UInt32_t *GetFieldData4BytePtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN UInt64_t *GetFieldData8BytePtr_FUNC(FieldData_pa fd);
|
||||||
|
EXTERN void *GetFieldDataVoidPtr_FUNC(FieldData_pa fd); /*danger:see above*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN FieldData_pa AllocScratchNodalFieldDataPtr(LgIndex_t NumValues,
|
||||||
|
FieldDataType_e Type,
|
||||||
|
Boolean_t ShowErrMsg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN void DeallocScratchNodalFieldDataPtr(FieldData_pa *ScratchFieldData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assume that indexrange has already been converted to the actual indices.
|
||||||
|
*/
|
||||||
|
EXTERN void CalcFieldDataMinMaxUsingRange(FieldData_pa field_data,
|
||||||
|
double *min_ptr,
|
||||||
|
double *max_ptr,
|
||||||
|
LgIndex_t startindex,
|
||||||
|
IndexRange_s *indexrange);
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN void CopyTypedValueArray(FieldDataType_e ValueType,
|
||||||
|
void *DstArray,
|
||||||
|
LgIndex_t DstStart,
|
||||||
|
void *SrcArray,
|
||||||
|
LgIndex_t SrcStart,
|
||||||
|
LgIndex_t SrcEnd);
|
||||||
|
|
||||||
|
EXTERN void SwapBytesInTypedValueArray(FieldDataType_e ValueType,
|
||||||
|
void *SrcArray,
|
||||||
|
LgIndex_t SrcStart,
|
||||||
|
LgIndex_t SrcEnd,
|
||||||
|
LgIndex_t SrcSkip);
|
||||||
|
|
||||||
|
EXTERN void SwapBytesInUnalignedTypedValueArray(FieldDataType_e ValueType,
|
||||||
|
void *SrcArray,
|
||||||
|
LgIndex_t SrcStart,
|
||||||
|
LgIndex_t SrcEnd,
|
||||||
|
LgIndex_t SrcSkip);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copies values from "src" to "dst". "src" or "dst" may
|
||||||
|
* be differing types. Either or both may be V3D data pointers.
|
||||||
|
*/
|
||||||
|
EXTERN void CopyFieldDataRange(FieldData_pa dst,
|
||||||
|
LgIndex_t dst_start,
|
||||||
|
FieldData_pa src,
|
||||||
|
LgIndex_t src_start,
|
||||||
|
LgIndex_t src_end); /* -1 means last point */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copy all values in field data
|
||||||
|
*/
|
||||||
|
EXTERN void CopyFieldData(FieldData_pa dst,
|
||||||
|
FieldData_pa src);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Like CopyFieldData except for single value.
|
||||||
|
*/
|
||||||
|
EXTERN void CopyFieldValue(FieldData_pa dst,
|
||||||
|
LgIndex_t dstindex,
|
||||||
|
FieldData_pa src,
|
||||||
|
LgIndex_t srcindex);
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets all values in the field data pointer "field_data"
|
||||||
|
* to zero.
|
||||||
|
*/
|
||||||
|
EXTERN void SetFieldDataPtrToAllZeros(FieldData_pa field_data);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GetFieldValue macro
|
||||||
|
*/
|
||||||
|
#if !defined GET_FIELD_VALUE_BY_VIRTUAL_FUNCTION && \
|
||||||
|
!defined GET_FIELD_VALUE_BY_FLOAT_ONLY_MACRO && \
|
||||||
|
!defined GET_FIELD_VALUE_BY_DOUBLE_ONLY_MACRO && \
|
||||||
|
!defined GET_FIELD_VALUE_BY_FLOAT_AND_DOUBLE_MACRO
|
||||||
|
#if !defined NO_ASSERTS || defined DEBUG_FIELDVALUES
|
||||||
|
#define GET_FIELD_VALUE_BY_VIRTUAL_FUNCTION
|
||||||
|
#else
|
||||||
|
#define GET_FIELD_VALUE_BY_FLOAT_AND_DOUBLE_MACRO
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined GET_FIELD_VALUE_BY_VIRTUAL_FUNCTION
|
||||||
|
#define GetFieldValue(fd,pt) ((GetFieldDataGetFunction(fd))((fd),(pt)))
|
||||||
|
#elif defined GET_FIELD_VALUE_BY_FLOAT_ONLY_MACRO
|
||||||
|
#define GetFieldValue(fd,pt) (GetFieldDataGetFunction(fd)==GetFieldValueForFloat \
|
||||||
|
?GetFieldDataFloatPtr(fd)[(pt)] \
|
||||||
|
:(GetFieldDataGetFunction(fd))((fd),(pt)))
|
||||||
|
#elif defined GET_FIELD_VALUE_BY_DOUBLE_ONLY_MACRO
|
||||||
|
#define GetFieldValue(fd,pt) (GetFieldDataGetFunction(fd)==GetFieldValueForDouble \
|
||||||
|
?GetFieldDataDoublePtr(fd)[(pt)] \
|
||||||
|
:(GetFieldDataGetFunction(fd))((fd),(pt)))
|
||||||
|
#elif defined GET_FIELD_VALUE_BY_FLOAT_AND_DOUBLE_MACRO
|
||||||
|
#define GetFieldValue(fd,pt) (GetFieldDataGetFunction(fd)==GetFieldValueForFloat \
|
||||||
|
?GetFieldDataFloatPtr(fd)[(pt)] \
|
||||||
|
:GetFieldDataGetFunction(fd)==GetFieldValueForDouble \
|
||||||
|
?GetFieldDataDoublePtr(fd)[(pt)] \
|
||||||
|
:(GetFieldDataGetFunction(fd))((fd),(pt)))
|
||||||
|
#else
|
||||||
|
#error "Need to define one of FIELD_VALUE_MACRO constants"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SetFieldValue macro
|
||||||
|
*/
|
||||||
|
#define SetFieldValue(fd,pt,val) ((GetFieldDataSetFunction(fd))((fd),(pt),(val)))
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
|
||||||
|
#if defined _DEBUG
|
||||||
|
#define USEFUNCTIONSFORNODEVALUES
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if !defined NO_ASSERTS
|
||||||
|
#endif
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined DATASHRMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* General set of macros for reference count mananagement.
|
||||||
|
*/
|
||||||
|
#define IncStructureReference(V) ((V)->RefCount++)
|
||||||
|
#define DecStructureReference(V) ((V)->RefCount--)
|
||||||
|
#define IsStructureShared(V) ((V)->RefCount > 1)
|
||||||
|
#define IsStructureReferenced(V) ((V)->RefCount > 0)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Special set of macros for field data that is having variable sharing between
|
||||||
|
* zones tracked. Field data maintains two reference counts: The first,
|
||||||
|
* RefCount, is used to keep track of when the field data needs to be
|
||||||
|
* deallocated; the second, VarShareRefCount, is used to track variable sharing
|
||||||
|
* between zones.
|
||||||
|
*/
|
||||||
|
#define IncVarStructureReference(V) ((V)->VarShareRefCount++)
|
||||||
|
#define DecVarStructureReference(V) ((V)->VarShareRefCount--)
|
||||||
|
#define IsVarStructureShared(V) ((V)->VarShareRefCount > 1)
|
||||||
|
#define IsVarStructureReferenced(V) ((V)->VarShareRefCount > 0)
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* DATAUTIL.h : COPYRIGHT (C)1987-2002 Tecplot, Inc.
|
||||||
|
* ALL RIGHTS RESERVED
|
||||||
|
*
|
||||||
|
* NOTE: THIS MODULE NOW IS PART OF THE TECPLOT SOURCE
|
||||||
|
* ONLY EDIT THIS IN THE MAIN TECPLOT SOURCE DIRECTORY.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef DATAUTIL_H
|
||||||
|
#define DATAUTIL_H
|
||||||
|
#define DATAUTIL_VERSION 61
|
||||||
|
|
||||||
|
#if defined MAKEARCHIVE
|
||||||
|
extern void InitInputSpecs(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Read a binary tecplot datafile.
|
||||||
|
*
|
||||||
|
* @param GetHeaderInfoOnly
|
||||||
|
* Return only the header info from the datafile.
|
||||||
|
*
|
||||||
|
* @param FName
|
||||||
|
* Name of the file to read.
|
||||||
|
*
|
||||||
|
* @param IVersion
|
||||||
|
* Returns version of the input file.
|
||||||
|
*
|
||||||
|
* @param DataSetTitle
|
||||||
|
* Allocates space for and returns dataset title.
|
||||||
|
*
|
||||||
|
* @param NumZones
|
||||||
|
* Returns the number of zones.
|
||||||
|
*
|
||||||
|
* @param NumVars
|
||||||
|
* Returns the number of variables.
|
||||||
|
*
|
||||||
|
* @param VarNames
|
||||||
|
* Allocates space for and returns the var names.
|
||||||
|
*
|
||||||
|
* @param ZoneNames
|
||||||
|
* Allocates space for and returns the zone names.
|
||||||
|
*
|
||||||
|
* @param NumPtsI, NumPtsJ, NumPtsK
|
||||||
|
* Zone dimensions loaded into LgIndex_t arrays.
|
||||||
|
*
|
||||||
|
* @param ZoneNames
|
||||||
|
* Zone types loaded into ZoneType_e array.
|
||||||
|
*
|
||||||
|
* @param UserRec
|
||||||
|
* Allocates space for and returns the user records.
|
||||||
|
*
|
||||||
|
* @param RawDataspaceAllocated
|
||||||
|
* Only used if GetHeaderInfoOnly is FALSE. TRUE = calling program has alloced space for
|
||||||
|
* the raw data. FALSE= let ReadTec allocate space for the raw data.
|
||||||
|
*
|
||||||
|
* @param NodeMap
|
||||||
|
* Finite Element connectivity information. ReadTec
|
||||||
|
* will allocate the space for you if RawDataspaceAllocated is FALSE.
|
||||||
|
*
|
||||||
|
* @param VDataBase
|
||||||
|
* Raw field data loaded into double arrays. ReadTec
|
||||||
|
* will allocate the space for you if RawDataspaceAllocated is
|
||||||
|
* FALSE. If RawDataspaceAllocated is TRUE then ReadTec will
|
||||||
|
* only load the arrays that have non NULL addresses.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
LIBFUNCTION Boolean_t STDCALL ReadTec(Boolean_t GetHeaderInfoOnly,
|
||||||
|
char *FName,
|
||||||
|
short *IVersion,
|
||||||
|
char **DataSetTitle,
|
||||||
|
EntIndex_t *NumZones,
|
||||||
|
EntIndex_t *NumVars,
|
||||||
|
StringList_pa *VarNames,
|
||||||
|
StringList_pa *ZoneNames,
|
||||||
|
LgIndex_t **NumPtsI,
|
||||||
|
LgIndex_t **NumPtsJ,
|
||||||
|
LgIndex_t **NumPtsK,
|
||||||
|
ZoneType_e **ZoneType,
|
||||||
|
StringList_pa *UserRec,
|
||||||
|
Boolean_t RawDataspaceAllocated,
|
||||||
|
NodeMap_t ***NodeMap,
|
||||||
|
double ***VDataBase);
|
||||||
|
|
||||||
|
LIBFUNCTION void * STDCALL TecAlloc(size_t size);
|
||||||
|
|
||||||
|
LIBFUNCTION void STDCALL TecFree(void *ptr);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* !DATAUTIL_H */
|
||||||
@ -0,0 +1,149 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
#ifndef _FACE_H_
|
||||||
|
#define _FACE_H_
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined FACEMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace tecplot
|
||||||
|
{
|
||||||
|
namespace kernel
|
||||||
|
{
|
||||||
|
class SubElemValueProducerInterface;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
inline Boolean_t IsCellFaceLogicallyCollapsed(LgIndex_t I1,
|
||||||
|
LgIndex_t I2,
|
||||||
|
LgIndex_t I3,
|
||||||
|
LgIndex_t I4)
|
||||||
|
{
|
||||||
|
return ((I1 == I2 && I3 == I4) ||
|
||||||
|
(I1 == I4 && I2 == I3) ||
|
||||||
|
(I1 == I3) ||
|
||||||
|
(I2 == I4));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IMPORTANT NOTE:
|
||||||
|
* A face obscuration of FaceObscuration_LogicallyObscured means that the
|
||||||
|
* face is entirely obscured by either an implicit neighbor for inside faces
|
||||||
|
* of ordered data or an auto generated neighbor for finite element data. In
|
||||||
|
* either case, logical obscuration is not considered if user defined
|
||||||
|
* neighbors have been specified for the face. Therefore, interior faces of
|
||||||
|
* ordered data can have an indication of FaceObscuration_PartiallyObscured.
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
FaceObscuration_NotObscured,
|
||||||
|
FaceObscuration_PartiallyObscured,
|
||||||
|
FaceObscuration_EntirelyObscured,
|
||||||
|
FaceObscuration_LogicallyObscured,
|
||||||
|
END_FaceObscuration_e,
|
||||||
|
FaceObscuration_Invalid = BadEnumValue
|
||||||
|
} FaceObscuration_e;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN LgIndex_t GetLogicalOrderedNeighbor(LgIndex_t NumIPts,
|
||||||
|
LgIndex_t NumJPts,
|
||||||
|
LgIndex_t NumKPts,
|
||||||
|
LgIndex_t Element,
|
||||||
|
LgIndex_t Face);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to determine a cell's neighbor. It calls FaceNeighborGetSurfaceCellNeighbor()
|
||||||
|
* for classic zones.
|
||||||
|
*/
|
||||||
|
EXTERN void GetSurfaceCellNeighbor(CZInfo_s const* CZInfo,
|
||||||
|
CZData_s const* CZData,
|
||||||
|
LgIndex_t SurfaceCellIndex,
|
||||||
|
tecplot::kernel::SubElemValueProducerInterface* NodeValueProducer,
|
||||||
|
ElemFaceOffset_t PlaneOrFaceOffset,
|
||||||
|
ElemFaceOffset_t Edge,
|
||||||
|
LgIndex_t* NeighborSurfaceCellElem,
|
||||||
|
EntIndex_t* NeighborSurfaceCellZone);
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN FaceObscuration_e GetFaceObscuration(CZInfo_s const* CZInfo,
|
||||||
|
CZData_s const* CZData,
|
||||||
|
Set_pa ActiveRelevantZones,
|
||||||
|
LgIndex_t Element,
|
||||||
|
LgIndex_t FOffset,
|
||||||
|
Boolean_t ConsiderValueBlanking,
|
||||||
|
Boolean_t ConsiderIJKBlanking,
|
||||||
|
Boolean_t ConsiderDepthBlanking);
|
||||||
|
|
||||||
|
EXTERN EntIndex_t GetNodesPerElementFace(ZoneType_e ZoneType);
|
||||||
|
|
||||||
|
EXTERN EntIndex_t GetFacesPerElement(ZoneType_e ZoneType,
|
||||||
|
LgIndex_t IMax,
|
||||||
|
LgIndex_t JMax,
|
||||||
|
LgIndex_t KMax);
|
||||||
|
|
||||||
|
EXTERN CollapsedStatus_e GetSurfaceCellCollapsedStatus(CZInfo_s const* CZInfo,
|
||||||
|
CZData_s const* CZData,
|
||||||
|
tecplot::kernel::SubElemValueProducerInterface* SubElemValueProducer);
|
||||||
|
EXTERN CollapsedStatus_e GetSurfaceCellCollapsedStatus(CZInfo_s const* CZInfo,
|
||||||
|
CZData_s const* CZData,
|
||||||
|
LgIndex_t I1,
|
||||||
|
LgIndex_t I2,
|
||||||
|
LgIndex_t I3,
|
||||||
|
LgIndex_t I4);
|
||||||
|
EXTERN CollapsedStatus_e GetSurfaceCellLogicalCollapsedStatus(ZoneType_e ZoneType,
|
||||||
|
LgIndex_t I1,
|
||||||
|
LgIndex_t I2,
|
||||||
|
LgIndex_t I3,
|
||||||
|
LgIndex_t I4);
|
||||||
|
EXTERN CollapsedStatus_e GetSurfEdgeOrVolFaceLogicalCollapsedStatus(NodeMap_pa NodeMap,
|
||||||
|
LgIndex_t Element,
|
||||||
|
EntIndex_t Face);
|
||||||
|
#if defined ALLOW_USERDEF_NO_NEIGHBORING_ELEMENT
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t IsUserDefFaceNeighborBoundary(FaceNeighbor_pa FaceNeighbor,
|
||||||
|
LgIndex_t Element,
|
||||||
|
LgIndex_t Face);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
#if !defined FILESTREAM_h
|
||||||
|
#define FILESTREAM_h
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
# undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined FILESTREAMMODULE
|
||||||
|
# define EXTERN
|
||||||
|
#else
|
||||||
|
# define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
FILE *File;
|
||||||
|
Boolean_t IsByteOrderNative;
|
||||||
|
} FileStream_s;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a structure for associating an open file stream with its byte
|
||||||
|
* order. The byte order can changed at any time.
|
||||||
|
*
|
||||||
|
* @param File
|
||||||
|
* Handle to a file which can be NULL.
|
||||||
|
* @param IsByteOrderNative
|
||||||
|
* TRUE if the file's byte order is native, FALSE if foreign.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* An allocated structure associating an open file to its byte order.
|
||||||
|
*/
|
||||||
|
EXTERN FileStream_s *FileStreamAlloc(FILE *File,
|
||||||
|
Boolean_t IsByteOrderNative);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deallocates the structure associating the file stream with the byte order.
|
||||||
|
* This function does NOT close the file.
|
||||||
|
*
|
||||||
|
* @param FileStream
|
||||||
|
* Pointer to an open file stream or a pointer to NULL.
|
||||||
|
*/
|
||||||
|
EXTERN void FileStreamDealloc(FileStream_s **FileStream);
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined GEOMMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* * macros for checking CoordSys_e * */
|
||||||
|
#define VALID_RECTANGLE_COORDSYS(sys) \
|
||||||
|
(((sys)==CoordSys_Frame) || \
|
||||||
|
((sys)==CoordSys_Grid))
|
||||||
|
#define VALID_SQUARE_COORDSYS(sys) VALID_RECTANGLE_COORDSYS((sys))
|
||||||
|
#define VALID_ELLIPSE_COORDSYS(sys) VALID_RECTANGLE_COORDSYS((sys))
|
||||||
|
#define VALID_CIRCLE_COORDSYS(sys) VALID_ELLIPSE_COORDSYS((sys))
|
||||||
|
#define VALID_IMAGE_COORDSYS(sys) VALID_RECTANGLE_COORDSYS((sys))
|
||||||
|
#define VALID_LINESEG_COORDSYS(sys) \
|
||||||
|
(((sys)==CoordSys_Frame) || \
|
||||||
|
((sys)==CoordSys_Grid) || \
|
||||||
|
((sys)==CoordSys_Grid3D))
|
||||||
|
#define VALID_GEOM_COORDSYS(sys) \
|
||||||
|
(((sys)==CoordSys_Frame) || \
|
||||||
|
((sys)==CoordSys_Grid) || \
|
||||||
|
((sys)==CoordSys_Grid3D))
|
||||||
|
|
||||||
|
#define VALID_GEOM_TYPE(geomtype) \
|
||||||
|
( VALID_ENUM((geomtype),GeomType_e) && \
|
||||||
|
(geomtype)!=GeomType_LineSegs3D )
|
||||||
|
|
||||||
|
#define VALID_GEOM_FIELD_DATA_TYPE(datatype) \
|
||||||
|
( ( (datatype) == FieldDataType_Float ) || \
|
||||||
|
( (datatype) == FieldDataType_Double ) )
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined GEOM2MODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
|
||||||
|
EXTERN FieldDataType_e GetGeomFieldDataType(Geom_s const* Geom);
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,196 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined INITMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Input Specification limits */
|
||||||
|
|
||||||
|
/* General */
|
||||||
|
EXTERN InputSpec_s /*X*/ GridCoordInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ GridCoordFloatInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ XFrameCoordInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ YFrameCoordInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ XFrameCoordFloatInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ YFrameCoordFloatInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ XFrameCoordDeltaInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ YFrameCoordDeltaInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ XFrameCoordFloatDeltaInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ YFrameCoordFloatDeltaInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ FrameOffsetCoordInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ XPaperCoordInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ YPaperCoordInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisPercentageInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AngleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AngleToApproxInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ FieldOfViewInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ZeroAndAboveLgIndexInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ZeroAndAboveSmIntegerInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ZeroAndAboveDoubleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AboveZeroLgIndexInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AboveZeroDoubleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ DoubleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ EntIndexInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ EntRangeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ IndexRangeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AboveZeroIndexRangeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ZeroToOneInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ PercentageInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AboveZeroPercentageInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ SignedPercentageInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ RadiansInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AboveZeroRadiansInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ TimeDateDoubleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AboveZeroTimeDateDoubleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AboveZeroElapsedTimeInputSpec;
|
||||||
|
|
||||||
|
|
||||||
|
/* Specific */
|
||||||
|
#define MIN_VIEWPORT_SIZE 0.05
|
||||||
|
EXTERN InputSpec_s /*X*/ SurfaceTranslucencyInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxDepthBufferSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxMultiSamplesInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MinBitsPerRGBPlaneInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AnimationSpeedInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AnimationNumStepsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxCustomColorsInInterfaceInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxReducedPointsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxStripLengthInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxPrimativesPerBlockInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxTextureSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ SuperSampleFactorInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ TickLengthInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ BorrowLicenseInputSpec;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* I/O Related */
|
||||||
|
EXTERN InputSpec_s /*X*/ HardcopyPaperSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ HardcopyNumCopiesInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ HardcopyPrecisionInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ HardcopyPenSpeedInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ PenPlotterPenNumberInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ BitDumpDepthInputSpec;
|
||||||
|
|
||||||
|
|
||||||
|
/* Widths, physical lengths, etc. */
|
||||||
|
EXTERN InputSpec_s /*X*/ XFrameDimensionInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ YFrameDimensionInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ LineThicknessInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ PatternLengthInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisPercentageTextSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ FrameTextSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ GridTextSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ PointTextSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ TextBoxMarginInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ TextLineSpacingInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ArrowheadSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisLabelOffsetInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ LegendLineSpacingInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ StreamStepSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ StreamMaxStepsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ArrowheadSpacingInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ RulerPaddingInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ RulerThicknessInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ PickHandleWidthInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ImageDimensionInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ZoomScalePerFrameUnitInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ RGBLegendHeightInputSpec;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Limit the number of objects or limit which object can be selected*/
|
||||||
|
EXTERN InputSpec_s /*X*/ ColorMapGroupInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ SliceGroupInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ IsoSurfaceGroupInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ContourGroupInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ColorIndexInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumLightSourceShadesInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumberOfControlPointsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ CustomLabelNumberInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumMinorTicksInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisEdgeNumberInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ LineMapWhichXAxisInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ LineMapWhichYAxisInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumberOfCurvePointsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumberOfContourLevelsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ColorMapOverrideLevelInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ColorMapOverrideNumberInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumberOfColorMapCyclesInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumberOfRodPointsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumberOfStreamtracesInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ NumberOfEllipsePointsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxPtsInALineInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxChrsTextLabelsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxContourLevelsInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MaxLinkGroupsInputSpec;
|
||||||
|
|
||||||
|
|
||||||
|
/* Ratios */
|
||||||
|
EXTERN InputSpec_s /*X*/ DataAspectRatioLimitInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ DataAspectRatioResetInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisBoxAspectRatioLimitInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisBoxAspectRatioResetInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisRatioInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisBoxPaddingInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ScreenDistanceRatioInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ LiftFractionInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ZClipInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ VectorHeadSizeFractionInputSpec;
|
||||||
|
|
||||||
|
|
||||||
|
/* Misc */
|
||||||
|
EXTERN InputSpec_s /*X*/ ValuePrecisionInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ PolynomialOrderInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ SplineSlopeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ RotationStepSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ SmoothRotationDegPerFrameUnitInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ TranslationStepSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ScaleStepSizeInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ SortLevelInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ AxisLabelSkipInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ TextAngleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ArrowheadAngleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ MinCreaseAngleInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ExponentInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ SmoothWeightInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ TriangleKeepFactorInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ PlotAttrColumnWidthInputSpec;
|
||||||
|
EXTERN InputSpec_s /*X*/ ImageQualityInputSpec;
|
||||||
|
|
||||||
@ -0,0 +1,684 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************/
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
/* NOTE: All code contained between comments that look like
|
||||||
|
* BEGINREMOVEFROMADDON
|
||||||
|
* ENDREMOVEFROMADDON
|
||||||
|
* are pulled out to create the MASTER.h file used in addons.
|
||||||
|
*/
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#ifndef _MASTER_H_
|
||||||
|
#define _MASTER_H_
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Annotations that specify the life cycle of objects returned from functions
|
||||||
|
* and input and output parameters sent as function parameters. The following
|
||||||
|
* table specifies the meaning in their context. The annotations provide code
|
||||||
|
* generation tools with information for building language bindings to various
|
||||||
|
* Tecplot 360 and Tecplot SDK related libraries.
|
||||||
|
*
|
||||||
|
* For purposes of this table the client is one making the call and the service
|
||||||
|
* is the recipient.
|
||||||
|
*
|
||||||
|
* +==================+=========================+=================================================================+
|
||||||
|
* | Function Context | Annotation | Meaning |
|
||||||
|
* | Result or | | |
|
||||||
|
* | Parameter | | |
|
||||||
|
* |==================+=========================+=================================================================|
|
||||||
|
* | Result | TP_OUT | Default for a function return value that does not transfer |
|
||||||
|
* | | | ownership. Because this is the most common scenario this |
|
||||||
|
* | | | annotation is implied and never explicitly used in this |
|
||||||
|
* | | | context. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Scalar Result | TP_GIVES | Annotates a function scalar return value as one who's ownership |
|
||||||
|
* | | | is transfered to the client. The client is responsible for |
|
||||||
|
* | | | properly disposing the value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Array Result | TP_ARRAY_GIVES | Annotates a function array return value as one who's ownership |
|
||||||
|
* | | | is transfered to the client. The client is responsible for |
|
||||||
|
* | | | properly disposing the value. |
|
||||||
|
* |==================+=========================+=================================================================|
|
||||||
|
* | Parameter | TP_IN | Default for a function input parameter value sent to the |
|
||||||
|
* | | | service. Because this is the most common scenario this |
|
||||||
|
* | | | annotation is implied and never explicitly used. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Parameter | TP_ACQUIRES | Annotates a function parameter as one that sends a value to |
|
||||||
|
* | | | the service through the parameter and acquires shared |
|
||||||
|
* | | | ownership of the input value with the client. The service is |
|
||||||
|
* | | | not responsible for disposing the value however it is |
|
||||||
|
* | | | expected that a symmetric API exists that "releases" the |
|
||||||
|
* | | | library of this shared ownership. For example: |
|
||||||
|
* | | | void addListener(TP_ACQUIRES Listener& listener); |
|
||||||
|
* | | | void removeListener(TP_RELEASES Listener& listener); |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Parameter | TP_RELEASES | Annotates a function parameter as one that sends a value to |
|
||||||
|
* | | | the service through the parameter and releases previously |
|
||||||
|
* | | | shared ownership of the |
|
||||||
|
* | | | input value with the client. The service is not responsible |
|
||||||
|
* | | | for disposing the value however it is expected that a |
|
||||||
|
* | | | symmetric API exists that "releases" the library of this |
|
||||||
|
* | | | shared ownership. For example: |
|
||||||
|
* | | | void addListener(TP_ACQUIRES Listener& listener); |
|
||||||
|
* | | | void removeListener(TP_RELEASES Listener& listener); |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Scalar Parameter | TP_OUT | Annotates a function scalar parameter as one that returns a |
|
||||||
|
* | | | value to the client through the parameter but does not |
|
||||||
|
* | | | transfer ownership of the output value to the client. |
|
||||||
|
* | | | The client is not responsible for disposing the value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Scalar Parameter | TP_IN_OUT | Annotates a function scalar parameter as one that both sends |
|
||||||
|
* | | | a value to the service and returns a value to the client |
|
||||||
|
* | | | through the parameter. Ownership of the input value is not |
|
||||||
|
* | | | transfered to the service nor is ownership of the output value |
|
||||||
|
* | | | transfered to the client. The service is not responsible for |
|
||||||
|
* | | | disposing the input value and the client is not responsible |
|
||||||
|
* | | | for disposing the output value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Array Parameter | TP_ARRAY_OUT | Annotates a function array parameter as one that returns a |
|
||||||
|
* | | | value to the client through the parameter but does not |
|
||||||
|
* | | | transfer ownership of the output value to the client. |
|
||||||
|
* | | | The client is not responsible for disposing the value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Array Parameter | TP_ARRAY_IN_OUT | Annotates a function array parameter as one that both sends |
|
||||||
|
* | | | a value to the service and returns a value to the client |
|
||||||
|
* | | | through the parameter. Ownership of the input value is not |
|
||||||
|
* | | | transfered to the service nor is ownership of the output value |
|
||||||
|
* | | | transfered to the client. The service is not responsible for |
|
||||||
|
* | | | disposing the input value and the client is not responsible |
|
||||||
|
* | | | for disposing the output value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Scalar Parameter | TP_GIVES | Annotates a function scalar parameter as one that returns a |
|
||||||
|
* | | | value to the client through the parameter and transfers |
|
||||||
|
* | | | ownership of the output value to the client. The client is |
|
||||||
|
* | | | responsible for properly disposing the value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Scalar Parameter | TP_RECEIVES | Annotates a function scalar parameter as one that sends a value |
|
||||||
|
* | | | to the service through the parameter and transfers ownership |
|
||||||
|
* | | | of the input value to the service. The service is responsible |
|
||||||
|
* | | | for properly disposing the value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Scalar Parameter | TP_RECEIVES_GIVES | Annotates a function scalar parameter as one that both sends |
|
||||||
|
* | | | a value to the service and returns a value to the client |
|
||||||
|
* | | | through the parameter. Ownership of the input value is |
|
||||||
|
* | | | transfered to the service and ownership of the output value is |
|
||||||
|
* | | | transfered to the client. The service is responsible for |
|
||||||
|
* | | | properly disposing the input value and the client is |
|
||||||
|
* | | | responsible for properly disposing the output value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Array Parameter | TP_ARRAY_GIVES | Annotates a function array parameter as one that returns a |
|
||||||
|
* | | | value to the client through the parameter and transfers |
|
||||||
|
* | | | ownership of the output value to the client. The client is |
|
||||||
|
* | | | responsible for properly disposing the value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Array Parameter | TP_ARRAY_RECEIVES | Annotates a function array parameter as one that sends a value |
|
||||||
|
* | | | to the service through the parameter and transfers ownership |
|
||||||
|
* | | | of the input value to the service. The service is responsible |
|
||||||
|
* | | | for properly disposing the value. |
|
||||||
|
* |------------------+-------------------------+-----------------------------------------------------------------|
|
||||||
|
* | Array Parameter | TP_ARRAY_RECEIVES_GIVES | Annotates a function array parameter as one that both sends |
|
||||||
|
* | | | a value to the service and returns a value to the client |
|
||||||
|
* | | | through the parameter. Ownership of the input value is |
|
||||||
|
* | | | transfered to the service and ownership of the output value is |
|
||||||
|
* | | | transfered to the client. The service is responsible for |
|
||||||
|
* | | | properly disposing the input value and the client is |
|
||||||
|
* | | | responsible for properly disposing the output value. |
|
||||||
|
* |==================+===================+=======================================================================|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* First check to make sure that our life-cycle keywords are not in conflict with any system defines.
|
||||||
|
*/
|
||||||
|
#if defined TP_ACQUIRES || \
|
||||||
|
defined TP_RELEASES || \
|
||||||
|
defined TP_OUT || \
|
||||||
|
defined TP_IN_OUT || \
|
||||||
|
defined TP_ARRAY_OUT || \
|
||||||
|
defined TP_ARRAY_IN_OUT || \
|
||||||
|
defined TP_GIVES || \
|
||||||
|
defined TP_RECEIVES || \
|
||||||
|
defined TP_RECEIVES_GIVES || \
|
||||||
|
defined TP_ARRAY_GIVES || \
|
||||||
|
defined TP_ARRAY_RECEIVES || \
|
||||||
|
defined TP_ARRAY_RECEIVES_GIVES
|
||||||
|
#error "Tecplot's parameter life-cycle keywords are in direct conflict with other meanings."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined INCLUDE_OBJECT_LIFECYCLE_ANNOTATIONS
|
||||||
|
#define TP_ACQUIRES __attribute((gccxml("acquires","in")))
|
||||||
|
#define TP_RELEASES __attribute((gccxml("releases","in")))
|
||||||
|
#define TP_OUT __attribute((gccxml("out")))
|
||||||
|
#define TP_IN_OUT __attribute((gccxml("in","out")))
|
||||||
|
#define TP_ARRAY_OUT __attribute((gccxml("array","out")))
|
||||||
|
#define TP_ARRAY_IN_OUT __attribute((gccxml("array","in","out")))
|
||||||
|
#define TP_GIVES __attribute((gccxml("gives","out")))
|
||||||
|
#define TP_RECEIVES __attribute((gccxml("receives","in")))
|
||||||
|
#define TP_RECEIVES_GIVES __attribute((gccxml("receives","in","gives","out")))
|
||||||
|
#define TP_ARRAY_GIVES __attribute((gccxml("array","gives","out")))
|
||||||
|
#define TP_ARRAY_RECEIVES __attribute((gccxml("array","receives","in")))
|
||||||
|
#define TP_ARRAY_RECEIVES_GIVES __attribute((gccxml("array","receives","in","gives","out")))
|
||||||
|
#else
|
||||||
|
#define TP_ACQUIRES
|
||||||
|
#define TP_RELEASES
|
||||||
|
#define TP_OUT
|
||||||
|
#define TP_IN_OUT
|
||||||
|
#define TP_ARRAY_OUT
|
||||||
|
#define TP_ARRAY_IN_OUT
|
||||||
|
#define TP_GIVES
|
||||||
|
#define TP_RECEIVES
|
||||||
|
#define TP_RECEIVES_GIVES
|
||||||
|
#define TP_ARRAY_GIVES
|
||||||
|
#define TP_ARRAY_RECEIVES
|
||||||
|
#define TP_ARRAY_RECEIVES_GIVES
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#ifdef NO_ASSERTS /* obfuscate names */
|
||||||
|
#define ShutDownLicensing FreeAllExtraMapData
|
||||||
|
#define ProcessYMapInXDirection
|
||||||
|
#endif /* NO_ASSERTS */
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************
|
||||||
|
* LICENSING
|
||||||
|
**************************************/
|
||||||
|
#if defined TECPLOTKERNEL && !defined ENGINE
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if defined FLEXLM && defined RLM
|
||||||
|
#endif
|
||||||
|
#if !defined FLEXLM && !defined RLM
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
#include "W__BASE.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
#include <queue>
|
||||||
|
|
||||||
|
#include "TranslatedString.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following is a temporary fix for figuring out which product is
|
||||||
|
* running. In the future when Focus and 360 use the same code base,
|
||||||
|
* we will have to do this dynamically (either with flags on the compiler
|
||||||
|
* or variables within Tecplot).
|
||||||
|
*/
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#if defined _WIN32
|
||||||
|
|
||||||
|
#if !defined TECPLOTKERNEL
|
||||||
|
|
||||||
|
#if !defined MSWIN
|
||||||
|
#define MSWIN
|
||||||
|
#endif /* !MSWIN */
|
||||||
|
|
||||||
|
/* For the sake of some older add-ons,
|
||||||
|
defined _WINDOWS, WINDOWS, and WIN32
|
||||||
|
New code should always use MSWIN */
|
||||||
|
|
||||||
|
#if !defined WINDOWS
|
||||||
|
#define WINDOWS
|
||||||
|
#endif /* WINDOWS */
|
||||||
|
|
||||||
|
#if !defined _WINDOWS
|
||||||
|
#define _WINDOWS
|
||||||
|
#endif /* !_WINDOWS */
|
||||||
|
|
||||||
|
#if !defined WIN32
|
||||||
|
#define WIN32
|
||||||
|
#endif /* !WIN32 */
|
||||||
|
|
||||||
|
#if defined _DEBUG
|
||||||
|
#if !defined DEBUG
|
||||||
|
#define DEBUG
|
||||||
|
#endif
|
||||||
|
#elif defined CHECKED_BUILD
|
||||||
|
#if defined NO_ASSERTS
|
||||||
|
#undef NO_ASSERTS
|
||||||
|
#endif
|
||||||
|
#if defined NDEBUG
|
||||||
|
#undef NDEBUG
|
||||||
|
#endif
|
||||||
|
#else /* RELEASE */
|
||||||
|
#if !defined NDEBUG
|
||||||
|
#define NDEBUG
|
||||||
|
#endif
|
||||||
|
#if !defined NO_ASSERTS
|
||||||
|
#define NO_ASSERTS
|
||||||
|
#endif
|
||||||
|
#endif /* _DEBUG */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1400
|
||||||
|
#define VS_2005 /* Using VS2005 Compiler */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined TECPLOTKERNEL && defined VS_2005
|
||||||
|
/* Suppress the warnings about the
|
||||||
|
deprecated c runtime functions. */
|
||||||
|
|
||||||
|
#if !defined _CRT_SECURE_NO_DEPRECATE
|
||||||
|
#define _CRT_SECURE_NO_DEPRECATE
|
||||||
|
#endif
|
||||||
|
#endif /* !TECPLOTKERNEL && VS_2005 */
|
||||||
|
|
||||||
|
#endif /* MSWIN */
|
||||||
|
|
||||||
|
#ifdef NDEBUG
|
||||||
|
# ifdef _DEBUG
|
||||||
|
# error "Both NDEBUG and _DEBUG defined"
|
||||||
|
# endif
|
||||||
|
#elif defined TECPLOTKERNEL
|
||||||
|
# ifndef _DEBUG
|
||||||
|
# define _DEBUG
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Now a requirement */
|
||||||
|
#define USE_3D_HARDWARE
|
||||||
|
|
||||||
|
#ifndef THREED
|
||||||
|
# define THREED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#if defined QUICKDEMO
|
||||||
|
#define DEMO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined MicrosoftC
|
||||||
|
#define DOS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined CRAYX
|
||||||
|
#define CRAY
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined IRISX
|
||||||
|
#define IRIS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined HPX
|
||||||
|
#define HPUX
|
||||||
|
#define HP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined IBMRS6000X
|
||||||
|
#define IBMRS6000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined COMPAQALPHAX
|
||||||
|
#define COMPAQALPHA
|
||||||
|
#define COMPAQX
|
||||||
|
#define COMPAQ
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined DECALPHAX
|
||||||
|
#define DECALPHA
|
||||||
|
#define DECX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined DECX
|
||||||
|
#define DEC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined SUNSOLARISX || defined SUNSOLARIS86X
|
||||||
|
#define SUNX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined SUNX
|
||||||
|
#define SUN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined IRISX || defined CRAYX || defined HPX || defined SUNX || defined CONVEXX
|
||||||
|
#define UNIXX
|
||||||
|
#define SYSV
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined DECX || defined LINUX || defined IBMRS6000X || defined COMPAQX || defined DARWIN
|
||||||
|
#define UNIXX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* A bit of OEM stuff */
|
||||||
|
#define OEM_INVALID_CHECKSUM (LgIndex_t) -1
|
||||||
|
|
||||||
|
/* Hide the name of the checksum function */
|
||||||
|
#if defined NDEBUG
|
||||||
|
# define DECRYPTTIMEDCODE FixupPlot
|
||||||
|
# define CHECKHASHEDCODE ExpandPlot
|
||||||
|
# define UPDATECLASSICOEMEHCKSUM ToggleQuadrants
|
||||||
|
# define UPDATEOEMCHECKSUM ComputeAngleFromQuatrant
|
||||||
|
# define InitOemSettings InitAngleQuatrantSettings
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
#define USE_TRUETYPEFONTS
|
||||||
|
#endif
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#ifdef __cplusplus // STL
|
||||||
|
|
||||||
|
#ifdef MSWIN
|
||||||
|
|
||||||
|
#pragma warning(push, 1) /* warning disabling bellow doesn't actually have any effect on compiler warning.
|
||||||
|
* It appears that Microsft STL enables all the warning right back on.
|
||||||
|
* Therefore, the only way to hide them is to push existing warning level,
|
||||||
|
* lower the level for the time while STL headers are included and then restore
|
||||||
|
* previous warning level with a "pragma warning(pop)"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma warning(disable: 4018) // signed/unsigned mismatch
|
||||||
|
#pragma warning(disable: 4100) // unreferenced formal parameter
|
||||||
|
#pragma warning(disable: 4146) // unary minus operator applied to unsigned type,
|
||||||
|
// result still unsigned
|
||||||
|
#pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2',
|
||||||
|
// possible loss of data
|
||||||
|
#pragma warning(disable: 4245) // conversion from 'type1' to 'type2', signed/unsigned
|
||||||
|
// mismatch
|
||||||
|
#pragma warning(disable: 4511) // 'class' : copy constructor could not be generated
|
||||||
|
#pragma warning(disable: 4512) // 'class' : assignment operator could not be generated
|
||||||
|
#pragma warning(disable: 4663) // C++ language change: to explicitly specialize class
|
||||||
|
// template 'vector'
|
||||||
|
#pragma warning(disable: 4710) // 'function' : function not inlined
|
||||||
|
#pragma warning(disable: 4786) // identifier was truncated to 'number' characters
|
||||||
|
// in the debug information
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MSWIN
|
||||||
|
#pragma warning(pop) //Restore old warning state.
|
||||||
|
#endif //MSWIN
|
||||||
|
|
||||||
|
#endif //__cplusplus
|
||||||
|
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#ifdef MSWIN
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#ifdef TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#endif
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#ifndef TECPLOTKERNEL
|
||||||
|
#if defined VS_2005
|
||||||
|
#define Widget LONG_PTR /* correct for 32 & 64 bit builds */
|
||||||
|
#else
|
||||||
|
#define Widget long
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* MSWIN */
|
||||||
|
|
||||||
|
|
||||||
|
#if defined UNIXX && defined ENGINE
|
||||||
|
typedef void *Widget;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#if !defined SYSV && !defined MSWIN
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (MicrosoftC)
|
||||||
|
#include <stdlib.h>
|
||||||
|
#define EXECOS
|
||||||
|
#ifndef FAR
|
||||||
|
#define FAR
|
||||||
|
#endif
|
||||||
|
#define VOID void
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#if defined UNIXX
|
||||||
|
#if !defined ENGINE
|
||||||
|
#define X11
|
||||||
|
#define MOTIF
|
||||||
|
#endif
|
||||||
|
#define FAR
|
||||||
|
#define NEAR
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if !defined THREADS_BY_PTHREADS && !defined THREADS_BY_WINAPI
|
||||||
|
#endif
|
||||||
|
#if defined THREADS_BY_PTHREADS
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
/* OPENGL currently a must have */
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
# if !defined ENGINE
|
||||||
|
# if defined UNIXX
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
/*
|
||||||
|
* If not building the tecplot kernel then at least
|
||||||
|
* include the X Instrinsics. This will make most
|
||||||
|
* development for addons etc work.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* NOTE: MOTIF not defined if ENGINE is defined */
|
||||||
|
#if defined MOTIF
|
||||||
|
# if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
# if XmVERSION == 1 && XmREVISION == 0
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# include <X11/Intrinsic.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined MOTIF
|
||||||
|
#define CREATE_DIALOG_PARAMS Widget W
|
||||||
|
typedef Widget ComboBoxWidget_t;
|
||||||
|
typedef Widget DropDownListWidget_t;
|
||||||
|
typedef Widget FileDialogWidget_t;
|
||||||
|
typedef Widget LabelWidget_t;
|
||||||
|
typedef Widget ListWidget_t;
|
||||||
|
typedef Widget OptionMenuWidget_t;
|
||||||
|
typedef Widget PullDownMenuWidget_t;
|
||||||
|
typedef Widget ScaleWidget_t;
|
||||||
|
typedef Widget TextFieldWidget_t;
|
||||||
|
typedef Widget ToggleWidget_t;
|
||||||
|
typedef Widget ButtonWidget_t;
|
||||||
|
typedef Widget GridWidget_t;
|
||||||
|
#endif
|
||||||
|
#if defined MSWIN
|
||||||
|
#include <windows.h>
|
||||||
|
#define CREATE_DIALOG_PARAMS CWnd *, LaunchDialogMode_e
|
||||||
|
typedef Widget ComboBoxWidget_t;
|
||||||
|
typedef Widget DropDownListWidget_t;
|
||||||
|
typedef Widget FileDialogWidget_t;
|
||||||
|
typedef Widget LabelWidget_t;
|
||||||
|
typedef Widget ListWidget_t;
|
||||||
|
typedef Widget OptionMenuWidget_t;
|
||||||
|
typedef Widget PullDownMenuWidget_t;
|
||||||
|
typedef Widget ScaleWidget_t;
|
||||||
|
typedef Widget TextFieldWidget_t;
|
||||||
|
typedef Widget ToggleWidget_t;
|
||||||
|
typedef Widget ButtonWidget_t;
|
||||||
|
typedef Widget GridWidget_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#if defined MSWIN && defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if defined TRACE
|
||||||
|
#endif
|
||||||
|
#if defined TRACE0
|
||||||
|
#endif
|
||||||
|
#if defined TRACE1
|
||||||
|
#endif
|
||||||
|
#if defined TRACE2
|
||||||
|
#endif
|
||||||
|
#if defined TRACE3
|
||||||
|
#endif
|
||||||
|
#if defined NDEBUG
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
#endif /* MSWIN */
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/* Assume that if TRACE is not defined, then none of the TRACE macros are */
|
||||||
|
#if !defined (TRACE)
|
||||||
|
/* TRACE is not used by non-debug builds */
|
||||||
|
#if defined NDEBUG
|
||||||
|
#if defined MSWIN
|
||||||
|
#define TRACE __noop
|
||||||
|
#define TRACE0(s) __noop
|
||||||
|
#define TRACE1(S,a1) __noop
|
||||||
|
#define TRACE2(s,a1,a2) __noop
|
||||||
|
#define TRACE3(s,a1,a2,a3) __noop
|
||||||
|
#else
|
||||||
|
#define TRACE(str) ((void)0)
|
||||||
|
#define TRACE0(str) ((void)0)
|
||||||
|
#define TRACE1(str,a1) ((void)0)
|
||||||
|
#define TRACE2(str,a1,a2) ((void)0)
|
||||||
|
#define TRACE3(str,a1,a2,a3) ((void)0)
|
||||||
|
#endif /* MSWIN */
|
||||||
|
#else /* DEBUG */
|
||||||
|
#if defined MSWIN
|
||||||
|
/* If the add-on is running in debug mode but does not
|
||||||
|
* use MFC, then no TRACE macro is available. Thus, to make tracing available,
|
||||||
|
* map TRACE to the win32 OutpuDebugString() function.
|
||||||
|
*/
|
||||||
|
# define TRACE(str) do { OutputDebugStringA(str); } while (0)
|
||||||
|
# define TRACE1(str,a1) do { char s[5000]; sprintf(s,str,a1); OutputDebugStringA(s); } while (0)
|
||||||
|
# define TRACE2(str,a1,a2) do { char s[5000]; sprintf(s,str,a1,a2); OutputDebugStringA(s); } while (0)
|
||||||
|
# define TRACE3(str,a1,a2,a3) do { char s[5000]; sprintf(s,str,a1,a2,a3); OutputDebugStringA(s); } while (0)
|
||||||
|
# define TRACE0(str) TRACE(str)
|
||||||
|
#else
|
||||||
|
#define TRACE printf
|
||||||
|
#define TRACE0 printf
|
||||||
|
#define TRACE1 printf
|
||||||
|
#define TRACE2 printf
|
||||||
|
#define TRACE3 printf
|
||||||
|
#endif /* MSWIN */
|
||||||
|
#endif /* NDEBUG */
|
||||||
|
#endif /* !defined (TRACE) */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Platform independent way for add-ons to know how much space
|
||||||
|
to allocate for a filename.
|
||||||
|
*/
|
||||||
|
#if !defined MAX_SIZEOFUTF8CHAR
|
||||||
|
#define MAX_SIZEOFUTF8CHAR 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined (MaxCharsFilePath)
|
||||||
|
# if defined (MSWIN)
|
||||||
|
# define MaxCharsFilePath (_MAX_PATH*MAX_SIZEOFUTF8CHAR+1) /* Includes traling '\0' */
|
||||||
|
# else
|
||||||
|
# define MaxCharsFilePath 2047 /* ...not really a hard limit for Linux/Unix */
|
||||||
|
# endif /* MSWIN */
|
||||||
|
#endif /* !MaxCharsFilePath */
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Under Windows, if we are doing a release build (NDEBUG) that is not a CHECKED_BUILD
|
||||||
|
* then NO_ASSERTS should be defined
|
||||||
|
*/
|
||||||
|
#if defined MSWIN && defined NDEBUG && !defined NO_ASSERTS && !defined CHECKED_BUILD
|
||||||
|
/* intentionally break the compile */
|
||||||
|
# error "define NO_ASSERTS for release builds"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Under Windows, if we are doing a CHECKED_BUILD then it should
|
||||||
|
* also be a release build (NDEBUG)
|
||||||
|
*/
|
||||||
|
#if defined MSWIN && defined CHECKED_BUILD && !defined NDEBUG
|
||||||
|
# error "CHECKED_BUILDS must also be release builds"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined NO_ASSERTS
|
||||||
|
# define USE_MACROS_FOR_FUNCTIONS
|
||||||
|
#endif
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
/*
|
||||||
|
* Under Linux the definition of NULL has a cast that conflicts with our own
|
||||||
|
* casting causing warnings that make it tough to find real problems.
|
||||||
|
*/
|
||||||
|
#if defined LINUX && defined NULL
|
||||||
|
# undef NULL
|
||||||
|
# define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
#if !defined MSWIN && !defined ENGINE && !defined ISMESA
|
||||||
|
#define DISALLOW_OFFSCREEN_EXPORT_IN_BATCH
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#endif /* _MASTER_H_ */
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
alloc.cpp
|
||||||
|
arrlist.cpp
|
||||||
|
auxdata.cpp
|
||||||
|
dataio4.cpp
|
||||||
|
dataio.cpp
|
||||||
|
dataset0.cpp
|
||||||
|
dataset.cpp
|
||||||
|
datautil.cpp
|
||||||
|
filestream.cpp
|
||||||
|
geom2.cpp
|
||||||
|
q_msg.cpp
|
||||||
|
q_unicode.cpp
|
||||||
|
set.cpp
|
||||||
|
strlist.cpp
|
||||||
|
strutil.cpp
|
||||||
|
tassert.cpp
|
||||||
|
tecxxx.cpp
|
||||||
|
TranslatedString.cpp
|
||||||
|
|
||||||
|
LIB = $(FOAM_LIBBIN)/libtecio
|
||||||
|
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
#include "tecioOptions"
|
||||||
|
|
||||||
|
EXE_INC = \
|
||||||
|
$(TECIO_FLAGS) $(TECIO_INC)
|
||||||
|
|
||||||
|
LIB_LIBS = \
|
||||||
|
$(TECIO_LIBS)
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
#if defined(linux64)
|
||||||
|
|
||||||
|
TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUX64 -DUSEENUM -DTHREED -U_WIN32
|
||||||
|
|
||||||
|
#elif defined(linuxIA64)
|
||||||
|
|
||||||
|
TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUXI64 -DUSEENUM -DTHREED -U_WIN32
|
||||||
|
|
||||||
|
#elif defined(linux)
|
||||||
|
|
||||||
|
TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DUSEENUM -DTHREED -U_WIN32
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
# error architecture not supported for compiling tecio.
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
TECIO_INC =
|
||||||
|
TECIO_LIBS =
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#ifndef Q_MSG_H
|
||||||
|
#define Q_MSG_H
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined Q_MSGMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MAX_STATUS_LINE_MSG_LEN 255
|
||||||
|
|
||||||
|
#include "TranslatedString.h"
|
||||||
|
|
||||||
|
EXTERN Boolean_t WrapString(const char *OldString,
|
||||||
|
char **NewString);
|
||||||
|
EXTERN void Warning(tecplot::strutil::TranslatedString Format,
|
||||||
|
...); /* zero or more arguments */
|
||||||
|
# if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
EXTERN void ErrMsg(tecplot::strutil::TranslatedString Format,
|
||||||
|
...); /* zero or more arguments */
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if !defined ENGINE
|
||||||
|
#endif
|
||||||
|
#if !defined ENGINE
|
||||||
|
#if defined MOTIF
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if !defined ENGINE
|
||||||
|
#endif
|
||||||
|
#if defined Q_MSGMODULE
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
#endif // TECPLOTKERNEL
|
||||||
|
|
||||||
|
#endif // Q_MSG_H
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined Q_UNICODE_H_
|
||||||
|
# define Q_UNICODE_H_
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined Q_UNICODEMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace tecplot
|
||||||
|
{
|
||||||
|
namespace strutil
|
||||||
|
{
|
||||||
|
|
||||||
|
// functions
|
||||||
|
Boolean_t IsValidUtf8LeadByte(Byte_t ch);
|
||||||
|
Boolean_t IsValidUtf8ContinuingByte(Byte_t ch);
|
||||||
|
Boolean_t IsValidUtf8Byte(Byte_t ch);
|
||||||
|
|
||||||
|
Boolean_t IsValidUtf8String(const char *str);
|
||||||
|
Boolean_t ShouldConvertWideStringToUtf8String(const wchar_t *str);
|
||||||
|
void InitTranslatedStrings();
|
||||||
|
void CleanUpTranslatedStrings();
|
||||||
|
|
||||||
|
Boolean_t IsNullOrZeroLengthString(const char *S);
|
||||||
|
Boolean_t IsNullOrZeroLengthString(tecplot::strutil::TranslatedString TS);
|
||||||
|
|
||||||
|
Boolean_t IsEmptyString(const char *S);
|
||||||
|
Boolean_t IsEmptyString(tecplot::strutil::TranslatedString S);
|
||||||
|
Boolean_t IsEmptyString(const wchar_t* S);
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
|
||||||
|
std::string LookUpTranslation(std::string& strEnglish);
|
||||||
|
void MsWinInitTranslatedStrings();
|
||||||
|
|
||||||
|
std::string WStringToString(std::wstring str);
|
||||||
|
std::wstring StringToWString(std::string str);
|
||||||
|
|
||||||
|
std::wstring MultiByteToWideChar(const char *Utf8Str,
|
||||||
|
unsigned int CodePage);
|
||||||
|
|
||||||
|
std::string WideCharToMultiByte(const wchar_t *WideStr,
|
||||||
|
unsigned int CodePage);
|
||||||
|
|
||||||
|
// Conversion
|
||||||
|
std::string WideCharToUtf8(const wchar_t* str);
|
||||||
|
std::wstring Utf8ToWideChar(const char *str);
|
||||||
|
char *getenv(const char *str);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -0,0 +1,283 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined SETMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _SET_H_INCLUDED
|
||||||
|
#define _SET_H_INCLUDED
|
||||||
|
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define PadOut(X,Y) ((int)(((X)-1)/(Y)+1)*(Y))
|
||||||
|
#define SetBitSize (8*sizeof(SetData_t))
|
||||||
|
#define SetLastBit (((unsigned long)1)<<(SetBitSize-1))
|
||||||
|
|
||||||
|
#if defined _DEBUG
|
||||||
|
# define USE_FUNCTIONS_FOR_SETS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* *
|
||||||
|
* * NOTE: "Set_pa" is a pointer to an "abstract type",
|
||||||
|
* * hence the "_pa". Pointer here is akin to "handle".
|
||||||
|
* * Any routines dealing with the internals of Set_pa
|
||||||
|
* * or Set_a must be in the same file as these routines
|
||||||
|
* */
|
||||||
|
|
||||||
|
/* Set_a is intentionally not defined to further
|
||||||
|
* deter usage of this private structure */
|
||||||
|
struct _Set_a
|
||||||
|
{
|
||||||
|
/* * PRIVATE * */
|
||||||
|
SetIndex_t size;
|
||||||
|
SetData_pt data;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Checks set for NULL.
|
||||||
|
*/
|
||||||
|
#define IsSetNull(Set) ((Set)==NULL)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates how many bytes are required to store the set data.
|
||||||
|
*/
|
||||||
|
inline size_t SetDataSizeInBytes(Set_pa Set)
|
||||||
|
{
|
||||||
|
REQUIRE(VALID_REF(Set));
|
||||||
|
return Set->size / SetBitSize * sizeof(SetData_t);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocates a new empty set. Returns NULL if not enough memory.
|
||||||
|
*/
|
||||||
|
EXTERN Set_pa AllocSet(Boolean_t show_error_msg);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Frees all memory associated with set "*set", and
|
||||||
|
* sets "*set" to NULL.
|
||||||
|
*/
|
||||||
|
EXTERN void DeallocSet(Set_pa *Set);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function adapts the DeallocSet function to work with the
|
||||||
|
* ArrayList's deallocation callback.
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t SetItemDestructor(void *ItemRef,
|
||||||
|
ArbParam_t ClientData);
|
||||||
|
/*
|
||||||
|
* Makes sure set "set" can hold at least "max_val" elements.
|
||||||
|
* Returns TRUE if successful, FALSE otherwise. A successful
|
||||||
|
* call to ExpandSet() guarentees that any calls to AddToSet()
|
||||||
|
* will be successful as long as the elements added are less
|
||||||
|
* than "max_val".
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t ExpandSet(Set_pa Set,
|
||||||
|
SetIndex_t max_val,
|
||||||
|
Boolean_t show_error_msg);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copies set "src" to set "dst". Returns TRUE if successful,
|
||||||
|
* FALSE if "src" contains elements it is unable to add to "dst".
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t CopySet(Set_pa dst,
|
||||||
|
Set_pa src,
|
||||||
|
Boolean_t show_error_msg);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Appends set "src" to set "dst". Returns TRUE if successful,
|
||||||
|
* FALSE if "src" contains elements it is unable to add to "dst".
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t AppendSet(Set_pa dst,
|
||||||
|
Set_pa src,
|
||||||
|
Boolean_t show_error_msg);
|
||||||
|
/*
|
||||||
|
* Empties the set "set".
|
||||||
|
*/
|
||||||
|
EXTERN void ClearSet(Set_pa Set);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Adds "member" to set "set". Returns TRUE if successful,
|
||||||
|
* FALSE otherwise. AddToSet() can only return FALSE if
|
||||||
|
* "member" is greater than any previous member of "set" and
|
||||||
|
* also greater that any "max_val" set with ExpandSet().
|
||||||
|
*/
|
||||||
|
#if defined USE_FUNCTIONS_FOR_SETS
|
||||||
|
EXTERN Boolean_t AddToSet(Set_pa Set,
|
||||||
|
SetIndex_t member,
|
||||||
|
Boolean_t show_error_msg);
|
||||||
|
#else
|
||||||
|
# if defined __cplusplus
|
||||||
|
inline Boolean_t AddToSet(Set_pa Set,
|
||||||
|
SetIndex_t member,
|
||||||
|
Boolean_t show_error_msg)
|
||||||
|
{
|
||||||
|
if (Set &&
|
||||||
|
(member + 1 <= Set->size ||
|
||||||
|
ExpandSet(Set, member + 1, show_error_msg)))
|
||||||
|
{
|
||||||
|
SetIndex_t word = member / SetBitSize;
|
||||||
|
SetData_t bit = (SetData_t)1 << (member % SetBitSize);
|
||||||
|
Set->data[word] |= bit;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
} /* AddToSet() */
|
||||||
|
# else
|
||||||
|
# define AddToSet(Set,member,show_error_msg) \
|
||||||
|
(((Set) && \
|
||||||
|
((member)+1 <= (Set)->size || \
|
||||||
|
ExpandSet((Set), (member)+1, (show_error_msg)))) \
|
||||||
|
? (((Set)->data[(member) / SetBitSize] |= (SetData_t)1 << ((member) % SetBitSize)), TRUE) \
|
||||||
|
: FALSE)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Removes "member" from set "set".
|
||||||
|
*/
|
||||||
|
EXTERN void RemoveFromSet(Set_pa Set,
|
||||||
|
SetIndex_t member);
|
||||||
|
|
||||||
|
EXTERN void DeleteSetMember(Set_pa Set,
|
||||||
|
SetIndex_t Member);
|
||||||
|
EXTERN Boolean_t InsertSetMember(Set_pa Set,
|
||||||
|
SetIndex_t Member,
|
||||||
|
Boolean_t ShowErrMsg);
|
||||||
|
/*
|
||||||
|
* Test for membership of "member" in set "set". This is the only
|
||||||
|
* function worth making into a macro or inline function.
|
||||||
|
*/
|
||||||
|
#if defined USE_FUNCTIONS_FOR_SETS
|
||||||
|
EXTERN Boolean_t InSet(Set_pa Set,
|
||||||
|
SetIndex_t member);
|
||||||
|
#else
|
||||||
|
# if defined __cplusplus
|
||||||
|
inline Boolean_t InSet(Set_pa Set,
|
||||||
|
SetIndex_t member)
|
||||||
|
{
|
||||||
|
if (Set && (0 <= member && member < Set->size))
|
||||||
|
{
|
||||||
|
SetIndex_t word = member / SetBitSize;
|
||||||
|
SetData_t bit = (SetData_t)1 << (member % SetBitSize);
|
||||||
|
return (Set->data[word]&bit) != 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
} /* InSet() */
|
||||||
|
# else
|
||||||
|
# define InSet(Set,member) ((Set && (0<=(member) && (member)<(Set)->size)) \
|
||||||
|
? ((Set)->data[(member)/SetBitSize]&((SetData_t)1<<((member)%SetBitSize)))!=0 \
|
||||||
|
: FALSE)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns TRUE if set "set" is empty.
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t IsEmpty(Set_pa Set);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns TRUE if Set has voids.
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t HasVoids(Set_pa Set);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns number of members in Set "Set".
|
||||||
|
*/
|
||||||
|
EXTERN SetIndex_t MemberCount(Set_pa Set);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns the next member in set "set" after member "start_at".
|
||||||
|
* Use "start_at" of BAD_ZV_VALUE to find first member.
|
||||||
|
*/
|
||||||
|
EXTERN SetIndex_t GetNextMember(Set_pa Set,
|
||||||
|
SetIndex_t start_at);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns the previous member in set "set" before member
|
||||||
|
* "start_at". Use "start_at" of BAD_ZV_VALUE to find last member.
|
||||||
|
*/
|
||||||
|
EXTERN SetIndex_t GetPrevMember(Set_pa Set,
|
||||||
|
SetIndex_t start_at);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns TRUE if sets are equal (have same members). FALSE otherwise.
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t EqualSets(Set_pa set1,
|
||||||
|
Set_pa set2);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns TRUE if all members of childset are contained in parentset.
|
||||||
|
*/
|
||||||
|
EXTERN Boolean_t IsSubSet(Set_pa childset,
|
||||||
|
Set_pa parentset);
|
||||||
|
|
||||||
|
EXTERN SetIndex_t MemberOffset(Set_pa Set,
|
||||||
|
SetIndex_t Member);
|
||||||
|
|
||||||
|
EXTERN SetIndex_t OffsetMember(Set_pa Set,
|
||||||
|
SetIndex_t Offset);
|
||||||
|
|
||||||
|
|
||||||
|
EXTERN Boolean_t CopySetMember(Set_pa DstSet,
|
||||||
|
SetIndex_t DstOffset,
|
||||||
|
Set_pa SrcSet,
|
||||||
|
SetIndex_t SrcOffset);
|
||||||
|
|
||||||
|
EXTERN void ShiftSet(Set_pa Set,
|
||||||
|
SetIndex_t ShiftPos1,
|
||||||
|
SetIndex_t ShiftPos2,
|
||||||
|
SetIndex_t ShiftAmount);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handy macros
|
||||||
|
*/
|
||||||
|
#define GetFirstSetMember(Set) (GetNextMember((Set), BAD_SET_VALUE))
|
||||||
|
#define GetLastSetMember(Set) (GetPrevMember((Set), BAD_SET_VALUE))
|
||||||
|
|
||||||
|
#define ForAllMembersInSet(Member, Set) \
|
||||||
|
for (Member = GetFirstSetMember((Set)); \
|
||||||
|
Member != BAD_SET_VALUE; \
|
||||||
|
Member = GetNextMember((Set), (Member)))
|
||||||
|
#define ForAllMembersInReversedSet(Member, Set) \
|
||||||
|
for (Member = GetLastSetMember((Set)); \
|
||||||
|
Member != BAD_SET_VALUE; \
|
||||||
|
Member = GetPrevMember((Set), (Member)))
|
||||||
|
|
||||||
|
#endif // _SET_H_INCLUDED
|
||||||
@ -0,0 +1,122 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
# undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined STRLISTMODULE
|
||||||
|
# define EXTERN
|
||||||
|
#else
|
||||||
|
# define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined ARRLIST_h
|
||||||
|
# error "Include ARRLIST.h before including STRLIST.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* For building pltview.exe under Windows, we use
|
||||||
|
* tecio.dll (which is linked to pltview).
|
||||||
|
* Since pltview.exe uses a few of the
|
||||||
|
* functions here, they need to be exported into
|
||||||
|
* the tecio.dll, thus "TECXXX.h" is included for the
|
||||||
|
* LIBFUNCTION & LIBCALL keywords. They are not
|
||||||
|
* documented with the other TECXXX() functions,
|
||||||
|
* however.
|
||||||
|
*
|
||||||
|
* If pltview requires other string functions
|
||||||
|
* in the future, they can be added to the dll
|
||||||
|
* by adding LIBFUNCTION & LIBCALL as in
|
||||||
|
* StringListDealloc(), etc. below.
|
||||||
|
*
|
||||||
|
* When building the tecplot kernal, LIBFUNCTION
|
||||||
|
* and LIBCALL are nop's.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include "TECXXX.h"
|
||||||
|
|
||||||
|
EXTERN Boolean_t StringListValid(StringList_pa StringList);
|
||||||
|
EXTERN void StringListClear(StringList_pa StringList);
|
||||||
|
EXTERN void StringListRemoveStrings(StringList_pa StringList,
|
||||||
|
LgIndex_t StringOffset,
|
||||||
|
LgIndex_t Count);
|
||||||
|
EXTERN void StringListRemoveString(StringList_pa StringList,
|
||||||
|
LgIndex_t StringOffset);
|
||||||
|
LIBFUNCTION void LIBCALL StringListDealloc(StringList_pa *StringList);
|
||||||
|
EXTERN StringList_pa StringListAlloc(void);
|
||||||
|
EXTERN Boolean_t StringListAppendString(StringList_pa StringList,
|
||||||
|
const char *String);
|
||||||
|
LIBFUNCTION LgIndex_t LIBCALL StringListCount(StringList_pa StringList);
|
||||||
|
LIBFUNCTION char * LIBCALL StringListGetString(StringList_pa StringList,
|
||||||
|
LgIndex_t StringOffset);
|
||||||
|
|
||||||
|
#if defined USE_MACROS_FOR_FUNCTIONS
|
||||||
|
# define StringListGetStringRef StringListGetStringRef_MACRO
|
||||||
|
#else
|
||||||
|
# define StringListGetStringRef StringListGetStringRef_FUNC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined USE_MACROS_FOR_FUNCTIONS
|
||||||
|
EXTERN const char * StringListGetStringRef_FUNC(StringList_pa StringList,
|
||||||
|
LgIndex_t StringOffset);
|
||||||
|
#endif
|
||||||
|
/**
|
||||||
|
* To maintain the string list's integrity the result is cast to a
|
||||||
|
* (const char *) to minimize the risk of users passing the result
|
||||||
|
* to FREE_ARRAY.
|
||||||
|
*/
|
||||||
|
#define StringListGetStringRef_MACRO(StringList, StringOffset) \
|
||||||
|
((const char *)ArrayListGetCharPtr((ArrayList_pa)(StringList), StringOffset))
|
||||||
|
|
||||||
|
EXTERN Boolean_t StringListSetString(StringList_pa StringList,
|
||||||
|
LgIndex_t StringOffset,
|
||||||
|
const char *String);
|
||||||
|
EXTERN Boolean_t StringListInsertString(StringList_pa StringList,
|
||||||
|
LgIndex_t StringOffset,
|
||||||
|
const char *String);
|
||||||
|
EXTERN StringList_pa StringListCopy(StringList_pa StringList);
|
||||||
|
EXTERN Boolean_t StringListAppend(StringList_pa Target,
|
||||||
|
StringList_pa Source);
|
||||||
|
|
||||||
|
EXTERN char *StringListToNLString(StringList_pa StringList);
|
||||||
|
EXTERN StringList_pa StringListFromNLString(const char *String);
|
||||||
|
EXTERN char **StringListToArray(StringList_pa StringList);
|
||||||
|
EXTERN StringList_pa StringListFromArray(const char **StringArray,
|
||||||
|
LgIndex_t Count);
|
||||||
|
EXTERN StringList_pa StringListFromCompound(const char *String);
|
||||||
|
EXTERN char *StringListToCompound(StringList_pa StringList,
|
||||||
|
char GroupJoinCharacter,
|
||||||
|
const char *CharsToEscape);
|
||||||
|
EXTERN void StringListSort(StringList_pa StringList,
|
||||||
|
StringListStringComparator_pf Comparator,
|
||||||
|
ArbParam_t ClientData);
|
||||||
@ -0,0 +1,218 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined STRUTILMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace tecplot
|
||||||
|
{
|
||||||
|
namespace strutil
|
||||||
|
{
|
||||||
|
class Scanner;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EXTERN void FormatStringBufferCleanup(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is a helper function for FormatString or any other functions that want
|
||||||
|
* to format a string based on a format string followed by a set of arguments.
|
||||||
|
* See FormatString or ErrMsg functions for example usage.
|
||||||
|
*
|
||||||
|
* @param Format
|
||||||
|
* C format string.
|
||||||
|
* @param Arguments
|
||||||
|
* Variable argument list already fetched using va_start().
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* Allocated string with the formatted string or NULL if it failed.
|
||||||
|
*/
|
||||||
|
EXTERN char *vFormatString(const char *Format,
|
||||||
|
va_list Arguments);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats a string using the specified C format string.
|
||||||
|
*
|
||||||
|
* @param Format
|
||||||
|
* C format string.
|
||||||
|
* @param ...
|
||||||
|
* Any arguments needed by the C format string.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* Allocated string with the formatted string or NULL if it failed. The
|
||||||
|
* client is responsible for deallocating the resource.
|
||||||
|
*/
|
||||||
|
EXTERN char *FormatString(tecplot::strutil::TranslatedString Format,
|
||||||
|
...); /* 0 or more variable arguments */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Formats a string using the specified C format string and places the result
|
||||||
|
* in the string buffer.
|
||||||
|
*
|
||||||
|
* @param Buffer
|
||||||
|
* String buffer to receive the formatted string.
|
||||||
|
* @param Format
|
||||||
|
* C format string.
|
||||||
|
* @param ...
|
||||||
|
* Any arguments needed by the C format string.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* Upon successful return, these functions return the number of characters
|
||||||
|
* printed, not including the trailing '\0' used to end output to strings. If
|
||||||
|
* unsuccessful -1 is returned.
|
||||||
|
*/
|
||||||
|
EXTERN int FormatString(std::string& Buffer,
|
||||||
|
tecplot::strutil::TranslatedString Format
|
||||||
|
...); /* 0 or more variable arguments */
|
||||||
|
EXTERN char *DupString(tecplot::strutil::TranslatedString String);
|
||||||
|
EXTERN void CopySubString(char *Target,
|
||||||
|
const char *Source,
|
||||||
|
int Index,
|
||||||
|
int Count);
|
||||||
|
|
||||||
|
#if !defined MSWIN
|
||||||
|
|
||||||
|
EXTERN void ReplaceCharInString(char *S,
|
||||||
|
short OldChar,
|
||||||
|
short NewChar);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN void MakeStringLowerCase(char *str);
|
||||||
|
EXTERN void MakeStringUpperCase(char *str);
|
||||||
|
EXTERN char *TrimLeadAndTrailSpaces(char *String);
|
||||||
|
EXTERN char *StringFlushLeft(char *String);
|
||||||
|
EXTERN char *StringTruncate(char *String,
|
||||||
|
LgIndex_t MaxLength);
|
||||||
|
EXTERN char *StringTrimAndTruncate(char *String,
|
||||||
|
LgIndex_t MaxLength);
|
||||||
|
|
||||||
|
#ifndef MSWIN
|
||||||
|
EXTERN StringList_pa LineBreakString(const char *String,
|
||||||
|
UInt32_t WrapMargin);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN Boolean_t MatchKey(char *StringToMatch,
|
||||||
|
char *Key);
|
||||||
|
EXTERN void RemoveSeparator(const char **CPtr);
|
||||||
|
EXTERN void SkipWhiteSpace(const char **CPtr);
|
||||||
|
EXTERN void SkipNonWhiteSpace(char **CPtr);
|
||||||
|
EXTERN const char *ustrstr(const char *s1,
|
||||||
|
const char *s2);
|
||||||
|
EXTERN int ustrncmp(const char *s1,
|
||||||
|
const char *s2,
|
||||||
|
size_t Len);
|
||||||
|
EXTERN int ustrcmp(const char *s1,
|
||||||
|
const char *s2);
|
||||||
|
/* public access */
|
||||||
|
/* InternalResetString should not be used directly (use ResetString macro) */
|
||||||
|
#if !defined NO_ASSERTS
|
||||||
|
EXTERN Boolean_t InternalResetString(char **SBase,
|
||||||
|
const char *NewString,
|
||||||
|
Boolean_t IssueErrMsg,
|
||||||
|
const char *FileName,
|
||||||
|
int LineNumber);
|
||||||
|
# define ResetString(SBase, NewString, IssueErrMsg) InternalResetString( \
|
||||||
|
SBase, \
|
||||||
|
NewString, \
|
||||||
|
IssueErrMsg, \
|
||||||
|
__FILE__, __LINE__)
|
||||||
|
#else
|
||||||
|
EXTERN Boolean_t InternalResetString(char **SBase,
|
||||||
|
const char *NewString,
|
||||||
|
Boolean_t IssueErrMsg);
|
||||||
|
# define ResetString(SBase, NewString, IssueErrMsg) InternalResetString( \
|
||||||
|
SBase, \
|
||||||
|
NewString, \
|
||||||
|
IssueErrMsg)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN Boolean_t ScanForString(tecplot::strutil::Scanner &scanner,
|
||||||
|
std::string &DestString,
|
||||||
|
Boolean_t GrabEntireStringIncludingDelimiters);
|
||||||
|
EXTERN Boolean_t TackOnString(char **SBase,
|
||||||
|
const char *StringToAdd,
|
||||||
|
Boolean_t DeleteStringToAdd,
|
||||||
|
Boolean_t ConvertNewlineToAscii);
|
||||||
|
EXTERN Boolean_t TackOnConstString(char **SBase,
|
||||||
|
const char *StringToAdd,
|
||||||
|
Boolean_t ConvertNewlineToAscii);
|
||||||
|
EXTERN Boolean_t TackOnChar(char **SBase,
|
||||||
|
char CharToAdd);
|
||||||
|
EXTERN Boolean_t ReplaceNewlineWithBackslashN(char **String);
|
||||||
|
EXTERN Boolean_t ReplaceBackslashNWithNewline(char **S);
|
||||||
|
|
||||||
|
EXTERN Boolean_t EscapeOutDelimitersInString(char **S,
|
||||||
|
char Delimiter);
|
||||||
|
EXTERN Boolean_t ScanForSymbol(tecplot::strutil::Scanner &scanner,
|
||||||
|
char Symbol,
|
||||||
|
Boolean_t OnlySkipWhiteSpace);
|
||||||
|
|
||||||
|
|
||||||
|
/* Newline Delimited Strings */
|
||||||
|
EXTERN char *ConvertStringToNewlineDelimitedString(const char *OriginalString);
|
||||||
|
EXTERN char *ConvertNewlineDelimitedStringToQuotedString(const char *NewlineDelimitedString,
|
||||||
|
Boolean_t SeparateInstructionsWithPlus);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EXTERN char *InsertNameAtPlaceHolder(char *BaseString,
|
||||||
|
char *NameToInsert);
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if !defined NO_ASSERTS
|
||||||
|
#endif /* !NO_ASSERTS */
|
||||||
|
#endif //TECPLOTKERNEL
|
||||||
|
|
||||||
|
inline char* EndOfString(char* str)
|
||||||
|
{
|
||||||
|
return str + strlen(str);
|
||||||
|
};
|
||||||
|
inline char const* EndOfString(char const* str)
|
||||||
|
{
|
||||||
|
return str + strlen(str);
|
||||||
|
};
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined SYSTEMMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
EXTERN int OpenFileListGetCount(void);
|
||||||
|
EXTERN char *GetLongFileName(const char *FileName);
|
||||||
|
EXTERN Boolean_t VerifyToOverwriteFile(const char *FName);
|
||||||
|
EXTERN Boolean_t IsValidDirectory(const char *FName);
|
||||||
|
EXTERN Boolean_t FileExists(const char *F,
|
||||||
|
Boolean_t ShowErr);
|
||||||
|
EXTERN Boolean_t IsOkFNameChar(unsigned char ch);
|
||||||
|
EXTERN void ErrFName(const char *FName);
|
||||||
|
EXTERN Boolean_t IsValidFileName(const char *FileName,
|
||||||
|
Boolean_t IsReading,
|
||||||
|
Boolean_t ShowError);
|
||||||
|
EXTERN Boolean_t ResizeFile(FILE *File,
|
||||||
|
Int64_t Length);
|
||||||
|
EXTERN Boolean_t Close_File(FILE **F,
|
||||||
|
Boolean_t ShowErr);
|
||||||
|
EXTERN Boolean_t Open_File(FILE **F,
|
||||||
|
const char *FName,
|
||||||
|
Boolean_t IsReading,
|
||||||
|
Boolean_t IsAppending,
|
||||||
|
Boolean_t ForceOpen,
|
||||||
|
Boolean_t ShowErr,
|
||||||
|
Boolean_t IsAscii);
|
||||||
|
|
||||||
@ -0,0 +1,513 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* Provide four levels of assertion control. Assertions provide a mechanism
|
||||||
|
* to enforce a contract between a client and service provider. The assertions
|
||||||
|
* are listed in order of highest to lowest priority. Assertions can be turned
|
||||||
|
* off individually by defining the appropriate name (see preprossessor
|
||||||
|
* definitions below), however, lower priority assertions should be turned
|
||||||
|
* off prior to higher ones. As confidence in the code increases all assertions
|
||||||
|
* can be turned off by defining NO_ASSERTS.
|
||||||
|
*
|
||||||
|
* The assertions defined below have the following meanings:
|
||||||
|
*
|
||||||
|
* INVARIANT - Asserts that a property's state is invariant throughout the
|
||||||
|
* life of the property's scope. Stating invariant properties
|
||||||
|
* of an application provides a deeper understanding of the
|
||||||
|
* application's state. These statements are usually
|
||||||
|
* positioned just ahead of the preconditions and just after
|
||||||
|
* the postconditions.
|
||||||
|
*
|
||||||
|
* REQUIRE - Asserts that a method's preconditions are within their
|
||||||
|
* valid domains. Preconditions are conditions placed upon
|
||||||
|
* any state information relied upon for the call. These
|
||||||
|
* statements should be as close to the top of the method
|
||||||
|
* as possible (except for assertions on invariant properties).
|
||||||
|
*
|
||||||
|
* ENSURE - Asserts that a method's postconditions are within their
|
||||||
|
* valid ranges. Postconditions are conditions placed upon
|
||||||
|
* any state information modified by the call. These
|
||||||
|
* statements should be as close to the bottom of the method
|
||||||
|
* (presumably there is only one exit point) as possible
|
||||||
|
* (except for assertions on invariant properties).
|
||||||
|
*
|
||||||
|
* CHECK - Any other assertion not covered by the above assertions.
|
||||||
|
* These are often added within a method body to specify
|
||||||
|
* something that may not be immediately obvious to the reader
|
||||||
|
* or to validate your assumptions about a call to a 3rd party
|
||||||
|
* method that does not use runtime assertions for its
|
||||||
|
* preconditions or postconditions. Obviously if the 3rd party
|
||||||
|
* method uses assertions then there is no need for the CHECK.
|
||||||
|
*
|
||||||
|
* Additionally a convenience macro is available to place in code that is
|
||||||
|
* pending implementation.
|
||||||
|
*
|
||||||
|
* NOT_IMPLEMENTED - Assertion that always fails during runtime for debug
|
||||||
|
* builds and always fails at compile time for release
|
||||||
|
* builds.
|
||||||
|
*/
|
||||||
|
#if !defined TASSERT_H
|
||||||
|
#define TASSERT_H
|
||||||
|
|
||||||
|
#if defined (MSWIN)
|
||||||
|
# include <assert.h>
|
||||||
|
#endif /* MSWIN */
|
||||||
|
|
||||||
|
#if !defined TECPLOTKERNEL && !defined STD_ASSERTS
|
||||||
|
#define STD_ASSERTS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined (MSWIN)
|
||||||
|
# include <assert.h>
|
||||||
|
# if !defined ASSERT
|
||||||
|
# define ASSERT assert
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
/* MFC .NET defines ENSURE, so we undefine it here */
|
||||||
|
#if defined ENSURE
|
||||||
|
#undef ENSURE
|
||||||
|
#endif /* ENSURE */
|
||||||
|
#endif /* MSWIN */
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#define INVALID_REF ((void *)0x0000FFFF)
|
||||||
|
/*
|
||||||
|
* Chances are low the address 0x11111111 will be used, so we'll risk asserting
|
||||||
|
* against it (see unitialized assignment in newmalloc).
|
||||||
|
*/
|
||||||
|
#define UNINITIALIZED_REF ((void *)0x11111111)
|
||||||
|
#define INVALID_FN_REF ((void *)NULL)
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#ifdef UNIXX
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
# if defined NO_ASSERTS
|
||||||
|
# else
|
||||||
|
# endif
|
||||||
|
#endif /* TECPLOTKERNAL */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#if !defined TECPLOTKERNEL
|
||||||
|
/* For add-ons, there is a problem with VALID_REF, so just test for non-NULL */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
# define VALID_REF(p) ( (p) != NULL )
|
||||||
|
# define VALID_FN_REF(fp) ( (fp) != NULL )
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#endif /* !defined TECPLOTKERNAL */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
/* Widgets are pointers under Motif */
|
||||||
|
# define VALID_WIDGET(widget) VALID_REF((widget))
|
||||||
|
/* Menu widgets are pointers too */
|
||||||
|
# define VALID_MENU_WIDGET(widget) VALID_REF((widget))
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
#endif /* UNIXX */
|
||||||
|
|
||||||
|
#ifdef MSWIN
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
/* Don't use AfxIsValidAddress()! See Bug <7245>.
|
||||||
|
1/4/08, dto. */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#if defined NO_ASSERTS
|
||||||
|
/* release build in TecUtil layer uses these for TUASSERT */
|
||||||
|
# define VALID_REF(p) ((p) != NULL)
|
||||||
|
# define VALID_FN_REF(pf) ((pf) != NULL)
|
||||||
|
#else
|
||||||
|
# define VALID_REF(p) ((p) != NULL && !IsBadReadPtr((const void *)(p), 1))
|
||||||
|
# define VALID_FN_REF(pf) ((pf) != NULL && !IsBadReadPtr((const void *)(pf),(UINT_PTR)sizeof(const void*)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
/* Widgets are numbers under Windows, so we decode it with GetWindowFromWidget */
|
||||||
|
# if defined ENGINE
|
||||||
|
# define VALID_WIDGET(widget) ((widget) != NULL)
|
||||||
|
# else
|
||||||
|
# define VALID_WIDGET(widget) ((widget) != NULL && GetWindowFromWidget((widget))!=NULL)
|
||||||
|
# endif // ENGINE
|
||||||
|
|
||||||
|
/* Menu widgets are numbers too, so we just check against zero */
|
||||||
|
# define VALID_MENU_WIDGET(widget) ((widget)!=NULL)
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
#endif /* MSWIN */
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
/* handles are not pointers to memory, so the only test we can */
|
||||||
|
/* perform is to check for 0 */
|
||||||
|
#define VALID_HANDLE(handle) ((handle)!=0)
|
||||||
|
|
||||||
|
#if defined FLEXLM
|
||||||
|
#define VALID_FLEX_JOB_HANDLE(handle) ((handle) != NULL)
|
||||||
|
#define VALID_FLEX_ERROR_CODE(ErrorCode)(ErrorCode <= 0)
|
||||||
|
#endif /* FLEXLM */
|
||||||
|
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
/* other useful validity checks */
|
||||||
|
#define VALID_BOOLEAN(b) ((b) == TRUE || (b) == FALSE)
|
||||||
|
#define VALID_ENUM(value, type) (0 <= (value) && \
|
||||||
|
(value) < END_##type)
|
||||||
|
|
||||||
|
/* Test a parameter than can be NULL or a valid pointer */
|
||||||
|
#define VALID_REF_OR_NULL(ptr) IMPLICATION((ptr) != NULL, VALID_REF(ptr))
|
||||||
|
#define VALID_FN_REF_OR_NULL(ptr) IMPLICATION((ptr) != NULL, VALID_FN_REF(ptr))
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#define VALID_TRANSLATED_STRING(ts) (!(ts).isNull())
|
||||||
|
|
||||||
|
/**
|
||||||
|
* These macros are a little complicated but it allows one to
|
||||||
|
* write a simple assertion regardless of the zone type or
|
||||||
|
* selected plane:
|
||||||
|
*
|
||||||
|
* REQUIRE(VALID_CELL_INDEX(CZData, CellIndex, Plane)));
|
||||||
|
*
|
||||||
|
* Prior to using the macros a call to SetupXxx,
|
||||||
|
* or at a minimum SetupCZData, must be called to setup
|
||||||
|
* the globals defining the dataset structure.
|
||||||
|
*/
|
||||||
|
#define VALID_FE_CELL_INDEX(CZData, CellIndex) \
|
||||||
|
(/* CellIndex range test */ \
|
||||||
|
0 <= (CellIndex) && \
|
||||||
|
(CellIndex) < (CZData)->NumElements)
|
||||||
|
|
||||||
|
#define VALID_IPLANE_CELL_INDEX(CZData,CellIndex) \
|
||||||
|
(/* CellIndex range test */ \
|
||||||
|
(CellIndex) >= 0 && \
|
||||||
|
IINDEX((CZData),CellIndex) <= MAX((CZData)->NumIPtsM1,1) && \
|
||||||
|
JINDEX((CZData),CellIndex) < MAX((CZData)->NumJPtsM1,1) && \
|
||||||
|
KINDEX((CZData),CellIndex) < MAX((CZData)->NumKPtsM1,1))
|
||||||
|
|
||||||
|
#define VALID_JPLANE_CELL_INDEX(CZData,CellIndex) \
|
||||||
|
(/* CellIndex range test */ \
|
||||||
|
(CellIndex) >= 0 && \
|
||||||
|
IINDEX((CZData),CellIndex) < MAX((CZData)->NumIPtsM1,1) && \
|
||||||
|
JINDEX((CZData),CellIndex) <= MAX((CZData)->NumJPtsM1,1) && \
|
||||||
|
KINDEX((CZData),CellIndex) < MAX((CZData)->NumKPtsM1,1))
|
||||||
|
|
||||||
|
#define VALID_KPLANE_CELL_INDEX(CZData,CellIndex) \
|
||||||
|
(/* CellIndex range test */ \
|
||||||
|
(CellIndex) >= 0 && \
|
||||||
|
IINDEX((CZData),CellIndex) < MAX((CZData)->NumIPtsM1,1) && \
|
||||||
|
JINDEX((CZData),CellIndex) < MAX((CZData)->NumJPtsM1,1) && \
|
||||||
|
KINDEX((CZData),CellIndex) <= MAX((CZData)->NumKPtsM1,1))
|
||||||
|
|
||||||
|
#define VALID_ORDERED_CELL_INDEX(CZData, CellIndex, Plane) \
|
||||||
|
(/* macro preconditions */ \
|
||||||
|
((IJKPlanes_e)(Plane) == IJKPlanes_I || \
|
||||||
|
(IJKPlanes_e)(Plane) == IJKPlanes_J || \
|
||||||
|
(IJKPlanes_e)(Plane) == IJKPlanes_K || \
|
||||||
|
(IJKPlanes_e)(Plane) == IJKPlanes_Volume) && \
|
||||||
|
\
|
||||||
|
/* CellIndex range test */ \
|
||||||
|
(IMPLICATION(((IJKPlanes_e)(Plane) == IJKPlanes_I || \
|
||||||
|
(IJKPlanes_e)(Plane) == IJKPlanes_Volume), \
|
||||||
|
VALID_IPLANE_CELL_INDEX((CZData),CellIndex)) && \
|
||||||
|
IMPLICATION(((IJKPlanes_e)(Plane) == IJKPlanes_J || \
|
||||||
|
(IJKPlanes_e)(Plane) == IJKPlanes_Volume), \
|
||||||
|
VALID_JPLANE_CELL_INDEX((CZData),CellIndex)) && \
|
||||||
|
IMPLICATION(((IJKPlanes_e)(Plane) == IJKPlanes_K || \
|
||||||
|
(IJKPlanes_e)(Plane) == IJKPlanes_Volume), \
|
||||||
|
VALID_KPLANE_CELL_INDEX((CZData),CellIndex))))
|
||||||
|
|
||||||
|
#define VALID_CELL_INDEX(CZData, CellIndex, Plane) \
|
||||||
|
(((CZData)->NM != NULL || (CZData)->FM != NULL) ? \
|
||||||
|
VALID_FE_CELL_INDEX((CZData), (CellIndex)) : \
|
||||||
|
VALID_ORDERED_CELL_INDEX((CZData), (CellIndex), (Plane)))
|
||||||
|
|
||||||
|
#define VALID_DATASET(dataSet,checkNumZones) (((dataSet) != NULL) && \
|
||||||
|
IMPLICATION((checkNumZones),(dataSet)->NumZones >= 1))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef MSWIN
|
||||||
|
/* Here is a more specific check in Windows for a valid
|
||||||
|
pointer to an MFC Window object.
|
||||||
|
Note that GetSafeHwnd() works even if pWnd is NULL, because
|
||||||
|
it checks the 'this' pointer first */
|
||||||
|
# define VALID_WND(pWnd) (::IsWindow((pWnd)->GetSafeHwnd()))
|
||||||
|
|
||||||
|
#else /* !MSWIN */
|
||||||
|
# define VALID_WND(pWnd) /* Should not be used in Motif */
|
||||||
|
#endif /* MSWIN */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/* Check for a non-zero length string */
|
||||||
|
#if defined MSWIN
|
||||||
|
# if defined NO_ASSERTS
|
||||||
|
# define VALID_NON_ZERO_LEN_STR(str) (VALID_REF(str) && !ISEMPTYSTRING(str))
|
||||||
|
# else
|
||||||
|
# define VALID_NON_ZERO_LEN_STR(str) \
|
||||||
|
(VALID_REF(str) && \
|
||||||
|
!IsBadReadPtr((const void*)(str),(UINT_PTR)(1+strlen((const char*)(str)))) && \
|
||||||
|
!ISEMPTYSTRING(str))
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define VALID_NON_ZERO_LEN_STR(str) (VALID_REF(str) && !ISEMPTYSTRING(str))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define VALID_SET_INDEX(setIndex) (((SetIndex_t)setIndex)>=(SetIndex_t)1)
|
||||||
|
|
||||||
|
/* Check for valid stdio file handle */
|
||||||
|
#define VALID_FILE_HANDLE(stream) ((stream) != NULL)
|
||||||
|
|
||||||
|
/* To check colors and pen numbers */
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#define VALID_BASIC_COLOR(BColor) \
|
||||||
|
(FirstBasicColor<=(BColor) && (BColor)<=LastBasicColor)
|
||||||
|
#define VALID_CONTOUR_COLOR(Color) \
|
||||||
|
(ContourColorOffset<=(Color) && \
|
||||||
|
(Color)<ContourColorOffset+GeneralBase.Limits.MaxNumContourLevels+1)
|
||||||
|
#define VALID_PLOTTING_COLOR(Color) \
|
||||||
|
(VALID_BASIC_COLOR(Color) || VALID_CONTOUR_COLOR(Color))
|
||||||
|
#define VALID_INTERFACE_SPECIFIC_COLOR(BColor) \
|
||||||
|
(FirstInterfaceColor<=(BColor) && (BColor)<=LastInterfaceColor)
|
||||||
|
#define VALID_INTERFACE_COLOR(Color) \
|
||||||
|
(VALID_PLOTTING_COLOR(Color) || VALID_INTERFACE_SPECIFIC_COLOR(Color))
|
||||||
|
#define VALID_MULTICOLOR_COLOR(Color) \
|
||||||
|
(((Color) == MultiColor_C) || ((Color) == MultiColor2_C) || \
|
||||||
|
((Color) == MultiColor3_C) || ((Color) == MultiColor4_C) || \
|
||||||
|
((Color) == MultiColor5_C) || ((Color) == MultiColor6_C) || \
|
||||||
|
((Color) == MultiColor7_C) || ((Color) == MultiColor8_C))
|
||||||
|
#define VALID_RGB_COLOR(Color) \
|
||||||
|
((Color) == RGBColor_C)
|
||||||
|
#define VALID_ASSIGNABLE_COLOR(C) \
|
||||||
|
(VALID_BASIC_COLOR(C) || \
|
||||||
|
VALID_MULTICOLOR_COLOR(C) || \
|
||||||
|
VALID_RGB_COLOR(C))
|
||||||
|
#define VALID_PEN_OFFSET(PenOffset) \
|
||||||
|
(Black_C<=(PenOffset) && (PenOffset)<=NumPlotterPens)
|
||||||
|
#define VALID_PEN_OFFSET_FOR_OBJECT(PenOffset) \
|
||||||
|
(FirstObjectPen<=(PenOffset) && (PenOffset)<=LastObjectPen)
|
||||||
|
|
||||||
|
|
||||||
|
/* to check FE cells */
|
||||||
|
#define VALID_ELEMENT_TYPE(element_type) \
|
||||||
|
((element_type) == ZoneType_FETriangle || \
|
||||||
|
(element_type) == ZoneType_FEQuad || \
|
||||||
|
(element_type) == ZoneType_FETetra || \
|
||||||
|
(element_type) == ZoneType_FEBrick || \
|
||||||
|
(element_type) == ZoneType_FELineSeg)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Test validity of zone and variable names. A valid name is one that has a
|
||||||
|
* valid reference, is not padded with spaces and is within the maximum
|
||||||
|
* specified length.
|
||||||
|
*/
|
||||||
|
#define VALID_NAME(Name, MaxLength) \
|
||||||
|
(VALID_REF(Name) && \
|
||||||
|
(ISEMPTYSTRING(Name) || \
|
||||||
|
(!isspace((Name)[0]) && !isspace((Name)[strlen(Name)-1]))) && \
|
||||||
|
strlen(Name) <= (MaxLength))
|
||||||
|
#define VALID_ZONE_NAME(Name) VALID_NAME((Name), MaxChrsZnTitle)
|
||||||
|
#define VALID_VAR_NAME(Name) VALID_NAME((Name), MaxChrsVarName)
|
||||||
|
|
||||||
|
|
||||||
|
/* Special test for lighting effect (don't allow "none" in some cases) */
|
||||||
|
#define VALID_LIGHTINGEFFECT(L) \
|
||||||
|
(((L) == LightingEffect_Paneled) || ((L) == LightingEffect_Gouraud))
|
||||||
|
|
||||||
|
|
||||||
|
/* type definition for assert failure notification function */
|
||||||
|
typedef void (*TAssertFailureNotifyFunc)(
|
||||||
|
const char *expression, /* text representation of the assertion */
|
||||||
|
const char *file_name, /* name of the file containing the assertion */
|
||||||
|
int line); /* line number in the file of the assertion */
|
||||||
|
|
||||||
|
#if !defined STD_ASSERTS
|
||||||
|
/* external function prototypes */
|
||||||
|
extern void TAssert(
|
||||||
|
const char *expression, /* text representation of the assertion */
|
||||||
|
const char *file_name, /* name of the file containing the assertion */
|
||||||
|
int line); /* line number in the file of the assertion */
|
||||||
|
|
||||||
|
extern TAssertFailureNotifyFunc InstallTAssertFailureNotify(
|
||||||
|
TAssertFailureNotifyFunc new_function); /* new notification function */
|
||||||
|
#endif /* !STD_ASSERTS */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
#if defined NO_ASSERTS
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
# define TASSERT(EXPR)
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
# define INVARIANT(EXPR)
|
||||||
|
# define REQUIRE(EXPR)
|
||||||
|
# define ENSURE(EXPR)
|
||||||
|
# define CHECK(EXPR)
|
||||||
|
# ifdef VERIFY
|
||||||
|
# undef VERIFY
|
||||||
|
# endif
|
||||||
|
# define VERIFY(EXPR) ((void)(EXPR))
|
||||||
|
/*
|
||||||
|
* Only define IGNORENOTIMPLEMENTED if building a "test" release build
|
||||||
|
* that you are fully aware may contain unimplemented features.
|
||||||
|
*/
|
||||||
|
# if defined IGNORENOTIMPLEMENTED
|
||||||
|
# define NOT_IMPLEMENTED() CHECK(FALSE)
|
||||||
|
# else
|
||||||
|
# if defined MSWIN
|
||||||
|
/*
|
||||||
|
* NOT_IMPLEMENTED is defined using a parameter, but should be called with none,
|
||||||
|
* this will then throw a warning and not break the compile. Unix doesn't pick
|
||||||
|
* up this warning, so break the compile under Unix
|
||||||
|
*/
|
||||||
|
# define NOT_IMPLEMENTED(x) TAssert("Not Implemented", __FILE__, __LINE__)
|
||||||
|
# endif
|
||||||
|
# if defined UNIXX
|
||||||
|
# define NOT_IMPLEMENTED() not implemented /* intentionally break the compile */
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#elif defined STD_ASSERTS
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
# define TASSERT(EXPR) assert(EXPR)
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
# define INVARIANT(EXPR) assert(EXPR)
|
||||||
|
# define REQUIRE(EXPR) assert(EXPR)
|
||||||
|
# define ENSURE(EXPR) assert(EXPR)
|
||||||
|
# define CHECK(EXPR) assert(EXPR)
|
||||||
|
# ifdef VERIFY
|
||||||
|
# undef VERIFY
|
||||||
|
# endif
|
||||||
|
# ifndef VERIFY
|
||||||
|
# if defined NDEBUG
|
||||||
|
# define VERIFY(EXPR) ((void)(EXPR))
|
||||||
|
# else
|
||||||
|
# define VERIFY(EXPR) assert(EXPR)
|
||||||
|
# endif
|
||||||
|
# endif /* VERIFY */
|
||||||
|
# define NOT_IMPLEMENTED() assert(!("Not Implemented"))
|
||||||
|
#else
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#if defined (MSWIN)
|
||||||
|
#if defined CHECKED_BUILD
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
class AssertionLog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void initializeAssertLog(const std::string &fileName);
|
||||||
|
static bool isLoggingAssertions();
|
||||||
|
static void addAssertion(const std::string &message);
|
||||||
|
private:
|
||||||
|
static void writeOutAssertion(const std::string &message);
|
||||||
|
private:
|
||||||
|
static bool logAssertions;
|
||||||
|
static std::string logFileName;
|
||||||
|
static std::vector<std::string> assertList;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void TWinCheckedFailedLine(const char *Expr,
|
||||||
|
const char *FileName,
|
||||||
|
int LineNum);
|
||||||
|
|
||||||
|
#define TASSERT(EXPR)\
|
||||||
|
do { if (!(EXPR)) { TWinCheckedFailedLine(#EXPR,__FILE__,__LINE__); } } while (0)
|
||||||
|
#else
|
||||||
|
#define TASSERT(EXPR) ASSERT(EXPR) /* MFC assert.
|
||||||
|
Works in both release & debug builds */
|
||||||
|
#endif /* CHECKED_BUILD */
|
||||||
|
#else
|
||||||
|
#define TASSERT(EXPR) (void)((EXPR) || (TAssert(#EXPR, __FILE__, __LINE__), 0))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# if defined NO_INVARIANTS
|
||||||
|
# define INVARIANT(EXPR)
|
||||||
|
# else
|
||||||
|
# define INVARIANT(EXPR) TASSERT(EXPR)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined NO_PRECONDITIONS
|
||||||
|
# define REQUIRE(EXPR)
|
||||||
|
# else
|
||||||
|
# define REQUIRE(EXPR) TASSERT(EXPR)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined NO_POSTCONDITIONS
|
||||||
|
# define ENSURE(EXPR)
|
||||||
|
# else
|
||||||
|
# define ENSURE(EXPR) TASSERT(EXPR)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined VERIFY
|
||||||
|
# undef VERIFY
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined NO_CHECKS
|
||||||
|
# define CHECK(EXPR)
|
||||||
|
# define VERIFY(EXPR) ((void)(EXPR))
|
||||||
|
# else
|
||||||
|
# define CHECK(EXPR) TASSERT(EXPR)
|
||||||
|
# if defined NDEBUG
|
||||||
|
# define VERIFY(EXPR) ((void)(EXPR))
|
||||||
|
# else
|
||||||
|
# define VERIFY(EXPR) TASSERT(EXPR)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined NICE_NOT_IMPLEMENTED
|
||||||
|
# define NOT_IMPLEMENTED() NiceNotImplemented()
|
||||||
|
# else
|
||||||
|
# define NOT_IMPLEMENTED() TASSERT(!("Not Implemented"))
|
||||||
|
# endif
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
#endif
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#if !defined STD_ASSERTS
|
||||||
|
extern void TecplotMopupOnAssert(void);
|
||||||
|
#endif /* !STD_ASSERTS */
|
||||||
|
|
||||||
|
#if defined NICE_NOT_IMPLEMENTED
|
||||||
|
extern void NiceNotImplemented(void);
|
||||||
|
#endif
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
/* convenience macros for implication, P -> Q, and equivalence, P <-> Q. */
|
||||||
|
#define IMPLICATION(P,Q) (!(P) || (Q))
|
||||||
|
#define EQUIVALENCE(P,Q) ((P) == (Q))
|
||||||
|
|
||||||
|
/* BEGINREMOVEFROMADDON */
|
||||||
|
#if defined RLM
|
||||||
|
#define VALID_RLM_HANDLE(h) ((h) != NULL)
|
||||||
|
#endif /* RLM */
|
||||||
|
/* ENDREMOVEFROMADDON */
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* TASSERT_H */
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include "TECXXX.h"
|
||||||
@ -0,0 +1,698 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* TECXXX.h: Copyright (C) 1988-2008 Tecplot, Inc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined TECXXX_H_
|
||||||
|
#define TECXXX_H_
|
||||||
|
|
||||||
|
#if !defined CRAY
|
||||||
|
# define TECFOREIGN112 tecforeign112
|
||||||
|
# define TECINI112 tecini112
|
||||||
|
# define TECZNE112 teczne112
|
||||||
|
# define TECDAT112 tecdat112
|
||||||
|
# define TECNOD112 tecnod112
|
||||||
|
# define TECGEO112 tecgeo112
|
||||||
|
# define TECTXT112 tectxt112
|
||||||
|
# define TECLAB112 teclab112
|
||||||
|
# define TECFIL112 tecfil112
|
||||||
|
# define TECEND112 tecend112
|
||||||
|
# define TECUSR112 tecusr112
|
||||||
|
# define TECAUXSTR112 tecauxstr112
|
||||||
|
# define TECZAUXSTR112 teczauxstr112
|
||||||
|
# define TECVAUXSTR112 tecvauxstr112
|
||||||
|
# define TECFACE112 tecface112
|
||||||
|
# define TECPOLY112 tecpoly112
|
||||||
|
|
||||||
|
# define TECFOREIGN111 tecforeign111
|
||||||
|
# define TECINI111 tecini111
|
||||||
|
# define TECZNE111 teczne111
|
||||||
|
# define TECDAT111 tecdat111
|
||||||
|
# define TECNOD111 tecnod111
|
||||||
|
# define TECGEO111 tecgeo111
|
||||||
|
# define TECTXT111 tectxt111
|
||||||
|
# define TECLAB111 teclab111
|
||||||
|
# define TECFIL111 tecfil111
|
||||||
|
# define TECEND111 tecend111
|
||||||
|
# define TECUSR111 tecusr111
|
||||||
|
# define TECAUXSTR111 tecauxstr111
|
||||||
|
# define TECZAUXSTR111 teczauxstr111
|
||||||
|
# define TECVAUXSTR111 tecvauxstr111
|
||||||
|
# define TECFACE111 tecface111
|
||||||
|
# define TECPOLY111 tecpoly111
|
||||||
|
|
||||||
|
# define TECFOREIGN110 tecforeign110
|
||||||
|
# define TECINI110 tecini110
|
||||||
|
# define TECZNE110 teczne110
|
||||||
|
# define TECDAT110 tecdat110
|
||||||
|
# define TECNOD110 tecnod110
|
||||||
|
# define TECGEO110 tecgeo110
|
||||||
|
# define TECTXT110 tectxt110
|
||||||
|
# define TECLAB110 teclab110
|
||||||
|
# define TECFIL110 tecfil110
|
||||||
|
# define TECEND110 tecend110
|
||||||
|
# define TECUSR110 tecusr110
|
||||||
|
# define TECAUXSTR110 tecauxstr110
|
||||||
|
# define TECZAUXSTR110 teczauxstr110
|
||||||
|
# define TECVAUXSTR110 tecvauxstr110
|
||||||
|
# define TECFACE110 tecface110
|
||||||
|
|
||||||
|
# define TECFOREIGN100 tecforeign100
|
||||||
|
# define TECINI100 tecini100
|
||||||
|
# define TECZNE100 teczne100
|
||||||
|
# define TECDAT100 tecdat100
|
||||||
|
# define TECNOD100 tecnod100
|
||||||
|
# define TECGEO100 tecgeo100
|
||||||
|
# define TECTXT100 tectxt100
|
||||||
|
# define TECLAB100 teclab100
|
||||||
|
# define TECFIL100 tecfil100
|
||||||
|
# define TECEND100 tecend100
|
||||||
|
# define TECUSR100 tecusr100
|
||||||
|
# define TECAUXSTR100 tecauxstr100
|
||||||
|
# define TECZAUXSTR100 teczauxstr100
|
||||||
|
# define TECVAUXSTR100 tecvauxstr100
|
||||||
|
# define TECFACE100 tecface100
|
||||||
|
|
||||||
|
# define TECINI tecini
|
||||||
|
# define TECZNE teczne
|
||||||
|
# define TECDAT tecdat
|
||||||
|
# define TECNOD tecnod
|
||||||
|
# define TECGEO tecgeo
|
||||||
|
# define TECTXT tectxt
|
||||||
|
# define TECLAB teclab
|
||||||
|
# define TECFIL tecfil
|
||||||
|
# define TECEND tecend
|
||||||
|
# define TECUSR tecusr
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#else
|
||||||
|
#define INTEGER4 int
|
||||||
|
#define INTEGER2 short
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined _WIN32
|
||||||
|
#if !defined MSWIN
|
||||||
|
#define MSWIN /* MSWIN */
|
||||||
|
#endif
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
|
#if !defined (EXTERNC)
|
||||||
|
# if defined (__cplusplus)
|
||||||
|
# define EXTERNC extern "C"
|
||||||
|
# else
|
||||||
|
# define EXTERNC
|
||||||
|
# endif /* __cplusplus */
|
||||||
|
#endif /* EXTERN_C */
|
||||||
|
|
||||||
|
#if !defined (STDCALL)
|
||||||
|
# if defined MSWIN
|
||||||
|
# define STDCALL __stdcall
|
||||||
|
# else /* !MSWIN */
|
||||||
|
# define STDCALL
|
||||||
|
# endif /* MSWIN */
|
||||||
|
#endif /* STDCALL */
|
||||||
|
|
||||||
|
#if !defined (DLLEXPORT)
|
||||||
|
# if defined (MSWIN)
|
||||||
|
# define DLLEXPORT _declspec (dllexport)
|
||||||
|
# else
|
||||||
|
# define DLLEXPORT
|
||||||
|
# endif /* MSWIN */
|
||||||
|
#endif /* DLLEXPORT */
|
||||||
|
|
||||||
|
#if !defined (DLLIMPORT)
|
||||||
|
# if defined (MSWIN)
|
||||||
|
# define DLLIMPORT _declspec (dllimport)
|
||||||
|
# else
|
||||||
|
# define DLLIMPORT
|
||||||
|
# endif /* MSWIN */
|
||||||
|
#endif /* DLLIMPORT */
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (TECPLOTKERNEL)
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#else /* !TECPLOTKERNAL && !MAKEARCHIVE */
|
||||||
|
# define LIBCALL STDCALL
|
||||||
|
# define LIBFUNCTION EXTERNC DLLIMPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* V11.3 tecio functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
LIBFUNCTION void LIBCALL TECFOREIGN112(INTEGER4 *OutputForeignByteOrder);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECINI112(char *Title,
|
||||||
|
char *Variables,
|
||||||
|
char *FName,
|
||||||
|
char *ScratchDir,
|
||||||
|
INTEGER4 *FileType,
|
||||||
|
INTEGER4 *Debug,
|
||||||
|
INTEGER4 *VIsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZNE112(char *ZoneTitle,
|
||||||
|
INTEGER4 *ZoneType,
|
||||||
|
INTEGER4 *IMxOrNumPts,
|
||||||
|
INTEGER4 *JMxOrNumElements,
|
||||||
|
INTEGER4 *KMxOrNumFaces,
|
||||||
|
INTEGER4 *ICellMx,
|
||||||
|
INTEGER4 *JCellMx,
|
||||||
|
INTEGER4 *KCellMx,
|
||||||
|
double *SolutionTime,
|
||||||
|
INTEGER4 *StrandID,
|
||||||
|
INTEGER4 *ParentZone,
|
||||||
|
INTEGER4 *IsBlock,
|
||||||
|
INTEGER4 *NumFaceConnections,
|
||||||
|
INTEGER4 *FaceNeighborMode,
|
||||||
|
INTEGER4 *TotalNumFaceNodes,
|
||||||
|
INTEGER4 *NumConnectedBoundaryFaces,
|
||||||
|
INTEGER4 *TotalNumBoundaryConnections,
|
||||||
|
INTEGER4 *PassiveVarList,
|
||||||
|
INTEGER4 *ValueLocation,
|
||||||
|
INTEGER4 *ShareVarFromZone,
|
||||||
|
INTEGER4 *ShareConnectivityFromZone);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECDAT112(INTEGER4 *N,
|
||||||
|
void *FieldData,
|
||||||
|
INTEGER4 *IsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECNOD112(INTEGER4 *NData);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECEND112(void);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECLAB112(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECUSR112(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECGEO112(double *XPos,
|
||||||
|
double *YPos,
|
||||||
|
double *ZPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *Color,
|
||||||
|
INTEGER4 *FillColor,
|
||||||
|
INTEGER4 *IsFilled,
|
||||||
|
INTEGER4 *GeomType,
|
||||||
|
INTEGER4 *LinePattern,
|
||||||
|
double *PatternLength,
|
||||||
|
double *LineThickness,
|
||||||
|
INTEGER4 *NumEllipsePts,
|
||||||
|
INTEGER4 *ArrowheadStyle,
|
||||||
|
INTEGER4 *ArrowheadAttachment,
|
||||||
|
double *ArrowheadSize,
|
||||||
|
double *ArrowheadAngle,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *Clipping,
|
||||||
|
INTEGER4 *NumSegments,
|
||||||
|
INTEGER4 *NumSegPts,
|
||||||
|
float *XGeomData,
|
||||||
|
float *YGeomData,
|
||||||
|
float *ZGeomData,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECTXT112(double *XOrThetaPos,
|
||||||
|
double *YOrRPos,
|
||||||
|
double *ZOrUnusedPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *BFont,
|
||||||
|
INTEGER4 *FontHeightUnits,
|
||||||
|
double *FontHeight,
|
||||||
|
INTEGER4 *BoxType,
|
||||||
|
double *BoxMargin,
|
||||||
|
double *BoxLineThickness,
|
||||||
|
INTEGER4 *BoxColor,
|
||||||
|
INTEGER4 *BoxFillColor,
|
||||||
|
double *Angle,
|
||||||
|
INTEGER4 *Anchor,
|
||||||
|
double *LineSpacing,
|
||||||
|
INTEGER4 *TextColor,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *Clipping,
|
||||||
|
char *String,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFIL112(INTEGER4 *F);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECAUXSTR112(char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZAUXSTR112(char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECVAUXSTR112(INTEGER4 *Var,
|
||||||
|
char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFACE112(INTEGER4 *FaceConnections);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECPOLY112(INTEGER4 *FaceNodeCounts,
|
||||||
|
INTEGER4 *FaceNodes,
|
||||||
|
INTEGER4 *FaceLeftElems,
|
||||||
|
INTEGER4 *FaceRightElems,
|
||||||
|
INTEGER4 *FaceBndryConnectionCounts,
|
||||||
|
INTEGER4 *FaceBndryConnectionElems,
|
||||||
|
INTEGER4 *FaceBndryConnectionZones);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* V11.1 tecio functions TODO (JN): Tecplot's version is still in flux so the .1 may change
|
||||||
|
*/
|
||||||
|
|
||||||
|
LIBFUNCTION void LIBCALL TECFOREIGN111(INTEGER4 *OutputForeignByteOrder);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECINI111(char *Title,
|
||||||
|
char *Variables,
|
||||||
|
char *FName,
|
||||||
|
char *ScratchDir,
|
||||||
|
INTEGER4 *FileType,
|
||||||
|
INTEGER4 *Debug,
|
||||||
|
INTEGER4 *VIsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZNE111(char *ZoneTitle,
|
||||||
|
INTEGER4 *ZoneType,
|
||||||
|
INTEGER4 *IMxOrNumPts,
|
||||||
|
INTEGER4 *JMxOrNumElements,
|
||||||
|
INTEGER4 *KMxOrNumFaces,
|
||||||
|
INTEGER4 *ICellMx,
|
||||||
|
INTEGER4 *JCellMx,
|
||||||
|
INTEGER4 *KCellMx,
|
||||||
|
double *SolutionTime,
|
||||||
|
INTEGER4 *StrandID,
|
||||||
|
INTEGER4 *ParentZone,
|
||||||
|
INTEGER4 *IsBlock,
|
||||||
|
INTEGER4 *NumFaceConnections,
|
||||||
|
INTEGER4 *FaceNeighborMode,
|
||||||
|
INTEGER4 *TotalNumFaceNodes,
|
||||||
|
INTEGER4 *NumConnectedBoundaryFaces,
|
||||||
|
INTEGER4 *TotalNumBoundaryConnections,
|
||||||
|
INTEGER4 *PassiveVarList,
|
||||||
|
INTEGER4 *ValueLocation,
|
||||||
|
INTEGER4 *ShareVarFromZone,
|
||||||
|
INTEGER4 *ShareConnectivityFromZone);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECDAT111(INTEGER4 *N,
|
||||||
|
void *FieldData,
|
||||||
|
INTEGER4 *IsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECNOD111(INTEGER4 *NData);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECEND111(void);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECLAB111(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECUSR111(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECGEO111(double *XPos,
|
||||||
|
double *YPos,
|
||||||
|
double *ZPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *Color,
|
||||||
|
INTEGER4 *FillColor,
|
||||||
|
INTEGER4 *IsFilled,
|
||||||
|
INTEGER4 *GeomType,
|
||||||
|
INTEGER4 *LinePattern,
|
||||||
|
double *PatternLength,
|
||||||
|
double *LineThickness,
|
||||||
|
INTEGER4 *NumEllipsePts,
|
||||||
|
INTEGER4 *ArrowheadStyle,
|
||||||
|
INTEGER4 *ArrowheadAttachment,
|
||||||
|
double *ArrowheadSize,
|
||||||
|
double *ArrowheadAngle,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *Clipping,
|
||||||
|
INTEGER4 *NumSegments,
|
||||||
|
INTEGER4 *NumSegPts,
|
||||||
|
float *XGeomData,
|
||||||
|
float *YGeomData,
|
||||||
|
float *ZGeomData,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECTXT111(double *XOrThetaPos,
|
||||||
|
double *YOrRPos,
|
||||||
|
double *ZOrUnusedPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *BFont,
|
||||||
|
INTEGER4 *FontHeightUnits,
|
||||||
|
double *FontHeight,
|
||||||
|
INTEGER4 *BoxType,
|
||||||
|
double *BoxMargin,
|
||||||
|
double *BoxLineThickness,
|
||||||
|
INTEGER4 *BoxColor,
|
||||||
|
INTEGER4 *BoxFillColor,
|
||||||
|
double *Angle,
|
||||||
|
INTEGER4 *Anchor,
|
||||||
|
double *LineSpacing,
|
||||||
|
INTEGER4 *TextColor,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *Clipping,
|
||||||
|
char *String,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFIL111(INTEGER4 *F);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECAUXSTR111(char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZAUXSTR111(char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECVAUXSTR111(INTEGER4 *Var,
|
||||||
|
char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFACE111(INTEGER4 *FaceConnections);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECPOLY111(INTEGER4 *FaceNodeCounts,
|
||||||
|
INTEGER4 *FaceNodes,
|
||||||
|
INTEGER4 *FaceLeftElems,
|
||||||
|
INTEGER4 *FaceRightElems,
|
||||||
|
INTEGER4 *FaceBndryConnectionCounts,
|
||||||
|
INTEGER4 *FaceBndryConnectionElems,
|
||||||
|
INTEGER2 *FaceBndryConnectionZones);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* V11 tecio functions
|
||||||
|
*/
|
||||||
|
|
||||||
|
LIBFUNCTION void LIBCALL TECFOREIGN110(INTEGER4 *OutputForeignByteOrder);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECINI110(char *Title,
|
||||||
|
char *Variables,
|
||||||
|
char *FName,
|
||||||
|
char *ScratchDir,
|
||||||
|
INTEGER4 *Debug,
|
||||||
|
INTEGER4 *VIsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZNE110(char *ZoneTitle,
|
||||||
|
INTEGER4 *ZoneType,
|
||||||
|
INTEGER4 *IMxOrNumPts,
|
||||||
|
INTEGER4 *JMxOrNumElements,
|
||||||
|
INTEGER4 *KMxOrNumFaces,
|
||||||
|
INTEGER4 *ICellMx,
|
||||||
|
INTEGER4 *JCellMx,
|
||||||
|
INTEGER4 *KCellMx,
|
||||||
|
double *SolutionTime,
|
||||||
|
INTEGER4 *StrandID,
|
||||||
|
INTEGER4 *ParentZone,
|
||||||
|
INTEGER4 *IsBlock,
|
||||||
|
INTEGER4 *NumFaceConnections,
|
||||||
|
INTEGER4 *FaceNeighborMode,
|
||||||
|
INTEGER4 *PassiveVarList,
|
||||||
|
INTEGER4 *ValueLocation,
|
||||||
|
INTEGER4 *ShareVarFromZone,
|
||||||
|
INTEGER4 *ShareConnectivityFromZone);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECDAT110(INTEGER4 *N,
|
||||||
|
void *FieldData,
|
||||||
|
INTEGER4 *IsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECNOD110(INTEGER4 *NData);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECEND110(void);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECLAB110(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECUSR110(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECGEO110(double *XPos,
|
||||||
|
double *YPos,
|
||||||
|
double *ZPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *Color,
|
||||||
|
INTEGER4 *FillColor,
|
||||||
|
INTEGER4 *IsFilled,
|
||||||
|
INTEGER4 *GeomType,
|
||||||
|
INTEGER4 *LinePattern,
|
||||||
|
double *PatternLength,
|
||||||
|
double *LineThickness,
|
||||||
|
INTEGER4 *NumEllipsePts,
|
||||||
|
INTEGER4 *ArrowheadStyle,
|
||||||
|
INTEGER4 *ArrowheadAttachment,
|
||||||
|
double *ArrowheadSize,
|
||||||
|
double *ArrowheadAngle,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *Clipping,
|
||||||
|
INTEGER4 *NumSegments,
|
||||||
|
INTEGER4 *NumSegPts,
|
||||||
|
float *XGeomData,
|
||||||
|
float *YGeomData,
|
||||||
|
float *ZGeomData,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECTXT110(double *XOrThetaPos,
|
||||||
|
double *YOrRPos,
|
||||||
|
double *ZOrUnusedPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *BFont,
|
||||||
|
INTEGER4 *FontHeightUnits,
|
||||||
|
double *FontHeight,
|
||||||
|
INTEGER4 *BoxType,
|
||||||
|
double *BoxMargin,
|
||||||
|
double *BoxLineThickness,
|
||||||
|
INTEGER4 *BoxColor,
|
||||||
|
INTEGER4 *BoxFillColor,
|
||||||
|
double *Angle,
|
||||||
|
INTEGER4 *Anchor,
|
||||||
|
double *LineSpacing,
|
||||||
|
INTEGER4 *TextColor,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *Clipping,
|
||||||
|
char *String,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFIL110(INTEGER4 *F);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECAUXSTR110(char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZAUXSTR110(char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECVAUXSTR110(INTEGER4 *Var,
|
||||||
|
char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFACE110(INTEGER4 *FaceConnections);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* V10 tecio functions kept for backward compatability.
|
||||||
|
*/
|
||||||
|
|
||||||
|
LIBFUNCTION void LIBCALL TECFOREIGN100(INTEGER4 *OutputForeignByteOrder);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECINI100(char *Title,
|
||||||
|
char *Variables,
|
||||||
|
char *FName,
|
||||||
|
char *ScratchDir,
|
||||||
|
INTEGER4 *Debug,
|
||||||
|
INTEGER4 *VIsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZNE100(char *ZoneTitle,
|
||||||
|
INTEGER4 *ZoneType,
|
||||||
|
INTEGER4 *IMxOrNumPts,
|
||||||
|
INTEGER4 *JMxOrNumElements,
|
||||||
|
INTEGER4 *KMxOrNumFaces,
|
||||||
|
INTEGER4 *ICellMx,
|
||||||
|
INTEGER4 *JCellMx,
|
||||||
|
INTEGER4 *KCellMx,
|
||||||
|
INTEGER4 *IsBlock,
|
||||||
|
INTEGER4 *NumFaceConnections,
|
||||||
|
INTEGER4 *FaceNeighborMode,
|
||||||
|
INTEGER4 *ValueLocation,
|
||||||
|
INTEGER4 *ShareVarFromZone,
|
||||||
|
INTEGER4 *ShareConnectivityFromZone);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECDAT100(INTEGER4 *N,
|
||||||
|
void *FieldData,
|
||||||
|
INTEGER4 *IsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECNOD100(INTEGER4 *NData);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECEND100(void);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECLAB100(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECUSR100(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECGEO100(double *XPos,
|
||||||
|
double *YPos,
|
||||||
|
double *ZPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *Color,
|
||||||
|
INTEGER4 *FillColor,
|
||||||
|
INTEGER4 *IsFilled,
|
||||||
|
INTEGER4 *GeomType,
|
||||||
|
INTEGER4 *LinePattern,
|
||||||
|
double *PatternLength,
|
||||||
|
double *LineThickness,
|
||||||
|
INTEGER4 *NumEllipsePts,
|
||||||
|
INTEGER4 *ArrowheadStyle,
|
||||||
|
INTEGER4 *ArrowheadAttachment,
|
||||||
|
double *ArrowheadSize,
|
||||||
|
double *ArrowheadAngle,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *Clipping,
|
||||||
|
INTEGER4 *NumSegments,
|
||||||
|
INTEGER4 *NumSegPts,
|
||||||
|
float *XGeomData,
|
||||||
|
float *YGeomData,
|
||||||
|
float *ZGeomData,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECTXT100(double *XOrThetaPos,
|
||||||
|
double *YOrRPos,
|
||||||
|
double *ZOrUnusedPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *BFont,
|
||||||
|
INTEGER4 *FontHeightUnits,
|
||||||
|
double *FontHeight,
|
||||||
|
INTEGER4 *BoxType,
|
||||||
|
double *BoxMargin,
|
||||||
|
double *BoxLineThickness,
|
||||||
|
INTEGER4 *BoxColor,
|
||||||
|
INTEGER4 *BoxFillColor,
|
||||||
|
double *Angle,
|
||||||
|
INTEGER4 *Anchor,
|
||||||
|
double *LineSpacing,
|
||||||
|
INTEGER4 *TextColor,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *Clipping,
|
||||||
|
char *String,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFIL100(INTEGER4 *F);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECAUXSTR100(char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZAUXSTR100(char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECVAUXSTR100(INTEGER4 *Var,
|
||||||
|
char *Name,
|
||||||
|
char *Value);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFACE100(INTEGER4 *FaceConnections);
|
||||||
|
|
||||||
|
/* Old V9 functions retained for backward compatibility */
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECINI(char *Title,
|
||||||
|
char *Variables,
|
||||||
|
char *FName,
|
||||||
|
char *ScratchDir,
|
||||||
|
INTEGER4 *Debug,
|
||||||
|
INTEGER4 *VIsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECZNE(char *ZoneTitle,
|
||||||
|
INTEGER4 *IMx,
|
||||||
|
INTEGER4 *JMx,
|
||||||
|
INTEGER4 *KMx,
|
||||||
|
char *ZFormat,
|
||||||
|
char *DupList);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECDAT(INTEGER4 *N,
|
||||||
|
void *FieldData,
|
||||||
|
INTEGER4 *IsDouble);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECNOD(INTEGER4 *NData);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECEND(void);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECLAB(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECUSR(char *S);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECGEO(double *XPos,
|
||||||
|
double *YPos,
|
||||||
|
double *ZPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *Color,
|
||||||
|
INTEGER4 *FillColor,
|
||||||
|
INTEGER4 *IsFilled,
|
||||||
|
INTEGER4 *GeomType,
|
||||||
|
INTEGER4 *LinePattern,
|
||||||
|
double *PatternLength,
|
||||||
|
double *LineThickness,
|
||||||
|
INTEGER4 *NumEllipsePts,
|
||||||
|
INTEGER4 *ArrowheadStyle,
|
||||||
|
INTEGER4 *ArrowheadAttachment,
|
||||||
|
double *ArrowheadSize,
|
||||||
|
double *ArrowheadAngle,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
INTEGER4 *NumSegments,
|
||||||
|
INTEGER4 *NumSegPts,
|
||||||
|
float *XGeomData,
|
||||||
|
float *YGeomData,
|
||||||
|
float *ZGeomData,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECTXT(double *XPos,
|
||||||
|
double *YPos,
|
||||||
|
INTEGER4 *PosCoordMode,
|
||||||
|
INTEGER4 *AttachToZone,
|
||||||
|
INTEGER4 *Zone,
|
||||||
|
INTEGER4 *BFont,
|
||||||
|
INTEGER4 *FontHeightUnits,
|
||||||
|
double *FontHeight,
|
||||||
|
INTEGER4 *BoxType,
|
||||||
|
double *BoxMargin,
|
||||||
|
double *BoxLineThickness,
|
||||||
|
INTEGER4 *BoxColor,
|
||||||
|
INTEGER4 *BoxFillColor,
|
||||||
|
double *Angle,
|
||||||
|
INTEGER4 *Anchor,
|
||||||
|
double *LineSpacing,
|
||||||
|
INTEGER4 *TextColor,
|
||||||
|
INTEGER4 *Scope,
|
||||||
|
char *Text,
|
||||||
|
char *mfc);
|
||||||
|
|
||||||
|
LIBFUNCTION INTEGER4 LIBCALL TECFIL(INTEGER4 *F);
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
#endif /* TECXXX_H_ */
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined EXTERN
|
||||||
|
#undef EXTERN
|
||||||
|
#endif
|
||||||
|
#if defined TEXTMODULE
|
||||||
|
#define EXTERN
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define _TEXT_H_INCLUDED
|
||||||
|
|
||||||
|
/* These macros for checking CoordSys_e and Units of text objects (i.e., those associated with the text tool). */
|
||||||
|
#define VALID_TEXT_COORDSYS(sys) (((sys)==CoordSys_Frame)||((sys)==CoordSys_Grid)||((sys)==CoordSys_Grid3D))
|
||||||
|
#define VALID_TEXT_UNITS(units) (((units)==Units_Grid)||((units)==Units_Frame)||((units)==Units_Point))
|
||||||
|
#define VALID_TEXT_COORDSYS_AND_UNITS(pos_sys, size_units) \
|
||||||
|
( VALID_TEXT_COORDSYS((pos_sys)) && \
|
||||||
|
VALID_TEXT_UNITS((size_units)) && \
|
||||||
|
! ((pos_sys) == CoordSys_Frame && (size_units) == Units_Grid) )
|
||||||
|
|
||||||
|
/* This is for any type of font in Tecplot. */
|
||||||
|
#define VALID_FONT_SIZEUNITS(units) (((units)==Units_Grid)||((units)==Units_Frame)||((units)==Units_Point)||(units)==Units_AxisPercentage)
|
||||||
|
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#if 0 /* contract template */
|
||||||
|
#endif
|
||||||
|
#if 0 /* contract template */
|
||||||
|
#endif
|
||||||
|
#endif /* TECPLOTKERNEL */
|
||||||
@ -0,0 +1,362 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "MASTER.h"
|
||||||
|
#define TECPLOTENGINEMODULE
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "GLOBAL.h"
|
||||||
|
#include "TASSERT.h"
|
||||||
|
#include "Q_UNICODE.h"
|
||||||
|
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
namespace tecplot
|
||||||
|
{
|
||||||
|
namespace strutil
|
||||||
|
{
|
||||||
|
|
||||||
|
#if defined MSWIN && !defined TECPLOTKERNEL
|
||||||
|
/**
|
||||||
|
* Stub function for non-TECPLOTKERNEL
|
||||||
|
*/
|
||||||
|
string LookUpTranslation(string& str)
|
||||||
|
{
|
||||||
|
return string(str);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience function for creating Utf8 string translations.
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* String to translate.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* A new Utf8 translated string.
|
||||||
|
*/
|
||||||
|
static inline string* createUtf8StringTranslation(string& str)
|
||||||
|
{
|
||||||
|
#if defined MSWIN
|
||||||
|
string *result = new string(LookUpTranslation(str));
|
||||||
|
#else
|
||||||
|
string *result = new string(str);
|
||||||
|
#endif
|
||||||
|
ENSURE(VALID_REF(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
/**
|
||||||
|
* Convenience function for creating wide string translations.
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* String to translate.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* A new wide translated string.
|
||||||
|
*/
|
||||||
|
static inline wstring* createWideStringTranslation(string& str)
|
||||||
|
{
|
||||||
|
wstring *result = new wstring;
|
||||||
|
*result = StringToWString(LookUpTranslation(str));
|
||||||
|
|
||||||
|
ENSURE(VALID_REF(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
/**
|
||||||
|
* Convenience function for creating wide string with the given mode.
|
||||||
|
*
|
||||||
|
* @param mode
|
||||||
|
* Indicates if this string is to be translated or not.
|
||||||
|
* @param str
|
||||||
|
* String to translate.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* A new wide translated string.
|
||||||
|
*/
|
||||||
|
static inline wstring* createWideString(TranslatedString::Mode mode,
|
||||||
|
string& str)
|
||||||
|
{
|
||||||
|
REQUIRE(mode == TranslatedString::DoTranslate || mode == TranslatedString::DontTranslate);
|
||||||
|
|
||||||
|
wstring* result;
|
||||||
|
if (mode == TranslatedString::DoTranslate)
|
||||||
|
result = createWideStringTranslation(str);
|
||||||
|
else
|
||||||
|
result = new wstring(StringToWString(str));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
void TranslatedString::init(TranslatedString::Mode mode,
|
||||||
|
const char* str,
|
||||||
|
const char* translatorNotes)
|
||||||
|
{
|
||||||
|
REQUIRE(mode == DoTranslate || mode == DontTranslate);
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(str));
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(translatorNotes));
|
||||||
|
|
||||||
|
m_mode = mode;
|
||||||
|
m_isNull = (str == NULL);
|
||||||
|
if (!m_isNull)
|
||||||
|
m_string = str;
|
||||||
|
m_utf8String = NULL; // ...on demand resource
|
||||||
|
#if defined MSWIN
|
||||||
|
m_wideString = NULL; // ...on demand resource
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString::TranslatedString()
|
||||||
|
{
|
||||||
|
init(DontTranslate, (const char*)NULL, (const char*)NULL);
|
||||||
|
ENSURE(this->isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString TranslatedString::null()
|
||||||
|
{
|
||||||
|
return dontTranslate(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString::TranslatedString(TranslatedString::Mode mode,
|
||||||
|
const char* str,
|
||||||
|
const char* translatorNotes)
|
||||||
|
{
|
||||||
|
|
||||||
|
REQUIRE(mode == DoTranslate || mode == DontTranslate);
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(str));
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(translatorNotes));
|
||||||
|
|
||||||
|
init(mode, str, translatorNotes);
|
||||||
|
ENSURE(this->isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString::~TranslatedString()
|
||||||
|
{
|
||||||
|
delete m_utf8String;
|
||||||
|
#if defined MSWIN
|
||||||
|
delete m_wideString;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !defined NO_ASSERTS
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
bool TranslatedString::isValid() const
|
||||||
|
{
|
||||||
|
CHECK(IMPLICATION(m_isNull, m_string.length() == 0));
|
||||||
|
#if 0
|
||||||
|
/* TODO(DTO/RMS/CAM): 11/2/2007
|
||||||
|
* Code currently exists in Tecplot where we call translate() on a
|
||||||
|
* variable. This seems wrong and at times (PleaseWait() in
|
||||||
|
* particular) the variable passed is a NULL pointer which causes
|
||||||
|
* this assertion to fail. There is not enough time before v11.2
|
||||||
|
* release to remove all translate() calls to non-literal strings so
|
||||||
|
* we'll have to do this as a post release cleanup. For now just
|
||||||
|
* deactivate this assertion.
|
||||||
|
*/
|
||||||
|
CHECK(IMPLICATION(m_isNull, m_mode == DontTranslate));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
bool TranslatedString::isNull() const
|
||||||
|
{
|
||||||
|
INVARIANT(this->isValid());
|
||||||
|
return m_isNull;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
bool TranslatedString::isNullOrZeroLength() const
|
||||||
|
{
|
||||||
|
INVARIANT(this->isValid());
|
||||||
|
return m_isNull || m_string.length() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
const char* TranslatedString::c_str()
|
||||||
|
{
|
||||||
|
INVARIANT(this->isValid());
|
||||||
|
|
||||||
|
const char* result = NULL;
|
||||||
|
if (!isNull())
|
||||||
|
{
|
||||||
|
if (m_mode == DoTranslate)
|
||||||
|
{
|
||||||
|
if (m_utf8String == NULL)
|
||||||
|
m_utf8String = createUtf8StringTranslation(m_string);
|
||||||
|
result = m_utf8String->c_str();
|
||||||
|
}
|
||||||
|
else // ...if we aren't translating don't bother creating another Utf8 copy just use m_string
|
||||||
|
result = m_string.c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
ENSURE(result == NULL || VALID_REF(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
const wchar_t *TranslatedString::c_wstr()
|
||||||
|
{
|
||||||
|
INVARIANT(this->isValid());
|
||||||
|
|
||||||
|
const wchar_t *result = NULL;
|
||||||
|
if (!isNull())
|
||||||
|
{
|
||||||
|
if (m_wideString == NULL)
|
||||||
|
m_wideString = createWideString(m_mode, m_string);
|
||||||
|
result = m_wideString->c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
ENSURE(result == NULL || VALID_REF(result));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString::operator string()
|
||||||
|
{
|
||||||
|
INVARIANT(this->isValid());
|
||||||
|
REQUIRE(!isNull());
|
||||||
|
|
||||||
|
string* result;
|
||||||
|
if (m_mode == DoTranslate)
|
||||||
|
{
|
||||||
|
if (m_utf8String == NULL)
|
||||||
|
m_utf8String = createUtf8StringTranslation(m_string);
|
||||||
|
result = m_utf8String;
|
||||||
|
}
|
||||||
|
else // ...if we aren't translating don't bother creating another Utf8 copy just use m_string
|
||||||
|
result = &m_string;
|
||||||
|
|
||||||
|
return *result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString::operator wstring()
|
||||||
|
{
|
||||||
|
INVARIANT(this->isValid());
|
||||||
|
REQUIRE(!isNull());
|
||||||
|
|
||||||
|
if (m_wideString == NULL)
|
||||||
|
m_wideString = createWideString(m_mode, m_string);
|
||||||
|
|
||||||
|
return *m_wideString;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString& TranslatedString::operator =(const TranslatedString& other)
|
||||||
|
{
|
||||||
|
REQUIRE(other.isValid());
|
||||||
|
|
||||||
|
if (this != &other) // ...only perform if not self assignment
|
||||||
|
{
|
||||||
|
m_mode = other.m_mode;
|
||||||
|
m_isNull = other.m_isNull;
|
||||||
|
m_string = other.m_string;
|
||||||
|
m_utf8String = (other.m_utf8String != NULL ? new string(*other.m_utf8String) : NULL);
|
||||||
|
#if defined MSWIN
|
||||||
|
m_wideString = (other.m_wideString != NULL ? new wstring(*other.m_wideString) : NULL);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
ENSURE(this->isValid());
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString::TranslatedString(const TranslatedString& other)
|
||||||
|
{
|
||||||
|
REQUIRE(other.isValid());
|
||||||
|
|
||||||
|
m_mode = other.m_mode;
|
||||||
|
m_isNull = other.m_isNull;
|
||||||
|
m_string = other.m_string;
|
||||||
|
m_utf8String = (other.m_utf8String != NULL ? new string(*other.m_utf8String) : NULL);
|
||||||
|
#if defined MSWIN
|
||||||
|
m_wideString = (other.m_wideString != NULL ? new wstring(*other.m_wideString) : NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ENSURE(this->isValid());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString TranslatedString::translate(const char* str,
|
||||||
|
const char* translatorNotes)
|
||||||
|
{
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(str));
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(translatorNotes));
|
||||||
|
|
||||||
|
return TranslatedString(DoTranslate, str, translatorNotes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
TranslatedString TranslatedString::dontTranslate(const char* str)
|
||||||
|
{
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(str));
|
||||||
|
|
||||||
|
return TranslatedString(DontTranslate, str, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,293 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
******* ********
|
||||||
|
****** Copyright (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
*****************************************************************
|
||||||
|
*****************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TECPLOT_STRUTIL_TRANSLATEDSTRING
|
||||||
|
#define TECPLOT_STRUTIL_TRANSLATEDSTRING
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
#pragma warning(disable : 4181)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace tecplot
|
||||||
|
{
|
||||||
|
namespace strutil
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class responsible for translating strings for internationalization. This
|
||||||
|
* class is used both to perform the translation and to identify which strings
|
||||||
|
* are/aren't in need of translation.
|
||||||
|
*
|
||||||
|
* With the exception of the empty constructor all translated strings are
|
||||||
|
* created via static methods or inline helper functions named translate() and
|
||||||
|
* dontTranslate(). Translated strings created with a call to translate() are
|
||||||
|
* flagged as needing human translation and return the translated value at
|
||||||
|
* runtime. Translated strings created with a call to dontTranslate() are
|
||||||
|
* flagged as not needing human translation and return the non-translated value
|
||||||
|
* at runtime. Examples:
|
||||||
|
*
|
||||||
|
* ErrMsg(translate("Can I have %d cookies?", numCookies);
|
||||||
|
* ErrMsg(dontTranslate("%s"), errMsgString);
|
||||||
|
*
|
||||||
|
* Conversion methods exists for std::string so that they operate well
|
||||||
|
* together. Therefore you can pass translated strings to methods or functions
|
||||||
|
* that receive std::string or std::string references. Additionally you can
|
||||||
|
* perform std::string operations by casting the translated string to a
|
||||||
|
* std::string. For example:
|
||||||
|
*
|
||||||
|
* if (string(dialogTitle).size() != 0)
|
||||||
|
* ...do something useful
|
||||||
|
*
|
||||||
|
* We have intentionally not provided conversion methods for "const char*" (an
|
||||||
|
* internal representation of the object's string) because of the risk of the
|
||||||
|
* client using the pointer after the translated string object goes out of
|
||||||
|
* scope.
|
||||||
|
*
|
||||||
|
* @author David Ossorio
|
||||||
|
*/
|
||||||
|
class TranslatedString
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Enumeration describing available translation modes.
|
||||||
|
*/
|
||||||
|
typedef enum { DontTranslate, DoTranslate } Mode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs an empty translated string. It is equivalent to calling
|
||||||
|
* TranslatedString::null().
|
||||||
|
*/
|
||||||
|
TranslatedString();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience function for creating a NULL translated string.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* NULL translated string.
|
||||||
|
*/
|
||||||
|
static TranslatedString null();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a translated string object and marks it as a string needing
|
||||||
|
* translation.
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* Character string to translate.
|
||||||
|
* @param translatorNotes
|
||||||
|
* Optional notes for the human translator describing the meaning
|
||||||
|
* of the string.
|
||||||
|
*/
|
||||||
|
static TranslatedString translate(const char* str,
|
||||||
|
const char* translatorNotes = NULL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a translated string object and marks it as a string not needing
|
||||||
|
* translation.
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* Character string to translate. The str parameter can be a NULL
|
||||||
|
* pointer.
|
||||||
|
*/
|
||||||
|
static TranslatedString dontTranslate(const char* str);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destructor.
|
||||||
|
*/
|
||||||
|
virtual ~TranslatedString();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the object's string is NULL.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* true if the object's string is NULL, false otherwise.
|
||||||
|
*/
|
||||||
|
virtual bool isNull() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the object's string is NULL or zero length.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* true if the object's string is NULL or zero length, false otherwise.
|
||||||
|
*/
|
||||||
|
virtual bool isNullOrZeroLength() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the internal representation of the object's string. Use this
|
||||||
|
* result carefully. When this object goes out of scope so does this
|
||||||
|
* references.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* Pointer to the internal representation of the object's string.
|
||||||
|
*/
|
||||||
|
virtual const char* c_str();
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
/**
|
||||||
|
* Returns the internal representation of the wide character version of the
|
||||||
|
* object's string. Use this result carefully. When this object goes out of
|
||||||
|
* scope so does this references.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* Pointer to the internal representation of the object's string.
|
||||||
|
*/
|
||||||
|
virtual const wchar_t* c_wstr();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a copy of the object's string by this object. The result is
|
||||||
|
* translated or not depending on the platform and how it was created.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* Copy of the object's string.
|
||||||
|
*/
|
||||||
|
virtual operator std::string();
|
||||||
|
|
||||||
|
#if defined MSWIN
|
||||||
|
/**
|
||||||
|
* Returns a copy of the wide character version of the object's string.
|
||||||
|
* The result is translated or not depending on the platform and how it was
|
||||||
|
* created.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* Copy of the wide character version of the object's string.
|
||||||
|
*/
|
||||||
|
virtual operator std::wstring();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assignment operator.
|
||||||
|
*/
|
||||||
|
virtual TranslatedString& operator =(const TranslatedString& other);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy constructor.
|
||||||
|
*/
|
||||||
|
TranslatedString(const TranslatedString& other);
|
||||||
|
|
||||||
|
#if !defined NO_ASSERTS
|
||||||
|
/**
|
||||||
|
* Used only for assertions.
|
||||||
|
*/
|
||||||
|
virtual bool isValid() const;
|
||||||
|
#endif /* !NO_ASSERTS */
|
||||||
|
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* Constructs a translated string. This is declared private to make sure
|
||||||
|
* clients use translate() or dontTranslate() so that Tecplot's translation
|
||||||
|
* parser can easily extract strings from the source code.
|
||||||
|
*
|
||||||
|
* @param mode
|
||||||
|
* Indicates if this string is to be translated or not at runtime.
|
||||||
|
* @param str
|
||||||
|
* Character string to translate.
|
||||||
|
* @param translatorNotes
|
||||||
|
* Optional notes for the human translator describing the meaning
|
||||||
|
* of the string.
|
||||||
|
*/
|
||||||
|
TranslatedString(TranslatedString::Mode mode,
|
||||||
|
const char* str,
|
||||||
|
const char* translatorNotes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience method for initialize a translated string.
|
||||||
|
*
|
||||||
|
* @param mode
|
||||||
|
* Indicates if this string is to be translated or not at runtime.
|
||||||
|
* @param str
|
||||||
|
* Character string to translate.
|
||||||
|
* @param translatorNotes
|
||||||
|
* Optional notes for the human translator describing the meaning
|
||||||
|
* of the string.
|
||||||
|
*/
|
||||||
|
void init(TranslatedString::Mode mode,
|
||||||
|
const char* str,
|
||||||
|
const char* translatorNotes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private instance data.
|
||||||
|
*/
|
||||||
|
TranslatedString::Mode m_mode;
|
||||||
|
bool m_isNull;
|
||||||
|
std::string m_string;
|
||||||
|
std::string *m_utf8String;
|
||||||
|
#if defined MSWIN
|
||||||
|
std::wstring *m_wideString;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience function for creating a translated string object and marking it
|
||||||
|
* as a string needing translation.
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* Character string to translate.
|
||||||
|
* @param translatorNotes
|
||||||
|
* Optional notes for the human translator describing the meaning
|
||||||
|
* of the string.
|
||||||
|
*/
|
||||||
|
inline TranslatedString translate(const char* str,
|
||||||
|
const char* translatorNotes = NULL)
|
||||||
|
{
|
||||||
|
return TranslatedString::translate(str, translatorNotes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience function for creating a translated string object and marking it
|
||||||
|
* as a string not needing translation.
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* Character string to translate. The str parameter can be a NULL
|
||||||
|
* pointer.
|
||||||
|
*/
|
||||||
|
inline TranslatedString dontTranslate(const char* str)
|
||||||
|
{
|
||||||
|
return TranslatedString::dontTranslate(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convenience function for creating a translated string object and marks it as
|
||||||
|
* a string not needing translation.
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* String to translate.
|
||||||
|
*/
|
||||||
|
inline TranslatedString dontTranslate(const std::string& str)
|
||||||
|
{
|
||||||
|
return TranslatedString::dontTranslate(str.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
@ -0,0 +1,161 @@
|
|||||||
|
/*
|
||||||
|
* NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
|
||||||
|
*
|
||||||
|
* Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
|
||||||
|
*
|
||||||
|
* Tecplot hereby grants OpenCFD limited authority to distribute without
|
||||||
|
* alteration the source code to the Tecplot Input/Output library, known
|
||||||
|
* as TecIO, as part of its distribution of OpenFOAM and the
|
||||||
|
* OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
|
||||||
|
* granted access to the TecIO source code, and may redistribute it for the
|
||||||
|
* purpose of maintaining the converter. However, no authority is granted
|
||||||
|
* to alter the TecIO source code in any form or manner.
|
||||||
|
*
|
||||||
|
* This limited grant of distribution does not supersede Tecplot, Inc.'s
|
||||||
|
* copyright in TecIO. Contact Tecplot, Inc. for further information.
|
||||||
|
*
|
||||||
|
* Tecplot, Inc.
|
||||||
|
* 3535 Factoria Blvd, Ste. 550
|
||||||
|
* Bellevue, WA 98006, USA
|
||||||
|
* Phone: +1 425 653 1200
|
||||||
|
* http://www.tecplot.com/
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "MASTER.h"
|
||||||
|
|
||||||
|
#define TECPLOTENGINEMODULE
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
******* ********
|
||||||
|
****** (C) 1988-2008 Tecplot, Inc. *******
|
||||||
|
******* ********
|
||||||
|
******************************************************************
|
||||||
|
******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ALLOCMODULE
|
||||||
|
#include "GLOBAL.h"
|
||||||
|
#include "ALLOC.h"
|
||||||
|
#include "TASSERT.h"
|
||||||
|
#if defined TECPLOTKERNEL
|
||||||
|
/* CORE SOURCE CODE REMOVED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined TRACK_MEMORY_USAGE
|
||||||
|
static size_t memInUse = 0;
|
||||||
|
static size_t memTotalHighMark = 0;
|
||||||
|
static size_t memCurrentHighMark = 0;
|
||||||
|
static size_t memSavedHighMark = 0;
|
||||||
|
Mutex_pa memMutex;
|
||||||
|
|
||||||
|
void initMemoryUsageTracking(void)
|
||||||
|
{
|
||||||
|
REQUIRE(!Thread_ThreadingIsInitialized());
|
||||||
|
Thread_InitMutex(&memMutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cleanUpMemoryUsageTracking(void)
|
||||||
|
{
|
||||||
|
REQUIRE(!Thread_ThreadingIsInitialized());
|
||||||
|
Thread_FreeMutex(&memMutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void trackMemoryClearHighMark(void)
|
||||||
|
{
|
||||||
|
memCurrentHighMark = memInUse;
|
||||||
|
}
|
||||||
|
|
||||||
|
void trackMemorySaveHighMark(void)
|
||||||
|
{
|
||||||
|
memSavedHighMark = memCurrentHighMark;
|
||||||
|
}
|
||||||
|
|
||||||
|
void trackMemoryAlloc(size_t size)
|
||||||
|
{
|
||||||
|
REQUIRE(memInUse >= 0);
|
||||||
|
|
||||||
|
if (Thread_ThreadingIsInitialized())
|
||||||
|
Thread_LockMutex(memMutex);
|
||||||
|
|
||||||
|
memInUse += size;
|
||||||
|
if (memInUse > memTotalHighMark)
|
||||||
|
memTotalHighMark = memInUse;
|
||||||
|
if (memInUse > memCurrentHighMark)
|
||||||
|
memCurrentHighMark = memInUse;
|
||||||
|
|
||||||
|
if (Thread_ThreadingIsInitialized())
|
||||||
|
Thread_UnlockMutex(memMutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void trackMemoryFree(size_t size)
|
||||||
|
{
|
||||||
|
if (Thread_ThreadingIsInitialized())
|
||||||
|
Thread_LockMutex(memMutex);
|
||||||
|
|
||||||
|
memInUse -= size;
|
||||||
|
|
||||||
|
if (Thread_ThreadingIsInitialized())
|
||||||
|
Thread_UnlockMutex(memMutex);
|
||||||
|
|
||||||
|
ENSURE(memInUse >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void getMemoryUsage(size_t* memoryInUse,
|
||||||
|
size_t* memoryCurrentHighMark,
|
||||||
|
size_t* memorySavedHighMark,
|
||||||
|
size_t* memoryTotalHighMark)
|
||||||
|
{
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(memoryInUse));
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(memoryCurrentHighMark));
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(memorySavedHighMark));
|
||||||
|
REQUIRE(VALID_REF_OR_NULL(memoryTotalHighMark));
|
||||||
|
if (memoryInUse != NULL)
|
||||||
|
*memoryInUse = memInUse;
|
||||||
|
if (memoryCurrentHighMark != NULL)
|
||||||
|
*memoryCurrentHighMark = memCurrentHighMark;
|
||||||
|
if (memorySavedHighMark != NULL)
|
||||||
|
*memorySavedHighMark = memSavedHighMark;
|
||||||
|
if (memoryTotalHighMark != NULL)
|
||||||
|
*memoryTotalHighMark = memTotalHighMark;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined MSWIN && defined ALLOC_HEAP
|
||||||
|
#define HEAPMIN 512
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined MSWIN && defined ALLOC_HEAP
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
void *MSWinAlloc(DWORD nSize)
|
||||||
|
{
|
||||||
|
long *pMem = NULL;
|
||||||
|
if (nSize < HEAPMIN)
|
||||||
|
pMem = (long *)malloc(sizeof(long) + nSize);
|
||||||
|
else
|
||||||
|
pMem = (long *)HeapAlloc(GetProcessHeap(), NULL, sizeof(long) + nSize);
|
||||||
|
if (pMem)
|
||||||
|
pMem[0] = nSize;
|
||||||
|
return (void *)&(pMem[1]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined MSWIN && defined ALLOC_HEAP
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
void MSWinFree(void *pMem)
|
||||||
|
{
|
||||||
|
REQUIRE(VALID_REF(pMem));
|
||||||
|
if (pMem)
|
||||||
|
{
|
||||||
|
long *pMemLong = &(((long *)pMem)[-1]);
|
||||||
|
if (pMemLong[0] < HEAPMIN)
|
||||||
|
free((void *)pMemLong);
|
||||||
|
else
|
||||||
|
HeapFree(GetProcessHeap(), NULL, (void *)pMemLong);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user