IJKZoneInfo.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. #pragma once
  2. #include "ThirdPartyHeadersBegin.h"
  3. #include <vector>
  4. #include <boost/unordered_map.hpp>
  5. #include "ThirdPartyHeadersEnd.h"
  6. #include "SzlFileLoader.h"
  7. #include "IJKSubzoneInfo.h"
  8. #include "MinMax.h"
  9. namespace tecplot
  10. {
  11. namespace ___3933
  12. {
  13. class ___1881
  14. {
  15. public:
  16. typedef boost::unordered_map<___2090::SubzoneOffset_t, std::vector<___2479>> NszMinMaxMap;
  17. static const ___1844 ijkCornerOffset[NUM_IJK_CELL_CORNERS];
  18. static const ___1844 ijkFaceNeighborOffset[NUM_IJK_CELL_FACES];
  19. private:
  20. IJKSubzoneInfo m_cszInfo;
  21. IJKSubzoneInfo m_nszInfo;
  22. #if !defined NO_ASSERTS
  23. ___2090::___2980 m_partition;
  24. #endif
  25. bool m_includeIMaxNodesInSubzones;
  26. bool m_includeJMaxNodesInSubzones;
  27. bool m_includeKMaxNodesInSubzones;
  28. NszMinMaxMap m_nszMinMaxes;
  29. public:
  30. ___1881(___1844 const &___2714, ___1844 const &subzoneMaxIJKDim, ___2090::___2980 ___2977 = ___2090::UNKNOWN_PARTITION, bool minimizeNumSubzones = DEFAULT_MINIMIZE_IJK_NUM_SUBZONES, bool includeIMaxNodesInSubzones = true, bool includeJMaxNodesInSubzones = true, bool includeKMaxNodesInSubzones = true) : m_cszInfo(___2714.getCellIJK(), subzoneMaxIJKDim, ___2977, minimizeNumSubzones), m_nszInfo(___1844(includeIMaxNodesInSubzones ? ___2714.i() : ___2714.i() - 1, includeJMaxNodesInSubzones ? ___2714.___2105() : ___2714.___2105() - 1, includeKMaxNodesInSubzones ? ___2714.___2134() : ___2714.___2134() - 1), subzoneMaxIJKDim, ___2977, minimizeNumSubzones)
  31. #if !defined NO_ASSERTS
  32. ,
  33. m_partition(___2977)
  34. #endif
  35. ,
  36. m_includeIMaxNodesInSubzones(includeIMaxNodesInSubzones), m_includeJMaxNodesInSubzones(includeJMaxNodesInSubzones), m_includeKMaxNodesInSubzones(includeKMaxNodesInSubzones)
  37. {
  38. ___4278(___2977);
  39. REQUIRE(___2714 > 0);
  40. REQUIRE(subzoneMaxIJKDim > 0);
  41. }
  42. ___1881() {}
  43. ___1881(___2090::___2980 ___2977, IJKSubzoneInfo const &nodeSubzoneInfo, IJKSubzoneInfo const &cellSubzoneInfo) : m_cszInfo(cellSubzoneInfo), m_nszInfo(nodeSubzoneInfo)
  44. #if !defined NO_ASSERTS
  45. ,
  46. m_partition(___2977)
  47. #endif
  48. ,
  49. m_includeIMaxNodesInSubzones(true), m_includeJMaxNodesInSubzones(true), m_includeKMaxNodesInSubzones(true)
  50. {
  51. ___4278(___2977);
  52. REQUIRE(___2977 >= 0);
  53. }
  54. ~___1881() {}
  55. inline void swap(___1881 &___2888)
  56. {
  57. m_cszInfo.swap(___2888.m_cszInfo);
  58. m_nszInfo.swap(___2888.m_nszInfo);
  59. }
  60. inline void reset(___1844 const &___2714, ___1844 const &subzoneMaxIJKDim, bool minimizeNumSubzones = DEFAULT_MINIMIZE_IJK_NUM_SUBZONES, bool includeIMaxNodesInSubzones = true, bool includeJMaxNodesInSubzones = true, bool includeKMaxNodesInSubzones = true)
  61. {
  62. REQUIRE(___2714 > 0);
  63. REQUIRE(subzoneMaxIJKDim > 0);
  64. m_cszInfo.reset(___2714.getCellIJK(), subzoneMaxIJKDim, minimizeNumSubzones);
  65. m_nszInfo.reset(___2714, subzoneMaxIJKDim, minimizeNumSubzones);
  66. m_includeIMaxNodesInSubzones = includeIMaxNodesInSubzones;
  67. m_includeJMaxNodesInSubzones = includeJMaxNodesInSubzones;
  68. m_includeKMaxNodesInSubzones = includeKMaxNodesInSubzones;
  69. }
  70. inline bool ___2067() const { return m_cszInfo.___2067() && m_nszInfo.___2067(); }
  71. inline bool validCszAddress(___2090::SubzoneAddress cszAddress) const { return m_cszInfo.validSzAddress(cszAddress); }
  72. inline bool validNszAddress(___2090::SubzoneAddress nszAddress) const { return m_nszInfo.validSzAddress(nszAddress); }
  73. inline bool validCellSubzone(___2090::SubzoneOffset_t ___469) const { return m_cszInfo.validSubzone(___469); }
  74. inline bool validNodeSubzone(___2090::SubzoneOffset_t ___2734) const { return m_nszInfo.validSubzone(___2734); }
  75. inline bool validCellAddress(___2090 ___451) const { return validCszAddress(___451.subzoneAddress()) && ___451.itemOffset() < getNumCellsInCsz(___451.subzoneOffset()); }
  76. inline bool validNodeAddress(___2090 nodeAddress) const { return validNszAddress(nodeAddress.subzoneAddress()) && nodeAddress.itemOffset() < getNumNodesInNsz(nodeAddress.subzoneOffset()); }
  77. bool includeIMaxNodesInSubzones() const { return m_includeIMaxNodesInSubzones; }
  78. bool includeJMaxNodesInSubzones() const { return m_includeJMaxNodesInSubzones; }
  79. bool includeKMaxNodesInSubzones() const { return m_includeKMaxNodesInSubzones; }
  80. inline ___465 ___1766(void) const { return ___465(m_cszInfo.getNumItems()); }
  81. inline ___2718 ___1768(void) const { return ___2718(m_nszInfo.getNumItems()); }
  82. inline ___1844 const ___2895() const { return ___1844(m_cszInfo.ijkDim().i() + 1, m_cszInfo.ijkDim().___2105() + 1, m_cszInfo.ijkDim().___2134()); }
  83. inline ___1844 const &contiguousCellIJKDim() const { return m_cszInfo.ijkDim(); }
  84. inline ___1844 const &___2714() const { return m_nszInfo.ijkDim(); }
  85. inline ___1844 const &___2198() const { return m_cszInfo.ijkLastIndex(); }
  86. inline ___1844 const &___2199() const { return m_nszInfo.ijkLastIndex(); }
  87. inline ___1844 ___690(___2090::SubzoneOffset_t ___469) const
  88. {
  89. REQUIRE(___469 < getNumCszs());
  90. return m_cszInfo.subzoneIJKStart(___469);
  91. }
  92. inline ___1844 ___689(___2090::SubzoneOffset_t ___469) const
  93. {
  94. REQUIRE(___469 < getNumCszs());
  95. return m_cszInfo.subzoneIJKEnd(___469);
  96. }
  97. inline ___1844 ___2761(___2090::SubzoneOffset_t ___2734) const
  98. {
  99. REQUIRE(___2734 < getNumNszs());
  100. return m_nszInfo.subzoneIJKStart(___2734);
  101. }
  102. inline ___1844 ___2760(___2090::SubzoneOffset_t ___2734) const
  103. {
  104. REQUIRE(___2734 < getNumNszs());
  105. return m_nszInfo.subzoneIJKEnd(___2734);
  106. }
  107. inline void nszIJKStartAndEnd(___2090::SubzoneOffset_t ___2734, ___1844 &___1880, ___1844 &___1852) const
  108. {
  109. REQUIRE(___2734 < getNumNszs());
  110. m_nszInfo.subzoneIJKStartAndEnd(___2734, ___1880, ___1852);
  111. }
  112. static ___2090::SubzoneOffset_t calcNumCszs(___1844 const &zoneIJKDim, ___1844 const &subzoneMaxIJK, bool minimizeNumSubzones = DEFAULT_MINIMIZE_IJK_NUM_SUBZONES)
  113. {
  114. REQUIRE(zoneIJKDim > 0 && zoneIJKDim.getNumPaddedCells() <= MAX_NUM_CELLS);
  115. REQUIRE(subzoneMaxIJK > 0 && subzoneMaxIJK.blockSize() <= ___2090::MAX_ITEM_OFFSET + 1);
  116. ___2090::SubzoneOffset_t const ___2783 = IJKSubzoneInfo::calcNumSubzones(zoneIJKDim.getCellIJK(), subzoneMaxIJK, minimizeNumSubzones);
  117. ENSURE(___2783 > 0 && ___2783 <= zoneIJKDim.getNumContiguousCells());
  118. return ___2783;
  119. }
  120. static ___2090::SubzoneOffset_t calcNumNszs(___1844 const &zoneIJKDim, ___1844 const &subzoneMaxIJK, bool minimizeNumSubzones = DEFAULT_MINIMIZE_IJK_NUM_SUBZONES)
  121. {
  122. REQUIRE(zoneIJKDim > 0 && zoneIJKDim.blockSize() <= MAX_NUM_NODES);
  123. REQUIRE(subzoneMaxIJK > 0 && subzoneMaxIJK.blockSize() <= ___2090::MAX_ITEM_OFFSET + 1);
  124. ___2090::SubzoneOffset_t const ___2823 = IJKSubzoneInfo::calcNumSubzones(zoneIJKDim, subzoneMaxIJK, minimizeNumSubzones);
  125. ENSURE(___2823 > 0 && ___2823 <= zoneIJKDim.blockSize());
  126. return ___2823;
  127. }
  128. inline ___2090::SubzoneOffset_t getNumCszs(void) const { return m_cszInfo.getNumSzs(); }
  129. inline ___2090::ItemOffset_t getNumCellsInCsz(___2090::SubzoneOffset_t ___469) const
  130. {
  131. REQUIRE(validCellSubzone(___469));
  132. ___2090::ItemOffset_t const ___2781 = m_cszInfo.numItemsInSz(___469);
  133. ENSURE(0 < ___2781 && ___2781 < ___2090::MAX_ITEM_OFFSET + 1);
  134. return ___2781;
  135. }
  136. inline ___2090 cellAddressAtCellIJK(___1844 const &cellIJK) const
  137. {
  138. REQUIRE(cellIJK < m_cszInfo.ijkDim());
  139. ___2090 const ___451 = m_cszInfo.itemAddressAtItemIJK(cellIJK);
  140. ENSURE(validCellAddress(___451));
  141. return ___451;
  142. }
  143. inline ___1844 cellIJKAtCellAddress(___2090 ___451) const
  144. {
  145. REQUIRE(validCellAddress(___451));
  146. ___1844 const cellIJK = m_cszInfo.itemIJKAtItemAddress(___451);
  147. ENSURE(cellIJK < m_cszInfo.ijkDim());
  148. return cellIJK;
  149. }
  150. inline ___2090 cellAddressAtContiguousCellIndex(___465 contiguousCellIndex) const
  151. {
  152. REQUIRE(contiguousCellIndex < ___1766());
  153. ___2090 const ___451 = m_cszInfo.itemAddressAtItemIndex(contiguousCellIndex);
  154. ENSURE(validCellAddress(___451));
  155. return ___451;
  156. }
  157. inline ___465 contiguousCellIndexAtCellAddress(___2090 ___451) const
  158. {
  159. REQUIRE(validCellAddress(___451));
  160. ___465 const contiguousCellIndex = m_cszInfo.itemIndexAtItemAddress(___451);
  161. ENSURE(contiguousCellIndex < ___1766());
  162. return contiguousCellIndex;
  163. }
  164. inline ___465 contiguousCellIndexAtCellIJK(___1844 const &cellIJK) const
  165. {
  166. ___465 const contiguousCellIndex = m_cszInfo.itemIndexAtItemIJK(cellIJK);
  167. ENSURE(contiguousCellIndex < ___1766());
  168. return contiguousCellIndex;
  169. }
  170. inline ___465 getMaxPaddedCellIndex() const
  171. {
  172. REQUIRE(m_includeIMaxNodesInSubzones && m_includeJMaxNodesInSubzones && m_includeKMaxNodesInSubzones);
  173. return m_nszInfo.ijkDim().i() * m_nszInfo.ijkDim().___2105() * m_cszInfo.ijkDim().___2134();
  174. }
  175. inline ___2090 cellAddressAtPaddedCellIndex(___465 paddedCellIndex) const
  176. {
  177. REQUIRE(paddedCellIndex < getMaxPaddedCellIndex());
  178. REQUIRE(m_includeIMaxNodesInSubzones && m_includeJMaxNodesInSubzones && m_includeKMaxNodesInSubzones);
  179. ___1844 cellIJK = m_nszInfo.itemIJKAtItemIndex(paddedCellIndex);
  180. if (cellIJK.i() == m_cszInfo.ijkDim().i())
  181. cellIJK.setI(m_cszInfo.ijkLastIndex().i());
  182. if (cellIJK.___2105() == m_cszInfo.ijkDim().___2105())
  183. cellIJK.setJ(m_cszInfo.ijkLastIndex().___2105());
  184. REQUIRE(cellIJK < m_cszInfo.ijkDim());
  185. ___2090 const ___451 = m_cszInfo.itemAddressAtItemIJK(cellIJK);
  186. ENSURE(validCellAddress(___451));
  187. return ___451;
  188. }
  189. inline ___465 paddedCellIndexAtCellAddress(___2090 ___451) const
  190. {
  191. REQUIRE(validCellAddress(___451));
  192. ___1844 const cellIJK = m_cszInfo.itemIJKAtItemAddress(___451);
  193. ___465 const paddedCellIndex = paddedCellIndexAtCellIJK(cellIJK);
  194. ENSURE(paddedCellIndex < getMaxPaddedCellIndex());
  195. return paddedCellIndex;
  196. }
  197. inline ___465 paddedCellIndexAtCellIJK(___1844 const &cellIJK) const
  198. {
  199. REQUIRE(m_includeIMaxNodesInSubzones && m_includeJMaxNodesInSubzones && m_includeKMaxNodesInSubzones);
  200. ___465 const paddedCellIndex = m_nszInfo.itemIndexAtItemIJK(cellIJK);
  201. ENSURE(paddedCellIndex < getMaxPaddedCellIndex());
  202. return paddedCellIndex;
  203. }
  204. inline ___2090::SubzoneAddress cszAtCellIJK(___1844 const &cellIJK) const
  205. {
  206. REQUIRE(cellIJK < m_cszInfo.ijkDim());
  207. ___2090::SubzoneAddress const cszAddress = m_cszInfo.szAddressAtItemIJK(cellIJK);
  208. ENSURE(validCszAddress(cszAddress));
  209. return cszAddress;
  210. }
  211. inline ___2090::SubzoneOffset_t getNumNszs(void) const { return m_nszInfo.getNumSzs(); }
  212. inline ___2090::ItemOffset_t getNumNodesInNsz(___2090::SubzoneOffset_t ___2734) const
  213. {
  214. REQUIRE(validNodeSubzone(___2734));
  215. ___2090::ItemOffset_t const ___2821 = m_nszInfo.numItemsInSz(___2734);
  216. ENSURE(0 < ___2821 && ___2821 < ___2090::MAX_ITEM_OFFSET + 1);
  217. return ___2821;
  218. }
  219. inline ___2090 nodeAddressAtNodeIJK(___1844 const &nodeIJK) const
  220. {
  221. REQUIRE(nodeIJK < m_nszInfo.ijkDim());
  222. ___2090 const nodeAddress = m_nszInfo.itemAddressAtItemIJK(nodeIJK);
  223. ENSURE(validNodeAddress(nodeAddress));
  224. return nodeAddress;
  225. }
  226. inline ___1844 nodeIJKAtNodeAddress(___2090 nodeAddress) const
  227. {
  228. REQUIRE(validNodeAddress(nodeAddress));
  229. ___1844 const nodeIJK = m_nszInfo.itemIJKAtItemAddress(nodeAddress);
  230. ENSURE(nodeIJK < m_nszInfo.ijkDim());
  231. return nodeIJK;
  232. }
  233. inline ___2090 nodeAddressAtNodeIndex(___2718 ___2716) const
  234. {
  235. REQUIRE(___2716 < ___1768());
  236. ___2090 const nodeAddress = m_nszInfo.itemAddressAtItemIndex(___2716);
  237. return nodeAddress;
  238. }
  239. inline ___2090::SubzoneAddress nszAtNodeIJK(___1844 const &nodeIJK) const
  240. {
  241. REQUIRE(nodeIJK < m_nszInfo.ijkDim());
  242. ___2090::SubzoneAddress const nszAddress = m_nszInfo.szAddressAtItemIJK(nodeIJK);
  243. ENSURE(validNszAddress(nszAddress));
  244. return nszAddress;
  245. }
  246. inline ___2718 nodeIndexAtNodeAddress(___2090 nodeAddress) const
  247. {
  248. REQUIRE(validNodeAddress(nodeAddress));
  249. ___2718 const ___2716 = m_nszInfo.itemIndexAtItemAddress(nodeAddress);
  250. ENSURE(___2716 < ___1768());
  251. return ___2716;
  252. }
  253. inline ___2718 nodeIndexAtNodeIJK(___1844 const &nodeIJK) const
  254. {
  255. ___2718 const ___2716 = m_nszInfo.itemIndexAtItemIJK(nodeIJK);
  256. ENSURE(___2716 < ___1768());
  257. return ___2716;
  258. }
  259. inline ___2090 getCellCorner(___2090 ___451, ___682 ___681) const
  260. {
  261. REQUIRE(validCellAddress(___451));
  262. REQUIRE(___681 < NUM_IJK_CELL_CORNERS);
  263. ___1844 const zoneCellIJK = m_cszInfo.itemIJKAtItemAddress(___451);
  264. ___1844 const cornerIJK = zoneCellIJK + ijkCornerOffset[___681];
  265. ___478(0 <= cornerIJK);
  266. ___2090 cornerNodeAddress;
  267. if (cornerIJK < ___2714())
  268. {
  269. cornerNodeAddress = nodeAddressAtNodeIJK(cornerIJK);
  270. ___478(validNodeAddress(cornerNodeAddress));
  271. }
  272. else
  273. {
  274. cornerNodeAddress = ___2090(BAD_ANY_INDEX);
  275. }
  276. return cornerNodeAddress;
  277. }
  278. inline void getCellCorners(___2090 ___451, ___3269<___2090> &cornerNodeAddresses) const
  279. {
  280. REQUIRE(validCellAddress(___451));
  281. REQUIRE(cornerNodeAddresses.empty());
  282. cornerNodeAddresses.reserve(NUM_IJK_CELL_CORNERS);
  283. cornerNodeAddresses.___3503(NUM_IJK_CELL_CORNERS);
  284. ___1844 const zoneCellIJK = m_cszInfo.itemIJKAtItemAddress(___451);
  285. ___1844 const &nodeSzIJKDim = ___2714();
  286. ___1844 const baseSzIJK = m_nszInfo.szIJKAtItemIJK(zoneCellIJK);
  287. ___1844 const baseIJKEnd = m_nszInfo.itemIJKEnd(baseSzIJK);
  288. for (___682 ___681 = 0; ___681 < NUM_IJK_CELL_CORNERS; ++___681)
  289. {
  290. ___1844 const cornerIJK = zoneCellIJK + ijkCornerOffset[___681];
  291. ___478(0 <= cornerIJK);
  292. if (cornerIJK < nodeSzIJKDim)
  293. {
  294. ___1844 const nszIJK(cornerIJK.i() > baseIJKEnd.i() ? baseSzIJK.i() + 1 : baseSzIJK.i(), cornerIJK.___2105() > baseIJKEnd.___2105() ? baseSzIJK.___2105() + 1 : baseSzIJK.___2105(), cornerIJK.___2134() > baseIJKEnd.___2134() ? baseSzIJK.___2134() + 1 : baseSzIJK.___2134());
  295. cornerNodeAddresses[___681] = m_nszInfo.itemAddressAtItemIJK(cornerIJK, nszIJK);
  296. ___478(validNodeAddress(cornerNodeAddresses[___681]));
  297. }
  298. else
  299. {
  300. cornerNodeAddresses[___681] = ___2090(BAD_ANY_INDEX);
  301. }
  302. }
  303. }
  304. inline ___465 getNumIJKFaceNeighbors(___2090 ___451, FaceIndex_t ASSERT_ONLY(___457)) const
  305. {
  306. ___4278(___451);
  307. REQUIRE(___457 < NUM_IJK_CELL_FACES);
  308. return 1;
  309. }
  310. inline void cszFaceNeighborIJKRange(___2090::SubzoneOffset_t ___469, int iDir, int jDir, int kDir, ___2090::SubzoneAddress &fnCszAddress, ___1844 &fnCszIJKRange) const
  311. {
  312. REQUIRE(validCellSubzone(___469));
  313. REQUIRE(iDir == -1 || iDir == 0 || iDir == 1);
  314. REQUIRE(jDir == -1 || jDir == 0 || jDir == 1);
  315. REQUIRE(kDir == -1 || kDir == 0 || kDir == 1);
  316. REQUIRE((iDir != 0 && jDir == 0 && kDir == 0) || (iDir == 0 && jDir != 0 && kDir == 0) || (iDir == 0 && jDir == 0 && kDir != 0));
  317. ___1844 const subzoneIJK = m_cszInfo.szIJKAtSzIndex(___469);
  318. fnCszAddress = m_cszInfo.szAddressAtSzIJK(___1844(subzoneIJK.i() + iDir, subzoneIJK.___2105() + jDir, subzoneIJK.___2134() + kDir));
  319. ___1844 const fnCszIJKStart = m_cszInfo.subzoneIJKStart(fnCszAddress.subzoneOffset());
  320. ___1844 const fnCszIJKEnd = m_cszInfo.subzoneIJKEnd(fnCszAddress.subzoneOffset());
  321. fnCszIJKRange = fnCszIJKEnd - fnCszIJKStart + 1;
  322. }
  323. inline void getIJKFaceNeighbor(___2090 ___451, FaceIndex_t ___457, ___465 ASSERT_ONLY(neighborOffset), ___2090 &fnCoord, ___4636 &fnZone) const
  324. {
  325. REQUIRE(___457 < NUM_IJK_CELL_FACES);
  326. REQUIRE(neighborOffset < getNumIJKFaceNeighbors(___451, ___457));
  327. ___2090::SubzoneOffset_t const ___469 = ___451.subzoneOffset();
  328. ___2090::ItemOffset_t const ___2865 = ___451.itemOffset();
  329. ___1844 const ijkLastIndex = m_cszInfo.ijkLastIndex();
  330. ___1844 const ___1880 = m_cszInfo.subzoneIJKStart(___469);
  331. ___1844 const ___1852 = m_cszInfo.subzoneIJKEnd(___469);
  332. ___1844 const ijkRange = ___1852 - ___1880 + 1;
  333. ___1844 const ___1862 = ijkRange.ijkAtOffset(___2865);
  334. ___1844 const ijkCell = ___1880 + ___1862;
  335. ___2090::SubzoneAddress fnCszAddress;
  336. ___1844 fnCszIJKRange;
  337. switch (___457)
  338. {
  339. case 0:
  340. if (ijkCell.i() > 0)
  341. {
  342. if (___1862.i() > 0)
  343. {
  344. fnCoord = m_cszInfo.itemAddressAtItemIJK(ijkCell - ___1844(1, 0, 0));
  345. }
  346. else
  347. {
  348. cszFaceNeighborIJKRange(___469, -1, 0, 0, fnCszAddress, fnCszIJKRange);
  349. ___1844 const fnCszIJKOffset(fnCszIJKRange.i() - 1, ___1862.___2105(), ___1862.___2134());
  350. fnCoord = ___2090(fnCszAddress, static_cast<___2090::ItemOffset_t>(fnCszIJKRange.offsetAtIJK(fnCszIJKOffset)));
  351. }
  352. }
  353. else
  354. {
  355. fnCoord = ___2090(___2749);
  356. }
  357. break;
  358. case 1:
  359. if (ijkCell.i() < ijkLastIndex.i())
  360. {
  361. if (___1862.i() < ijkRange.i() - 1)
  362. {
  363. fnCoord = m_cszInfo.itemAddressAtItemIJK(ijkCell + ___1844(1, 0, 0));
  364. }
  365. else
  366. {
  367. cszFaceNeighborIJKRange(___469, 1, 0, 0, fnCszAddress, fnCszIJKRange);
  368. ___1844 const fnCszIJKOffset(0, ___1862.___2105(), ___1862.___2134());
  369. fnCoord = ___2090(fnCszAddress, static_cast<___2090::ItemOffset_t>(fnCszIJKRange.offsetAtIJK(fnCszIJKOffset)));
  370. }
  371. }
  372. else
  373. {
  374. fnCoord = ___2090(___2749);
  375. }
  376. break;
  377. case 2:
  378. if (ijkCell.___2105() > 0)
  379. {
  380. if (___1862.___2105() > 0)
  381. {
  382. fnCoord = m_cszInfo.itemAddressAtItemIJK(ijkCell - ___1844(0, 1, 0));
  383. }
  384. else
  385. {
  386. cszFaceNeighborIJKRange(___469, 0, -1, 0, fnCszAddress, fnCszIJKRange);
  387. ___1844 const fnCszIJKOffset(___1862.i(), fnCszIJKRange.___2105() - 1, ___1862.___2134());
  388. fnCoord = ___2090(fnCszAddress, static_cast<___2090::ItemOffset_t>(fnCszIJKRange.offsetAtIJK(fnCszIJKOffset)));
  389. }
  390. }
  391. else
  392. {
  393. fnCoord = ___2090(___2749);
  394. }
  395. break;
  396. case 3:
  397. if (ijkCell.___2105() < ijkLastIndex.___2105())
  398. {
  399. if (___1862.___2105() < ijkRange.___2105() - 1)
  400. {
  401. fnCoord = m_cszInfo.itemAddressAtItemIJK(ijkCell + ___1844(0, 1, 0));
  402. }
  403. else
  404. {
  405. cszFaceNeighborIJKRange(___469, 0, 1, 0, fnCszAddress, fnCszIJKRange);
  406. ___1844 const fnCszIJKOffset(___1862.i(), 0, ___1862.___2134());
  407. fnCoord = ___2090(fnCszAddress, static_cast<___2090::ItemOffset_t>(fnCszIJKRange.offsetAtIJK(fnCszIJKOffset)));
  408. }
  409. }
  410. else
  411. {
  412. fnCoord = ___2090(___2749);
  413. }
  414. break;
  415. case 4:
  416. if (ijkCell.___2134() > 0)
  417. {
  418. if (___1862.___2134() > 0)
  419. {
  420. fnCoord = m_cszInfo.itemAddressAtItemIJK(ijkCell - ___1844(0, 0, 1));
  421. }
  422. else
  423. {
  424. cszFaceNeighborIJKRange(___469, 0, 0, -1, fnCszAddress, fnCszIJKRange);
  425. ___1844 const fnCszIJKOffset(___1862.i(), ___1862.___2105(), fnCszIJKRange.___2134() - 1);
  426. fnCoord = ___2090(fnCszAddress, static_cast<___2090::ItemOffset_t>(fnCszIJKRange.offsetAtIJK(fnCszIJKOffset)));
  427. }
  428. }
  429. else
  430. {
  431. fnCoord = ___2090(___2749);
  432. }
  433. break;
  434. case 5:
  435. if (ijkCell.___2134() < ijkLastIndex.___2134())
  436. {
  437. if (___1862.___2134() < ijkRange.___2134() - 1)
  438. {
  439. fnCoord = m_cszInfo.itemAddressAtItemIJK(ijkCell + ___1844(0, 0, 1));
  440. }
  441. else
  442. {
  443. cszFaceNeighborIJKRange(___469, 0, 0, 1, fnCszAddress, fnCszIJKRange);
  444. ___1844 const fnCszIJKOffset(___1862.i(), ___1862.___2105(), 0);
  445. fnCoord = ___2090(fnCszAddress, static_cast<___2090::ItemOffset_t>(fnCszIJKRange.offsetAtIJK(fnCszIJKOffset)));
  446. }
  447. }
  448. else
  449. {
  450. fnCoord = ___2090(___2749);
  451. }
  452. break;
  453. default:
  454. ___478(___1305);
  455. break;
  456. }
  457. fnZone = ___2750;
  458. }
  459. ___465 getCellsAroundNodeIJK(___1844 const &nodeIJK, ___3269<___2090> &adjacentCells) const;
  460. ___372 getCszsOnIndexPlane(IJKPlanes_e whichPlane, ___2718 planeIndex, ___3269<___2090::SubzoneAddress> &cszAddresses) const
  461. {
  462. REQUIRE(whichPlane == ___1867 || whichPlane == ___1872 || whichPlane == ___1874);
  463. REQUIRE(IMPLICATION(whichPlane == ___1867, planeIndex < m_nszInfo.ijkDim().i()) && IMPLICATION(whichPlane == ___1872, planeIndex < m_nszInfo.ijkDim().___2105()) && IMPLICATION(whichPlane == ___1874, planeIndex < m_nszInfo.ijkDim().___2134()));
  464. REQUIRE(cszAddresses.empty());
  465. ___372 const ___2039 = m_cszInfo.getSubzonesOnIndexPlane(whichPlane, planeIndex, cszAddresses);
  466. ENSURE(IMPLICATION(___2039, !cszAddresses.empty()));
  467. ENSURE(IMPLICATION(___2039, isSorted(cszAddresses.begin(), cszAddresses.end())));
  468. ENSURE(IMPLICATION(___2039, cszAddresses[cszAddresses.size() - 1].___2977() == m_partition));
  469. ENSURE(IMPLICATION(___2039, cszAddresses[cszAddresses.size() - 1].subzoneOffset() < getNumCszs()));
  470. return ___2039;
  471. }
  472. ___372 getCszsOnIndexLine(IJKLines_e whichLine, ___2718 mIndex, ___2718 nIndex, ___3269<___2090::SubzoneAddress> &cszAddresses) const
  473. {
  474. REQUIRE(whichLine == ___1857 || whichLine == ___1859 || whichLine == ___1860);
  475. REQUIRE(IMPLICATION(whichLine == ___1857, mIndex < m_nszInfo.ijkDim().___2105() && nIndex < m_nszInfo.ijkDim().___2134()) && IMPLICATION(whichLine == ___1859, mIndex < m_nszInfo.ijkDim().i() && nIndex < m_nszInfo.ijkDim().___2134()) && IMPLICATION(whichLine == ___1860, mIndex < m_nszInfo.ijkDim().i() && nIndex < m_nszInfo.ijkDim().___2105()));
  476. REQUIRE(cszAddresses.empty());
  477. REQUIRE(m_includeIMaxNodesInSubzones && m_includeJMaxNodesInSubzones && m_includeKMaxNodesInSubzones);
  478. ___372 const ___2039 = m_cszInfo.getSubzonesOnIndexLine(whichLine, mIndex, nIndex, cszAddresses);
  479. ENSURE(IMPLICATION(___2039, !cszAddresses.empty()));
  480. ENSURE(IMPLICATION(___2039, isSorted(cszAddresses.begin(), cszAddresses.end())));
  481. ENSURE(IMPLICATION(___2039, cszAddresses[cszAddresses.size() - 1].___2977() == m_partition));
  482. ENSURE(IMPLICATION(___2039, cszAddresses[cszAddresses.size() - 1].subzoneOffset() < getNumCszs()));
  483. return ___2039;
  484. }
  485. ___372 getNszsOnIndexPlane(IJKPlanes_e whichPlane, ___2718 planeIndex, ___3269<___2090::SubzoneAddress> &nszAddresses) const
  486. {
  487. REQUIRE(whichPlane == ___1867 || whichPlane == ___1872 || whichPlane == ___1874);
  488. REQUIRE(IMPLICATION(whichPlane == ___1867, planeIndex < m_nszInfo.ijkDim().i()) && IMPLICATION(whichPlane == ___1872, planeIndex < m_nszInfo.ijkDim().___2105()) && IMPLICATION(whichPlane == ___1874, planeIndex < m_nszInfo.ijkDim().___2134()));
  489. REQUIRE(nszAddresses.empty());
  490. REQUIRE(m_includeIMaxNodesInSubzones && m_includeJMaxNodesInSubzones && m_includeKMaxNodesInSubzones);
  491. ___372 ___2039 = m_nszInfo.getSubzonesOnIndexPlane(whichPlane, planeIndex, nszAddresses);
  492. ENSURE(IMPLICATION(___2039, !nszAddresses.empty()));
  493. ENSURE(IMPLICATION(___2039, isSorted(nszAddresses.begin(), nszAddresses.end())));
  494. ENSURE(IMPLICATION(___2039, nszAddresses[nszAddresses.size() - 1].___2977() == m_partition));
  495. ENSURE(IMPLICATION(___2039, nszAddresses[nszAddresses.size() - 1].subzoneOffset() < getNumNszs()));
  496. return ___2039;
  497. }
  498. ___372 getNszsOnIndexLine(IJKLines_e whichLine, ___2718 mIndex, ___2718 nIndex, ___3269<___2090::SubzoneAddress> &nszAddresses) const
  499. {
  500. REQUIRE(whichLine == ___1857 || whichLine == ___1859 || whichLine == ___1860);
  501. REQUIRE(IMPLICATION(whichLine == ___1857, mIndex < m_nszInfo.ijkDim().___2105() && nIndex < m_nszInfo.ijkDim().___2134()) && IMPLICATION(whichLine == ___1859, mIndex < m_nszInfo.ijkDim().i() && nIndex < m_nszInfo.ijkDim().___2134()) && IMPLICATION(whichLine == ___1860, mIndex < m_nszInfo.ijkDim().i() && nIndex < m_nszInfo.ijkDim().___2105()));
  502. REQUIRE(nszAddresses.empty());
  503. REQUIRE(m_includeIMaxNodesInSubzones && m_includeJMaxNodesInSubzones && m_includeKMaxNodesInSubzones);
  504. ___372 const ___2039 = m_nszInfo.getSubzonesOnIndexLine(whichLine, mIndex, nIndex, nszAddresses);
  505. ENSURE(IMPLICATION(___2039, !nszAddresses.empty()));
  506. ENSURE(IMPLICATION(___2039, isSorted(nszAddresses.begin(), nszAddresses.end())));
  507. ENSURE(IMPLICATION(___2039, nszAddresses[nszAddresses.size() - 1].___2977() == m_partition));
  508. ENSURE(IMPLICATION(___2039, nszAddresses[nszAddresses.size() - 1].subzoneOffset() < getNumNszs()));
  509. return ___2039;
  510. }
  511. void includeNszVarMinMax(___2090::SubzoneOffset_t ___2734, std::vector<___2479> const &varMinMaxes)
  512. {
  513. REQUIRE(!varMinMaxes.empty());
  514. std::vector<___2479> &nszVarMinMaxes = m_nszMinMaxes[___2734];
  515. if (nszVarMinMaxes.empty())
  516. nszVarMinMaxes.resize(varMinMaxes.size());
  517. for (size_t ___4336 = 0; ___4336 < varMinMaxes.size(); ++___4336)
  518. nszVarMinMaxes[___4336].include(varMinMaxes[___4336]);
  519. }
  520. NszMinMaxMap const &getNszMinMaxes() const { return m_nszMinMaxes; }
  521. inline void resetNeighborInfo() { m_nszMinMaxes.clear(); }
  522. ___372 getNodeSubzonesInRange(___1844 const &nodeIJKStart, ___1844 const &nodeIJKEnd, ___3269<___2090::SubzoneAddress> &refNszAddresses) const;
  523. ___372 getCszReferencedNszs(___2090::SubzoneAddress cszAddress, ___3269<___2090::SubzoneAddress> &refNszAddresses) const;
  524. ___372 getCellSubzonesInRange(___1844 const &cellIJKStart, ___1844 const &cellIJKEnd, ___3269<___2090::SubzoneAddress> &refCszAddresses) const;
  525. ___372 getNszReferencedCszs(___2090::SubzoneAddress nszAddress, ___3269<___2090::SubzoneAddress> &refCszAddresses) const;
  526. };
  527. }
  528. }