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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "degenerateMatcher.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 Foam::hexMatcher Foam::degenerateMatcher::hex;
32 Foam::wedgeMatcher Foam::degenerateMatcher::wedge;
33 Foam::prismMatcher Foam::degenerateMatcher::prism;
34 Foam::tetWedgeMatcher Foam::degenerateMatcher::tetWedge;
35 Foam::pyrMatcher Foam::degenerateMatcher::pyr;
36 Foam::tetMatcher Foam::degenerateMatcher::tet;
39 Foam::cellShape Foam::degenerateMatcher::match
41 const faceList& faces,
42 const labelList& owner,
44 const labelList& cellFaces
47 // Recognize in order of assumed occurrence.
49 if (hex.matchShape(false, faces, owner, cellI, cellFaces))
51 return cellShape(hex.model(), hex.vertLabels());
53 else if (tet.matchShape(false, faces, owner, cellI, cellFaces))
55 return cellShape(tet.model(), tet.vertLabels());
57 else if (prism.matchShape(false, faces, owner, cellI, cellFaces))
59 return cellShape(prism.model(), prism.vertLabels());
61 else if (pyr.matchShape(false, faces, owner, cellI, cellFaces))
63 return cellShape(pyr.model(), pyr.vertLabels());
65 else if (wedge.matchShape(false, faces, owner, cellI, cellFaces))
67 return cellShape(wedge.model(), wedge.vertLabels());
69 else if (tetWedge.matchShape(false, faces, owner, cellI, cellFaces))
71 return cellShape(tetWedge.model(), tetWedge.vertLabels());
75 return cellShape(*(cellModeller::lookup(0)), labelList(0));
80 Foam::cellShape Foam::degenerateMatcher::match(const faceList& faces)
82 // Do as if single cell mesh; all faces are referenced by a single cell
87 labelList(faces.size(), 0), // cell 0 is owner of all faces
89 identity(faces.size()) // cell 0 consists of all faces
94 Foam::cellShape Foam::degenerateMatcher::match(const cellShape& shape)
96 return match(shape.collapsedFaces());
100 Foam::cellShape Foam::degenerateMatcher::match
102 const primitiveMesh& mesh,
116 // ************************************************************************* //