35 #include "primitiveMeshTools.H"
39 #include "IOdictionary.H"
46 int main(
int argc,
char *argv[])
54 argList::noParallel();
58 #include "setRootCase.H"
59 #include "createTime.H"
60 #include "createPolyMesh.H"
62 IOdictionary QGDCellQuality
74 scalar faceCosine (readScalar(QGDCellQuality.lookup(
"faceCosine")));
75 scalar maxAspectRatio(readScalar(QGDCellQuality.lookup(
"maxAspectRatio")));
78 cellSet badFaceAngle (mesh,
"badFaceAngle", IOobject::NO_READ);
80 const labelListList& pointFaces =
83 const label nInternalFaces = mesh.nInternalFaces();
87 forAll(pointFaces[ipoint], iface)
89 label ifaceId = pointFaces[ipoint][iface];
91 label iown = mesh.faceOwner()[ifaceId];
92 if (ifaceId < nInternalFaces)
94 inei = mesh.faceNeighbour()[ifaceId];
97 forAll(pointFaces[ipoint], kface)
99 label kfaceId = pointFaces[ipoint][kface];
100 if (ifaceId == kfaceId)
106 label kown = mesh.faceOwner()[kfaceId];
107 if (kfaceId < nInternalFaces)
109 knei = mesh.faceNeighbour()[kfaceId];
112 vector ni = mesh.faceAreas()[ifaceId] / mag(mesh.faceAreas()[ifaceId]);
113 vector nk = mesh.faceAreas()[kfaceId] / mag(mesh.faceAreas()[kfaceId]);
115 scalar dotnf = mag( ni & nk );
117 if ((inei == knei) && (inei >= 0))
120 if (dotnf >= faceCosine)
122 badFaceAngle.insert(inei);
126 if ((iown == kown) || (iown == knei))
129 if (dotnf >= faceCosine)
131 badFaceAngle.insert(iown);
137 if (dotnf >= faceCosine)
139 badFaceAngle.insert(inei);
147 badFaceAngle.write();
153 scalarField openness(mesh.cellVolumes().size(), 0);
154 scalarField aspectRatio(mesh.cellVolumes().size(), 1);
156 primitiveMeshTools::cellClosedness
166 cellSet highAspectRatio (mesh,
"highAspectRatio", IOobject::NO_READ);
168 forAll(aspectRatio, iCell)
170 if (aspectRatio[iCell] > maxAspectRatio)
172 highAspectRatio.insert(iCell);
182 Info<<
"End\n" << endl;
int main(int argc, char *argv[])