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 Foam::cellToCellStencil
28 baseclass for extended cell centred addressing. Contains per cell a
29 list of neighbouring cells and/or boundaryfaces in global addressing.
34 \*---------------------------------------------------------------------------*/
36 #ifndef cellToCellStencil_H
37 #define cellToCellStencil_H
39 #include "globalIndex.H"
42 #include "indirectPrimitivePatch.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class cellToCellStencil Declaration
53 \*---------------------------------------------------------------------------*/
55 class cellToCellStencil
61 const polyMesh& mesh_;
63 //- Global numbering for cells and boundary faces
64 const globalIndex globalNumbering_;
79 static void merge(const label, const labelList&, labelList&);
81 //- Valid boundary faces (not empty and not coupled)
82 void validBoundaryFaces(boolList& isValidBFace) const;
84 //- Return patch of all coupled faces.
85 autoPtr<indirectPrimitivePatch> allCoupledFacesPatch() const;
87 //- Combine operator for labelLists
91 void operator()(labelList& x, const labelList& y) const;
94 //- Collect cell neighbours of faces in global numbering
99 const boolList& nonEmptyFace,
100 const labelList& faceLabels,
101 labelHashSet& globals
104 //- Collect cell neighbours of faces in global numbering
105 labelList calcFaceCells
107 const boolList& nonEmptyFace,
108 const labelList& faceLabels,
109 labelHashSet& globals
117 //- Construct from mesh
118 explicit cellToCellStencil(const polyMesh&);
123 const polyMesh& mesh() const
128 //- Global numbering for cells and boundary faces
129 const globalIndex& globalNumbering() const
131 return globalNumbering_;
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 // ************************************************************************* //