Trip HTG tests htGrid : instance of HYperTreeGrid originHTG : coordinates origine of HyperTreeGrid inputTreeIndex : particular case -1 : checked all index (iTest == 0) 0 to ... : checked neighbor index tree (iTest != 0) allTreeIndex : expected result neighbor index tree maskedRootCellsTree : indices of cells masked
| 199 | // allTreeIndex : expected result neighbor index tree |
| 200 | // maskedRootCellsTree : indices of cells masked |
| 201 | void Trip(vtkHyperTreeGrid* htGrid, const std::vector<double>& originHTG, |
| 202 | const std::vector<vtkIdType>& inputTreeIndex, |
| 203 | #ifndef NDEBUG |
| 204 | const std::vector<std::vector<vtkIdType>>& allTreeIndex, |
| 205 | const std::vector<bool>& maskedRootCellsTree |
| 206 | #else |
| 207 | const std::vector<std::vector<vtkIdType>>& vtkNotUsed(allTreeIndex), |
| 208 | const std::vector<bool>& vtkNotUsed(maskedRootCellsTree) |
| 209 | #endif |
| 210 | ) |
| 211 | { |
| 212 | TripAll(htGrid); |
| 213 | |
| 214 | // Other pass across tree roots follow inputTreeIndex |
| 215 | for (size_t iTest = 0; iTest < inputTreeIndex.size(); ++iTest) |
| 216 | { |
| 217 | vtkNew<vtkHyperTreeGridNonOrientedMooreSuperCursor> supercursor; |
| 218 | |
| 219 | htGrid->InitializeNonOrientedMooreSuperCursor(supercursor, inputTreeIndex[iTest]); |
| 220 | |
| 221 | if (supercursor->GetTree() != nullptr) |
| 222 | { |
| 223 | continue; |
| 224 | } |
| 225 | if (supercursor->IsMasked()) |
| 226 | { |
| 227 | #ifndef NDEBUG |
| 228 | const vtkIdType crtTreeIndex = |
| 229 | #endif |
| 230 | ComputeTreeIndex(htGrid, originHTG, supercursor, supercursor->GetIndiceCentralCursor()); |
| 231 | |
| 232 | assert(maskedRootCellsTree[crtTreeIndex] || |
| 233 | GuruMeditation(iTest, "expected root cell masked", htGrid, originHTG, supercursor)); |
| 234 | continue; |
| 235 | } |
| 236 | for (unsigned int iC = 0; iC < supercursor->GetNumberOfCursors(); ++iC) |
| 237 | { |
| 238 | vtkHyperTree* ht = supercursor->GetTree(iC); |
| 239 | if (ht != nullptr) |
| 240 | { |
| 241 | assert(supercursor->GetLevel(iC) == 0 || |
| 242 | GuruMeditation(iTest, "The level of origin cell of an HT is always 0 !")); |
| 243 | assert(supercursor->GetGlobalNodeIndex(iC) <= htGrid->GetGlobalNodeIndexMax() || |
| 244 | GuruMeditation(iTest, |
| 245 | "The global node index of origin cell of an HT is always lower and equal than global " |
| 246 | "node index max !")); |
| 247 | assert((htGrid->GetGlobalNodeIndexMax() + 1) == htGrid->GetNumberOfCells() || |
| 248 | GuruMeditation(iTest, |
| 249 | "The global node index max more one is equal a number of cells, in this case !")); |
| 250 | #ifndef NDEBUG |
| 251 | const vtkIdType crtTreeIndex = |
| 252 | #endif |
| 253 | ComputeTreeIndex(htGrid, originHTG, supercursor, iC); |
| 254 | if (!supercursor->IsMasked(iC)) |
| 255 | { |
| 256 | assert(!maskedRootCellsTree[crtTreeIndex] || |
| 257 | GuruMeditation(iTest, "expected neighbor not masked", htGrid, originHTG, supercursor)); |
| 258 |
no test coverage detected