68 return (idx.
x() >= 0 && idx.
y() >= 0 && idx.
z() >= 0);
79 const PDRblock& pdrBlock
86 const label maxPointId =
cmptMax(pdrBlock.sizes())+1;
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)
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)
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 "
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);
void resize(const label len)
Adjust allocated size of list.
List< labelVector > cellIndex
For each cell, the corresponding i-j-k address.
List< direction > faceOrient
For each face, the x/y/z orientation.
void classify(const polyMesh &mesh, const PDRblock &pdrBlock)
Determine i-j-k indices for faces/cells.
static scalar gridPointRelTol
Relative tolerance when matching grid points. Default = 0.02.
labelVector cellDims
The cell i-j-k addressing range.
List< labelVector > faceIndex
For each face, the corresponding i-j-k address.
labelVector faceDims
The face i-j-k addressing range.
virtual bool read()
Re-read model coefficients if they have changed.
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
@ XDIR
1: x-direction (vector component 0)
@ ZDIR
4: z-direction (vector component 2)
@ YDIR
2: y-direction (vector component 1)
static const char *const componentNames[]
static constexpr direction nComponents
Number of components in bool is 1.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
virtual const labelList & faceNeighbour() const
Return face neighbour.
virtual const pointField & points() const
Return raw points.
label nInternalFaces() const noexcept
Number of internal faces.
const vectorField & cellCentres() const
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
label nFaces() const noexcept
Number of mesh faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Vector< label > labelVector
Vector of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
MinMax< label > labelMinMax
A label min/max range.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)