Go to the documentation of this file.
65 const PDRblock& pdrBlock
72 const label maxPointId =
cmptMax(pdrBlock.sizes())+1;
75 <<
" nPoints:" <<
mesh.nPoints()
76 <<
" nCells:" <<
mesh.nCells()
77 <<
" nFaces:" <<
mesh.nFaces() <<
nl;
80 <<
" minEdgeLen:" << pdrBlock.minEdgeLen() <<
nl;
84 List<labelVector> pointIndex(
mesh.nPoints());
86 for (label pointi=0; pointi <
mesh.nPoints(); ++pointi)
93 const labelMinMax invertedLimits(maxPointId, -maxPointId);
94 Vector<labelMinMax> faceLimits;
96 const Vector<direction> faceBits
106 for (label facei=0; facei <
mesh.nFaces(); ++facei)
108 faceLimits.x() = faceLimits.y() = faceLimits.z() = invertedLimits;
110 for (
const label pointi :
mesh.faces()[facei])
114 faceLimits[cmpt].add(pointIndex[pointi][cmpt]);
122 const auto& limits = faceLimits[cmpt];
128 <<
"Unexpected search failure for " << facei <<
" in "
133 if (limits.min() < 0)
136 <<
"Face " << facei <<
" contains non-grid point in "
140 else if (limits.min() == limits.max())
143 inPlane |= faceBits[cmpt];
145 else if (limits.min() + 1 != limits.max())
170 <<
"Face " << facei <<
" not in an x/y/z plane?" <<
nl
178 faceLimits.x().min(),
179 faceLimits.y().min(),
195 for (label celli=0; celli <
mesh.nCells(); ++celli)
197 cellIndex[celli] = pdrBlock.findCell(cc[celli]);
204 for (label celli=0; celli <
mesh.nCells(); ++celli)
208 for (
const label facei :
mesh.cells()[celli])
226 IjkField<bool> cellFound(pdrBlock.sizes(),
false);
228 for (label celli=0; celli <
cellIndex.size(); ++celli)
234 cellFound(cellIdx) =
true;
238 label firstMissing = cellFound.find(
false);
240 if (firstMissing >= 0)
243 <<
"No cell found for " << pdrBlock.index(firstMissing)
254 const PDRblock& pdrBlock
258 classify(
mesh, pdrBlock);
List< labelVector > faceIndex
For each face, the corresponding i-j-k address.
vectorField pointField
pointField is a vectorField.
void classify(const polyMesh &mesh, const PDRblock &pdrBlock)
Determine i-j-k indices for faces/cells.
static const Vector< label > one
static Vector< label > uniform(const label &s)
Return a VectorSpace with all elements = s.
static const char *const componentNames[]
labelVector cellDims
The cell i-j-k addressing range.
1: x-direction (vector component 0)
2: y-direction (vector component 1)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
labelVector faceDims
The face i-j-k addressing range.
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Vector< label > labelVector
Vector of labels.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
List< direction > faceOrient
For each face, the x/y/z orientation.
messageStream Info
Information stream (uses stdout - output is on the master only)
List< labelVector > cellIndex
For each cell, the corresponding i-j-k address.
void resize(const label newSize)
Adjust allocated size of list.
MinMax< label > labelMinMax
A label min/max range.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void read(const Time &runTime, const PDRblock &pdrBlock)
Read OpenFOAM mesh and determine i-j-k indices for faces/cells.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
4: z-direction (vector component 2)
vector point
Point is a vector.
static scalar gridPointRelTol
Relative tolerance when matching grid points. Default = 0.02.
static constexpr direction nComponents
Number of components in this vector space.