createBoundaryFaces.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "sammMesh.H"
00031
00032
00033
00034
00035
00036 bool sammMesh::sammEqualFace
00037 (
00038 const face& boundaryFace,
00039 const face& cellFace
00040 ) const
00041 {
00042
00043
00044
00045
00046 label nEqual = 0;
00047
00048 forAll (cellFace, cellFaceLabelI)
00049 {
00050 const label curCellFaceLabel = cellFace[cellFaceLabelI];
00051
00052 forAll (boundaryFace, bouFaceLabelI)
00053 {
00054 if (boundaryFace[bouFaceLabelI] == curCellFaceLabel)
00055 {
00056 nEqual++;
00057
00058 break;
00059 }
00060 }
00061 }
00062
00063 if (nEqual >= 3)
00064 {
00065 return true;
00066 }
00067 else
00068 {
00069 return false;
00070 }
00071 }
00072
00073
00074 void sammMesh::createBoundaryFaces()
00075 {
00076 forAll(boundary_, patchI)
00077 {
00078 faceList& patchFaces = boundary_[patchI];
00079
00080 const labelListList& PointCells = pointCells();
00081
00082 forAll(patchFaces, faceI)
00083 {
00084 bool found = false;
00085
00086 face& curFace = patchFaces[faceI];
00087 const labelList& facePoints = curFace;
00088
00089 forAll(facePoints, pointI)
00090 {
00091 const labelList& facePointCells =
00092 PointCells[facePoints[pointI]];
00093
00094 forAll(facePointCells, cellI)
00095 {
00096 const faceList& curCellFaces =
00097 cellFaces_[facePointCells[cellI]];
00098
00099 forAll(curCellFaces, cellFaceI)
00100 {
00101 if (sammEqualFace(curCellFaces[cellFaceI], curFace))
00102 {
00103
00104 found = true;
00105
00106
00107
00108 curFace = curCellFaces[cellFaceI];
00109 }
00110 if (found) break;
00111 }
00112 if (found) break;
00113 }
00114 if (found) break;
00115 }
00116 if (!found)
00117 {
00118 FatalErrorIn("sammMesh::createBoundaryFaces()")
00119 << "Face " << faceI
00120 << " does not have neighbour cell." << endl
00121 << " face : " << endl << curFace
00122 << abort(FatalError);
00123 }
00124 }
00125 }
00126 }
00127
00128
00129
Copyright © 2000-2009 OpenCFD Ltd