#pragma once #include "ThirdPartyHeadersBegin.h" # include #include "ThirdPartyHeadersEnd.h" #include "SzlFileLoader.h" #include "IJK.h" namespace tecplot { namespace ___3933 { class IJKSubzoneInfo { private: ___1844 m_zoneIJKDim; ___1844 m_zoneLastIJKIndex; ___1844 m_subzoneItemsMaxIJKDim; ___2090::___2980 m_partition; ___1844 m_subzoneTilingIJKDim; ___1844 m_subzoneTilingIJKShift; ___2090::SubzoneOffset_t m_numSubzones; #if !defined NO_ASSERTS bool ___2492; #endif public: IJKSubzoneInfo( ___1844 const& zoneIJKDim, ___1844 const& subzoneMaxIJKDim, ___2090::___2980 ___2977, bool minimizeNumSubzones) : m_zoneIJKDim(zoneIJKDim) , m_zoneLastIJKIndex(zoneIJKDim.maxOp(1)-1) , m_subzoneItemsMaxIJKDim(subzoneMaxIJKDim) , m_partition(___2977) , m_subzoneTilingIJKDim(numSubzonesForDirection(zoneIJKDim.i(), ___2090::ItemOffset_t(subzoneMaxIJKDim.i()), minimizeNumSubzones), numSubzonesForDirection(zoneIJKDim.___2105(), ___2090::ItemOffset_t(subzoneMaxIJKDim.___2105()), minimizeNumSubzones), numSubzonesForDirection(zoneIJKDim.___2134(), ___2090::ItemOffset_t(subzoneMaxIJKDim.___2134()), minimizeNumSubzones)) , m_subzoneTilingIJKShift(subzoneShiftForDirection(zoneIJKDim.i(), ___2090::ItemOffset_t(subzoneMaxIJKDim.i()), minimizeNumSubzones), subzoneShiftForDirection(zoneIJKDim.___2105(), ___2090::ItemOffset_t(subzoneMaxIJKDim.___2105()), minimizeNumSubzones), subzoneShiftForDirection(zoneIJKDim.___2134(), ___2090::ItemOffset_t(subzoneMaxIJKDim.___2134()), minimizeNumSubzones)) , m_numSubzones( ___2090::SubzoneOffset_t(m_subzoneTilingIJKDim.blockSize()) ) #if !defined NO_ASSERTS , ___2492(minimizeNumSubzones) #endif { REQUIRE(zoneIJKDim>0); REQUIRE(subzoneMaxIJKDim>0); } IJKSubzoneInfo() : m_zoneIJKDim(0,0,0) , m_zoneLastIJKIndex(0,0,0) , m_subzoneItemsMaxIJKDim(0,0,0) , m_subzoneTilingIJKDim(0,0,0) , m_subzoneTilingIJKShift(0,0,0) , m_numSubzones(0) {} ~IJKSubzoneInfo() {} inline void swap(IJKSubzoneInfo& ___2888) { using std::swap; swap(m_zoneIJKDim, ___2888.m_zoneIJKDim); swap(m_zoneLastIJKIndex, ___2888.m_zoneLastIJKIndex); swap(m_subzoneItemsMaxIJKDim, ___2888.m_subzoneItemsMaxIJKDim); swap(m_subzoneTilingIJKDim, ___2888.m_subzoneTilingIJKDim); swap(m_subzoneTilingIJKShift, ___2888.m_subzoneTilingIJKShift); swap(m_numSubzones, ___2888.m_numSubzones); } inline void reset( ___1844 const& zoneIJKSize, ___1844 const& subzoneIJKMax, bool minimizeNumSubzones = DEFAULT_MINIMIZE_IJK_NUM_SUBZONES) { REQUIRE(zoneIJKSize>0); REQUIRE(subzoneIJKMax>0); REQUIRE(minimizeNumSubzones==DEFAULT_MINIMIZE_IJK_NUM_SUBZONES); m_zoneIJKDim = zoneIJKSize; m_zoneLastIJKIndex = zoneIJKSize.maxOp(1)-1; m_subzoneItemsMaxIJKDim = subzoneIJKMax; m_subzoneTilingIJKDim = ___1844( numSubzonesForDirection(zoneIJKSize.i(), ___2090::ItemOffset_t(subzoneIJKMax.i()), minimizeNumSubzones), numSubzonesForDirection(zoneIJKSize.___2105(), ___2090::ItemOffset_t(subzoneIJKMax.___2105()), minimizeNumSubzones), numSubzonesForDirection(zoneIJKSize.___2134(), ___2090::ItemOffset_t(subzoneIJKMax.___2134()), minimizeNumSubzones) ); m_subzoneTilingIJKShift = ___1844( subzoneShiftForDirection(zoneIJKSize.i(), ___2090::ItemOffset_t(subzoneIJKMax.i()), minimizeNumSubzones), subzoneShiftForDirection(zoneIJKSize.___2105(), ___2090::ItemOffset_t(subzoneIJKMax.___2105()), minimizeNumSubzones), subzoneShiftForDirection(zoneIJKSize.___2134(), ___2090::ItemOffset_t(subzoneIJKMax.___2134()), minimizeNumSubzones) ); m_numSubzones = ___2090::SubzoneOffset_t(m_subzoneTilingIJKDim.blockSize()); } inline bool ___2067() const { return m_zoneIJKDim > 0 && m_subzoneItemsMaxIJKDim > 0; } inline bool validSubzone(___2090::SubzoneOffset_t ___3880) const { return ___3880 < getNumSzs(); } inline bool validSzAddress(___2090::SubzoneAddress szAddress) const { return validSubzone(szAddress.subzoneOffset()) && szAddress.___2977() == m_partition; } inline bool validItemAddress(___2090 ___2089) const { return validSzAddress(___2089.subzoneAddress()) && ___2089.itemOffset() < numItemsInSz(___2089.subzoneOffset()); } ___81 getNumItems(void) const { return m_zoneIJKDim.blockSize(); } ___1844 const& ijkDim(void) const { return m_zoneIJKDim; } ___1844 const& ijkLastIndex(void) const { ___478(m_zoneLastIJKIndex == m_zoneIJKDim.maxOp(1)-1); return m_zoneLastIJKIndex; } ___2090::SubzoneOffset_t getNumSzs(void) const { ENSURE(m_numSubzones == ___2090::SubzoneOffset_t(m_subzoneTilingIJKDim.blockSize())); ENSURE(m_numSubzones == calcNumSubzones(m_zoneIJKDim, m_subzoneItemsMaxIJKDim, ___2492)); return m_numSubzones; } static inline ___2090::SubzoneOffset_t numSubzonesForDirection( ___81 itemIndexDim, ___2090::ItemOffset_t subzoneIndexMax, bool minimizeNumSubzones = DEFAULT_MINIMIZE_IJK_NUM_SUBZONES) { REQUIRE(itemIndexDim>0); REQUIRE(subzoneIndexMax<=___2090::MAX_ITEM_OFFSET+1); ___2090::SubzoneOffset_t numSubzonesForDir; if ( minimizeNumSubzones ) { numSubzonesForDir = ___2090::SubzoneOffset_t( (itemIndexDim+subzoneIndexMax-1)/subzoneIndexMax ); } else { numSubzonesForDir = ___2090::SubzoneOffset_t( 1+(itemIndexDim/subzoneIndexMax) ); } ENSURE(numSubzonesForDir>0); ENSURE((___81)numSubzonesForDir*subzoneIndexMax>=itemIndexDim); ENSURE( IMPLICATION(minimizeNumSubzones, ___81(numSubzonesForDir-1)*subzoneIndexMax0); REQUIRE(subzoneIJKMax>0); ___1844 const subzoneTilingIJK( numSubzonesForDirection(zoneIJKDim.i(), ___2090::ItemOffset_t(subzoneIJKMax.i()), minimizeIJKNumSubzones), numSubzonesForDirection(zoneIJKDim.___2105(), ___2090::ItemOffset_t(subzoneIJKMax.___2105()), minimizeIJKNumSubzones), numSubzonesForDirection(zoneIJKDim.___2134(), ___2090::ItemOffset_t(subzoneIJKMax.___2134()), minimizeIJKNumSubzones)); ___2090::SubzoneOffset_t const numSubzones = ___2090::SubzoneOffset_t(subzoneTilingIJK.blockSize()); ENSURE(numSubzones>0 && numSubzones <= zoneIJKDim.blockSize()); return numSubzones; } static inline ___2090::ItemOffset_t subzoneShiftForDirection( ___81 itemIndexDim, ___2090::ItemOffset_t subzoneIndexMax, bool minimizeNumSubzones = DEFAULT_MINIMIZE_IJK_NUM_SUBZONES) { REQUIRE(itemIndexDim>0); REQUIRE(subzoneIndexMax>=3 && subzoneIndexMax<=___2090::MAX_ITEM_OFFSET+1); ___2090::ItemOffset_t const remainder = ___2090::ItemOffset_t(itemIndexDim % subzoneIndexMax); ___2090::ItemOffset_t subzoneShift = (subzoneIndexMax-remainder)/2; if ( minimizeNumSubzones && remainder == 0 ) subzoneShift = 0; ENSURE(subzoneShift= 0); return indexStart; } ___1844 itemIJKEnd(___1844 const& szIJK) const { INVARIANT(m_subzoneTilingIJKShift < m_subzoneItemsMaxIJKDim); ___1844 const indexEnd = m_zoneIJKDim.minOp((szIJK + 1)*m_subzoneItemsMaxIJKDim - m_subzoneTilingIJKShift) - 1; ENSURE(indexEnd(m_subzoneTilingIJKDim.offsetAtIJK(szIJK))); ENSURE(validSzAddress(szAddress)); ENSURE(szIJKAtSzIndex(szAddress.subzoneOffset())==szIJK); return szAddress; } void subzoneIJKStartAndEnd( ___2090::SubzoneOffset_t ___3880, ___1844& ___1880, ___1844& ___1852) const { REQUIRE(___3880 < getNumSzs()); ___1844 const szIJK = szIJKAtSzIndex(___3880); ___1880 = itemIJKStart(szIJK); ___1852 = itemIJKEnd(szIJK); ENSURE(___1880(m_subzoneTilingIJKDim.offsetAtIJK(subzoneIJK))); ENSURE(validSzAddress(szAddress)); return szAddress; } ___2090::SubzoneAddress szAddressAtItemIndex(___81 itemIndex) const { REQUIRE(itemIndex(m_subzoneTilingIJKDim.offsetAtIJK(szIJK)); ___1844 const ___1880 = itemIJKStart(szIJK); ___1844 const ___1852 = itemIJKEnd(szIJK); ___1844 const localMax = ___1852-___1880+1; ___1844 const localIJK = itemIJK-___1880; ___478(localIJK<=localMax); ___2090::ItemOffset_t const itemOffset = ___2090::ItemOffset_t(localMax.offsetAtIJK(localIJK)); ENSURE(itemOffset& szAddresses) const; ___372 getSubzonesOnIndexLine( IJKLines_e whichLine, ___81 mIndex, ___81 nIndex, ___3269<___2090::SubzoneAddress>& szAddresses) const; }; }}