lduPrimitiveMeshAssembly.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) 2019 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::lduPrimitiveMeshAssembly
28
29Description
30 An assembly of lduMatrix that is specific inter-region coupling
31 through mapped patches.
32
33SourceFiles
34 lduPrimitiveMeshAssembly.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef lduPrimitiveMeshAssembly_H
39#define lduPrimitiveMeshAssembly_H
40
41#include "fvMesh.H"
42#include "lduPrimitiveMesh.H"
43
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class lduPrimitiveMeshAssembly Declaration
52\*---------------------------------------------------------------------------*/
54:
55 public regIOobject,
56 public lduPrimitiveMesh
57{
58 // Private Data
59
60 //- UPtrList for fvMesh
61 UPtrList<lduMesh> meshes_;
62
63 //- Overwrite patchAddr from lduPrimitiveMesh for assembly ldu address
64 List<labelList> patchAddr_;
65
66 //- Map from original to asembled (-1 for non-existing)
67 labelListList patchMap_;
68
69 //- Map from original to asembled plus extra virtual patch Ids
70 labelListList patchLocalToGlobalMap_;
71
72 //- Map internal faces from local to global
73 labelListList faceMap_;
74
75 //- Map patch local sub-face to global new internal face
76 labelListListList faceBoundMap_;
77
78 //- Map patch local sub-face to nbrCellId
79 labelListListList cellBoundMap_;
80
81 //- Map patch local sub-face to local patch face
82 labelListListList facePatchFaceMap_;
83
84 //- Offset cells
85 labelList cellOffsets_;
86
87
88 // Private Member Functions
89
90 //- Get size of all meshes
91 static label totalSize(const UPtrList<lduMesh>&);
92
93 //- No copy construct
95
96 //- No copy assignment
97 void operator=(const lduPrimitiveMeshAssembly&) = delete;
98
99
100public:
101
102
103 // Static Data
104
105 // Declare name of the class and its debug switch
106 TypeName("lduPrimitiveMeshAssembly");
107
108
109 // Constructors
110
111 //- Construct from UPtrList of lduMesh
113 (
114 const IOobject& io,
116 );
117
118 //- Construct from one mesh
120 (
121 const IOobject& io,
122 const lduMesh&
123 );
124
125
126 //- Destructor
127 virtual ~lduPrimitiveMeshAssembly() = default;
128
129
130 // Public Member Functions
131
132 //- Update mappings
133 template<class Type>
134 void update
135 (
137 );
138
139 //- Size maps
140 void updateMaps(const UPtrList<lduMesh>&);
141
142 //- Find nrb mesh Id for mapped patches
143 label findNbrMeshId(const polyPatch& pp,const label iMesh) const;
144
145
146 // Access
147
148 //- Return the object registry
149 virtual const objectRegistry& thisDb() const
150 {
151 return meshes_[0].thisDb();
152 }
153
154 //- Return true if thisDb() is a valid DB
155 virtual bool hasDb() const
156 {
157 return true;
158 }
159
160 //- Return patch addressing
161 virtual const labelUList& patchAddr(const label patchNo) const
162 {
163 return patchAddr_[patchNo];
164 }
165
166 //- Return patchMap
167 const labelListList& patchMap() const
168 {
169 return patchMap_;
170 }
171
172 //- Return patchLocalToGlobalMap
174 {
175 return patchLocalToGlobalMap_;
176 }
177
178 //- Return boundary face map
179 const labelListListList& faceBoundMap() const
180 {
181 return faceBoundMap_;
182 }
183
184 //- Return patch local sub-face to nbrCellId map
185 const labelListListList& cellBoundMap() const
186 {
187 return cellBoundMap_;
188 }
189
190 //- Return patch local sub-face to local patch face map
192 {
193 return facePatchFaceMap_;
194 }
195
196 //- Return cellOffsets
197 const labelList& cellOffsets() const
198 {
199 return cellOffsets_;
200 }
201
202 //- Return faceMap
203 const labelListList& faceMap() const
204 {
205 return faceMap_;
206 }
207
208 //- Return patchAddr
209 const List<labelList>& patchAddr() const
210 {
211 return patchAddr_;
212 }
213
214 //- Return fvMeshes
215 const UPtrList<lduMesh>& meshes() const
216 {
217 return meshes_;
218 }
219
220 //- Write Data
221 virtual bool writeData(Ostream&) const
222 {
224 return false;
225 }
226};
227
228
229// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230
231} // End namespace Foam
232
233// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234
235#ifdef NoRepository
237#endif
238
239// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240
241#endif
242
243// ************************************************************************* //
Generic GeometricField class.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:71
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:63
An assembly of lduMatrix that is specific inter-region coupling through mapped patches.
virtual const objectRegistry & thisDb() const
Return the object registry.
const labelListListList & cellBoundMap() const
Return patch local sub-face to nbrCellId map.
void updateMaps(const UPtrList< lduMesh > &)
Size maps.
virtual const labelUList & patchAddr(const label patchNo) const
Return patch addressing.
const labelList & cellOffsets() const
Return cellOffsets.
const labelListListList & faceBoundMap() const
Return boundary face map.
label findNbrMeshId(const polyPatch &pp, const label iMesh) const
Find nrb mesh Id for mapped patches.
const UPtrList< lduMesh > & meshes() const
Return fvMeshes.
TypeName("lduPrimitiveMeshAssembly")
const labelListList & patchMap() const
Return patchMap.
const labelListList & faceMap() const
Return faceMap.
virtual bool hasDb() const
Return true if thisDb() is a valid DB.
const List< labelList > & patchAddr() const
Return patchAddr.
virtual bool writeData(Ostream &) const
Write Data.
const labelListListList & facePatchFaceMap() const
Return patch local sub-face to local patch face map.
const labelListList & patchLocalToGlobalMap() const
Return patchLocalToGlobalMap.
virtual ~lduPrimitiveMeshAssembly()=default
Destructor.
Simplest concrete lduMesh that stores the addressing needed by lduMatrix.
Registry of regIOobjects.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
mesh update()
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73