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 "primitiveMesh.H"
29 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
31 const Foam::labelListList& Foam::primitiveMesh::edgeFaces() const
37 Pout<< "primitiveMesh::edgeFaces() : calculating edgeFaces" << endl;
41 // For checking calls:abort so we can quickly hunt down
43 FatalErrorIn("primitiveMesh::edgeFaces()")
49 efPtr_ = new labelListList(nEdges());
50 invertManyToMany(nEdges(), faceEdges(), *efPtr_);
57 const Foam::labelList& Foam::primitiveMesh::edgeFaces
60 DynamicList<label>& storage
65 return edgeFaces()[edgeI];
69 // Use the fact that pointEdges are sorted in incrementing edge order
70 const edge& e = edges()[edgeI];
71 const labelList& pFaces0 = pointFaces()[e[0]];
72 const labelList& pFaces1 = pointFaces()[e[1]];
79 while (i0 < pFaces0.size() && i1 < pFaces1.size())
81 if (pFaces0[i0] < pFaces1[i1])
85 else if (pFaces0[i0] > pFaces1[i1])
92 storage.append(pFaces0[i0]);
103 const Foam::labelList& Foam::primitiveMesh::edgeFaces(const label edgeI) const
105 return edgeFaces(edgeI, labels_);
109 // ************************************************************************* //