createPolyBoundary.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 #include "polyPatch.H"
00032
00033
00034
00035 void sammMesh::createPolyBoundary()
00036 {
00037 label nBoundaryFacesFound = 0;
00038
00039 polyBoundaryPatchStartIndices_.setSize(boundary_.size());
00040
00041 label nCreatedFaces = nInternalFaces_;
00042
00043 const labelListList& PointCells = pointCells();
00044
00045 forAll (boundary_, patchI)
00046 {
00047 const faceList& curShapePatch = boundary_[patchI];
00048
00049 polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
00050
00051 forAll (curShapePatch, faceI)
00052 {
00053 bool found = false;
00054
00055 const face& curFace = curShapePatch[faceI];
00056
00057 meshFaces_[nCreatedFaces] = curFace;
00058
00059
00060
00061 const labelList& facePoints = curFace;
00062
00063 forAll(facePoints, pointI)
00064 {
00065 const labelList& facePointCells =
00066 PointCells[facePoints[pointI]];
00067
00068 forAll(facePointCells, cellI)
00069 {
00070 const faceList& curCellFaces =
00071 cellFaces_[facePointCells[cellI]];
00072
00073 forAll(curCellFaces, cellFaceI)
00074 {
00075 if (curCellFaces[cellFaceI] == curFace)
00076 {
00077
00078 found = true;
00079
00080
00081 if
00082 (
00083 cellPolys_[facePointCells[cellI]][cellFaceI]
00084 != -1
00085 )
00086 {
00087 FatalErrorIn
00088 (
00089 "void sammMesh::createPolyBoundary()"
00090 ) << "This looks like an already detected "
00091 << "internal face"
00092 << abort(FatalError);
00093 }
00094
00095 cellPolys_[facePointCells[cellI]][cellFaceI] =
00096 nCreatedFaces;
00097
00098 nBoundaryFacesFound++;
00099 }
00100 if (found) break;
00101 }
00102 if (found) break;
00103 }
00104 if (found) break;
00105 }
00106
00107 nCreatedFaces++;
00108 }
00109 }
00110
00111
00112 meshFaces_.setSize(nCreatedFaces);
00113
00114 Info << "Number of boundary faces: " << nBoundaryFacesFound << endl;
00115 Info << "Total number of faces: " << nCreatedFaces << endl;
00116 }
00117
00118
00119 List<polyPatch* > sammMesh::polyBoundaryPatches(const polyMesh& pMesh)
00120 {
00121 List<polyPatch* > p(boundary_.size());
00122
00123 forAll (boundary_, patchI)
00124 {
00125 const faceList& curShapePatch = boundary_[patchI];
00126
00127 p[patchI] = polyPatch::New
00128 (
00129 patchTypes_[patchI],
00130 patchNames_[patchI],
00131 curShapePatch.size(),
00132 polyBoundaryPatchStartIndices_[patchI],
00133 patchI,
00134 pMesh.boundaryMesh()
00135 ).ptr();
00136
00137 p[patchI]->physicalType() = patchPhysicalTypes_[patchI];
00138 }
00139
00140 return p;
00141 }
00142
00143
00144
Copyright © 2000-2009 OpenCFD Ltd