Boolean_t BondAtomPairsGetFromOffset(BondAtomPairs_pa BondAtomPairs, LgIndex_t PointOffset, LgIndex_t *Atom1, LgIndex_t *Atom2) { Boolean_t IsOk = TRUE; ArrListItem_u Item; REQUIRE(BondAtomPairsIsValid(BondAtomPairs)); REQUIRE(PointOffset >= 0 && PointOffset < BondAtomPairsGetCount(BondAtomPairs)); REQUIRE(VALID_REF(Atom1)); REQUIRE(VALID_REF(Atom2)); Item = ArrListGetItem(BondAtomPairs->Atom1, PointOffset); *Atom1 = Item.Long; Item = ArrListGetItem(BondAtomPairs->Atom2, PointOffset); *Atom2 = Item.Long; ENSURE(VALID_REF(Atom1)); ENSURE(VALID_REF(Atom2)); ENSURE(VALID_BOOLEAN(IsOk)); return IsOk; }
void FileStreamDealloc(FileStream_s **FileStream) { REQUIRE(VALID_REF(FileStream)); REQUIRE(VALID_REF(*FileStream) || *FileStream == NULL); if (*FileStream != NULL) { FREE_ITEM(*FileStream, "FileStream"); *FileStream = NULL; } ENSURE(*FileStream == NULL); }
Boolean_t ZoneSpecItemDestructor(void *ItemRef, ArbParam_t ClientData) { ZoneSpec_s **ZoneSpecRef = (ZoneSpec_s **)ItemRef; REQUIRE(VALID_REF(ZoneSpecRef)); REQUIRE(VALID_REF(*ZoneSpecRef) || *ZoneSpecRef == NULL); if (*ZoneSpecRef != NULL) ZoneSpecDealloc(ZoneSpecRef); ENSURE(*ZoneSpecRef == NULL); return TRUE; }
void ZoneSpecDealloc(ZoneSpec_s **ZoneSpec) { REQUIRE(VALID_REF(ZoneSpec)); REQUIRE(VALID_REF(*ZoneSpec) || *ZoneSpec == NULL); if (*ZoneSpec != NULL) { CleanoutZoneSpec(*ZoneSpec); FREE_ITEM(*ZoneSpec, "ZoneSpec structure"); *ZoneSpec = NULL; } ENSURE(*ZoneSpec == NULL); }
FileStream_s *FileStreamAlloc(FILE *File, Boolean_t IsByteOrderNative) { REQUIRE(VALID_REF(File) || File == NULL); FileStream_s *Result = ALLOC_ITEM(FileStream_s, "FileStream"); if (Result != NULL) { Result->File = File; Result->IsByteOrderNative = IsByteOrderNative; } ENSURE(VALID_REF(Result) || Result == NULL); return Result; }
void SetZoneSpecDefaults(ZoneSpec_s *ZoneSpec) { REQUIRE(VALID_REF(ZoneSpec)); ZoneSpec->Name = NULL; ZoneSpec->UniqueID = INVALID_UNIQUE_ID; ZoneSpec->ParentZone = BAD_SET_VALUE; ZoneSpec->StrandID = STRAND_ID_STATIC; ZoneSpec->SolutionTime = 0.0; ZoneSpec->NumPtsI = 0; ZoneSpec->NumPtsJ = 0; ZoneSpec->NumPtsK = 0; ZoneSpec->ICellDim = 0; // ...currently not used ZoneSpec->JCellDim = 0; // ...currently not used ZoneSpec->KCellDim = 0; // ...currently not used ZoneSpec->Type = ZoneType_Ordered; ZoneSpec->ZoneLoadInfo.PresetZoneColor = NoColor_C; ZoneSpec->ZoneLoadInfo.IsInBlockFormat = TRUE; ZoneSpec->AuxData = NULL; ZoneSpec->BuildZoneOptInfo = TRUE; /* classic data only */ ZoneSpec->FNMode = FaceNeighborMode_LocalOneToOne; ZoneSpec->FNAreCellFaceNbrsSupplied = FALSE; /* polytope data only */ ZoneSpec->NumFaceNodes = 0; ZoneSpec->NumFaceBndryFaces = 0; ZoneSpec->NumFaceBndryItems = 0; }
/** * Determine if the BondAtomPairs handle is sane. * * param BondAtomPairs * BondAtomPairs structure in question. * * return * TRUE if the BondAtomPairs structure is valid, otherwise FALSE. */ Boolean_t BondAtomPairsIsValid(BondAtomPairs_pa BondAtomPairs) { Boolean_t IsValid = FALSE; IsValid = (VALID_REF(BondAtomPairs) && VALID_REF(BondAtomPairs->Atom1) && ArrListIsValid(BondAtomPairs->Atom1) && VALID_REF(BondAtomPairs->Atom2) && ArrListIsValid(BondAtomPairs->Atom2)); /* Require the same count for each array list in BondAtomPairs structure. */ if (IsValid) { LgIndex_t Count = ArrListGetCount(BondAtomPairs->Atom1); IsValid = (ArrListGetCount(BondAtomPairs->Atom2) == Count); } ENSURE(VALID_BOOLEAN(IsValid)); return IsValid; }
/** * Cleanout the contents of the zone spec item but leaves the zone spec item. * This effectively leaves the zone spec structure in the same state as calling * ZoneSpecAlloc initially. * * param ZoneSpec * Zone spec item to cleanup. */ void CleanoutZoneSpec(ZoneSpec_s *ZoneSpec) { REQUIRE(VALID_REF(ZoneSpec)); if (ZoneSpec->Name != NULL) FREE_ARRAY(ZoneSpec->Name, "ZoneSpec name"); if (ZoneSpec->AuxData != NULL) AuxDataDealloc(&ZoneSpec->AuxData); SetZoneSpecDefaults(ZoneSpec); }
ZoneSpec_s *ZoneSpecAlloc(void) { ZoneSpec_s *Result; Result = (ZoneSpec_s *)ALLOC_ITEM(ZoneSpec_s, "ZoneSpec structure"); if (Result != NULL) SetZoneSpecDefaults(Result); ENSURE(Result == NULL || VALID_REF(Result)); return Result; }
void ZoneSpecExcludeBndryConnsFromMetrics(ZoneSpec_s* ZoneSpec) { REQUIRE(VALID_REF(ZoneSpec)); /* classic data face connectivity fixup (leave FNMode as-is) */ ZoneSpec->FNAreCellFaceNbrsSupplied = FALSE; // ...if we invalidate boundary connections CellFaceNbrs must now be auto-generated /* polytope data face connectivity fixup */ ZoneSpec->NumFaceBndryFaces = 0; ZoneSpec->NumFaceBndryItems = 0; }
Boolean_t SurfaceFitGetPointFromOffset(const SurfaceFit_pa SurfaceFit, const LgIndex_t PointOffset, double *Coord1, double *Coord2, double *Var) { Boolean_t IsOk = TRUE; ArrListItem_u Item; REQUIRE(SurfaceFitIsValid(SurfaceFit)); REQUIRE(PointOffset >= 0 && PointOffset < SurfaceFitGetPointCount(SurfaceFit)); REQUIRE(VALID_REF(Coord1)); REQUIRE(VALID_REF(Coord2)); REQUIRE(VALID_REF(Var)); Item = ArrListGetItem(SurfaceFit->Coord1, PointOffset); *Coord1 = Item.Double; Item = ArrListGetItem(SurfaceFit->Coord2, PointOffset); *Coord2 = Item.Double; Item = ArrListGetItem(SurfaceFit->Var, PointOffset); *Var = Item.Double; ENSURE(VALID_REF(Coord1)); ENSURE(VALID_REF(Coord2)); ENSURE(VALID_REF(Var)); ENSURE(VALID_BOOLEAN(IsOk)); return IsOk; }
/** * Determine if the SurfaceFit handle is sane. * * param SurfaceFit * SurfaceFit structure in question. * * return * TRUE if the SurfaceFit structure is valid, otherwise FALSE. */ Boolean_t SurfaceFitIsValid(SurfaceFit_pa SurfaceFit) { Boolean_t IsValid = FALSE; IsValid = (VALID_REF(SurfaceFit) && VALID_REF(SurfaceFit->Coord1) && ArrListIsValid(SurfaceFit->Coord1) && VALID_REF(SurfaceFit->Coord2) && ArrListIsValid(SurfaceFit->Coord2) && VALID_REF(SurfaceFit->Var) && ArrListIsValid(SurfaceFit->Var)); if (IsValid) IsValid = VALID_ENUM(SurfaceFit->SurfFitType, SurfFitType_e); /* Require the same count for each array list in SurfaceFit structure. */ if (IsValid) { LgIndex_t Count = ArrListGetCount(SurfaceFit->Coord1); IsValid = (ArrListGetCount(SurfaceFit->Coord2) == Count); if (IsValid) IsValid = (ArrListGetCount(SurfaceFit->Var) == Count); } ENSURE(VALID_BOOLEAN(IsValid)); return IsValid; }
/** * Deallocates the SurfaceFit handle and set the handle to NULL. * * note * Item destruction is the responsibility of the caller. * * param * Reference to a SurfaceFit handle. */ void SurfaceFitDealloc(SurfaceFit_pa *SurfaceFit) { REQUIRE(VALID_REF(SurfaceFit)); REQUIRE(SurfaceFitIsValid(*SurfaceFit) || *SurfaceFit == NULL); if (*SurfaceFit != NULL) { /* release the ArrList's */ if ((*SurfaceFit)->Coord1 != NULL) ArrListDealloc(&((*SurfaceFit)->Coord1)); if ((*SurfaceFit)->Coord2 != NULL) ArrListDealloc(&((*SurfaceFit)->Coord2)); if ((*SurfaceFit)->Var != NULL) ArrListDealloc(&((*SurfaceFit)->Var)); /* release the list structure itself */ FREE_ITEM(*SurfaceFit, "SurfaceFit structure"); *SurfaceFit = NULL; } ENSURE(*SurfaceFit == NULL); }
/** * Deallocates the BondAtomPairs handle and set the handle to NULL. * * note * Item destruction is the responsibility of the caller. * * param * Reference to a BondAtomPairs handle. */ void BondAtomPairsDealloc(BondAtomPairs_pa *BondAtomPairs) { REQUIRE(VALID_REF(BondAtomPairs)); REQUIRE(BondAtomPairsIsValid(*BondAtomPairs) || *BondAtomPairs == NULL); if (*BondAtomPairs != NULL) { /* release the ArrList's */ if ((*BondAtomPairs)->Atom1 != NULL) ArrListDealloc(&((*BondAtomPairs)->Atom1)); if ((*BondAtomPairs)->Atom2 != NULL) ArrListDealloc(&((*BondAtomPairs)->Atom2)); /* Notify Tecplot of memory usage change */ TecUtilMemoryChangeNotify(- (Int64_t)((*BondAtomPairs)->MemUsageReported)); (*BondAtomPairs)->MemUsageReported = 0; /* release the list structure itself */ FREE_ITEM(*BondAtomPairs, "BondAtomPairs structure"); *BondAtomPairs = NULL; } ENSURE(*BondAtomPairs == NULL); }
___1405 *___1402(FILE *File, ___372 ___2007) { REQUIRE(VALID_REF(File) || File == NULL); ___1405 *___3359 = ALLOC_ITEM(___1405, "FileStream"); if (___3359 != NULL) { ___3359->File = File; ___3359->___2007 = ___2007; } ENSURE(VALID_REF(___3359) || ___3359 == NULL); return ___3359; } void ___1403(___1405 **___1401) { REQUIRE(VALID_REF(___1401)); REQUIRE(VALID_REF(*___1401) || *___1401 == NULL); if (*___1401 != NULL) { ___1531(*___1401, "FileStream"); *___1401 = NULL; } ENSURE(*___1401 == NULL); }
INSTANTIATE_READ_VALUE_FOR_TYPE(uint8_t, false) INSTANTIATE_READ_VALUE_FOR_TYPE(uint16_t, false) INSTANTIATE_READ_VALUE_FOR_TYPE(int32_t, false) INSTANTIATE_READ_VALUE_FOR_TYPE(uint32_t, false) INSTANTIATE_READ_VALUE_FOR_TYPE(uint64_t, true) INSTANTIATE_READ_VALUE_FOR_TYPE(uint64_t, false) INSTANTIATE_READ_VALUE_FOR_TYPE(float, false) INSTANTIATE_READ_VALUE_FOR_TYPE(double, false) template<typename T, bool ___2025, int baseValue> ___372 readValues( ___1399& file, size_t ___2796, T* ___4299, IODescription const& ___972) { ___372 ___2039 = ___4226; REQUIRE(file.___2041()); REQUIRE(___2796>0); REQUIRE(VALID_REF(___4299)); REQUIRE(___972.___2067()); if (file.___2002()) { if (!___972.isEmpty()) ___2039 = readAndVerifyDescription(file, ___972); for (size_t ___1841 = 0; ___2039 && ___1841 < ___2796; ___1841++) { ___2039 = readAsciiValue<T, ___2025, baseValue>(file, ___4299[___1841]); ___2039 = ___2039 && consumeWhitespace(file); } } else { ___2039 = (file.fread(&___4299[0], sizeof(T), ___2796) == ___2796); } if ( !___2039 && !___972.isEmpty() ) { char formattedDescription[STRING_SIZE]; ___972.getFormattedDescription(formattedDescription, STRING_SIZE); ___1186("Error reading %" PRIu64 " %s values for %s data block.", uint64_t(___2796), ___198<T, ___2025>::typeName, formattedDescription); } ENSURE(VALID_BOOLEAN(___2039)); return ___2039; }
return ___3358; } char* FileStreamReader::fgets(char* s, int size) { REQUIRE(VALID_REF(s)); REQUIRE(size >= 0); REQUIRE(___2041()); char* ___3358 = ::fgets(s, size, m_fileIOStream.handle()); #ifdef PROFILE_FILE_ACCESS if ( ___3358 != NULL ) { statistics().numReadWritesPerformed++; statistics().___2780 += ___3358 ? strlen(s) : 0; } #endif return ___3358; } int FileStreamReader::feof() { REQUIRE(___2041()); return ::feof(m_fileIOStream.handle()); } int FileStreamReader::getc() { REQUIRE(___2041()); int ___3358 = ::getc(m_fileIOStream.handle());
template <typename T, bool ___2025, int base> ___372 encodeAsciiValue(char *str, int ___418, T const& ___4298) { REQUIRE(VALID_REF(str)); REQUIRE(___418 > 0); int nChars = 0; if (___4298 == ___4298) nChars = snprintf(str, ___418, ___199<T, ___2025>::___1474, -___199<T, ___2025>::size, ___4298 + base); else nChars = snprintf(str, ___418, ___199<T, ___2025>::___1474, -___199<T, ___2025>::size, (T)0); ___372 ___2039 = (nChars > 0 && nChars < ___418); ENSURE(VALID_BOOLEAN(___2039)); return ___2039; } template ___372 encodeAsciiValue<uint32_t, false, 0>(char *str, int ___418, uint32_t const& ___4298);
SPECIALIZE_MIN_MAX_ENCODING_FOR_TYPE(uint8_t) SPECIALIZE_MIN_MAX_ENCODING_FOR_TYPE(int16_t) SPECIALIZE_MIN_MAX_ENCODING_FOR_TYPE(int32_t) SPECIALIZE_MIN_MAX_ENCODING_FOR_TYPE(float) SPECIALIZE_MIN_MAX_ENCODING_FOR_TYPE(double) template <typename T, bool ___2025, int base> ___372 ___4563(FileWriterInterface& file, char const* ___972, ___81 ___1251, size_t ___2797, T const* ___4299, size_t ___4334 ) { ___372 ___2039 = ___4226; REQUIRE(file.___2041()); REQUIRE(VALID_DESCRIPTION(___972)); REQUIRE("extraID could have any value. NO_EXTRA_ID show only the description"); REQUIRE(___2797>0); REQUIRE(VALID_REF(___4299)); if ( file.___2002() ) { ASSERT_ONLY(___1393 beginningLocation = file.fileLoc()); std::string ___1418 = ___972; if ( ___1251 != ___2745 ) ___1418 += ___4187(___1251+1); #if defined ASCII_ANNOTATE_TYPES ___1418.append(1, ' ').append(AsciiTypeString<T>::typeString); #endif if ( ___2797 == 1 ) file.fprintf("%*s ", -___206, ___1418.c_str()); else file.fprintf("%*s\r\n", -___206, ___1418.c_str()); const int buffSize = 100; char buff[buffSize]; std::string outputBuffer; for ( size_t pos = 1; pos <= ___2797; ++pos ) { ___2039 = ___2039 && encodeAsciiValue<T, ___2025, base>(buff, buffSize, ___4299[pos-1]); outputBuffer.append(buff); if( (pos % ___4334) == 0 || (pos == ___2797 ) ) outputBuffer.append("\r\n"); else outputBuffer.append(" "); } file.fwrite(outputBuffer.c_str(), sizeof(char), outputBuffer.size()); ASSERT_ONLY(___1393 endingLocation = file.fileLoc()); ASSERT_ONLY(___1393 outputSize = (___1393)___206 + 2 + outputBuffer.size()); ___478(endingLocation - beginningLocation == outputSize); } else { file.fwrite(___4299, sizeof(T), ___2797); } ENSURE(VALID_BOOLEAN(___2039)); return ___2039; } template <typename OutType> ___372 ___4528( FileWriterInterface& file, char const* ___972, ___81 ___1251, size_t ___2797, ___2479 const* ___4299, size_t ___4334 ) { ___2240<std::pair<OutType, OutType> > outputArray; ___372 ___2039 = outputArray.alloc(___2797); if (___2039) { for (size_t i = 0; i < ___2797; ++i) { outputArray[i].first = static_cast<OutType>(___4299[i].minValue()); outputArray[i].second = static_cast<OutType>(___4299[i].maxValue()); } ___2039 = ___4563<std::pair<OutType, OutType>, false, 0>(file, ___972, ___1251, ___2797, &outputArray[0], ___4334); } return ___2039; } template <typename T, bool ___2025> uint64_t arrayValueSizeInFile(bool ___2002) { if (___2002) return ___199<T, ___2025>::size + ASCII_SPACING_LEN; return sizeof(T); } template <typename T, bool ___2025> uint64_t arraySizeInFile(size_t ___2797, bool ___2002) { uint64_t charsPerNumber = arrayValueSizeInFile<T, ___2025>(___2002); ___478(charsPerNumber > 0); uint64_t ___3358 = static_cast<uint64_t>(___2797) * charsPerNumber; if (___2002) ___3358 += static_cast<uint64_t>(___206) + ASCII_SPACING_LEN; return ___3358; } template <typename T, bool ___2025> uint64_t valueSizeInFile(bool ___2002) { return arraySizeInFile<T, ___2025>(1, ___2002); }
return ___2039; } ___372 FileStreamWriter::close(bool ___3361) { return m_fileIOStream.close(___3361); } ___1393 FileStreamWriter::fileLoc() { REQUIRE(___2041()); return m_fileIOStream.fileLoc(); } ___372 FileStreamWriter::___3460() { REQUIRE(___2041()); return m_fileIOStream.___3460(); } ___372 FileStreamWriter::___3459(___1393 fileLoc) { REQUIRE(___2041()); REQUIRE(fileLoc != ___330); return m_fileIOStream.___3459(fileLoc); } ___372 FileStreamWriter::seekToFileEnd() { REQUIRE(___2041()); return m_fileIOStream.seekToFileEnd(); } std::string const& FileStreamWriter::___1394() const { return m_fileIOStream.___1394(); } void FileStreamWriter::___3494(___372 ___2002) { REQUIRE(VALID_BOOLEAN(___2002)); m_fileIOStream.___3494(___2002); } ___372 FileStreamWriter::___2002() const { return m_fileIOStream.___2002(); } void FileStreamWriter::setDataFileType(DataFileType_e ___844) { REQUIRE(VALID_ENUM(___844, DataFileType_e)); m_fileIOStream.setDataFileType(___844); } DataFileType_e FileStreamWriter::___844() const { return m_fileIOStream.___844(); } class FileIOStatistics& FileStreamWriter::statistics() { return m_fileIOStream.statistics(); } size_t FileStreamWriter::fwrite(void const* ___416, size_t size, size_t count) { REQUIRE(___2041()); REQUIRE(VALID_REF(___416)); size_t ___3358 = ::fwrite(___416, size, count, m_fileIOStream.handle()); #ifdef PROFILE_FILE_ACCESS if ( ___3358 > 0 ) { statistics().numReadWritesPerformed++; statistics().___2780 += ___3358*size; } #endif return ___3358; } int FileStreamWriter::fprintf(char const* format, ...) { REQUIRE(___2041()); REQUIRE(VALID_NON_ZERO_LEN_STR(format)); va_list args; va_start(args, format); int ___3358 = ::vfprintf(m_fileIOStream.handle(), format, args); va_end (args);
return ___3358; } int FileStreamReader::fscanf(char const* format, void* ptr1, void* ptr2, void* ptr3) { REQUIRE(___2041()); REQUIRE(VALID_NON_ZERO_LEN_STR(format)); REQUIRE(VALID_REF(ptr1)); REQUIRE(VALID_REF(ptr2)); REQUIRE(VALID_REF(ptr3)); #ifdef PROFILE_FILE_ACCESS ___1393 startLoc = fileLoc(); #endif int ___3358 = ::fscanf(m_fileIOStream.handle(), format, ptr1, ptr2, ptr3); #ifdef PROFILE_FILE_ACCESS ___1393 endLoc = fileLoc(); statistics().numReadWritesPerformed++; statistics().___2780 += (endLoc-startLoc); #endif return ___3358; } }}
return ___2039; } ___372 FileStreamReader::close(bool ___3361) { return m_fileIOStream.close(___3361); } ___1393 FileStreamReader::fileLoc() { REQUIRE(___2041()); return m_fileIOStream.fileLoc(); } ___372 FileStreamReader::___3460() { REQUIRE(___2041()); return m_fileIOStream.___3460(); } ___372 FileStreamReader::___3459(___1393 fileLoc) { REQUIRE(___2041()); REQUIRE(fileLoc != ___330); return m_fileIOStream.___3459(fileLoc); } ___372 FileStreamReader::seekToFileEnd() { REQUIRE(___2041()); return m_fileIOStream.seekToFileEnd(); } std::string const& FileStreamReader::___1394() const { return m_fileIOStream.___1394(); } void FileStreamReader::___3494(___372 ___2002) { REQUIRE(VALID_BOOLEAN(___2002)); m_fileIOStream.___3494(___2002); } ___372 FileStreamReader::___2002() const { return m_fileIOStream.___2002(); } void FileStreamReader::setDataFileType(DataFileType_e ___844) { REQUIRE(VALID_ENUM(___844, DataFileType_e)); m_fileIOStream.setDataFileType(___844); } DataFileType_e FileStreamReader::___844() const { return m_fileIOStream.___844(); } class FileIOStatistics& FileStreamReader::statistics() { return m_fileIOStream.statistics(); } size_t FileStreamReader::fread(void* ___416, size_t size, size_t count) { REQUIRE(VALID_REF(___416)); REQUIRE(___2041()); size_t ___3358 = ::fread(___416, size, count, m_fileIOStream.handle()); #ifdef PROFILE_FILE_ACCESS if ( ___3358 > 0 ) { statistics().numReadWritesPerformed++; statistics().___2780 += ___3358*size; } #endif return ___3358; } char* FileStreamReader::fgets(char* s, int size) { REQUIRE(VALID_REF(s)); REQUIRE(size >= 0); REQUIRE(___2041()); char* ___3358 = ::fgets(s, size, m_fileIOStream.handle());