fvMeshLduAddressing.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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 public:
70 
71  // Constructors
72 
73  //- Construct from components
75  :
76  lduAddressing(mesh.nCells()),
77  lowerAddr_
78  (
79  labelList::subList
80  (
81  mesh.faceOwner(),
82  mesh.nInternalFaces()
83  )
84  ),
85  upperAddr_(mesh.faceNeighbour()),
86  patchAddr_(mesh.boundary().size()),
87  patchSchedule_(mesh.globalData().patchSchedule())
88  {
89  forAll(mesh.boundary(), patchi)
90  {
91  patchAddr_[patchi] = &mesh.boundary()[patchi].faceCells();
92  }
93  }
94 
95  //- Disallow default bitwise copy construction
97 
98 
99  //- Destructor
101  {}
102 
103 
104  // Member Functions
105 
106  //- Return lower addressing (i.e. lower label = upper triangle)
107  const labelUList& lowerAddr() const
108  {
109  return lowerAddr_;
110  }
111 
112  //- Return upper addressing (i.e. upper label)
113  const labelUList& upperAddr() const
114  {
115  return upperAddr_;
116  }
117 
118  //- Return patch addressing
119  const labelUList& patchAddr(const label i) const
120  {
121  return *patchAddr_[i];
122  }
123 
124  // Return patch field evaluation schedule
125  const lduSchedule& patchSchedule() const
126  {
127  return patchSchedule_;
128  }
129 
130 
131  // Member Operators
132 
133  //- Disallow default bitwise assignment
134  void operator=(const fvMeshLduAddressing&) = delete;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
const labelUList & lowerAddr() const
Return lower addressing (i.e. lower label = upper triangle)
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
void operator=(const fvMeshLduAddressing &)=delete
Disallow default bitwise assignment.
const lduSchedule & patchSchedule() const
A List obtained as a section of another List.
Definition: SubList.H:53
dynamicFvMesh & mesh
fvMeshLduAddressing(const fvMesh &mesh)
Construct from components.
faceListList boundary(nPatches)
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
Foam::fvMeshLduAddressing.
label patchi
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const labelUList & upperAddr() const
Return upper addressing (i.e. upper label)
The class contains the addressing required by the lduMatrix: upper, lower and losort.
const labelUList & patchAddr(const label i) const
Return patch addressing.
Namespace for OpenFOAM.
label size() const
Return number of equations.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Definition: fvMesh.C:540