ZoneMetadata.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. #pragma once
  2. #include "ThirdPartyHeadersBegin.h"
  3. #include <algorithm>
  4. #include <string>
  5. #include <vector>
  6. #include "ThirdPartyHeadersEnd.h"
  7. #include "basicTypes.h"
  8. #include "IJK.h"
  9. #include "IJKPartitionTree.h"
  10. #include "IJKZoneInfo.h"
  11. #include "FEZoneInfo.h"
  12. #include "MinMaxTree.h"
  13. #include "zoneUtil.h"
  14. #include "ClassicZoneFileLocations.h"
  15. #include "PartitionMetadata.h"
  16. #include "writeValueArray.h"
  17. namespace tecplot
  18. {
  19. namespace ___3933
  20. {
  21. template <typename T>
  22. ___2090::SubzoneOffset_t getNumSzFromNumItems(T ___2812)
  23. {
  24. REQUIRE(___2812 > 0);
  25. ___2090::SubzoneOffset_t ___3358 = static_cast<___2090::SubzoneOffset_t>((___2812 + 0xFF) >> 8);
  26. ENSURE(___3358 > 0);
  27. return ___3358;
  28. }
  29. class ZoneMetadata
  30. {
  31. private:
  32. UNCOPYABLE_CLASS(ZoneMetadata);
  33. private:
  34. ___4636 ___2677;
  35. ZoneType_e ___2684;
  36. bool m_isSZL;
  37. ___1844 m_zoneIJK;
  38. std::string ___2495;
  39. FaceNeighborMode_e ___2458;
  40. double ___2621;
  41. ___1172 ___2622;
  42. ___4636 ___2614;
  43. ___2090::___2980 m_numPartitions;
  44. ___1863 m_partitionTree;
  45. public:
  46. ___2240<___1881> m_ijkZoneInfos;
  47. ___2240<___465> m_ptnNumCells;
  48. ___2240<___2718> m_ptnNumNodes;
  49. ___2240<___465> m_ptnFirstCell;
  50. ___2240<___2718> m_ptnFirstNode;
  51. ___2240<___1844> m_ptnNodeMinIJKs;
  52. ___2240<___1844> m_ptnNodeMaxIJKs;
  53. ___2240<___2090::SubzoneOffset_t> m_ptnNumCszs;
  54. ___2240<___2090::SubzoneOffset_t> m_ptnNumNszs;
  55. ___2240<___2090::___2980> m_ptnFileNums;
  56. ___2240<___1393> m_ptnHeaderFileLocs;
  57. ___2240<___1393> m_varPtnMinMaxFileLocs;
  58. ___2240<MinMaxTree> m_varPtnMinMaxTrees;
  59. ___2240<PartitionMetadata> m_ptnMetadata;
  60. ClassicZoneFileLocations m_classicZoneFileLocations;
  61. public:
  62. ZoneMetadata() : ___2677(-1), ___2684(___4703), m_isSZL(false), m_zoneIJK(), ___2495(), ___2458(___1290), ___2621(0.0), ___2622(___3788), ___2614(-1), m_numPartitions(0) {}
  63. inline void swap(ZoneMetadata &___2888)
  64. {
  65. using std::swap;
  66. swap(___2677, ___2888.___2677);
  67. swap(___2684, ___2888.___2684);
  68. swap(m_isSZL, ___2888.m_isSZL);
  69. swap(m_zoneIJK, ___2888.m_zoneIJK);
  70. swap(___2495, ___2888.___2495);
  71. swap(___2458, ___2888.___2458);
  72. swap(___2621, ___2888.___2621);
  73. swap(___2622, ___2888.___2622);
  74. swap(___2614, ___2888.___2614);
  75. swap(m_numPartitions, ___2888.m_numPartitions);
  76. }
  77. inline ___4636 zone() const
  78. {
  79. ENSURE(___2677 >= 0 && ___2677 < MAX_NUM_ZONES);
  80. return ___2677;
  81. }
  82. inline ZoneType_e getZoneType() const
  83. {
  84. ENSURE(VALID_ENUM(___2684, ZoneType_e));
  85. return ___2684;
  86. }
  87. inline bool isSZL() const { return m_isSZL; }
  88. inline ___1844 const &getZoneIJK() const
  89. {
  90. ENSURE(m_zoneIJK.___2067());
  91. return m_zoneIJK;
  92. }
  93. inline ___465 ___1766() const
  94. {
  95. REQUIRE(___2684 != ___4698 && ___2684 != ___4699);
  96. if (___2684 == ___4704)
  97. return m_zoneIJK.getNumContiguousCells();
  98. else
  99. return m_zoneIJK.___1668();
  100. }
  101. inline ___2718 ___1768() const
  102. {
  103. REQUIRE(___2684 != ___4698 && ___2684 != ___4699);
  104. if (___2684 == ___4704)
  105. return m_zoneIJK.___1768();
  106. else
  107. return m_zoneIJK.___1670();
  108. }
  109. inline ___682 ___1669() const
  110. {
  111. REQUIRE(___2684 != ___4704 && ___2684 != ___4698 && ___2684 != ___4699);
  112. return m_zoneIJK.___1669();
  113. }
  114. inline ___682 ___1767() const
  115. {
  116. REQUIRE(___2684 != ___4698 && ___2684 != ___4699);
  117. if (___2684 == ___4704)
  118. return 8;
  119. else
  120. return ___1669();
  121. }
  122. inline std::string getName() const { return ___2495; }
  123. inline FaceNeighborMode_e getFaceNeighborMode() const
  124. {
  125. ENSURE(VALID_ENUM(___2458, FaceNeighborMode_e) || ___2458 == ___1288);
  126. return ___2458;
  127. }
  128. inline double getSolutionTime() const { return ___2621; }
  129. inline ___1172 getStrandID() const
  130. {
  131. REQUIRE(___2622 == ___3788 || ___4312(___2622));
  132. return ___2622;
  133. }
  134. inline ___4636 getParentZone() const
  135. {
  136. REQUIRE(___2614 == -1 || (___2614 >= 0 && ___2614 < MAX_NUM_ZONES));
  137. return ___2614;
  138. }
  139. void setZone(___4636 zone)
  140. {
  141. REQUIRE(zone >= 0 && zone < MAX_NUM_ZONES);
  142. ___2677 = zone;
  143. }
  144. void setZoneType(ZoneType_e ___4692)
  145. {
  146. REQUIRE(VALID_ENUM(___4692, ZoneType_e));
  147. ___2684 = ___4692;
  148. }
  149. inline void setIsSZL(bool isSZL) { m_isSZL = isSZL; }
  150. inline void setIJKMax(___1844 const &ijkDim)
  151. {
  152. REQUIRE(___2684 == ___4704);
  153. m_zoneIJK = ijkDim;
  154. }
  155. inline void setFEDescription(___465 ___2781, ___682 ___2789, ___2718 ___2821)
  156. {
  157. REQUIRE(___2684 != ___4704 && ___2684 != ___4698 && ___2684 != ___4699);
  158. REQUIRE(___2781 > 0 && ___2781 <= MAX_NUM_CELLS);
  159. REQUIRE(___2821 > 0 && ___2821 <= MAX_NUM_NODES);
  160. REQUIRE(___2789 > 0 && ___2789 <= MAX_NUM_CELL_CORNERS);
  161. m_zoneIJK = ___1844(___2821, ___2781, ___2789);
  162. }
  163. inline void setName(std::string const &___2685) { ___2495 = ___2685; }
  164. inline void setFaceNeighborMode(FaceNeighborMode_e ___1284)
  165. {
  166. REQUIRE(VALID_ENUM(___1284, FaceNeighborMode_e) || ___1284 == ___1288);
  167. ___2458 = ___1284;
  168. }
  169. inline void setSolutionTime(double ___3640) { ___2621 = ___3640; }
  170. inline void setStrandID(___1172 ___3785) { ___2622 = ___3785; }
  171. inline void setParentZone(___4636 ___2974)
  172. {
  173. REQUIRE(___2974 == -1 || (___2974 >= 0 && ___2974 < MAX_NUM_ZONES));
  174. ___2614 = ___2974;
  175. }
  176. inline ___2090::___2980 getNumPartitions() const
  177. {
  178. REQUIRE(m_isSZL);
  179. ENSURE(VALID_ITEM_ADDRESS_PARTITION(m_numPartitions - 1));
  180. return m_numPartitions;
  181. }
  182. inline ___2090::SubzoneOffset_t getNumCszsInPartition(___2090::___2980 ___2977) const
  183. {
  184. REQUIRE(m_isSZL);
  185. REQUIRE(___2977 < m_numPartitions);
  186. ___2090::SubzoneOffset_t const numCszs = m_ptnNumCszs[___2977];
  187. ENSURE(IMPLICATION(___2684 == ___4704, VALID_ITEM_ADDRESS_SUBZONE_OFFSET(numCszs - 1)));
  188. ENSURE(IMPLICATION(___2684 != ___4704, numCszs == getNumSzFromNumItems(m_ptnNumCells[___2977])));
  189. ENSURE(numCszs > 0);
  190. return numCszs;
  191. }
  192. inline ___2090::SubzoneOffset_t getNumNszsInPartition(___2090::___2980 ___2977) const
  193. {
  194. REQUIRE(m_isSZL);
  195. REQUIRE(___2977 < m_numPartitions);
  196. ___2090::SubzoneOffset_t const numNszs = m_ptnNumNszs[___2977];
  197. ENSURE(IMPLICATION(___2684 == ___4704, VALID_ITEM_ADDRESS_SUBZONE_OFFSET(numNszs - 1)));
  198. ENSURE(IMPLICATION(___2684 != ___4704, numNszs == getNumSzFromNumItems(m_ptnNumNodes[___2977])));
  199. ENSURE(numNszs > 0);
  200. return numNszs;
  201. }
  202. inline void setNumPartitions(___2090::___2980 numPartitions)
  203. {
  204. REQUIRE(numPartitions >= 1 && (m_isSZL ? VALID_ITEM_ADDRESS_PARTITION(numPartitions - 1) : numPartitions == 1));
  205. m_numPartitions = numPartitions;
  206. ENSURE(VALID_ITEM_ADDRESS_PARTITION(m_numPartitions - 1));
  207. }
  208. inline void addPartitionTreeItem(___2090::___2980 ___2977, ___1844 const &___2474, ___1844 const &___2364) { m_partitionTree.___13(___2977, ___2474, ___2364); }
  209. inline ___2090::___2980 getPartitionForIJK(___1844 const &___1843) const
  210. {
  211. if (m_numPartitions == 1)
  212. {
  213. return 0;
  214. }
  215. else
  216. {
  217. ___1853 ___2478(___1843.i(), ___1843.___2105(), ___1843.___2134());
  218. ___1853 ___2372(___1843.i(), ___1843.___2105(), ___1843.___2134());
  219. std::vector<___1864> ___2099;
  220. m_partitionTree.query(boost::geometry::index::intersects(___1855(___2478, ___2372)), std::back_inserter(___2099));
  221. return (___2099.empty() ? ___2090::INVALID_PARTITION : ___2099[0].second);
  222. }
  223. }
  224. inline std::vector<___2090::___2980> getPartitionsForIJKRange(___1844 const &ijkMin, ___1844 const &___1861) const
  225. {
  226. if (m_numPartitions == 1)
  227. {
  228. return std::vector<___2090::___2980>(1, 0);
  229. }
  230. else
  231. {
  232. ___1853 ___2478(ijkMin.i(), ijkMin.___2105(), ijkMin.___2134());
  233. ___1853 ___2372(___1861.i(), ___1861.___2105(), ___1861.___2134());
  234. std::vector<___1864> ___2099;
  235. m_partitionTree.query(boost::geometry::index::intersects(___1855(___2478, ___2372)), std::back_inserter(___2099));
  236. std::vector<___2090::___2980> ___3358;
  237. ___3358.reserve(___2099.size());
  238. for (std::vector<___1864>::const_iterator it = ___2099.begin(); it != ___2099.end(); ++it)
  239. ___3358.push_back(it->second);
  240. std::sort(___3358.begin(), ___3358.end());
  241. return ___3358;
  242. }
  243. }
  244. inline std::vector<___2090::___2980> getPartitionsForIndexPlane(IJKPlanes_e whichPlane, ___2718 planeIndex) const
  245. {
  246. if (m_numPartitions == 1)
  247. {
  248. return std::vector<___2090::___2980>(1, 0);
  249. }
  250. else
  251. {
  252. ___1844 planeMin(0, 0, 0);
  253. ___1844 planeMax(getZoneIJK() - 1);
  254. switch (whichPlane)
  255. {
  256. case ___1867:
  257. planeMin.setI(planeIndex);
  258. planeMax.setI(planeIndex);
  259. break;
  260. case ___1872:
  261. planeMin.setJ(planeIndex);
  262. planeMax.setJ(planeIndex);
  263. break;
  264. case ___1874:
  265. planeMin.___3497(planeIndex);
  266. planeMax.___3497(planeIndex);
  267. break;
  268. default:
  269. ___478(___1305);
  270. break;
  271. }
  272. ___1853 ___2478(planeMin.i(), planeMin.___2105(), planeMin.___2134());
  273. ___1853 ___2372(planeMax.i(), planeMax.___2105(), planeMax.___2134());
  274. std::vector<___1864> ___2099;
  275. m_partitionTree.query(boost::geometry::index::intersects(___1855(___2478, ___2372)), std::back_inserter(___2099));
  276. std::vector<___2090::___2980> ___3358;
  277. ___3358.reserve(___2099.size());
  278. for (std::vector<___1864>::const_iterator it = ___2099.begin(); it != ___2099.end(); ++it)
  279. ___3358.push_back(it->second);
  280. std::sort(___3358.begin(), ___3358.end());
  281. return ___3358;
  282. }
  283. }
  284. inline std::vector<___2090::___2980> getPartitionsForIndexLine(IJKLines_e whichLine, ___2718 mIndex, ___2718 nIndex) const
  285. {
  286. if (m_numPartitions == 1)
  287. {
  288. return std::vector<___2090::___2980>(1, 0);
  289. }
  290. else
  291. {
  292. ___1844 lineMin(0, 0, 0);
  293. ___1844 lineMax(getZoneIJK() - 1);
  294. switch (whichLine)
  295. {
  296. case ___1857:
  297. lineMin.setJ(mIndex);
  298. lineMin.___3497(nIndex);
  299. lineMax.setJ(mIndex);
  300. lineMax.___3497(nIndex);
  301. break;
  302. case ___1859:
  303. lineMin.setI(mIndex);
  304. lineMin.___3497(nIndex);
  305. lineMax.setI(mIndex);
  306. lineMax.___3497(nIndex);
  307. break;
  308. case ___1860:
  309. lineMin.setI(mIndex);
  310. lineMin.setJ(nIndex);
  311. lineMax.setI(mIndex);
  312. lineMax.setJ(nIndex);
  313. break;
  314. default:
  315. ___478(___1305);
  316. break;
  317. }
  318. ___1853 ___2478(lineMin.i(), lineMin.___2105(), lineMin.___2134());
  319. ___1853 ___2372(lineMax.i(), lineMax.___2105(), lineMax.___2134());
  320. std::vector<___1864> ___2099;
  321. m_partitionTree.query(boost::geometry::index::intersects(___1855(___2478, ___2372)), std::back_inserter(___2099));
  322. std::vector<___2090::___2980> ___3358;
  323. ___3358.reserve(___2099.size());
  324. for (std::vector<___1864>::const_iterator it = ___2099.begin(); it != ___2099.end(); ++it)
  325. ___3358.push_back(it->second);
  326. std::sort(___3358.begin(), ___3358.end());
  327. return ___3358;
  328. }
  329. }
  330. inline bool ijkPartitionMetadataIsLoaded(___2090::___2980 ___2977) const { return ___2977 < m_ijkZoneInfos.size() && m_ijkZoneInfos[___2977].___2067(); }
  331. inline ___2090 cellAddressAtIJKPaddedCellIndex(___465 paddedCellIndex) const
  332. {
  333. REQUIRE(paddedCellIndex < getZoneIJK().getNumPaddedCells());
  334. ___2090 ___451;
  335. if (getNumPartitions() == 1)
  336. {
  337. ___451 = m_ijkZoneInfos[0].cellAddressAtPaddedCellIndex(paddedCellIndex);
  338. }
  339. else
  340. {
  341. ___1844 const ___4632 = getZoneIJK().ijkAtOffset(paddedCellIndex);
  342. ___2090::___2980 const ___2977 = getPartitionForIJK(___4632);
  343. ___478(ijkPartitionMetadataIsLoaded(___2977));
  344. ___1844 partitionIJK = ___4632 - m_ptnNodeMinIJKs[___2977];
  345. if (partitionIJK.i() == m_ijkZoneInfos[___2977].___2895().i() - 1)
  346. partitionIJK.setI(partitionIJK.i() - 1);
  347. if (partitionIJK.___2105() == m_ijkZoneInfos[___2977].___2895().___2105() - 1)
  348. partitionIJK.setJ(partitionIJK.___2105() - 1);
  349. ___451 = m_ijkZoneInfos[___2977].cellAddressAtCellIJK(partitionIJK);
  350. ENSURE(___451.___2977() == ___2977);
  351. }
  352. return ___451;
  353. }
  354. inline ___2090 nodeAddressAtIJKNodeIndex(___2718 ___2716) const
  355. {
  356. ___2090 nodeAddress;
  357. if (getNumPartitions() == 1)
  358. {
  359. nodeAddress = m_ijkZoneInfos[0].nodeAddressAtNodeIndex(___2716);
  360. }
  361. else
  362. {
  363. ___1844 const ___4632 = getZoneIJK().ijkAtOffset(___2716);
  364. ___2090::___2980 const ___2977 = getPartitionForIJK(___4632);
  365. ___478(ijkPartitionMetadataIsLoaded(___2977));
  366. ___1844 const partitionIJK = ___4632 - m_ptnNodeMinIJKs[___2977];
  367. nodeAddress = m_ijkZoneInfos[___2977].nodeAddressAtNodeIJK(partitionIJK);
  368. ENSURE(nodeAddress.___2977() == ___2977);
  369. }
  370. return nodeAddress;
  371. }
  372. inline void findPartitionContainingIndex(___81 &ptnItemIndex, ___2090::___2980 &___2977, ___2240<___81> const &ptnNumItems) const
  373. {
  374. ___2090::___2980 numPartitions = getNumPartitions();
  375. if (numPartitions > 1)
  376. {
  377. while (true)
  378. {
  379. ___2718 const numPtnItems = ptnNumItems[___2977];
  380. if (ptnItemIndex < numPtnItems)
  381. break;
  382. ptnItemIndex -= numPtnItems;
  383. ++___2977;
  384. ___478(___2977 < numPartitions);
  385. }
  386. }
  387. }
  388. inline ___2090 itemAddressAtFEIndex(___81 itemIndex, ___2240<___81> const &ptnNumItems) const
  389. {
  390. ___81 ptnItemIndex = itemIndex;
  391. ___2090::___2980 ___2977 = 0;
  392. findPartitionContainingIndex(ptnItemIndex, ___2977, ptnNumItems);
  393. ___2090::SubzoneOffset_t const ___2763 = ___2090::SubzoneOffset_t(ptnItemIndex >> ___2090::ItemOffsetBitSize);
  394. ___2090::ItemOffset_t const itemOffset = ___2090::ItemOffset_t(ptnItemIndex & ___2090::MAX_ITEM_OFFSET);
  395. return ___2090(___2977, ___2763, itemOffset);
  396. }
  397. inline ___81 indexAtFEItemAddress(___2090 ___2089, ___2240<___81> const &ptnNumItems) const
  398. {
  399. ___81 itemIndex = (___81(___2089.subzoneOffset()) << ___2090::ItemOffsetBitSize) | ___2089.itemOffset();
  400. ___2090::___2980 ___2977 = ___2089.___2977();
  401. while (___2977 > 0)
  402. {
  403. --___2977;
  404. itemIndex += ptnNumItems[___2977];
  405. }
  406. return itemIndex;
  407. }
  408. ___2090 cellAddressAtFECellIndex(___465 zoneCellIndex) const
  409. {
  410. REQUIRE(zoneCellIndex < ___1766());
  411. return itemAddressAtFEIndex(zoneCellIndex, m_ptnNumCells);
  412. }
  413. ___465 cellIndexAtFECellAddress(___2090 ___451) const
  414. {
  415. REQUIRE(VALID_ITEM_ADDRESS(___451));
  416. return indexAtFEItemAddress(___451, m_ptnNumCells);
  417. }
  418. ___2090 nodeAddressAtFENodeIndex(___2718 zoneNodeIndex) const
  419. {
  420. REQUIRE(zoneNodeIndex < ___1768());
  421. return itemAddressAtFEIndex(zoneNodeIndex, m_ptnNumNodes);
  422. }
  423. ___2718 nodeIndexAtFENodeAddress(___2090 nodeAddress) const
  424. {
  425. REQUIRE(m_isSZL);
  426. REQUIRE(VALID_ITEM_ADDRESS(nodeAddress));
  427. return indexAtFEItemAddress(nodeAddress, m_ptnNumNodes);
  428. }
  429. ___465 paddedCellIndexAtIJKCellAddress(___2090 ___451) const
  430. {
  431. ___465 paddedCellIndex;
  432. if (getNumPartitions() == 1)
  433. {
  434. paddedCellIndex = m_ijkZoneInfos[0].paddedCellIndexAtCellAddress(___451);
  435. }
  436. else
  437. {
  438. ___2090::___2980 const ___2977 = ___451.___2977();
  439. ___478(ijkPartitionMetadataIsLoaded(___2977));
  440. ___1844 const cellIJK = m_ptnNodeMinIJKs[___2977] + m_ijkZoneInfos[___2977].cellIJKAtCellAddress(___451);
  441. paddedCellIndex = getZoneIJK().offsetAtIJK(cellIJK);
  442. }
  443. ENSURE(paddedCellIndex < getZoneIJK().getNumPaddedCells());
  444. return paddedCellIndex;
  445. }
  446. ___2718 nodeIndexAtIJKNodeAddress(___2090 nodeAddress) const
  447. {
  448. REQUIRE(getZoneType() == ___4704);
  449. ___2718 ___2716;
  450. if (getNumPartitions() == 1)
  451. {
  452. ___2716 = m_ijkZoneInfos[0].nodeIndexAtNodeAddress(nodeAddress);
  453. }
  454. else
  455. {
  456. ___2090::___2980 const ___2977 = nodeAddress.___2977();
  457. ___478(ijkPartitionMetadataIsLoaded(___2977));
  458. ___1844 const nodeIJK = m_ptnNodeMinIJKs[___2977] + m_ijkZoneInfos[___2977].nodeIJKAtNodeAddress(nodeAddress);
  459. ___2716 = getZoneIJK().offsetAtIJK(nodeIJK);
  460. }
  461. ENSURE(___2716 < ___1768());
  462. return ___2716;
  463. }
  464. ___465 getNumIJKFaceNeighbors(___2090 ___451, FaceIndex_t ___457) const
  465. {
  466. REQUIRE(m_isSZL);
  467. REQUIRE(___457 < NUM_IJK_CELL_FACES);
  468. ___2090::___2980 const ___2977 = ___451.___2977();
  469. ___478(ijkPartitionMetadataIsLoaded(___2977));
  470. return m_ijkZoneInfos[___2977].getNumIJKFaceNeighbors(___451, ___457);
  471. }
  472. void getIJKFaceNeighbor(___2090 ___451, FaceIndex_t ___457, ___465 neighborOffset, ___2090 &fnCoord, ___4636 &fnZone) const
  473. {
  474. REQUIRE(___451.isSzlItem());
  475. REQUIRE(m_isSZL);
  476. REQUIRE(___457 < NUM_IJK_CELL_FACES);
  477. REQUIRE(neighborOffset < getNumIJKFaceNeighbors(___451, ___457));
  478. ___2090::___2980 const ___2977 = ___451.___2977();
  479. ___478(ijkPartitionMetadataIsLoaded(___2977));
  480. m_ijkZoneInfos[___2977].getIJKFaceNeighbor(___451, ___457, neighborOffset, fnCoord, fnZone);
  481. if (fnCoord == ___2090(___2749) && getNumPartitions() > 1)
  482. {
  483. ___1844 neighborCellIJK = m_ijkZoneInfos[___2977].cellIJKAtCellAddress(___451) + m_ptnNodeMinIJKs[___2977] + ___1881::ijkFaceNeighborOffset[___457];
  484. if (0 <= neighborCellIJK && neighborCellIJK < getZoneIJK())
  485. {
  486. ___2090::___2980 neighborPartition = getPartitionForIJK(neighborCellIJK);
  487. neighborCellIJK -= m_ptnNodeMinIJKs[neighborPartition];
  488. if (neighborCellIJK <= m_ijkZoneInfos[neighborPartition].___2198())
  489. fnCoord = m_ijkZoneInfos[neighborPartition].cellAddressAtCellIJK(neighborCellIJK);
  490. }
  491. }
  492. }
  493. void getIJKFaceNeighbors(___2090 ___451, FaceIndex_t ___457, ___3269<___2090> &cellNeighbors, ___3269<___4636> &zoneNeighbors, bool &isFaceCompletelyObscured) const
  494. {
  495. REQUIRE(VALID_ITEM_ADDRESS(___451));
  496. REQUIRE(___457 < NUM_IJK_CELL_FACES);
  497. REQUIRE(cellNeighbors.empty());
  498. REQUIRE(zoneNeighbors.empty());
  499. ___2090 szlCellAddr;
  500. bool const isCellAddressUniform = ___451.___2065();
  501. if (isCellAddressUniform)
  502. {
  503. ___465 const paddedCellIndex = ___465(___451.___4258());
  504. szlCellAddr = cellAddressAtIJKPaddedCellIndex(paddedCellIndex);
  505. }
  506. else
  507. {
  508. szlCellAddr = ___451;
  509. }
  510. ___465 const numNeighbors = getNumIJKFaceNeighbors(szlCellAddr, ___457);
  511. ___478(numNeighbors != 0);
  512. isFaceCompletelyObscured = true;
  513. cellNeighbors.reserve(numNeighbors);
  514. cellNeighbors.___3503(numNeighbors);
  515. zoneNeighbors.reserve(numNeighbors);
  516. zoneNeighbors.___3503(numNeighbors);
  517. for (___465 n = 0; n < numNeighbors; ++n)
  518. {
  519. ___2090 fnCoord;
  520. ___4636 fnZone;
  521. getIJKFaceNeighbor(szlCellAddr, ___457, n, fnCoord, fnZone);
  522. if (fnCoord.___2065() && fnCoord.___4258() == ___2749)
  523. {
  524. ___478(fnZone == ___2750);
  525. cellNeighbors[n] = ___2090(___2749);
  526. zoneNeighbors[n] = ___2750;
  527. }
  528. else if (isCellAddressUniform)
  529. {
  530. cellNeighbors[n] = ___2090(paddedCellIndexAtIJKCellAddress(fnCoord));
  531. zoneNeighbors[n] = fnZone;
  532. }
  533. else
  534. {
  535. cellNeighbors[n] = fnCoord;
  536. zoneNeighbors[n] = fnZone;
  537. }
  538. }
  539. ENSURE(!cellNeighbors.empty());
  540. ENSURE(cellNeighbors.size() == zoneNeighbors.size());
  541. }
  542. };
  543. }
  544. }