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