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 "enrichedPatch.H"
27 #include "primitiveMesh.H"
28 #include "DynamicList.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
35 void Foam::enrichedPatch::calcPointPoints() const
37 // Calculate point-point addressing
40 FatalErrorIn("void enrichedPatch::calcPointPoints() const")
41 << "Point-point addressing already calculated."
46 // Go through all faces and add the previous and next point as the
47 // neighbour for each point. While inserting points, reject the
48 // duplicates (as every internal edge will be visited twice).
49 List<DynamicList<label, primitiveMesh::edgesPerPoint_> >
50 pp(meshPoints().size());
52 const faceList& lf = localFaces();
54 register bool found = false;
58 const face& curFace = lf[faceI];
60 forAll(curFace, pointI)
62 DynamicList<label, primitiveMesh::edgesPerPoint_>&
63 curPp = pp[curFace[pointI]];
66 label next = curFace.nextLabel(pointI);
85 label prev = curFace.prevLabel(pointI);
105 pointPointsPtr_ = new labelListList(pp.size());
106 labelListList& ppAddr = *pointPointsPtr_;
110 ppAddr[pointI].transfer(pp[pointI]);
115 // ************************************************************************* //