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 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  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  List<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().size()),
103  patchSchedule_(mesh.globalData().patchSchedule())
104  {
105  forAll(mesh.boundary(), patchI)
106  {
107  patchAddr_[patchI] = &mesh.boundary()[patchI].edgeFaces();
108  }
109  }
110 
111  //- Destructor
112  virtual ~faMeshLduAddressing() = default;
113 
114 
115  // Member Functions
116 
117  //- Return number of interfaces
118  virtual label nPatches() const
119  {
120  return patchAddr_.size();
121  }
122 
123  //- Return lower addressing (i.e. lower label = upper triangle)
124  virtual const labelUList& lowerAddr() const
125  {
126  return lowerAddr_;
127  }
128 
129  //- Return upper addressing (i.e. upper label)
130  virtual const labelUList& upperAddr() const
131  {
132  return upperAddr_;
133  }
134 
135  //- Return patch addressing
136  virtual const labelUList& patchAddr(const label i) const
137  {
138  return *patchAddr_[i];
139  }
140 
141  // Return patch field evaluation schedule
142  virtual const lduSchedule& patchSchedule() const
143  {
144  return patchSchedule_;
145  }
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
Foam::lduAddressing
The class contains the addressing required by the lduMatrix: upper, lower and losort.
Definition: lduAddressing.H:114
Foam::faMeshLduAddressing::upperAddr
virtual const labelUList & upperAddr() const
Return upper addressing (i.e. upper label)
Definition: faMeshLduAddressing.H:129
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
faMesh.H
Foam::lduAddressing::size
label size() const
Return number of equations.
Definition: lduAddressing.H:171
Foam::faMeshLduAddressing::lowerAddr
virtual const labelUList & lowerAddr() const
Return lower addressing (i.e. lower label = upper triangle)
Definition: faMeshLduAddressing.H:123
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::faMeshLduAddressing::faMeshLduAddressing
faMeshLduAddressing(const faMesh &mesh)
Construct from components.
Definition: faMeshLduAddressing.H:89
Foam::faMeshLduAddressing::nPatches
virtual label nPatches() const
Return number of interfaces.
Definition: faMeshLduAddressing.H:117
lduAddressing.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faMeshLduAddressing
lduAddressing wrapper for faMesh
Definition: faMeshLduAddressing.H:56
Foam::faMeshLduAddressing::~faMeshLduAddressing
virtual ~faMeshLduAddressing()=default
Destructor.
Foam::faMeshLduAddressing::patchAddr
virtual const labelUList & patchAddr(const label i) const
Return patch addressing.
Definition: faMeshLduAddressing.H:135
Foam::List< label >
Foam::UList< label >
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:77
boundary
faceListList boundary
Definition: createBlockMesh.H:4
Foam::faMeshLduAddressing::patchSchedule
virtual const lduSchedule & patchSchedule() const
Definition: faMeshLduAddressing.H:141