FEZoneInfo.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #pragma once
  2. #include "ThirdPartyHeadersBegin.h"
  3. #include <algorithm>
  4. #include <utility>
  5. #include <vector>
  6. #include <boost/foreach.hpp>
  7. #include <boost/shared_ptr.hpp>
  8. #include <boost/unordered_map.hpp>
  9. #include <boost/unordered_set.hpp>
  10. #include "ThirdPartyHeadersEnd.h"
  11. #include "FESubzonePartitionerInterface.h"
  12. #include "fileStuff.h"
  13. #include "SzlFileLoader.h"
  14. namespace tecplot
  15. {
  16. namespace ___3933
  17. {
  18. class ___1350
  19. {
  20. UNCOPYABLE_CLASS(___1350);
  21. public:
  22. ___1350(___465 ___2781, ___2718 ___2821, ___682 ___2789, boost::shared_ptr<FESubzonePartitionerInterface> subzonePartitioner, ___2090::___2980 ___2977 = ___2090::UNKNOWN_PARTITION, ___465 numGhostCells = 0, ___2718 numGhostNodes = 0) : m_numCells(___2781), m_numNodes(___2821), m_numCorners(___2789), m_subzonePartitioner(subzonePartitioner), m_partition(___2977), m_numGhostCells(numGhostCells), m_numGhostNodes(numGhostNodes), m_numReferencedPartitions(0) {}
  23. ~___1350() {}
  24. typedef boost::unordered_map<___2090::SubzoneOffset_t, boost::unordered_set<PartitionSubzone>> NeighborCszRefMap;
  25. typedef boost::unordered_map<___2090::SubzoneOffset_t, std::vector<___2479>> NszMinMaxMap;
  26. static ___2090::SubzoneOffset_t calcNumSubzones(___81 ___2812)
  27. {
  28. REQUIRE(___2812 > 0);
  29. REQUIRE(___2090::MAX_ITEM_OFFSET + 1 == DEFAULT_SUBZONE_MAX_FE_SIZE);
  30. ___2090::SubzoneOffset_t const numSubzones = ___2090::SubzoneOffset_t(1 + ((___2812 - 1) >> ___2090::ItemOffsetBitSize));
  31. ENSURE(numSubzones > 0 && numSubzones <= ___2812);
  32. return numSubzones;
  33. }
  34. ___2090::___2980 getPartition() const { return m_partition; }
  35. ___465 ___1766() const { return m_numCells; }
  36. ___2718 ___1768() const { return m_numNodes; }
  37. ___682 ___1767() const { return m_numCorners; }
  38. ___465 getNumGhostCells() const { return m_numGhostCells; }
  39. ___2718 getNumGhostNodes() const { return m_numGhostNodes; }
  40. inline ___2090::SubzoneOffset_t ___2783() const
  41. {
  42. ___2090::SubzoneOffset_t const ___2783 = m_subzonePartitioner->___2783();
  43. ENSURE(___2783 == 0 || ___2783 == calcNumSubzones(m_numCells - m_numGhostCells));
  44. return ___2783;
  45. }
  46. ___2090::ItemOffset_t ___2782(___2090::SubzoneOffset_t ___469) const { return m_subzonePartitioner->___2782(___469); }
  47. ___465 ___4608(___2090 szCoordinate) const { return m_subzonePartitioner->___4608(szCoordinate); }
  48. inline ___2090::SubzoneOffset_t ___2823() const
  49. {
  50. ___2090::SubzoneOffset_t const ___2823 = m_subzonePartitioner->___2823();
  51. ENSURE(___2823 == 0 || ___2823 == calcNumSubzones(m_numNodes - m_numGhostNodes));
  52. return ___2823;
  53. }
  54. ___2090::ItemOffset_t ___2822(___2090::SubzoneOffset_t ___2734) const { return m_subzonePartitioner->___2822(___2734); }
  55. ___2718 ___4657(___2090 szCoordinate) const { return m_subzonePartitioner->___4657(szCoordinate); }
  56. void addNeighborNodeCoordinate(___2718 ___4656, ___2090 szCoordinate) { m_subzonePartitioner->setNodeSubzoneCoordinate(___4656, szCoordinate); }
  57. inline void addNeighborCszInfo(tecplot::___2090::___2980 neighbor, std::vector<___2718> const &nodes, std::vector<boost::unordered_set<___2090::SubzoneOffset_t>> const &cellSubzones, std::vector<std::vector<___2479>> const &varMinMaxes)
  58. {
  59. REQUIRE(getPartition() != ___2090::INVALID_PARTITION);
  60. REQUIRE(neighbor != getPartition());
  61. REQUIRE(!nodes.empty());
  62. REQUIRE(nodes.size() == cellSubzones.size());
  63. REQUIRE(cellSubzones.size() == varMinMaxes.size());
  64. if (m_numReferencedPartitions == 0)
  65. {
  66. m_numReferencedPartitions = 2;
  67. m_referencedPartitions.alloc(m_numReferencedPartitions);
  68. m_referencedPartitions[0] = getPartition();
  69. m_referencedPartitions[1] = neighbor;
  70. }
  71. else
  72. {
  73. std::set<tecplot::___2090::___2980> partitions(m_referencedPartitions.begin(), m_referencedPartitions.end(m_numReferencedPartitions));
  74. if (partitions.insert(neighbor).second)
  75. {
  76. ++m_numReferencedPartitions;
  77. m_referencedPartitions.___937();
  78. m_referencedPartitions.alloc(m_numReferencedPartitions);
  79. int i = 0;
  80. BOOST_FOREACH (tecplot::___2090::___2980 ___2977, partitions)
  81. m_referencedPartitions[i++] = ___2977;
  82. }
  83. }
  84. for (size_t i = 0; i < nodes.size(); ++i)
  85. {
  86. ___2090 szCoordinate = ___3924(nodes[i]);
  87. ___2090::SubzoneOffset_t ___2757 = szCoordinate.subzoneOffset();
  88. BOOST_FOREACH (___2090::SubzoneOffset_t ___469, cellSubzones[i])
  89. m_neighborCszRefs[___2757].insert(PartitionSubzone(neighbor, ___469));
  90. std::vector<___2479> &minMaxes = m_nszMinMaxes[___2757];
  91. if (minMaxes.empty())
  92. minMaxes.resize(varMinMaxes[i].size());
  93. for (size_t ___2105 = 0; ___2105 < varMinMaxes[i].size(); ++___2105)
  94. minMaxes[___2105].include(varMinMaxes[i][___2105]);
  95. }
  96. }
  97. inline void addNeighborCszRef(___2090::SubzoneOffset_t ___2757, ___2090 cellCoordinate) { m_neighborCszRefs[___2757].insert(PartitionSubzone(cellCoordinate.___2977(), cellCoordinate.subzoneOffset())); }
  98. NeighborCszRefMap const &getNeighborCszRefs() const { return m_neighborCszRefs; }
  99. NszMinMaxMap const &getNszMinMaxes() const { return m_nszMinMaxes; }
  100. inline void resetNeighborInfo()
  101. {
  102. m_neighborCszRefs.clear();
  103. m_nszMinMaxes.clear();
  104. m_numReferencedPartitions = 0;
  105. m_referencedPartitions.___937();
  106. }
  107. inline ___2090 ___3924(___2718 ___4656) const
  108. {
  109. REQUIRE(0 <= ___4656 && ___4656 < m_numNodes);
  110. return m_subzonePartitioner->___3924(___4656);
  111. }
  112. inline ___2090 szCoordinateAtZoneCell(___2718 zoneCell) const
  113. {
  114. REQUIRE(0 <= zoneCell && zoneCell < m_numCells);
  115. return m_subzonePartitioner->szCoordinateAtZoneCell(zoneCell);
  116. }
  117. inline void addReferencedPartitions(std::set<tecplot::___2090::___2980> const &partitionSet)
  118. {
  119. REQUIRE(getPartition() != ___2090::INVALID_PARTITION);
  120. REQUIRE(!partitionSet.empty());
  121. std::set<tecplot::___2090::___2980> partitions(partitionSet);
  122. for (tecplot::___2090::___2980 i = 0; i < m_numReferencedPartitions; ++i)
  123. partitions.insert(m_referencedPartitions[i]);
  124. partitions.insert(getPartition());
  125. if (m_numReferencedPartitions != static_cast<tecplot::___2090::___2980>(partitions.size()))
  126. {
  127. m_referencedPartitions.___937();
  128. m_referencedPartitions.alloc((uint64_t)partitions.size());
  129. int i = 0;
  130. BOOST_FOREACH (tecplot::___2090::___2980 ___2977, partitions)
  131. {
  132. m_referencedPartitions[i] = ___2977;
  133. ++i;
  134. }
  135. m_numReferencedPartitions = i;
  136. }
  137. }
  138. tecplot::___2090::___2980 getNumReferencedPartitions() const { return m_numReferencedPartitions; }
  139. PartitionArray const &getReferencedPartitions() const { return m_referencedPartitions; }
  140. private:
  141. ___465 const m_numCells;
  142. ___2718 const m_numNodes;
  143. ___682 const m_numCorners;
  144. boost::shared_ptr<FESubzonePartitionerInterface> m_subzonePartitioner;
  145. ___2090::___2980 m_partition;
  146. ___465 const m_numGhostCells;
  147. ___2718 const m_numGhostNodes;
  148. NeighborCszRefMap m_neighborCszRefs;
  149. NszMinMaxMap m_nszMinMaxes;
  150. tecplot::___2090::___2980 m_numReferencedPartitions;
  151. PartitionArray m_referencedPartitions;
  152. };
  153. }
  154. }