faMeshLduAddressing.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2017 Wikki Ltd
9  Copyright (C) 2019-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::faMeshLduAddressing
29 
30 Description
31  lduAddressing wrapper for faMesh
32 
33 SourceFiles
34  faMeshLduAddressing.C
35 
36 Author
37  Zeljko Tukovic, FMENA
38  Hrvoje Jasak, Wikki Ltd.
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef faMeshLduAddressing_H
43 #define faMeshLduAddressing_H
44 
45 #include "lduAddressing.H"
46 #include "faMesh.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class faMeshLduAddressing Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public lduAddressing
60 {
61  // Private Data
62 
63  //- Lower as a subList of allOwner
64  const labelList::subList lowerAddr_;
65 
66  //- Upper as a reference to neighbour
67  const labelList& upperAddr_;
68 
69  //- Patch addressing as a list of sublists
70  const UPtrList<const labelUList> patchAddr_;
71 
72  //- Patch field evaluation schedule
73  const lduSchedule& patchSchedule_;
74 
75 
76  // Private Member Functions
77 
78  //- No copy construct
80 
81  //- No copy assignment
82  void operator=(const faMeshLduAddressing&) = delete;
83 
84 
85 public:
86 
87  // Constructors
88 
89  //- Construct from components
91  :
92  lduAddressing(mesh.nFaces()),
93  lowerAddr_
94  (
95  labelList::subList
96  (
97  mesh.edgeOwner(),
98  mesh.nInternalEdges()
99  )
100  ),
101  upperAddr_(mesh.edgeNeighbour()),
102  patchAddr_(mesh.boundary().edgeFaces()),
103  patchSchedule_(mesh.globalData().patchSchedule())
104  {}
105 
106 
107  //- Destructor
108  virtual ~faMeshLduAddressing() = default;
109 
110 
111  // Member Functions
112 
113  //- Return number of interfaces
114  virtual label nPatches() const noexcept
115  {
116  return patchAddr_.size();
117  }
118 
119  //- Return lower addressing (i.e. lower label = upper triangle)
120  virtual const labelUList& lowerAddr() const noexcept
121  {
122  return lowerAddr_;
123  }
124 
125  //- Return upper addressing (i.e. upper label)
126  virtual const labelUList& upperAddr() const noexcept
127  {
128  return upperAddr_;
129  }
130 
131  //- Return patch addressing
132  virtual const labelUList& patchAddr(const label patchi) const
133  {
134  return patchAddr_[patchi];
135  }
136 
137  //- Return patch field evaluation schedule
138  virtual const lduSchedule& patchSchedule() const noexcept
139  {
140  return patchSchedule_;
141  }
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::UPtrList::size
label size() const noexcept
The number of elements in the list.
Definition: UPtrListI.H:106
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:54
faMesh.H
Foam::faMeshLduAddressing::nPatches
virtual label nPatches() const noexcept
Return number of interfaces.
Definition: faMeshLduAddressing.H:113
Foam::faMeshLduAddressing::upperAddr
virtual const labelUList & upperAddr() const noexcept
Return upper addressing (i.e. upper label)
Definition: faMeshLduAddressing.H:125
Foam::faMeshLduAddressing::faMeshLduAddressing
faMeshLduAddressing(const faMesh &mesh)
Construct from components.
Definition: faMeshLduAddressing.H:89
Foam::faMeshLduAddressing::patchSchedule
virtual const lduSchedule & patchSchedule() const noexcept
Return patch field evaluation schedule.
Definition: faMeshLduAddressing.H:137
Foam::UPtrList
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:62
lduAddressing.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faMeshLduAddressing::lowerAddr
virtual const labelUList & lowerAddr() const noexcept
Return lower addressing (i.e. lower label = upper triangle)
Definition: faMeshLduAddressing.H:119
Foam::faMeshLduAddressing
lduAddressing wrapper for faMesh
Definition: faMeshLduAddressing.H:56
Foam::faMeshLduAddressing::~faMeshLduAddressing
virtual ~faMeshLduAddressing()=default
Destructor.
Foam::List< label >
Foam::UList< label >
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::faMeshLduAddressing::patchAddr
virtual const labelUList & patchAddr(const label patchi) const
Return patch addressing.
Definition: faMeshLduAddressing.H:131
boundary
faceListList boundary
Definition: createBlockMesh.H:4