1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Create intermediate mesh files from SAMM files
28 \*---------------------------------------------------------------------------*/
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // Specialist version of face comparison to deal with
35 // PROSTAR boundary format idiosyncracies
36 bool sammMesh::sammEqualFace
38 const face& boundaryFace,
42 // A PROSTAR boundary face is defined by 4 vertices irrespective
44 // In order to deal with all possibilities, two faces will be
45 // considered equal if three of the vertices are the same.
48 forAll (cellFace, cellFaceLabelI)
50 const label curCellFaceLabel = cellFace[cellFaceLabelI];
52 forAll (boundaryFace, bouFaceLabelI)
54 if (boundaryFace[bouFaceLabelI] == curCellFaceLabel)
74 void sammMesh::createBoundaryFaces()
76 forAll(boundary_, patchI)
78 faceList& patchFaces = boundary_[patchI];
80 const labelListList& PointCells = pointCells();
82 forAll(patchFaces, faceI)
86 face& curFace = patchFaces[faceI];
87 const labelList& facePoints = curFace;
89 forAll(facePoints, pointI)
91 const labelList& facePointCells =
92 PointCells[facePoints[pointI]];
94 forAll(facePointCells, cellI)
96 const faceList& curCellFaces =
97 cellFaces_[facePointCells[cellI]];
99 forAll(curCellFaces, cellFaceI)
101 if (sammEqualFace(curCellFaces[cellFaceI], curFace))
103 // Found the cell face corresponding to this face
106 // Set boundary face to the corresponding cell face
107 // which guarantees it is outward-pointing
108 curFace = curCellFaces[cellFaceI];
118 FatalErrorIn("sammMesh::createBoundaryFaces()")
120 << " does not have neighbour cell." << endl
121 << " face : " << endl << curFace
122 << abort(FatalError);
129 // ************************************************************************* //