68 return (idx.
x() >= 0 && idx.
y() >= 0 && idx.
z() >= 0);
79 const PDRblock& pdrBlock
86 const label maxPointId =
cmptMax(pdrBlock.sizes())+1;
89 <<
" nPoints:" <<
mesh.nPoints()
90 <<
" nCells:" <<
mesh.nCells()
91 <<
" nFaces:" <<
mesh.nFaces() <<
nl;
94 <<
" nPoints:" << pdrBlock.nPoints()
95 <<
" nCells:" << pdrBlock.nCells()
96 <<
" nFaces:" << pdrBlock.nFaces() <<
nl
97 <<
" min-edge:" << pdrBlock.edgeLimits().min() <<
nl;
99 Info<<
"Classifying ijk indexing... " <<
nl;
110 for (label celli = 0; celli <
mesh.nCells(); ++celli)
112 cellIndex[celli] = pdrBlock.findCell(cc[celli]);
119 IjkField<bool> cellFound(pdrBlock.sizes(),
false);
121 for (label celli=0; celli <
cellIndex.size(); ++celli)
125 if (isGoodIndex(cellIdx))
127 cellFound(cellIdx) =
true;
131 const label firstMiss = cellFound.find(
false);
136 for (label celli = firstMiss; celli < cellFound.size(); ++celli)
138 if (!cellFound[celli])
145 <<
"No ijk location found for "
146 << nMissing <<
" cells.\nFirst miss at: "
147 << pdrBlock.index(firstMiss)
155 List<labelVector> pointIndex(
mesh.nPoints());
157 for (label pointi = 0; pointi <
mesh.nPoints(); ++pointi)
164 const labelMinMax invertedLimits(maxPointId, -maxPointId);
165 Vector<labelMinMax> faceLimits;
167 const Vector<direction> faceBits
177 for (label facei=0; facei <
mesh.nFaces(); ++facei)
182 const label own =
mesh.faceOwner()[facei];
185 facei <
mesh.nInternalFaces()
186 ?
mesh.faceNeighbour()[facei]
193 faceIdx.x() = faceIdx.y() = faceIdx.z() = -1;
199 faceLimits.x() = faceLimits.y() = faceLimits.z() = invertedLimits;
201 for (
const label pointi :
mesh.faces()[facei])
205 faceLimits[cmpt].add(pointIndex[pointi][cmpt]);
213 const auto& limits = faceLimits[cmpt];
219 <<
"Unexpected search failure for " << facei <<
" in "
224 if (limits.min() < 0)
227 <<
"Face " << facei <<
" contains non-grid point in "
229 <<
mesh.faces()[facei] <<
' '
230 <<
mesh.faces()[facei].points(
mesh.points())
233 else if (limits.min() == limits.max())
236 inPlane |= faceBits[cmpt];
238 else if (limits.min() + 1 != limits.max())
241 <<
"Face " << facei <<
" not in "
263 <<
"Face " << facei <<
" not in an x/y/z plane?" <<
nl
268 faceIdx.x() = faceLimits.x().min();
269 faceIdx.y() = faceLimits.y().min();
270 faceIdx.z() = faceLimits.z().min();
278 const PDRblock& pdrBlock
282 classify(
mesh, pdrBlock);