/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/tecxxx.cpp
C++ | 4812 lines | 4687 code | 48 blank | 77 comment | 98 complexity | 5fe49e9e034ec3c2048bcba2da04635a MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.1
Large files files are truncated, but you can click here to view the full 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/
- *
- */
- #include "stdafx.h"
- #include "MASTER.h"
- #define TECPLOTENGINEMODULE
- /*
- ******************************************************************
- ******************************************************************
- ******* ********
- ****** (C) 1988-2008 Tecplot, Inc. *******
- ******* ********
- ******************************************************************
- ******************************************************************
- */
- /* Source file revision $Revision: 7627 $ */
- #include "GLOBAL.h"
- #include "TASSERT.h"
- #include "Q_UNICODE.h"
- #include "SYSTEM.h"
- #include "FILESTREAM.h"
- #if defined TECPLOTKERNEL
- /* CORE SOURCE CODE REMOVED */
- #endif
- #include "DATAIO4.h"
- #include "DATASET0.h"
- #include "TECXXX.h"
- #include "DATAUTIL.h"
- #include "ALLOC.h"
- #include <vector>
- #if !defined MAKEARCHIVE
- #include "AUXDATA.h"
- #endif /* MAKEARCHIVE */
- #if defined MSWIN
- #include <io.h>
- #endif
- #if defined UNIXX
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #endif
- #if defined TECPLOTKERNEL
- /* CORE SOURCE CODE REMOVED */
- #endif
- using namespace std;
- #if defined MAKEARCHIVE
- #if defined MSWIN && defined _DEBUG
- /* For debug .dll builds, send debug info to debug window. */
- #define PRINT0(s) do { OutputDebugString(s); } while (0)
- #define PRINT1(s,a1) do { char buffer[512]; sprintf(buffer,s,a1); OutputDebugString(buffer); } while (0)
- #define PRINT2(s,a1,a2) do { char buffer[512]; sprintf(buffer,s,a1,a2); OutputDebugString(buffer); } while (0)
- #else
- /* For all other builds (including release .dll), send debug info to stdout. */
- #define PRINT0(s) printf(s)
- #define PRINT1(s,a1) printf(s,a1)
- #define PRINT2(s,a1,a2) printf(s,a1,a2)
- #endif
- #else
- #if defined MSWIN
- /* For nonarchive, Windows, don't send debug info. */
- #define PRINT0(s) ((void)0)
- #define PRINT1(s,a1) ((void)0)
- #define PRINT2(s,a1,a2) ((void)0)
- #else
- /* For nonarchive, nonwindows, send debug info to stdout. */
- #define PRINT0(s) printf(s)
- #define PRINT1(s,a1) printf(s,a1)
- #define PRINT2(s,a1,a2) printf(s,a1,a2)
- #endif
- #endif
- typedef char *FNameType;
- typedef FILE *FilePtr;
- #define MaxNumFiles 10
- #define MAX_DUPLIST_VARS 50 /* maybe crank up in the future */
- #define BYTES_PER_CHUNK 4096
- #define TECIO_NO_NEIGHBORING_ELEM 0
- #define TECIO_NO_NEIGHBORING_ZONE 0
- #if defined MAKEARCHIVE
- static LgIndex_t DebugLevel[MaxNumFiles] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- #endif
- static INTEGER4 IsOpen[MaxNumFiles] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- static INTEGER4 NumErrs[MaxNumFiles] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- static INTEGER4 NumVars[MaxNumFiles];
- static FNameType DestFName[MaxNumFiles] = {NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL
- };
- static FNameType BlckFName[MaxNumFiles] = {NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL
- };
- static FileStream_s* BlckFile[MaxNumFiles];
- static FileStream_s* HeadFile[MaxNumFiles];
- static vector<FileOffset_t> MinMaxOffset[MaxNumFiles]; /* vector dimensioned by num zones */
- static vector<double> VarMinValue[MaxNumFiles]; /* vector dimensioned by num vars */
- static vector<double> VarMaxValue[MaxNumFiles]; /* vector dimensioned by num vars */
- static INTEGER4 DoWriteForeign = FALSE; /* ...default is to write native */
- static INTEGER4 IsWritingNative[MaxNumFiles];
- static INTEGER4 IsBlock[MaxNumFiles];
- static INTEGER4 ZoneType[MaxNumFiles];
- static LgIndex_t IMax[MaxNumFiles]; /* ones based indices */
- static LgIndex_t JMax[MaxNumFiles]; /* ones based indices */
- static LgIndex_t KMax[MaxNumFiles]; /* ones based indices */
- static vector<LgIndex_t> TotalNumFaceNodes[MaxNumFiles]; /* vector dimensioned by num zones */
- static LgIndex_t TotalNumFaceBndryFaces[MaxNumFiles];
- static LgIndex_t TotalNumFaceBndryConns[MaxNumFiles];
- static LgIndex_t ICellMax[MaxNumFiles];
- static LgIndex_t JCellMax[MaxNumFiles];
- static LgIndex_t KCellMax[MaxNumFiles];
- static vector<INTEGER4> NumFaceConnections[MaxNumFiles]; /* vector dimensioned by num zones */
- static INTEGER4 FaceNeighborMode[MaxNumFiles];
- static vector<INTEGER4> FaceNeighborsOrMapWritten[MaxNumFiles]; /* vector dimensioned by num zones */
- static INTEGER4 NumIndices[MaxNumFiles];
- static LgIndex_t NumDataValuesWritten[MaxNumFiles];
- static LgIndex_t NumOrderedCCDataValuesWritten[MaxNumFiles]; /* CC data only */
- static LgIndex_t NumDataValuesToWrite[MaxNumFiles];
- static vector<LgIndex_t> NumRunningVarValues[MaxNumFiles]; /* vector dimensioned by num vars */
- static vector<Boolean_t> IsSharedVar[MaxNumFiles]; /* vector dimensioned by num vars */
- static vector<Boolean_t> IsPassiveVar[MaxNumFiles]; /* vector dimensioned by num vars */
- static INTEGER4 CurZone[MaxNumFiles]; /* zero based zone numbers */
- static INTEGER4 CurVar[MaxNumFiles]; /* zero based var numbers */
- static INTEGER4 FieldDataType;
- static INTEGER4 CurFile = -1;
- static vector<Boolean_t> IsCellCentered[MaxNumFiles]; /* vector dimensioned by num vars */
- static Boolean_t HasFECONNECT[MaxNumFiles];
- static INTEGER4 FileTypes[MaxNumFiles];
- static vector<INTEGER4> NumConnectivityNodes[MaxNumFiles]; /* vector dimensioned by num zones */
- static vector<Boolean_t> ConnectivityWritten[MaxNumFiles]; /* vector dimensioned by num zones */
- /*
- * From preplot.cpp:
- *
- * ZoneType 0=ORDERED,1=FELINESEG,2=FETRIANGLE,
- * 3=FEQUADRILATERAL,4=FETETRAHEDRON,5=FEBRICK,
- * 6=FEPOLYGON,7=FEPOLYHEDRON
- */
- #define ORDERED 0
- #define FELINESEG 1
- #define FETRIANGLE 2
- #define FEQUADRILATERAL 3
- #define FETETRAHEDRON 4
- #define FEBRICK 5
- #define FEPOLYGON 6
- #define FEPOLYHEDRON 7
- /*
- * FileType 0=FULLFILE,1=GRIDFILE,2=SOLUTIONFILE
- */
- #define FULLFILE 0
- #define GRIDFILE 1
- #define SOLUTIONFILE 2
- #if defined MAKEARCHIVE
- static char const* ZoneTypes[] =
- {
- "ORDERED",
- "FELINESEG",
- "FETRIANGLE",
- "FEQUADRILATERAL",
- "FETETRAHEDRON",
- "FEBRICK",
- "FEPOLYGON",
- "FEPOLYHEDRON"
- };
- #endif /* MAKEARCHIVE */
- static void WriteErr(const char *routine_name)
- {
- #if defined MAKEARCHIVE
- PRINT2("Err: (%s) Write failure on file %d.\n", routine_name, CurFile + 1);
- #endif
- NumErrs[CurFile]++;
- }
- static LgIndex_t TecXXXZoneNum = 0;
- Boolean_t ParseDupList(LgIndex_t **ShareVarFromZone,
- LgIndex_t *ShareConnectivityFromZone,
- const char *DupList)
- {
- Boolean_t IsOk = TRUE;
- REQUIRE(VALID_REF(ShareVarFromZone) && *ShareVarFromZone == NULL);
- REQUIRE(VALID_REF(ShareConnectivityFromZone));
- REQUIRE(VALID_REF(DupList));
- while (IsOk && *DupList)
- {
- /* skip leading spaces */
- while (*DupList && *DupList == ' ')
- DupList++;
- /* is this the FECONNECT keyword? */
- if (*DupList && !strncmp(DupList, "FECONNECT", 9))
- *ShareConnectivityFromZone = TecXXXZoneNum;
- else if (*DupList && !isdigit(*DupList))
- IsOk = FALSE; /* syntax error */
- else if (*DupList)
- {
- char *NotUsed = NULL;
- EntIndex_t WhichVar = strtol(DupList, &NotUsed, 10);
- EntIndex_t numVarsForFile = NumVars[CurFile];
- if (0 < WhichVar && WhichVar < numVarsForFile)
- {
- if (!(*ShareVarFromZone))
- {
- *ShareVarFromZone = ALLOC_ARRAY(numVarsForFile, LgIndex_t, "Variable sharing list");
- if (*ShareVarFromZone)
- memset(*ShareVarFromZone, (char)0, numVarsForFile * sizeof(LgIndex_t));
- }
- if (*ShareVarFromZone)
- (*ShareVarFromZone)[WhichVar - 1] = TecXXXZoneNum;
- else
- IsOk = FALSE;
- }
- else
- {
- /* Invalid var num */
- IsOk = FALSE;
- }
- }
- /*
- * Skip to the comma. This
- * will also allow the syntax error
- * of more than one consecutive comma
- */
- while (*DupList && *DupList != ',')
- DupList++;
- /* skip past the comma (can handle the syntax error of more than 1 comma) */
- while (*DupList && *DupList == ',')
- DupList++;
- }
- return IsOk;
- }
- /**
- */
- static FileStream_s *OpenFileStream(const char *FilePath,
- const char *AccessMode,
- Boolean_t IsByteOrderNative)
- {
- REQUIRE(VALID_REF(FilePath));
- REQUIRE(VALID_REF(AccessMode));
- FileStream_s *Result = NULL;
- FILE *File = TP_FOPEN(FilePath, AccessMode);
- if (File != NULL)
- {
- Result = FileStreamAlloc(File, IsByteOrderNative);
- if (Result == NULL)
- TP_FCLOSE(File);
- }
- ENSURE((VALID_REF(Result) && VALID_REF(Result->File)) || Result == NULL);
- return Result;
- }
- /**
- */
- static void CloseFileStream(FileStream_s **FileStream)
- {
- REQUIRE(VALID_REF(FileStream));
- REQUIRE(VALID_REF(*FileStream) || *FileStream == NULL);
- if (*FileStream != NULL)
- {
- TP_FCLOSE((*FileStream)->File);
- FileStreamDealloc(FileStream);
- }
- ENSURE(*FileStream == NULL);
- }
- /**
- * Get the best terminator (separator) character to use for the string. First
- * precedence goes to the new line then the command and finally by default the
- * space. NOTE: We use a do loop to allow it to be used as a single statement.
- */
- #define GET_BEST_TERMINATOR_CHAR(CompoundStr, TerminatorChar) \
- do \
- { \
- if (strchr((CompoundStr), '\n') != NULL) \
- (TerminatorChar) = '\n'; \
- else if (strchr((CompoundStr), ',') != NULL) \
- (TerminatorChar) = ','; \
- else \
- (TerminatorChar) = ' '; \
- } while (0)
- /**
- * TECINIXXX
- */
- INTEGER4 LIBCALL TECINI112(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *FileType,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- size_t L;
- int I;
- char RName[80];
- char *CPtr;
- int NewFile = -1;
- /*
- * Note that users should not mix TECXXX, TEC100XXX, and TEC110XXX calls, but
- * just in case, initialize the TecXXXZoneNum variable. It may not help, but
- * it doesn't hurt...
- */
- TecXXXZoneNum = 0;
- #if defined MAKEARCHIVE
- InitInputSpecs();
- #endif
- for (I = 0; (I < MaxNumFiles) && (NewFile == -1); I++)
- {
- if (!IsOpen[I])
- NewFile = I;
- }
- if (NewFile == -1)
- {
- #if defined MAKEARCHIVE
- PRINT1("Err: (TECINI112) Too many files (%d) opened for printing.\n", NewFile);
- #endif
- return (-1);
- }
- if (CurFile == -1)
- CurFile = 0;
- #if defined MAKEARCHIVE
- DebugLevel[NewFile] = *Debug;
- #endif
- /* check sizes for array sized by number of variables */
- CHECK(VarMinValue[NewFile].empty());
- CHECK(VarMaxValue[NewFile].empty());
- CHECK(NumRunningVarValues[NewFile].empty());
- CHECK(IsSharedVar[NewFile].empty());
- CHECK(IsPassiveVar[NewFile].empty());
- CHECK(IsCellCentered[NewFile].empty());
- /* check sizes for array sized by number of zones */
- CHECK(MinMaxOffset[NewFile].empty());
- CHECK(TotalNumFaceNodes[NewFile].empty());
- CHECK(NumFaceConnections[NewFile].empty());
- CHECK(FaceNeighborsOrMapWritten[NewFile].empty());
- CHECK(NumConnectivityNodes[NewFile].empty());
- CHECK(ConnectivityWritten[NewFile].empty());
- CurZone[NewFile] = -1;
- L = 0;
- if (FName != NULL)
- L = strlen(FName);
- if (L == 0)
- {
- #if defined MAKEARCHIVE
- PRINT1("Err: (TECINI112) Bad file name for file %d.\n", NewFile);
- #endif
- return (-1);
- }
- DestFName[NewFile] = ALLOC_ARRAY(L + 1, char, "data set fname");
- strcpy(DestFName[NewFile], FName);
- #if defined (DOS)
- {
- sprintf(RName, "BLCKFILE.%03d", (int)(NewFile + 1));
- }
- #else
- {
- sprintf(RName, "tp%1dXXXXXX", NewFile + 1);
- }
- #endif
- L = strlen(RName);
- if (ScratchDir != NULL)
- L += strlen(ScratchDir) + 1; /* +1 for the slash delimeter */
- BlckFName[NewFile] = ALLOC_ARRAY(L + 1, char, "data set fname");
- if (ScratchDir != NULL)
- {
- strcpy(BlckFName[NewFile], ScratchDir);
- #if defined DOS || defined MSWIN
- {
- strcat(BlckFName[NewFile], "\\");
- }
- #else
- {
- strcat(BlckFName[NewFile], "/");
- }
- #endif
- }
- else
- BlckFName[NewFile][0] = '\0';
- strcat(BlckFName[NewFile], RName);
- CHECK(strlen(BlckFName[NewFile]) <= L);
- #if defined MSWIN
- {
- _mktemp(BlckFName[NewFile]);
- }
- #elif defined UNIXX
- {
- /*
- * POSIX compiant behavior is to make
- * sure umask is set correctly first.
- */
- mode_t OrigUmask = umask(0022); /* ...should produce rw------- */
- int FileDesc = mkstemp(BlckFName[NewFile]);
- if (FileDesc != -1)
- close(FileDesc);
- umask(OrigUmask);
- }
- #endif
- #if defined MAKEARCHIVE
- if (DebugLevel[NewFile])
- {
- PRINT2("Scratch File #%d: %s\n", NewFile + 1, BlckFName[NewFile]);
- PRINT2("Dest File #%d: %s\n", NewFile + 1, DestFName[NewFile]);
- }
- #endif
- IsWritingNative[NewFile] = !DoWriteForeign;
- #if defined TECPLOTKERNEL
- /* CORE SOURCE CODE REMOVED */
- #endif
- HeadFile[NewFile] = OpenFileStream(DestFName[NewFile], "wb", IsWritingNative[NewFile]);
- BlckFile[NewFile] = OpenFileStream(BlckFName[NewFile], "wb", IsWritingNative[NewFile]);
- if (BlckFile[NewFile] == NULL)
- {
- #if defined MAKEARCHIVE
- PRINT0("Err: (TECINI112) Cannot open scratch file for output.\n");
- PRINT0(" Check permissions in scratch directory.\n");
- #endif
- NumErrs[NewFile]++;
- return (-1);
- }
- if (HeadFile[NewFile] == NULL)
- {
- #if defined MAKEARCHIVE
- PRINT0("Err: (TECINI112) Cannot open plot file. Check permissions.\n");
- #endif
- NumErrs[NewFile]++;
- return (-1);
- }
- writeBinaryVersionNumber(*HeadFile[NewFile],
- TecplotBinaryFileVersion);
- WriteBinaryMagic(HeadFile[NewFile]);
- /* Write file type */
- if (*FileType >= FULLFILE && *FileType <= SOLUTIONFILE)
- FileTypes[NewFile] = *FileType;
- else
- {
- #if defined MAKEARCHIVE
- PRINT0("Err: (TECINI112) Bad filetype argument. Check documentation.\n");
- #endif
- NumErrs[NewFile]++;
- return (-1);
- }
- CHECK(TecplotBinaryFileVersion == 112);
- if (!WriteBinaryInt32(HeadFile[NewFile], (LgIndex_t)FileTypes[NewFile]))
- {
- WriteErr("TECINI112");
- return (-1);
- }
- if (!DumpDatafileString(HeadFile[NewFile],
- Title,
- TRUE))
- {
- WriteErr("TECINI112");
- return (-1);
- }
- NumVars[NewFile] = 0;
- CPtr = Variables;
- /*
- * Three possible variable name separators are accepted with the following
- * precidence: newline, comma, and space.
- */
- {
- char terminator;
- GET_BEST_TERMINATOR_CHAR(CPtr, terminator);
- while (*CPtr)
- {
- /* strip leading spaces */
- while (*CPtr && *CPtr == ' ')
- CPtr++;
- if (*CPtr)
- {
- NumVars[NewFile]++;
- /* skip to terminating character */
- while (*CPtr && *CPtr != terminator)
- CPtr++;
- /* skip past terminating character */
- if (*CPtr)
- CPtr++;
- }
- }
- }
- #if 0
- /* A grid file can have no variables in it as long as there is a connectivity list */
- if (NumVars[NewFile] == 0 && FileTypes[NewFile] != GRIDFILE)
- {
- #if defined MAKEARCHIVE
- PRINT0("Err: (TECINI110) No variable names were defined.\n");
- #endif
- NumErrs[NewFile]++;
- return (-1);
- }
- #endif
- #if defined MAKEARCHIVE
- if (DebugLevel[NewFile])
- PRINT1("NumVars=%d\n", NumVars[NewFile]);
- #endif
- /* make sure var-sized arrays are big enough for all vars */
- try
- {
- VarMinValue[NewFile].resize(NumVars[NewFile]);
- VarMaxValue[NewFile].resize(NumVars[NewFile]);
- NumRunningVarValues[NewFile].resize(NumVars[NewFile]);
- IsSharedVar[NewFile].resize(NumVars[NewFile]);
- IsPassiveVar[NewFile].resize(NumVars[NewFile]);
- IsCellCentered[NewFile].resize(NumVars[NewFile]);
- }
- catch (std::bad_alloc const&)
- {
- #if defined MAKEARCHIVE
- PRINT0("Err: (TECINI112) Memory allocation error.\n");
- #endif
- NumErrs[NewFile]++;
- return (-1);
- }
- if (!WriteBinaryInt32(HeadFile[NewFile], (LgIndex_t)NumVars[NewFile]))
- {
- WriteErr("TECINI110");
- return (-1);
- }
- CPtr = Variables;
- {
- char terminator;
- char TString[MaxChrsVarName+1];
- int I;
- GET_BEST_TERMINATOR_CHAR(CPtr, terminator);
- while (*CPtr)
- {
- /* skip leading space characters */
- while (*CPtr && *CPtr == ' ')
- CPtr++;
- if (*CPtr)
- {
- I = 0;
- /* skip to terminator */
- while (*CPtr && *CPtr != terminator)
- {
- TString[I++] = *CPtr++;
- }
- /* skip past terminator */
- if (*CPtr)
- CPtr++;
- /* strip trailing spaces */
- I--;
- while (I >= 0 && TString[I] == ' ')
- I--;
- TString[I+1] = '\0';
- if (!DumpDatafileString(HeadFile[NewFile], TString, TRUE))
- {
- WriteErr("TECINI110");
- return (-1);
- }
- }
- }
- }
- IsOpen[NewFile] = 1;
- if (*VIsDouble)
- FieldDataType = FieldDataType_Double;
- else
- FieldDataType = FieldDataType_Float;
- return (0);
- }
- INTEGER4 LIBCALL TECINI111(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *FileType,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- return TECINI112(Title,
- Variables,
- FName,
- ScratchDir,
- FileType,
- Debug,
- VIsDouble);
- }
- INTEGER4 LIBCALL TECINI110(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- INTEGER4 FType = FULLFILE;
- TecXXXZoneNum = 0;
- return TECINI112(Title,
- Variables,
- FName,
- ScratchDir,
- &FType,
- Debug,
- VIsDouble);
- }
- INTEGER4 LIBCALL TECINI100(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- INTEGER4 FType = FULLFILE;
- TecXXXZoneNum = 0;
- return TECINI112(Title,
- Variables,
- FName,
- ScratchDir,
- &FType,
- Debug,
- VIsDouble);
- }
- INTEGER4 LIBCALL TECINI(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- INTEGER4 FType = FULLFILE;
- TecXXXZoneNum = 0;
- return TECINI112(Title,
- Variables,
- FName,
- ScratchDir,
- &FType,
- Debug,
- VIsDouble);
- }
- #if defined MAKEARCHIVE && !defined _WIN32 /* every platform but Windows Intel */
- LIBFUNCTION INTEGER4 LIBCALL tecini112_(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *FileType,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- return TECINI112(Title, Variables, FName, ScratchDir, FileType, Debug, VIsDouble);
- }
- LIBFUNCTION INTEGER4 LIBCALL tecini111_(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *FileType,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- return TECINI112(Title, Variables, FName, ScratchDir, FileType, Debug, VIsDouble);
- }
- LIBFUNCTION INTEGER4 LIBCALL tecini110_(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- INTEGER4 FType = FULLFILE;
- return TECINI112(Title, Variables, FName, ScratchDir, &FType, Debug, VIsDouble);
- }
- LIBFUNCTION INTEGER4 LIBCALL tecini100_(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- INTEGER4 FType = FULLFILE;
- return TECINI112(Title, Variables, FName, ScratchDir, &FType, Debug, VIsDouble);
- }
- LIBFUNCTION INTEGER4 LIBCALL tecini_(char *Title,
- char *Variables,
- char *FName,
- char *ScratchDir,
- INTEGER4 *Debug,
- INTEGER4 *VIsDouble)
- {
- INTEGER4 FType = FULLFILE;
- return TECINI112(Title,
- Variables,
- FName,
- ScratchDir,
- &FType,
- Debug,
- VIsDouble);
- }
- #endif
- static int CheckData(const char *routine_name)
- {
- if (NumDataValuesToWrite[CurFile] != NumDataValuesWritten[CurFile])
- {
- #if defined MAKEARCHIVE
- PRINT2("Err: (%s) Wrong number of data values in file %d:\n", routine_name, CurFile + 1);
- PRINT2(" %d data values for Zone %d were processed,\n", NumDataValuesWritten[CurFile], CurZone[CurFile] + 1);
- PRINT1(" %d data values were expected.\n", NumDataValuesToWrite[CurFile]);
- #endif
- NumErrs[CurFile]++;
- return (-1);
- }
- return (0);
- }
- static int CheckFile(const char *routine_name)
- {
- if ((CurFile == -1) || (!IsOpen[CurFile]))
- {
- #if defined MAKEARCHIVE
- PRINT2("Err: (%s) Attempt to use invalid file (%d).\n",
- routine_name, CurFile + 1);
- #endif
- return (-1);
- }
- return (0);
- }
- /**
- * Advances CurVar[CurFile] to the next non-shared active variable. TECDATXXX
- * clients should not supply values for shared or passive variables.
- */
- static void AdvanceToNextVarWithValues(void)
- {
- /* search for the next variable with values */
- do
- {
- CurVar[CurFile]++;
- }
- while (CurVar[CurFile] < NumVars[CurFile] &&
- (IsSharedVar[CurFile][CurVar[CurFile]] ||
- IsPassiveVar[CurFile][CurVar[CurFile]]));
- }
- /**
- * TECZNEXXX
- */
- INTEGER4 LIBCALL TECZNE112(char *ZnTitle,
- INTEGER4 *ZnType,
- INTEGER4 *IMxOrNumPts,
- INTEGER4 *JMxOrNumElements,
- INTEGER4 *KMxOrNumFaces,
- INTEGER4 *ICellMx,
- INTEGER4 *JCellMx,
- INTEGER4 *KCellMx,
- double *SolutionTime,
- INTEGER4 *StrandID,
- INTEGER4 *ParentZone,
- INTEGER4 *IsBlk,
- INTEGER4 *NumFaceConn,
- INTEGER4 *FNMode,
- INTEGER4 *NumFaceNodes,
- INTEGER4 *NumFaceBndryFaces,
- INTEGER4 *NumFaceBndryConns,
- INTEGER4 *PassiveVarList,
- INTEGER4 *ValueLocation,
- INTEGER4 *ShareVarFromZone,
- INTEGER4 *ShareConnectivityFromZone)
- {
- int I;
- int IsOk = 1;
- if (CheckFile("TECZNE112") < 0)
- return (-1);
- if (CurZone[CurFile] > -1)
- {
- if (CheckData("TECZNE112") < 0)
- return (-1);
- }
- if (NumVars[CurFile] == 0)
- {
- WriteErr("TECZNE112");
- #if defined MAKEARCHIVE
- PRINT1("Err: (TECZNE112) Cannot write out zones if numvars is equal to zero (file %d).\n",
- CurFile + 1);
- #endif
- return (-1);
- }
- if (CurZone[CurFile] > MaxNumZonesOrVars - 2) /* -1 based */
- {
- WriteErr("TECZNE112");
- #if defined MAKEARCHIVE
- PRINT2("Err: (TECZNE112) Exceeded max number of zones (%d) in file %d.\n",
- MaxNumZonesOrVars, CurFile + 1);
- #endif
- return (-1);
- }
- if (*StrandID < -1)
- {
- #if defined MAKEARCHIVE
- PRINT2("Err: (TECZNE112) Invalid StrandID supplied for file %d, zone %d.\n",
- CurFile + 1, CurZone[CurFile] + 1 + 1);
- #endif
- return (-1);
- }
- if (*ParentZone < 0)
- {
- #if defined MAKEARCHIVE
- PRINT2("Err: (TECZNE112) Invalid ParentZone supplied for file %d, zone %d.\n",
- CurFile + 1, CurZone[CurFile] + 1 + 1);
- #endif
- return (-1);
- }
- /*
- * This is a temporary error. Point format should no longer be written to the file
- * and should instead be converted to block format before being written. Since the
- * conversion has not yet been implemented, it is an error to use point data.
- * TODO (JN): Remove this error when point to block conversion has been implemented.
- */
- if (*IsBlk != 1)
- {
- #if defined MAKEARCHIVE
- PRINT2("Err: (TECZNE112) Point data is not currently allowed. "
- " Please use block format for file %d, zone %d.\n",
- CurFile + 1, CurZone[CurFile] + 1 + 1);
- #endif
- return (-1);
- }
- NumDataValuesWritten[CurFile] = 0;
- NumOrderedCCDataValuesWritten[CurFile] = 0;
- CurZone[CurFile]++;
- /* Resize zone-dimensioned arrays (CurZone[] is 0-based) */
- try
- {
- MinMaxOffset[CurFile].resize(CurZone[CurFile] + 1);
- TotalNumFaceNodes[CurFile].resize(CurZone[CurFile] + 1);
- NumFaceConnections[CurFile].resize(CurZone[CurFile] + 1);
- FaceNeighborsOrMapWritten[CurFile].resize(CurZone[CurFile] + 1);
- NumConnectivityNodes[CurFile].resize(CurZone[CurFile] + 1);
- ConnectivityWritten[CurFile].resize(CurZone[CurFile] + 1);
- }
- catch (std::bad_alloc const&)
- {
- #if defined MAKEARCHIVE
- PRINT0("Err: (TECZNE112) Memory allocation error.\n");
- #endif
- NumErrs[CurFile]++;
- return (-1);
- }
- ZoneType[CurFile] = *ZnType;
- IMax[CurFile] = *IMxOrNumPts;
- JMax[CurFile] = *JMxOrNumElements;
- KMax[CurFile] = *KMxOrNumFaces;
- ICellMax[CurFile] = *ICellMx;
- JCellMax[CurFile] = *JCellMx;
- KCellMax[CurFile] = *KCellMx;
- /* Set the flags that connectivity, face neighbors or face map hasn't been written for the zone yet. */
- FaceNeighborsOrMapWritten[CurFile][CurZone[CurFile]] = FALSE;
- ConnectivityWritten[CurFile][CurZone[CurFile]] = FALSE;
- if (ZoneType[CurFile] == ZoneType_FEPolygon ||
- ZoneType[CurFile] == ZoneType_FEPolyhedron)
- {
- NumFaceConnections[CurFile][CurZone[CurFile]] = 0; /* ...not used for polytope data */
- FaceNeighborMode[CurFile] = 0; /* ...not used for polytope data */
- NumConnectivityNodes[CurFile][CurZone[CurFile]] = 0; /* ...not used for polytope data */
- IsBlock[CurFile] = TRUE; /* ...polytope data is always block */
- TotalNumFaceNodes[CurFile][CurZone[CurFile]] = *NumFaceNodes;
- TotalNumFaceBndryFaces[CurFile] = *NumFaceBndryFaces;
- TotalNumFaceBndryConns[CurFile] = *NumFaceBndryConns;
- }
- else /* ...classic data */
- {
- IsBlock[CurFile] = *IsBlk;
- NumFaceConnections[CurFile][CurZone[CurFile]] = *NumFaceConn;
- FaceNeighborMode[CurFile] = *FNMode;
- TotalNumFaceNodes[CurFile][CurZone[CurFile]] = 0; /* ...not used for classic data */
- TotalNumFaceBndryFaces[CurFile] = 0; /* ...not used for classic data */
- TotalNumFaceBndryConns[CurFile] = 0; /* ...not used for classic data */
- }
- WriteBinaryReal(HeadFile[CurFile],
- (double)ZoneMarker,
- FieldDataType_Float);
- if (!DumpDatafileString(HeadFile[CurFile],
- ZnTitle,
- TRUE))
- {
- WriteErr("TECZNE112");
- return (-1);
- }
- if ((ShareVarFromZone && *ShareConnectivityFromZone) &&
- CurZone[CurFile] == 0)
- {
- /* can't have a duplist if there's nothing to duplicate */
- IsOk = 0;
- }
- if (IsOk == 0)
- {
- #if defined MAKEARCHIVE
- PRINT1("Err: (TECZNE112) Bad zone format for file %d.\n", CurFile + 1);
- #endif
- NumErrs[CurFile]++;
- return (-1);
- }
- switch (ZoneType[CurFile])
- {
- case ORDERED:
- NumIndices[CurFile] = 0;
- break;
- case FELINESEG:
- NumIndices[CurFile] = 2;
- break;
- case FETRIANGLE:
- NumIndices[CurFile] = 3;
- break;
- case FEQUADRILATERAL:
- NumIndices[CurFile] = 4;
- break;
- case FETETRAHEDRON:
- NumIndices[CurFile] = 4;
- break;
- case FEBRICK:
- NumIndices[CurFile] = 8;
- break;
- }
- /* ...not used for poly or ordered data and don't count sharing or solution files. */
- if (ZoneType[CurFile] != ZoneType_FEPolygon &&
- ZoneType[CurFile] != ZoneType_FEPolyhedron &&
- *ShareConnectivityFromZone == 0 &&
- FileTypes[CurFile] != SOLUTIONFILE)
- NumConnectivityNodes[CurFile][CurZone[CurFile]] = NumIndices[CurFile] * JMax[CurFile];
- /*
- * We do not check any return values until the end. If these calls fail,
- * WriteFieldDataType below should fail as well.
- */
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)(*ParentZone) - 1); /* ...ParentZone is zero based for binary file */
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)(*StrandID) - 1); /* ...StrandID is zero based for binary file */
- WriteBinaryReal(HeadFile[CurFile], *SolutionTime, FieldDataType_Double);
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t) - 1); /* No Zone Color Assignment */
- WriteBinaryInt32(HeadFile[CurFile], ZoneType[CurFile]);
- NumDataValuesToWrite[CurFile] = 0;
- for (I = 0; I < NumVars[CurFile]; I++)
- {
- IsSharedVar[CurFile][I] = (ShareVarFromZone != NULL && ShareVarFromZone[I] != 0); /* ...shared? */
- IsPassiveVar[CurFile][I] = (PassiveVarList != NULL && PassiveVarList[I] == 1); /* ...passive? */
- }
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)(ValueLocation != NULL ? 1 : 0)); /* ...are var locations specified? */
- if (ValueLocation)
- {
- for (I = 0; I < NumVars[CurFile]; I++)
- {
- int VIndex;
- LgIndex_t NumNodes;
- LgIndex_t NumCells;
- if (ZoneType[CurFile] == ORDERED)
- {
- NumNodes = IMax[CurFile] * JMax[CurFile] * KMax[CurFile];
- NumCells = (MAX(IMax[CurFile] - 1, 1) *
- MAX(JMax[CurFile] - 1, 1) *
- MAX(KMax[CurFile] - 1, 1));
- }
- else
- {
- NumNodes = IMax[CurFile];
- NumCells = JMax[CurFile];
- }
- if (IsSharedVar[CurFile][I])
- VIndex = ShareVarFromZone[I] - 1;
- else
- VIndex = I;
- if (VIndex == 0)
- NumRunningVarValues[CurFile][I] = 0;
- else
- NumRunningVarValues[CurFile][VIndex] = NumRunningVarValues[CurFile][VIndex-1];
- IsCellCentered[CurFile][VIndex] = (ValueLocation[I] == ValueLocation_CellCentered);
- if (ValueLocation[I] == ValueLocation_CellCentered)
- {
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)1);
- if (!IsSharedVar[CurFile][I] && !IsPassiveVar[CurFile][I])
- {
- NumDataValuesToWrite[CurFile] += NumCells;
- NumRunningVarValues[CurFile][VIndex] += NumCells;
- }
- }
- else if (ValueLocation[I] == ValueLocation_Nodal)
- {
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)0);
- if (!IsSharedVar[CurFile][I] && !IsPassiveVar[CurFile][I])
- {
- NumDataValuesToWrite[CurFile] += NumNodes;
- NumRunningVarValues[CurFile][VIndex] += NumNodes;
- }
- }
- else
- {
- #if defined MAKEARCHIVE
- PRINT2("Err: (TECZNE112) Bad zone value location for file %d, variable %d.\n", CurFile + 1, I + 1);
- #endif
- NumErrs[CurFile]++;
- return(-1);
- }
- }
- }
- else
- {
- LgIndex_t NumNodes;
- if (ZoneType[CurFile] == ORDERED)
- {
- NumNodes = IMax[CurFile] * JMax[CurFile] * KMax[CurFile];
- }
- else
- {
- NumNodes = IMax[CurFile];
- }
- for (I = 0; I < NumVars[CurFile]; I++)
- {
- int VIndex;
- if (IsSharedVar[CurFile][I])
- VIndex = ShareVarFromZone[I] - 1;
- else
- VIndex = I;
- if (VIndex == 0)
- NumRunningVarValues[CurFile][I] = 0;
- else
- NumRunningVarValues[CurFile][VIndex] = NumRunningVarValues[CurFile][VIndex-1];
- IsCellCentered[CurFile][VIndex] = FALSE;
- if (!IsSharedVar[CurFile][I] && !IsPassiveVar[CurFile][I])
- {
- NumDataValuesToWrite[CurFile] += NumNodes;
- NumRunningVarValues[CurFile][VIndex] += NumNodes;
- }
- }
- }
- /*
- * As of binary version 108 Tecplot introduced
- * the ability to output its auto-generated face
- * neighbor array in its raw form. For now
- * TecIO will always decline to perform this
- * step and instead fall back to the delivering
- * one neighbor at a time.
- */
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)0); /* IsRawFNAvailable */
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)NumFaceConnections[CurFile][CurZone[CurFile]]);
- if (NumFaceConnections[CurFile][CurZone[CurFile]] > 0)
- {
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)FaceNeighborMode[CurFile]);
- if (ZoneType[CurFile] != ORDERED)
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)0); /* FEFaceNeighborsComplete */
- }
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)IMax[CurFile]);
- if (ZoneType[CurFile] == FEPOLYGON ||
- ZoneType[CurFile] == FEPOLYHEDRON)
- {
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)KMax[CurFile]);
- /*
- * As of binary version 111 these items moved from the data section to
- * the header.
- */
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)TotalNumFaceNodes[CurFile][CurZone[CurFile]]);
- if (TotalNumFaceBndryFaces[CurFile] > 0)
- {
- /* Each boundary face must have >= 1 boundary connection. */
- if (TotalNumFaceBndryConns[CurFile] < TotalNumFaceBndryFaces[CurFile])
- {
- #if defined MAKEARCHIVE
- PRINT1("Err: (TECZNE112) There must be at least 1 boundary connection for each boundary face in zone %d.\n",
- CurZone[CurFile] + 1);
- PRINT2(" %d boundary faces and %d boundary connections were specified.\n",
- TotalNumFaceBndryFaces[CurFile], TotalNumFaceBndryConns[CurFile]);
- #endif
- NumErrs[CurFile]++;
- return(-1);
- }
- /*
- * As a convenience for the ASCII format, TecUtil, and TECIO layers if any
- * boundary connections exists we automatically add a no-neighboring
- * connection as the first item so that they can user 0 for no-neighboring
- * element in the element list regardless if they have boundary connections
- * or not.
- */
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)TotalNumFaceBndryFaces[CurFile] + 1); /* ...add a boundary face for no neighboring element as a convenience */
- }
- else
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)TotalNumFaceBndryFaces[CurFile]);
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)TotalNumFaceBndryConns[CurFile]);
- }
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)JMax[CurFile]);
- if (ZoneType[CurFile] == ORDERED)
- {
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)KMax[CurFile]);
- }
- else
- {
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)ICellMax[CurFile]);
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)JCellMax[CurFile]);
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)KCellMax[CurFile]);
- }
- /*
- * Aux data. This has to be over-written by the aux data writing routine.
- * Because it currently at the end of the header section we don't need to
- * keep track of the position for seeking back to it.
- */
- WriteBinaryInt32(HeadFile[CurFile], (LgIndex_t)0);
- WriteBinaryReal(BlckFile[CurFile],
- (double)ZoneMarker,
- FieldDataType_Float);
- for (I = 0; I < NumVars[CurFile]; I++)
- {
- if (!WriteFieldDataType(BlckFile[CurFile],
- (FieldDataType_e)FieldDataType,
- TRUE))
- {
- WriteErr("TECZNE112");
- return (-1);
- }
- }
- /* Passive variable identification */
- if (PassiveVarList)
- {
- WriteBinaryInt32(BlckFile[CurFile], 1);
- for (I = 0; I < NumVars[CurFile]; I++)
- WriteBinaryInt32(BlckFile[CurFile], PassiveVarList[I]);
- }
- else
- WriteBinaryInt32(BlckFile[CurFile], 0);
- /* get the CurVar[CurFile] on the first active variable */
- CurVar[CurFile] = -1;
- AdvanceToNextVarWithValues();
- /* Variable & Connectivity Sharing */
- if (ShareVarFromZone)
- {
- WriteBinaryInt32(BlckFile[CurFile], 1);
- for (I = 0; I < NumVars[CurFile]; I++)
- WriteBinaryInt32(BlckFile[CurFile], ShareVarFromZone[I] - 1);
- }
- else
- WriteBinaryInt32(BlckFile[CurFile], 0);
- WriteBinaryInt32(BlckFile[CurFile], *ShareConnectivityFromZone - 1);
- /*
- * Create place holders or the variable min/max value. We will come back
- * later after writing the data portion with the real min/max values. In the
- * mean time, keep track of the starting point so we can seek back to this
- * place.
- */
- MinMaxOffset[CurFile][CurZone[CurFile]] = (FileOffset_t)TP_FTELL(BlckFile[CurFile]->File);
- for (I = 0; I < NumVars[CurFile]; I++)
- {
- /* initialize to unset values */
- VarMinValue[CurFile][I] = LARGEDOUBLE;
- VarMaxValue[CurFile][I] = -LARGEDOUBLE;
- if (!IsSharedVar[CurFile][I] && !IsPassiveVar[CurFile][I])
- {
- WriteBinaryReal(BlckFile[CurFile], 0.0, FieldDataType_Double);
- WriteBinaryReal(BlckFile[CurFile], 0.0, FieldDataType_Double);
- }
- }
- #if defined MAKEARCHIVE
- if (DebugLevel[CurFile])
- {
- PRINT1("Writing Zone %d:\n", CurZone[CurFile] + 1);
- PRINT1(" Title = %s\n", ZnTitle);
- PRINT1(" Type = %s\n", ZoneTypes[ZoneType[CurFile]]);
- PRINT1(" IMax = %d\n", IMax[CurFile]);
- PRINT1(" JMax = %d\n", JMax[CurFile]);
- PRINT1(" KMax = %d\n", KMax[CurFile]);
- if (ShareVarFromZone)
- {
- char DupList[1024] = "";
- for (I = 0; I < NumVars[CurFile]; I++)
- {
- if (I > 0)
- strcat(DupList, ",");
- sprintf(&DupList[strlen(DupList)], "%d", ShareVarFromZone[I]);
- }
- PRINT1(" DupList = %s\n", DupList);
- }
- }
- #endif
- return (0);
- }
- INTEGER4 LIBCALL TECZNE111(char *ZnTitle,
- INTEGER4 *ZnType,
- INTEGER4 *IMxOrNumPts,
- INTEGER4 *JMxOrNumElements,
- INTEGER4 *KMxOrNumFaces,
- INTEGER4 *ICellMx,
- INTEGER4 *JCellMx,
- INTEGER4 *KCellMx,
- double *SolutionTime,
- INTEGER4 *StrandID,
- INTEGER4 *ParentZone,
- INTEGER4 *IsBlk,
- INTEGER4 *NumFaceConn,
- INTEGER4 *FNMode,
- INTEGER4 *NumFaceNodes,
- INTEGER4 *NumFaceBndryFaces,
- INTEGER4 *NumFaceBndryConns,
- INTEGER4 *PassiveVarList,
- INTEGER4 *ValueLocation,
- INTEGER4 *ShareVarFromZone,
- INTEGER4 *ShareConnectivityFromZone)
- {
- return TECZNE112(ZnTitle,
- ZnType,
- IMxOrNumPts,
- JMxOrNumElements,
- KMxOrNumFaces,
- ICellMx,
- JCellMx,
- KCellMx,
- SolutionTime,
- StrandID,
- ParentZone,
- IsBlk,
- NumFaceConn,
- FNMode,
- NumFaceNodes,
- NumFaceBndryFaces,
- NumFaceBndryConns,
- PassiveVarList,
- ValueLocation,
- ShareVarFromZone,
- ShareConnectivityFromZone);
- }
- INTEGER4 LIBCALL TECZNE110(char *ZnTitle,
- INTEGER4 *ZnType,
- INTEGER4 *IMxOrNumPts,
- INTEGER4 *JMxOrNumElements,
- INTEGER4 *KMx,
- INTEGER4 *ICellMx,
- INTEGER4 *JCellMx,
- INTEGER4 *KCellMx,
- double *SolutionTime,
- INTEGER4 *StrandID,
- INTEGER4 *ParentZone,
- INTEGER4 *IsBlk,
- INTEGER4 *NumFaceConn,
- INTEGER4 *FNMode,
- INTEGER4 *PassiveVarList,
- INTEGER4 *ValueLocation,
- INTEGER4 *ShareVarFromZone,
- INTEGER4 *ShareConnectivityFromZone)
- {
- INTEGER4 NumFaceNodes = 0;
- INTEGER4 NumFaceBndryFaces = 0;
- INTEGER4 NumFaceBndryConns = 0;
- return TECZNE112(ZnTitle,
- ZnType,
- IMxOrNumPts,
- JMxOrNumElements,
- KMx,
- ICellMx,
- JCellMx,
- KCellMx,
- SolutionTime,
- StrandID,
- ParentZone,
- IsBlk,
- NumFaceConn,
- FNMode,
- &NumFaceNodes,
- &NumFaceBndryFaces,
- &NumFaceBndryConns,
- PassiveVarList,
- ValueLocation,
- ShareVarFromZone,
- ShareConnectivityFromZone);
- }
- INTEGER4 LIBCALL TECZNE100(char *ZnTitle,
- INTEGER4 *ZnType,
- INTEGER4 *IMxOrNumPts,
- INTEGER4 *JMxOrNumElements,
- INTEGER4 *KMx,
- INTEGER4 *ICellMx,
- INTEGER4 *JCellMx,
- INTEGER4 *KCellMx,
- INTEGER4 *IsBlk,
- INTEGER4 *NumFaceConn,
- INTEGER4 *FNMode,
- INTEGER4 *ValueLocation,
- INTEGER4 *ShareVarFromZone,
- INTEGER4 *ShareConnectivityFromZone)
- {
- double SolutionTime = 0.0;
- INTEGER4 StrandID = STRAND_ID_STATIC + 1; /* TECXXX is ones based for StrandID */
- INTEGER4 ParentZone = BAD_SET_VALUE + 1; /* TECXXX is ones based for ParentZone */
- INTEGER4 NumFaceNodes = 0;
- INTEGER4 NumFaceBndryFaces = 0;
- INTEGER4 NumFaceBndryConns = 0;
- return TECZNE112(ZnTitle,
- ZnType,
- IMxOrNumPts,
- JMxOrNumElements,
- KMx,
- ICellMx,
- JCellMx,
- KCellMx,
- &SolutionTime,
- &StrandID,
- &ParentZone,
- IsBlk,
- NumFaceConn,
- FNMode,
- &NumFaceNodes,
- &NumFaceBndryFaces,
- &NumFaceBndryConns,
- NULL, /* PassiveVarList */
- ValueLocation,
- ShareVarFromZone,
- ShareConnectivityFromZone);
- }
- #if !defined INDEX_16_BIT // not supported in this test-only mode
- INTEGER4 LIBCALL TECZNE(char *ZoneTitle,
- INTEGER4 *IMx,
- INTEGER4 *JMx,
- INTEGER4 *KMx,
- char *ZFormat,
- char *DupList)
- {
- LgIndex_t ZoneType;
- LgIndex_t IsBlock;
- LgIndex_t *ShareVarFromZone = NULL;
- LgIndex_t ShareConnectivityFromZone;
- LgIndex_t Result = 0;
- if (ZFormat == NULL)
- Result = -1;
- else if (!strcmp(ZFormat, "BLOCK"))
- {
- IsBlock = 1;
- ZoneType = ZoneType_Ordered;
- }
- else if (!strcmp(ZFormat, "FEBLOCK"))
- {
- IsBlock = 1;
- switch (*KMx)
- {
- /*
- * From preplot.c:
- *
- * ZoneType 0=ORDERED,1=FELINESEG,2=FETRIANGLE,
- * 3=FEQUADRILATERAL,4=FETETRAHEDRON,5=FEBRICK
- */
- case 0: /* Triangular. */
- ZoneType = 2;
- break;
- case 1: /* Quadrilateral */
- …
Large files files are truncated, but you can click here to view the full file