fvMeshLduAddressing.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 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::fvMeshLduAddressing
26 
27 Description
28  Foam::fvMeshLduAddressing
29 
30 SourceFiles
31  fvMeshLduAddressing.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fvMeshLduAddressing_H
36 #define fvMeshLduAddressing_H
37 
38 #include "lduAddressing.H"
39 #include "fvMesh.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class fvMeshLduAddressing Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public lduAddressing
53 {
54  // Private data
55 
56  //- Lower as a subList of allOwner
57  labelList::subList lowerAddr_;
58 
59  //- Upper as a reference to neighbour
60  const labelList& upperAddr_;
61 
62  //- Patch addressing as a list of sublists
63  List<const labelUList*> patchAddr_;
64 
65  //- Patch field evaluation schedule
66  const lduSchedule& patchSchedule_;
67 
68 
69  // Private Member Functions
70 
71  //- Disallow default bitwise copy construct
73 
74  //- Disallow default bitwise assignment
75  void operator=(const fvMeshLduAddressing&);
76 
77 
78 public:
79 
80  // Constructors
81 
82  //- Construct from components
84  :
85  lduAddressing(mesh.nCells()),
86  lowerAddr_
87  (
88  labelList::subList
89  (
90  mesh.faceOwner(),
91  mesh.nInternalFaces()
92  )
93  ),
94  upperAddr_(mesh.faceNeighbour()),
95  patchAddr_(mesh.boundary().size()),
96  patchSchedule_(mesh.globalData().patchSchedule())
97  {
98  forAll(mesh.boundary(), patchI)
99  {
100  patchAddr_[patchI] = &mesh.boundary()[patchI].faceCells();
101  }
102  }
103 
104 
105  //- Destructor
107  {}
108 
109 
110  // Member Functions
111 
112  //- Return lower addressing (i.e. lower label = upper triangle)
113  const labelUList& lowerAddr() const
114  {
115  return lowerAddr_;
116  }
117 
118  //- Return upper addressing (i.e. upper label)
119  const labelUList& upperAddr() const
120  {
121  return upperAddr_;
122  }
123 
124  //- Return patch addressing
125  const labelUList& patchAddr(const label i) const
126  {
127  return *patchAddr_[i];
128  }
129 
130  // Return patch field evaluation schedule
131  const lduSchedule& patchSchedule() const
132  {
133  return patchSchedule_;
134  }
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
label size() const
Return number of equations.
faceListList boundary(nPatches)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const labelUList & patchAddr(const label i) const
Return patch addressing.
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
dynamicFvMesh & mesh
Namespace for OpenFOAM.
const labelUList & upperAddr() const
Return upper addressing (i.e. upper label)
#define forAll(list, i)
Definition: UList.H:421
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
A List obtained as a section of another List.
Definition: SubList.H:53
const lduSchedule & patchSchedule() const
The class contains the addressing required by the lduMatrix: upper, lower and losort.
const labelUList & lowerAddr() const
Return lower addressing (i.e. lower label = upper triangle)
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:552
Foam::fvMeshLduAddressing.