43 void Foam::snappyLayerDriver::sumWeights
45 const PackedBoolList& isMasterEdge,
58 if (isMasterEdge.get(meshEdges[edgei]) == 1)
60 const edge&
e = edges[edgei];
70 - pts[meshPoints[
e[0]]]
73 scalar eWeight = 1.0/eMag;
75 invSumWeight[
e[0]] += eWeight;
76 invSumWeight[
e[1]] += eWeight;
89 forAll(invSumWeight, pointi)
91 scalar w = invSumWeight[pointi];
95 invSumWeight[pointi] = 1.0/w;
102 void Foam::snappyLayerDriver::smoothField
104 const motionSmoother& meshMover,
105 const PackedBoolList& isMasterPoint,
106 const PackedBoolList& isMasterEdge,
109 const label nSmoothDisp,
115 const labelList& meshPoints = pp.meshPoints();
128 Info<<
"shrinkMeshDistance : Smoothing field ..." <<
endl;
130 for (
label iter = 0; iter < nSmoothDisp; iter++)
154 average[pointi] < field[pointi]
155 &&
average[pointi] >= fieldMin[pointi]
158 field[pointi] =
average[pointi];
163 if ((iter % 10) == 0)
172 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
269 void Foam::snappyLayerDriver::smoothPatchNormals
271 const motionSmoother& meshMover,
272 const PackedBoolList& isMasterPoint,
273 const PackedBoolList& isMasterEdge,
275 const label nSmoothDisp,
281 const labelList& meshPoints = pp.meshPoints();
296 Info<<
"shrinkMeshDistance : Smoothing normals ..." <<
endl;
298 for (
label iter = 0; iter < nSmoothDisp; iter++)
314 if ((iter % 10) == 0)
323 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
331 normals[pointi] =
average[pointi];
332 normals[pointi] /=
mag(normals[pointi]) + vSmall;
339 void Foam::snappyLayerDriver::smoothNormals
341 const label nSmoothDisp,
342 const PackedBoolList& isMasterPoint,
343 const PackedBoolList& isMasterEdge,
349 Info<<
"shrinkMeshDistance : Smoothing normals in interior ..." <<
endl;
351 const fvMesh& mesh = meshRefiner_.mesh();
352 const edgeList& edges = mesh.edges();
355 PackedBoolList isFixedPoint(mesh.nPoints());
360 label meshPointi = fixedPoints[i];
361 isFixedPoint.set(meshPointi, 1);
385 for (
label iter = 0; iter < nSmoothDisp; iter++)
401 if ((iter % 10) == 0)
409 Info<<
" Iteration " << iter <<
" residual " << resid <<
endl;
416 if (isFixedPoint.get(pointi) == 0)
420 normals[pointi] =
average[pointi];
421 normals[pointi] /=
mag(normals[pointi]) + vSmall;
430 bool Foam::snappyLayerDriver::isMaxEdge
432 const List<pointData>& pointWallDist,
437 const fvMesh& mesh = meshRefiner_.mesh();
442 const edge&
e = mesh.edges()[edgei];
445 scalar magV0(
mag(v0));
453 scalar magV1(
mag(v1));
478 if ((pointWallDist[
e[0]].v() & pointWallDist[
e[1]].v()) < minCos)
491 void Foam::snappyLayerDriver::handleFeatureAngleLayerTerminations
494 const PackedBoolList& isMasterPoint,
497 List<extrudeMode>& extrudeStatus,
503 const fvMesh& mesh = meshRefiner_.mesh();
508 boolList extrudedFaces(pp.size(),
true);
510 forAll(pp.localFaces(), facei)
512 const face&
f = pp.localFaces()[facei];
516 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
518 extrudedFaces[facei] =
false;
533 List<List<point>> edgeFaceNormals(pp.nEdges());
534 List<List<bool>> edgeFaceExtrude(pp.nEdges());
538 const labelList& meshPoints = pp.meshPoints();
542 const labelList& eFaces = edgeFaces[edgei];
544 edgeFaceNormals[edgei].
setSize(eFaces.size());
545 edgeFaceExtrude[edgei].setSize(eFaces.size());
548 label facei = eFaces[i];
549 edgeFaceNormals[edgei][i] = faceNormals[facei];
550 edgeFaceExtrude[edgei][i] = extrudedFaces[facei];
559 globalMeshData::ListPlusEqOp<List<point>>(),
568 globalMeshData::ListPlusEqOp<List<bool>>(),
573 forAll(edgeFaceNormals, edgei)
575 const List<point>& eFaceNormals = edgeFaceNormals[edgei];
576 const List<bool>& eFaceExtrude = edgeFaceExtrude[edgei];
578 if (eFaceNormals.size() == 2)
580 const edge&
e = pp.edges()[edgei];
586 extrudeStatus[v0] != NOEXTRUDE
587 || extrudeStatus[v1] != NOEXTRUDE
590 if (!eFaceExtrude[0] || !eFaceExtrude[1])
592 const vector& n0 = eFaceNormals[0];
593 const vector& n1 = eFaceNormals[1];
595 if ((n0 & n1) < minCos)
608 if (isMasterPoint[meshPoints[v0]])
624 if (isMasterPoint[meshPoints[v1]])
643 void Foam::snappyLayerDriver::findIsolatedRegions
645 const scalar minCosLayerTermination,
646 const PackedBoolList& isMasterPoint,
647 const PackedBoolList& isMasterEdge,
651 List<extrudeMode>& extrudeStatus,
656 const fvMesh& mesh = meshRefiner_.mesh();
658 Info<<
"shrinkMeshDistance : Removing isolated regions ..." <<
endl;
661 label nPointCounter = 0;
667 handleFeatureAngleLayerTerminations
669 minCosLayerTermination,
680 syncPatchDisplacement
693 boolList extrudedFaces(pp.size(),
true);
694 forAll(pp.localFaces(), facei)
696 const face&
f = pp.localFaces()[facei];
699 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
701 extrudedFaces[facei] =
false;
709 boolList keptPoints(pp.nPoints(),
false);
710 forAll(keptPoints, patchPointi)
717 if (extrudedFaces[facei])
719 keptPoints[patchPointi] =
true;
736 forAll(keptPoints, patchPointi)
738 if (!keptPoints[patchPointi])
774 if (isMasterEdge.get(meshEdges[edgei]) == 1)
776 const edge&
e = edges[edgei];
781 if (extrudeStatus[v1] != NOEXTRUDE)
783 isolatedPoint[v0] += 1;
785 if (extrudeStatus[v0] != NOEXTRUDE)
787 isolatedPoint[v1] += 1;
805 const face&
f = pp.localFaces()[facei];
809 if (isolatedPoint[
f[fp]] > 2)
815 bool allPointsExtruded =
true;
820 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
822 allPointsExtruded =
false;
827 if (allPointsExtruded)
849 reduce(nPointCounter, sumOp<label>());
850 Info<<
"Number isolated points extrusion stopped : "<< nPointCounter
861 void Foam::snappyLayerDriver::medialAxisSmoothingInfo
863 const motionSmoother& meshMover,
864 const label nSmoothNormals,
865 const label nSmoothSurfaceNormals,
866 const scalar minMedialAxisAngleCos,
867 const scalar featureAngle,
876 Info<<
"medialAxisSmoothingInfo :"
877 <<
" Calculate distance to Medial Axis ..." <<
endl;
879 const polyMesh& mesh = meshMover.mesh();
883 const labelList& meshPoints = pp.meshPoints();
911 UIndirectList<point>(meshPointNormals, meshPoints) = pointNormals;
927 nSmoothSurfaceNormals,
935 UIndirectList<point>(meshPointNormals, meshPoints) = pointNormals;
938 "smoothed pointNormals",
948 List<pointData> pointWallDist(mesh.nPoints());
951 int dummyTrackData = 0;
957 List<pointData> wallInfo(meshPoints.size());
959 forAll(meshPoints, patchPointi)
961 label pointi = meshPoints[patchPointi];
962 wallInfo[patchPointi] = pointData
967 pointNormals[patchPointi]
972 List<pointData> edgeWallDist(mesh.nEdges());
973 PointEdgeWave<pointData> wallDistCalc
980 mesh.globalData().nTotalPoints(),
987 wallDistCalc.getUnsetPoints(),
994 <<
"Walking did not visit all points." <<
nl
995 <<
" Did not visit " << nUnvisit
996 <<
" out of " << mesh.globalData().nTotalPoints()
997 <<
" points. This is not necessarily a problem" <<
nl
998 <<
" and might be due to faceZones splitting of part"
999 <<
" of the domain." <<
nl <<
endl;
1011 forAll(pointWallDist, pointi)
1013 origin[pointi] = pointWallDist[pointi].origin();
1014 distSqr[pointi] = pointWallDist[pointi].distSqr();
1016 passiveV[pointi] = pointWallDist[pointi].v();
1028 List<pointData> pointMedialDist(mesh.nPoints());
1029 List<pointData> edgeMedialDist(mesh.nEdges());
1032 DynamicList<pointData> maxInfo(meshPoints.size());
1033 DynamicList<label> maxPoints(meshPoints.size());
1037 const edgeList& edges = mesh.edges();
1041 const edge&
e = edges[edgei];
1045 !pointWallDist[
e[0]].
valid(dummyTrackData)
1046 || !pointWallDist[
e[1]].
valid(dummyTrackData)
1051 else if (isMaxEdge(pointWallDist, edgei, minMedialAxisAngleCos))
1059 scalar eMag =
mag(eVec);
1067 scalar dist0 = (p0-pointWallDist[
e[0]].origin()) & eVec;
1068 scalar dist1 = (pointWallDist[
e[1]].origin()-p1) & eVec;
1069 scalar
s = 0.5*(dist1+eMag+dist0);
1076 else if (
s >= dist0+eMag)
1082 medialAxisPt = p0+(
s-dist0)*eVec;
1089 if (!pointMedialDist[pointi].
valid(dummyTrackData))
1091 maxPoints.append(pointi);
1102 pointMedialDist[pointi] = maxInfo.last();
1111 const polyBoundaryMesh&
patches = mesh.boundaryMesh();
1113 labelHashSet adaptPatches(meshMover.adaptPatchIndices());
1120 meshMover.displacement().boundaryField()[
patchi];
1125 && !isA<emptyPolyPatch>(pp)
1126 && !adaptPatches.found(
patchi)
1129 const labelList& meshPoints = pp.meshPoints();
1136 if (pvf.fixesValue())
1139 Info<<
"Inserting all points on patch " << pp.name()
1144 label pointi = meshPoints[i];
1145 if (!pointMedialDist[pointi].
valid(dummyTrackData))
1147 maxPoints.append(pointi);
1158 pointMedialDist[pointi] = maxInfo.last();
1169 Info<<
"Inserting points on patch " << pp.name()
1170 <<
" if angle to nearest layer patch > "
1173 scalar featureAngleCos =
Foam::cos(featureAngle);
1178 label pointi = meshPoints[i];
1182 pointWallDist[pointi].
valid(dummyTrackData)
1183 && !pointMedialDist[pointi].
valid(dummyTrackData)
1189 -pointWallDist[pointi].v()
1192 if (cosAngle > featureAngleCos)
1197 maxPoints.append(pointi);
1208 pointMedialDist[pointi] = maxInfo.last();
1225 PointEdgeWave<pointData> medialDistCalc
1233 mesh.globalData().nTotalPoints(),
1238 forAll(pointMedialDist, pointi)
1240 medialDist[pointi] =
Foam::sqrt(pointMedialDist[pointi].distSqr());
1241 medialVec[pointi] = pointMedialDist[pointi].origin();
1255 if (!pointWallDist[i].
valid(dummyTrackData))
1257 dispVec[i] =
vector(1, 0, 0);
1261 dispVec[i] = pointWallDist[i].v();
1281 forAll(medialRatio, pointi)
1283 if (!pointWallDist[pointi].
valid(dummyTrackData))
1285 medialRatio[pointi] = 0.0;
1289 scalar wDist2 = pointWallDist[pointi].distSqr();
1290 scalar mDist = medialDist[pointi];
1292 if (wDist2 <
sqr(small) && mDist < small)
1299 medialRatio[pointi] = 0.0;
1303 medialRatio[pointi] = mDist / (
Foam::sqrt(wDist2) + mDist);
1318 Info<<
"medialAxisSmoothingInfo :"
1319 <<
" Writing:" <<
nl
1320 <<
" " << dispVec.name()
1321 <<
" : normalised direction of nearest displacement" <<
nl
1322 <<
" " << medialDist.name()
1323 <<
" : distance to medial axis" <<
nl
1324 <<
" " << medialVec.name()
1325 <<
" : nearest point on medial axis" <<
nl
1326 <<
" " << medialRatio.name()
1327 <<
" : ratio of medial distance to wall distance" <<
nl
1329 meshRefiner_.mesh().setInstance(meshRefiner_.name());
1338 mesh.time().path()/meshRefiner_.name()
1343 medialRatio.
write();
1348 void Foam::snappyLayerDriver::shrinkMeshMedialDistance
1350 motionSmoother& meshMover,
1351 const dictionary& meshQualityDict,
1352 const List<labelPair>& baffles,
1353 const label nSmoothPatchThickness,
1354 const label nSmoothDisplacement,
1355 const scalar maxThicknessToMedialRatio,
1356 const label nAllowableErrors,
1358 const scalar minCosLayerTermination,
1368 List<extrudeMode>& extrudeStatus,
1373 Info<<
"shrinkMeshMedialDistance : Smoothing using Medial Axis ..." <<
endl;
1375 const polyMesh& mesh = meshMover.mesh();
1378 const labelList& meshPoints = pp.meshPoints();
1396 thickness =
mag(patchDisp);
1398 forAll(thickness, patchPointi)
1400 if (extrudeStatus[patchPointi] == NOEXTRUDE)
1402 thickness[patchPointi] = 0.0;
1406 label numThicknessRatioExclude = 0;
1411 autoPtr<OBJstream> str;
1419 /
"thicknessRatioExcludePoints_"
1420 + meshRefiner_.name()
1424 Info<<
"Writing points with too large an extrusion distance to "
1425 << str().name() <<
endl;
1428 autoPtr<OBJstream> medialVecStr;
1436 /
"thicknessRatioExcludeMedialVec_"
1437 + meshRefiner_.name()
1441 Info<<
"Writing points with too large an extrusion distance to "
1442 << medialVecStr().name() <<
endl;
1445 forAll(meshPoints, patchPointi)
1447 if (extrudeStatus[patchPointi] != NOEXTRUDE)
1449 label pointi = meshPoints[patchPointi];
1453 scalar mDist = medialDist[pointi];
1454 scalar thicknessRatio = thickness[patchPointi]/(mDist+vSmall);
1459 patchDisp[patchPointi]
1460 / (
mag(patchDisp[patchPointi]) + vSmall);
1461 vector mVec = mesh.points()[pointi]-medialVec[pointi];
1462 mVec /=
mag(mVec)+vSmall;
1463 thicknessRatio *= (
n&mVec);
1465 if (thicknessRatio > maxThicknessToMedialRatio)
1470 Pout<<
"truncating displacement at "
1471 << mesh.points()[pointi]
1472 <<
" from " << thickness[patchPointi]
1476 minThickness[patchPointi]
1477 +thickness[patchPointi]
1479 <<
" medial direction:" << mVec
1480 <<
" extrusion direction:" <<
n
1481 <<
" with thicknessRatio:" << thicknessRatio
1485 thickness[patchPointi] =
1486 0.5*(minThickness[patchPointi]+thickness[patchPointi]);
1488 patchDisp[patchPointi] = thickness[patchPointi]*
n;
1490 if (isMasterPoint[pointi])
1492 numThicknessRatioExclude++;
1497 const point& pt = mesh.points()[pointi];
1498 str().write(
linePointRef(pt, pt+patchDisp[patchPointi]));
1500 if (medialVecStr.valid())
1502 const point& pt = mesh.points()[pointi];
1503 medialVecStr().write
1516 reduce(numThicknessRatioExclude, sumOp<label>());
1517 Info<<
"shrinkMeshMedialDistance : Reduce layer thickness at "
1518 << numThicknessRatioExclude
1519 <<
" nodes where thickness to medial axis distance is large " <<
endl;
1526 minCosLayerTermination,
1539 forAll(thickness, patchPointi)
1541 if (extrudeStatus[patchPointi] == NOEXTRUDE)
1543 thickness[patchPointi] = 0.0;
1556 nSmoothPatchThickness,
1562 int dummyTrackData = 0;
1564 List<pointData> pointWallDist(mesh.nPoints());
1571 List<pointData> edgeWallDist(mesh.nEdges());
1572 labelList wallPoints(meshPoints.size());
1575 List<pointData> wallInfo(meshPoints.size());
1577 forAll(meshPoints, patchPointi)
1579 label pointi = meshPoints[patchPointi];
1580 wallPoints[patchPointi] = pointi;
1581 wallInfo[patchPointi] = pointData
1585 thickness[patchPointi],
1591 PointEdgeWave<pointData> wallDistCalc
1598 mesh.globalData().nTotalPoints(),
1606 forAll(displacement, pointi)
1608 if (!pointWallDist[pointi].
valid(dummyTrackData))
1610 displacement[pointi] =
Zero;
1619 displacement[pointi] =
1620 -medialRatio[pointi]
1621 *pointWallDist[pointi].s()
1629 if (nSmoothDisplacement > 0)
1643 Info<<
"shrinkMeshDistance : Smoothing displacement ..." <<
endl;
1645 const scalar
lambda = 0.33;
1646 const scalar
mu = -0.34;
1649 for (
label iter = 0; iter < nSmoothDisplacement; iter++)
1666 if (medialRatio[i] > small && medialRatio[i] < 1-small)
1669 (1-
lambda)*displacement[i]
1690 if (medialRatio[i] > small && medialRatio[i] < 1-small)
1692 displacement[i] = (1-
mu)*displacement[i]+
mu*
average[i];
1698 if ((iter % 10) == 0)
1706 Info<<
" Iteration " << iter <<
" residual " << resid
1714 meshMover.setDisplacementPatchFields();
1725 forAll(pointWallDist, pointi)
1727 pWallDist[pointi] = pointWallDist[pointi].s();
1737 "displacement BEFORE",
1742 meshMover.correctBoundaryConditions(displacement);
1745 "displacement AFTER",
1754 const_cast<Time&
>(mesh.time())++;
1755 Info<<
"Writing wanted-displacement mesh (possibly illegal) to "
1756 << meshRefiner_.name() <<
endl;
1759 meshRefiner_.mesh().movePoints(meshMover.curPoints());
1761 meshMover.movePoints();
1769 meshRefiner_.mesh().setInstance(meshRefiner_.name());
1779 mesh.time().path()/meshRefiner_.name()
1783 medialRatio.write();
1786 meshRefiner_.mesh().movePoints(oldPoints);
1788 meshMover.movePoints();
1795 Info<<
"shrinkMeshMedialDistance : Moving mesh ..." <<
endl;
1796 scalar oldErrorReduction = -1;
1798 for (
label iter = 0; iter < 2*nSnap ; iter++)
1800 Info<<
"Iteration " << iter <<
endl;
1803 Info<<
"Displacement scaling for error reduction set to 0." <<
endl;
1804 oldErrorReduction = meshMover.setErrorReduction(0.0);
1813 meshMover.paramDict(),
1820 Info<<
"shrinkMeshMedialDistance : Successfully moved mesh" <<
endl;
1825 if (oldErrorReduction >= 0)
1827 meshMover.setErrorReduction(oldErrorReduction);
1830 Info<<
"shrinkMeshMedialDistance : Finished moving mesh ..." <<
endl;
#define forAll(list, i)
Loop across all elements in list.
void setSize(const label)
Reset size of List.
virtual Ostream & write(const char)=0
Write character.
static void testSyncPointList(const string &msg, const polyMesh &mesh, const List< scalar > &fld)
const fvMesh & mesh() const
Reference to mesh.
static T gAverage(const PackedBoolList &isMasterElem, const UList< T > &values)
Helper: calculate average.
static writeType writeLevel()
Get/set write level.
virtual const pointField & points() const
Return raw points.
volScalarField scalarField(fieldObject, mesh)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const fvPatchList & patches
dimensionedScalar lambda(viscosity->lookup("lambda"))
#define WarningInFunction
Report a warning using Foam::Warning.
bool valid(const PtrList< ModelType > &l)
const dimensionedScalar mu
Atomic mass unit.
scalar radToDeg(const scalar rad)
Convert radians to degrees.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
line< point, const point & > linePointRef
Line using referred points.
vectorField pointField
pointField is a vectorField.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
List< bool > boolList
Bool container classes.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
PointField< scalar > pointScalarField
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
dimensionedScalar sqrt(const dimensionedScalar &ds)
List< labelList > labelListList
A List of labelList.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
PointField< vector > pointVectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
pointPatchField< vector > pointPatchVectorField
prefixOSstream Pout(cout, "Pout")
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensionedScalar cos(const dimensionedScalar &ds)
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("hex"));labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells]=cellShape(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< small) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &mergedCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]