Loading...
Searching...
No Matches
fvMeshPrimitiveLduAddressing.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) 2015-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::fvMeshPrimitiveLduAddressing
28
29Description
30 Variant of fvMeshLduAddressing that contains addressing instead of
31 slices.
32
33 Alternatively use lduPrimitiveMesh but that assumes there are only
34 lduInterfaces and not also generic patches.
35
36SourceFiles
37 fvMeshPrimitiveLduAddressing.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef fvMeshPrimitiveLduAddressing_H
42#define fvMeshPrimitiveLduAddressing_H
43
44#include "lduPrimitiveMesh.H"
45#include "lduAddressing.H"
46#include "fvMesh.H"
47#include "globalMeshData.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
54/*---------------------------------------------------------------------------*\
55 Class fvMeshPrimitiveLduAddressing Declaration
56\*---------------------------------------------------------------------------*/
57
58class fvMeshPrimitiveLduAddressing
59:
60 public lduAddressing
61{
62 // Private Data
63
64 //- Lower (face to owner addressing)
65 const labelList lowerAddr_;
66
67 //- Upper (face to neighbour addressing)
68 const labelList upperAddr_;
69
70 //- Patch addressing as a list of sublists
71 const UPtrList<const labelUList> patchAddr_;
72
73 //- Patch field evaluation schedule
74 const lduSchedule patchSchedule_;
75
76
77 // Private Member Functions
78
79 //- No copy construct
80 fvMeshPrimitiveLduAddressing
81 (
82 const fvMeshPrimitiveLduAddressing&
83 ) = delete;
84
85 //- No copy assignment
86 void operator=(const fvMeshPrimitiveLduAddressing&) = delete;
87
88
89public:
90
91 // Constructors
92
93 //- Construct from mesh
94 explicit fvMeshPrimitiveLduAddressing(const fvMesh& mesh);
95
96 //- Construct from components
97 fvMeshPrimitiveLduAddressing
98 (
99 const label nCells,
103 const lduSchedule& ps
104 );
105
106
107 //- Destructor
108 virtual ~fvMeshPrimitiveLduAddressing() = default;
109
110
111 // Member Functions
112
113 //- Return lower addressing (i.e. lower label = upper triangle)
114 virtual const labelUList& lowerAddr() const noexcept
115 {
116 return lowerAddr_;
117 }
118
119 //- Return upper addressing (i.e. upper label)
120 virtual const labelUList& upperAddr() const noexcept
122 return upperAddr_;
123 }
124
125 //- Return patch addressing for given patch
126 virtual const labelUList& patchAddr(const label patchi) const
127 {
128 return patchAddr_[patchi];
130
131 //- Return patch field evaluation schedule
132 virtual const lduSchedule& patchSchedule() const noexcept
133 {
134 return patchSchedule_;
135 }
136
137 //- Given additional addressing (in the form of additional neighbour
138 //- cells, i.e. like cellCells)
139 //
140 // - add any additional faces
141 // - sort in upper-triangular order
142 // - construct cell-faces equivalent of given nbrCells
143 // (so e.g. nbrCellFaces[cellI][0] is the face corresponding to
144 // the cell nbrCells[cellI][0])
145 // (note: face in nbrCellFaces is -1 if the nbrCell is not local)
146 // - construct additional processor interface addressing:
147 // per processor the local and the remote cell.
148 // - return old-to-new face mapping
150 (
151 const lduAddressing& addr,
152 const labelListList& nbrCells,
153 label& nExtraFaces,
154 labelList& lower,
155 labelList& upper,
156 labelListList& nbrCellFaces,
157 const globalIndex&,
158 const labelList& globalCellIDs,
159 labelListList& localFaceCells,
160 labelListList& remoteFaceCells
161 );
162
163 //- Return off-diagonal index given owner and neighbour label.
164 // \return -1 if not found
165 static label triIndex(const lduAddressing&, const label, const label);
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
virtual ~fvMeshPrimitiveLduAddressing()=default
Destructor.
virtual const labelUList & patchAddr(const label patchi) const
Return patch addressing for given patch.
static label triIndex(const lduAddressing &, const label, const label)
Return off-diagonal index given owner and neighbour label.
virtual const labelUList & lowerAddr() const noexcept
Return lower addressing (i.e. lower label = upper triangle).
virtual const lduSchedule & patchSchedule() const noexcept
Return patch field evaluation schedule.
static labelList addAddressing(const lduAddressing &addr, const labelListList &nbrCells, label &nExtraFaces, labelList &lower, labelList &upper, labelListList &nbrCellFaces, const globalIndex &, const labelList &globalCellIDs, labelListList &localFaceCells, labelListList &remoteFaceCells)
Given additional addressing (in the form of additional neighbour cells, i.e. like cellCells).
virtual const labelUList & upperAddr() const noexcept
Return upper addressing (i.e. upper label).
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
Definition globalIndex.H:77
The class contains the addressing required by the lduMatrix: upper, lower and losort.
lduAddressing(const lduAddressing &)=delete
No copy construct.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
List< lduScheduleEntry > lduSchedule
A List of lduSchedule entries.
Definition lduSchedule.H:46
const direction noexcept
Definition scalarImpl.H:265
UList< label > labelUList
A UList of labels.
Definition UList.H:75