1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Create intermediate mesh files from SAMM files
27 \*---------------------------------------------------------------------------*/
30 #include "polyPatch.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 void sammMesh::createPolyBoundary()
36 label nBoundaryFacesFound = 0;
38 polyBoundaryPatchStartIndices_.setSize(boundary_.size());
40 label nCreatedFaces = nInternalFaces_;
42 const labelListList& PointCells = pointCells();
44 forAll (boundary_, patchI)
46 const faceList& curShapePatch = boundary_[patchI];
48 polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
50 forAll (curShapePatch, faceI)
54 const face& curFace = curShapePatch[faceI];
56 meshFaces_[nCreatedFaces] = curFace;
58 // Must find which cell this face belongs to in order to
59 // mark it in the cellPolys_
60 const labelList& facePoints = curFace;
62 forAll(facePoints, pointI)
64 const labelList& facePointCells =
65 PointCells[facePoints[pointI]];
67 forAll(facePointCells, cellI)
69 const faceList& curCellFaces =
70 cellFaces_[facePointCells[cellI]];
72 forAll(curCellFaces, cellFaceI)
74 if (curCellFaces[cellFaceI] == curFace)
76 // Found the cell face corresponding to this face
82 cellPolys_[facePointCells[cellI]][cellFaceI]
88 "void sammMesh::createPolyBoundary()"
89 ) << "This looks like an already detected "
94 cellPolys_[facePointCells[cellI]][cellFaceI] =
97 nBoundaryFacesFound++;
110 // reset the size of the face list
111 meshFaces_.setSize(nCreatedFaces);
113 Info << "Number of boundary faces: " << nBoundaryFacesFound << endl;
114 Info << "Total number of faces: " << nCreatedFaces << endl;
118 List<polyPatch* > sammMesh::polyBoundaryPatches(const polyMesh& pMesh)
120 List<polyPatch* > p(boundary_.size());
122 forAll (boundary_, patchI)
124 const faceList& curShapePatch = boundary_[patchI];
126 p[patchI] = polyPatch::New
130 curShapePatch.size(),
131 polyBoundaryPatchStartIndices_[patchI],
136 p[patchI]->physicalType() = patchPhysicalTypes_[patchI];
143 // ************************************************************************* //