1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Create intermediate mesh files from SAMM files
27 \*---------------------------------------------------------------------------*/
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 // Specialist version of face comparison to deal with
34 // PROSTAR boundary format idiosyncracies
35 bool sammMesh::sammEqualFace
37 const face& boundaryFace,
41 // A PROSTAR boundary face is defined by 4 vertices irrespective
43 // In order to deal with all possibilities, two faces will be
44 // considered equal if three of the vertices are the same.
47 forAll(cellFace, cellFaceLabelI)
49 const label curCellFaceLabel = cellFace[cellFaceLabelI];
51 forAll(boundaryFace, bouFaceLabelI)
53 if (boundaryFace[bouFaceLabelI] == curCellFaceLabel)
73 void sammMesh::createBoundaryFaces()
75 forAll(boundary_, patchI)
77 faceList& patchFaces = boundary_[patchI];
79 const labelListList& PointCells = pointCells();
81 forAll(patchFaces, faceI)
85 face& curFace = patchFaces[faceI];
86 const labelList& facePoints = curFace;
88 forAll(facePoints, pointI)
90 const labelList& facePointCells =
91 PointCells[facePoints[pointI]];
93 forAll(facePointCells, cellI)
95 const faceList& curCellFaces =
96 cellFaces_[facePointCells[cellI]];
98 forAll(curCellFaces, cellFaceI)
100 if (sammEqualFace(curCellFaces[cellFaceI], curFace))
102 // Found the cell face corresponding to this face
105 // Set boundary face to the corresponding cell face
106 // which guarantees it is outward-pointing
107 curFace = curCellFaces[cellFaceI];
117 FatalErrorIn("sammMesh::createBoundaryFaces()")
119 << " does not have neighbour cell." << endl
120 << " face : " << endl << curFace
121 << abort(FatalError);
128 // ************************************************************************* //