cellToCellStencil.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::cellToCellStencil
26 
27 Description
28  baseclass for extended cell centred addressing. Contains per cell a
29  list of neighbouring cells and/or boundaryfaces in global addressing.
30 
31 SourceFiles
32  cellToCellStencil.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef cellToCellStencil_H
37 #define cellToCellStencil_H
38 
39 #include "globalIndex.H"
40 #include "boolList.H"
41 #include "HashSet.H"
42 #include "indirectPrimitivePatch.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class polyMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class cellToCellStencil Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public labelListList
58 {
59  // Private data
60 
61  const polyMesh& mesh_;
62 
63  //- Global numbering for cells and boundary faces
65 
66 
67 protected:
68 
69  //- Merge two lists.
70  static void merge
71  (
72  const label,
73  const label,
74  const labelList&,
75  labelList&
76  );
77 
78  //- Merge two lists.
79  static void merge(const label, const labelList&, labelList&);
80 
81  //- Valid boundary faces (not empty and not coupled)
82  void validBoundaryFaces(boolList& isValidBFace) const;
83 
84  //- Return patch of all coupled faces.
86 
87  //- Combine operator for labelLists
88  class unionEqOp
89  {
90  public:
91  void operator()(labelList& x, const labelList& y) const;
92  };
93 
94  //- Collect cell neighbours of faces in global numbering
95  void insertFaceCells
96  (
97  const label exclude0,
98  const label exclude1,
99  const boolList& nonEmptyFace,
100  const labelList& faceLabels,
101  labelHashSet& globals
102  ) const;
103 
104  //- Collect cell neighbours of faces in global numbering
106  (
107  const boolList& nonEmptyFace,
108  const labelList& faceLabels,
109  labelHashSet& globals
110  ) const;
111 
112 
113 public:
114 
115  // Constructors
116 
117  //- Construct from mesh
118  explicit cellToCellStencil(const polyMesh&);
119 
120 
121  // Member Functions
122 
123  const polyMesh& mesh() const
124  {
125  return mesh_;
126  }
127 
128  //- Global numbering for cells and boundary faces
129  const globalIndex& globalNumbering() const
130  {
131  return globalNumbering_;
132  }
133 
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #endif
144 
145 // ************************************************************************* //
Foam::cellToCellStencil::mesh
const polyMesh & mesh() const
Definition: cellToCellStencil.H:122
Foam::cellToCellStencil::insertFaceCells
void insertFaceCells(const label exclude0, const label exclude1, const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
Definition: cellToCellStencil.C:267
boolList.H
Foam::cellToCellStencil::calcFaceCells
labelList calcFaceCells(const boolList &nonEmptyFace, const labelList &faceLabels, labelHashSet &globals) const
Collect cell neighbours of faces in global numbering.
Definition: cellToCellStencil.C:319
globalIndex.H
Foam::HashSet< label, Hash< label > >
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::cellToCellStencil::globalNumbering
const globalIndex & globalNumbering() const
Global numbering for cells and boundary faces.
Definition: cellToCellStencil.H:128
Foam::cellToCellStencil::globalNumbering_
const globalIndex globalNumbering_
Global numbering for cells and boundary faces.
Definition: cellToCellStencil.H:63
Foam::cellToCellStencil::cellToCellStencil
cellToCellStencil(const polyMesh &)
Construct from mesh.
Definition: cellToCellStencil.C:342
Foam::cellToCellStencil::validBoundaryFaces
void validBoundaryFaces(boolList &isValidBFace) const
Valid boundary faces (not empty and not coupled)
Definition: cellToCellStencil.C:170
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::cellToCellStencil::merge
static void merge(const label, const label, const labelList &, labelList &)
Merge two lists.
Definition: cellToCellStencil.C:35
Foam::cellToCellStencil::unionEqOp::operator()
void operator()(labelList &x, const labelList &y) const
Definition: cellToCellStencil.C:242
HashSet.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:63
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::cellToCellStencil::mesh_
const polyMesh & mesh_
Definition: cellToCellStencil.H:60
Foam::cellToCellStencil::allCoupledFacesPatch
autoPtr< indirectPrimitivePatch > allCoupledFacesPatch() const
Return patch of all coupled faces.
Definition: cellToCellStencil.C:193
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::cellToCellStencil
baseclass for extended cell centred addressing. Contains per cell a list of neighbouring cells and/or...
Definition: cellToCellStencil.H:54
Foam::cellToCellStencil::unionEqOp
Combine operator for labelLists.
Definition: cellToCellStencil.H:87
y
scalar y
Definition: LISASMDCalcMethod1.H:14