------------------------------------------------------------------------------
| 1098 | |
| 1099 | //------------------------------------------------------------------------------ |
| 1100 | void vtkStructuredAMRGridConnectivity::CreateGhostedExtent(int gridId, int N) |
| 1101 | { |
| 1102 | assert("pre: gridId is out-of-bounds!" && (gridId >= 0) && |
| 1103 | (gridId < static_cast<int>(this->NumberOfGrids))); |
| 1104 | assert("pre: ghosted extents vector has not been allocated!" && |
| 1105 | (this->NumberOfGrids == this->GhostedExtents.size() / 6)); |
| 1106 | assert( |
| 1107 | "pre: number of ghost-layers requested should not be 0" && (this->NumberOfGhostLayers > 0)); |
| 1108 | |
| 1109 | int ext[6]; |
| 1110 | this->GetGridExtent(gridId, ext); |
| 1111 | |
| 1112 | switch (this->DataDescription) |
| 1113 | { |
| 1114 | case vtkStructuredData::VTK_STRUCTURED_X_LINE: |
| 1115 | IMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::LEFT)) ? N : 0; |
| 1116 | IMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::RIGHT)) ? N : 0; |
| 1117 | break; |
| 1118 | case vtkStructuredData::VTK_STRUCTURED_Y_LINE: |
| 1119 | JMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::BOTTOM)) ? N : 0; |
| 1120 | JMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::TOP)) ? N : 0; |
| 1121 | break; |
| 1122 | case vtkStructuredData::VTK_STRUCTURED_Z_LINE: |
| 1123 | KMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::BACK)) ? N : 0; |
| 1124 | KMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::FRONT)) ? N : 0; |
| 1125 | break; |
| 1126 | case vtkStructuredData::VTK_STRUCTURED_XY_PLANE: |
| 1127 | IMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::LEFT)) ? N : 0; |
| 1128 | IMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::RIGHT)) ? N : 0; |
| 1129 | JMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::BOTTOM)) ? N : 0; |
| 1130 | JMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::TOP)) ? N : 0; |
| 1131 | break; |
| 1132 | case vtkStructuredData::VTK_STRUCTURED_YZ_PLANE: |
| 1133 | JMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::BOTTOM)) ? N : 0; |
| 1134 | JMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::TOP)) ? N : 0; |
| 1135 | KMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::BACK)) ? N : 0; |
| 1136 | KMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::FRONT)) ? N : 0; |
| 1137 | break; |
| 1138 | case vtkStructuredData::VTK_STRUCTURED_XZ_PLANE: |
| 1139 | IMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::LEFT)) ? N : 0; |
| 1140 | IMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::RIGHT)) ? N : 0; |
| 1141 | KMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::BACK)) ? N : 0; |
| 1142 | KMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::FRONT)) ? N : 0; |
| 1143 | break; |
| 1144 | case vtkStructuredData::VTK_STRUCTURED_XYZ_GRID: |
| 1145 | IMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::LEFT)) ? N : 0; |
| 1146 | IMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::RIGHT)) ? N : 0; |
| 1147 | JMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::BOTTOM)) ? N : 0; |
| 1148 | JMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::TOP)) ? N : 0; |
| 1149 | KMIN(ext) -= (this->HasBlockConnection(gridId, AMRBlockFace::BACK)) ? N : 0; |
| 1150 | KMAX(ext) += (this->HasBlockConnection(gridId, AMRBlockFace::FRONT)) ? N : 0; |
| 1151 | break; |
| 1152 | default: |
| 1153 | std::cout << "Data description is: " << this->DataDescription << "\n"; |
| 1154 | std::cout.flush(); |
| 1155 | assert("pre: Undefined data-description!" && false); |
| 1156 | } // END switch |
| 1157 |
no test coverage detected