Go to the documentation of this file.
32 && isA<wedgePolyPatch>(
patches[patchI])
36 refCast<const wedgePolyPatch>(
patches[patchI]);
43 pp.size() == wpp.size()
45 &&
mag(ppCosAngle - wppCosAngle) >= 1
e-3
74 if (
patches[patchI].size() && isA<wedgePolyPatch>(
patches[patchI]))
77 refCast<const wedgePolyPatch>(
patches[patchI]);
83 Info<<
" Wedge " << pp.
name() <<
" with angle "
84 <<
radToDeg(wedgeAngle) <<
" degrees"
91 if (oppositePatchI == -1)
95 Info<<
" ***Cannot find opposite wedge for wedge "
102 refCast<const wedgePolyPatch>(
patches[oppositePatchI]);
109 Info<<
" ***Wedges do not have the same axis."
110 <<
" Encountered " << pp.
axis()
111 <<
" on patch " << pp.
name()
112 <<
" which differs from " << opp.
axis()
113 <<
" on opposite wedge patch" << opp.
axis()
124 const face&
f = pp[i];
128 label p1 =
f.nextLabel(fp);
139 scalar d =
mag((pt - p0) & pp.
n());
145 Info<<
" ***Wedge patch " << pp.
name() <<
" not planar."
146 <<
" Point " << pt <<
" is not in patch plane by "
159 label nEdgesInError = 0;
163 const face&
f = fcs[faceI];
168 label p1 =
f.nextLabel(fp);
172 scalar magD =
mag(d);
174 if (magD > ROOTVSMALL)
179 label nEmptyDirs = 0;
180 label nNonEmptyDirs = 0;
181 for (
direction cmpt=0; cmpt<vector::nComponents; cmpt++)
183 if (
mag(d[cmpt]) > 1
e-6)
200 else if (nEmptyDirs == 1)
203 if (nNonEmptyDirs > 0)
211 else if (nEmptyDirs > 1)
230 Info<<
" ***Number of edges not aligned with or perpendicular to "
231 <<
"non-empty directions: " << nErrorEdges <<
endl;
236 setPtr->
resize(2*nEdgesInError);
241 setPtr->
insert(iter.key()[0]);
242 setPtr->
insert(iter.key()[1]);
253 Info<<
" All edges aligned with or perpendicular to "
254 <<
"non-empty directions." <<
endl;
281 newPts[faceI].
setSize(pts[faceI].size());
294 if (facePts.size() > index)
296 ptsAtIndex[faceI] = facePts[index];
314 if (facePts.size() > index)
316 facePts[index] = ptsAtIndex[faceI];
323 pts.transfer(newPts);
357 const face&
f = cpp[i];
358 nbrPoints[bFaceI].
setSize(
f.size());
362 nbrPoints[bFaceI][fp] = p0;
367 syncTools::syncBoundaryFaceList
376 label nErrorFaces = 0;
377 scalar avgMismatch = 0;
378 label nCoupledPoints = 0;
385 refCast<const coupledPolyPatch>(
patches[patchI]);
403 const face&
f = cpp[i];
405 if (
f.size() != nbrPoints[bFaceI].
size())
408 <<
"Local face size : " <<
f.size()
409 <<
" does not equal neighbour face size : "
410 << nbrPoints[bFaceI].
size()
418 scalar d =
mag(p0 - nbrPoints[bFaceI][j]);
420 if (d > smallDist[i])
445 if (nCoupledPoints > 0)
447 avgMismatch /= nCoupledPoints;
454 Info<<
" **Error in coupled point location: "
456 <<
" faces have their 0th or consecutive vertex not opposite"
457 <<
" their coupled equivalent. Average mismatch "
458 << avgMismatch <<
"."
468 Info<<
" Coupled point location match (average "
469 << avgMismatch <<
") OK." <<
endl;
480 const bool allGeometry,
484 label noFailedChecks = 0;
486 Info<<
"\nChecking geometry..." <<
endl;
491 Info<<
" Overall domain bounding box "
492 << globalBb.
min() <<
" " << globalBb.
max() <<
endl;
496 scalar minDistSqr =
magSqr(1
e-6 * globalBb.
span());
500 Info<<
" Mesh has " <<
mesh.nGeometricD()
501 <<
" geometric (non-empty/wedge) directions " << validDirs <<
endl;
505 Info<<
" Mesh has " <<
mesh.nSolutionD()
506 <<
" solution (non-empty) directions " << solDirs <<
endl;
508 if (
mesh.nGeometricD() < 3)
520 &&
mesh.checkEdgeAlignment(
true, validDirs, &nonAlignedPoints)
527 nonAlignedPoints.
size(),
533 Info<<
" <<Writing " << nNonAligned
534 <<
" points on non-aligned edges to set "
537 nonAlignedPoints.
write();
542 if (
mesh.checkClosedBoundary(
true)) noFailedChecks++;
546 cellSet aspectCells(
mesh,
"highAspectRatioCells",
mesh.nCells()/100+1);
549 mesh.checkClosedCells
564 Info<<
" <<Writing " << nNonClosed
565 <<
" non closed cells to set " <<
cells.name() <<
endl;
566 cells.instance() =
mesh.pointsInstance();
579 Info<<
" <<Writing " << nHighAspect
580 <<
" cells with high aspect ratio to set "
593 if (
mesh.checkFaceAreas(
true, &faces))
601 Info<<
" <<Writing " << nFaces
602 <<
" zero area faces to set " << faces.
name() <<
endl;
623 Info<<
" <<Writing " << nCells
624 <<
" zero volume cells to set " <<
cells.name() <<
endl;
625 cells.instance() =
mesh.pointsInstance();
637 if (
mesh.checkFaceOrthogonality(
true, &faces))
646 Info<<
" <<Writing " << nFaces
647 <<
" non-orthogonal faces to set " << faces.
name() <<
endl;
659 if (
mesh.checkFacePyramids(
true, -SMALL, &faces))
667 Info<<
" <<Writing " << nFaces
668 <<
" faces with incorrect orientation to set "
682 if (
mesh.checkFaceSkewness(
true, &faces))
690 Info<<
" <<Writing " << nFaces
691 <<
" skew faces to set " << faces.
name() <<
endl;
712 Info<<
" <<Writing " << nFaces
713 <<
" faces with incorrectly matched 0th (or consecutive)"
731 polyMeshTetDecomposition::checkFaceTets
734 polyMeshTetDecomposition::minTetQuality,
746 Info<<
" <<Writing " << nFaces
747 <<
" faces with low quality or negative volume "
748 <<
"decomposition tets to set " << faces.
name() <<
endl;
763 if (
mesh.checkEdgeLength(
true, minDistSqr, &
points))
772 <<
" points on short edges to set " <<
points.name()
781 if (
mesh.checkPointNearness(
false, minDistSqr, &
points))
791 <<
" near (closer than " <<
Foam::sqrt(minDistSqr)
792 <<
" apart) points to set " << nearPoints.
name() <<
endl;
802 if (
mesh.checkFaceAngles(
true, 10, &faces))
810 Info<<
" <<Writing " << nFaces
811 <<
" faces with concave angles to set " << faces.
name()
826 if (
mesh.checkFaceFlatness(
true, 0.8, &faces))
834 Info<<
" <<Writing " << nFaces
835 <<
" warped faces to set " << faces.
name() <<
endl;
849 if (
mesh.checkCellDeterminant(
true, &
cells))
855 Info<<
" <<Writing " << nCells
856 <<
" under-determined cells to set " <<
cells.name() <<
endl;
857 cells.instance() =
mesh.pointsInstance();
869 if (
mesh.checkConcaveCells(
true, &
cells))
875 Info<<
" <<Writing " << nCells
876 <<
" concave cells to set " <<
cells.name() <<
endl;
877 cells.instance() =
mesh.pointsInstance();
889 if (
mesh.checkFaceWeight(
true, 0.05, &faces))
895 Info<<
" <<Writing " << nFaces
896 <<
" faces with low interpolation weights to set "
910 if (
mesh.checkVolRatio(
true, 0.01, &faces))
916 Info<<
" <<Writing " << nFaces
917 <<
" faces with low volume ratio cells to set "
928 return noFailedChecks;
const Field< PointType > & points() const
Return reference to global points.
void resize(const label newSize)
Resize the hash table for efficiency.
const point & max() const
Maximum describing the bounding box.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Wedge front and back plane patch.
#define forAll(list, i)
Loop across all elements in list.
bool checkWedges(const polyMesh &, const bool report, const Vector< label > &, labelHashSet *)
Check wedge orientation.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool checkCoupledPoints(const polyMesh &, const bool report, labelHashSet *)
Check 0th vertex on coupled faces.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
label checkGeometry(const polyMesh &mesh, const bool allGeometry, const autoPtr< surfaceWriter > &)
Unit conversion functions.
virtual bool write() const
Write using setting from DB.
Ostream & endl(Ostream &os)
Add newline and flush stream.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
dimensioned< scalar > mag(const dimensioned< Type > &)
const fileName & instance() const
virtual bool owner() const =0
Does this side own the patch ?
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
vector span() const
The bounding box span (from minimum to maximum)
const vector & axis() const
Return axis of the wedge.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
const word & name() const
Return name.
void mergeAndWrite(const surfaceWriter &, const faceSet &)
Write vtk representation of (assembled) faceSet to vtk file in.
const point & min() const
Minimum describing the bounding box.
label size() const
Return number of elements in table.
Base class for graphics format writing. Entry points are.
errorManip< error > abort(error &err)
A collection of cell labels.
static scalarField calcFaceTol(const UList< face > &faces, const pointField &points, const pointField &faceCentres)
Calculate typical tolerance per face. Is currently max distance.
label start() const
Return start label of this patch in the polyMesh face list.
void setSize(const label)
Reset size of List.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const vectorField::subField faceCentres() const
Return face centres.
virtual void transformPosition(pointField &) const =0
Transform a patch-based position from other side to this side.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
const vector & n() const
Return the normal to the patch.
dimensionedScalar acos(const dimensionedScalar &ds)
const dimensionedScalar e
Elementary charge.
bool insert(const Key &key)
Insert a new entry.
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
A bounding box defined in terms of the points at its extremities.
scalar cosAngle() const
Return the cosine of the wedge angle.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
label findOppositeWedge(const polyMesh &, const wedgePolyPatch &)
const word & name() const
Return name.
label index() const
Return the index of this patch in the boundaryMesh.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
const vector & centreNormal() const
Return plane normal between the wedge boundaries.