Loading...
Searching...
No Matches
fvSurfaceMapper.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) 2011-2013 OpenFOAM Foundation
9 Copyright (C) 2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fvSurfaceMapper
29
30Description
31 A finiteVolume surface mapper.
32
33SourceFiles
34 fvSurfaceMapper.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_fvSurfaceMapper_H
39#define Foam_fvSurfaceMapper_H
40
41#include "morphFieldMapper.H"
42#include "fvMesh.H"
43#include "faceMapper.H"
44#include "HashSet.H"
45#include "mapPolyMesh.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
52/*---------------------------------------------------------------------------*\
53 Class fvSurfaceMapper Declaration
54\*---------------------------------------------------------------------------*/
55
56class fvSurfaceMapper
57:
58 public morphFieldMapper
59{
60 // Private Data
61
62 //- Reference to mesh
63 const fvMesh& mesh_;
64
65 //- Reference to face mapper
66 const faceMapper& faceMap_;
67
68
69 // Demand-Driven Data
70
71 //- Direct addressing (only one for of addressing is used)
72 mutable std::unique_ptr<labelList> directAddrPtr_;
73
74 //- Interpolated addressing (only one for of addressing is used)
75 mutable std::unique_ptr<labelListList> interpAddrPtr_;
76
77 //- Interpolation weights
78 mutable std::unique_ptr<scalarListList> weightsPtr_;
79
80 //- Inserted faces
81 mutable std::unique_ptr<labelList> insertedObjectsPtr_;
82
83
84
85 // Private Member Functions
86
87 //- No copy construct
88 fvSurfaceMapper(const fvSurfaceMapper&) = delete;
89
90 //- No copy assignment
91 void operator=(const fvSurfaceMapper&) = delete;
92
93
94 //- Calculate addressing
95 void calcAddressing() const;
96
97
98public:
99
100 // Constructors
101
102 //- Construct from components
103 fvSurfaceMapper
104 (
105 const fvMesh& mesh,
106 const faceMapper& mapper
107 );
108
109
110 //- Destructor
111 virtual ~fvSurfaceMapper();
112
113
114 // Member Functions
115
116 //- Return size
117 virtual label size() const
118 {
119 return mesh_.nInternalFaces();
120 }
121
122 //- Return size of field before mapping
123 virtual label sizeBeforeMapping() const
124 {
125 return faceMap_.internalSizeBeforeMapping();
126 }
127
128 //- Is the mapping direct
129 virtual bool direct() const
130 {
131 return faceMap_.direct();
132 }
133
134 //- Has unmapped elements
135 virtual bool hasUnmapped() const
137 return insertedObjects();
138 }
139
140 //- Return direct addressing
141 virtual const labelUList& directAddressing() const;
142
143 //- Return interpolated addressing
144 virtual const labelListList& addressing() const;
145
146 //- Return interpolation weights
147 virtual const scalarListList& weights() const;
148
149 //- Are there any inserted faces
150 virtual bool insertedObjects() const
151 {
152 return faceMap_.insertedObjects();
153 }
154
155 //- Return list of inserted faces
156 virtual const labelList& insertedObjectLabels() const;
157
158 //- Return flux flip map
159 const labelHashSet& flipFaceFlux() const
161 return faceMap_.flipFaceFlux();
162 }
163};
164
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168} // End namespace Foam
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172#endif
173
174// ************************************************************************* //
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition faceMapper.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
virtual label size() const
Return size.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolation weights.
virtual bool hasUnmapped() const
Has unmapped elements.
virtual const labelUList & directAddressing() const
Return direct addressing.
const labelHashSet & flipFaceFlux() const
Return flux flip map.
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
virtual ~fvSurfaceMapper()
Destructor.
virtual bool insertedObjects() const
Are there any inserted faces.
virtual bool direct() const
Is the mapping direct.
morphFieldMapper()=default
Default construct.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
List< scalarList > scalarListList
List of scalarList.
Definition scalarList.H:35
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition HashSet.H:85
UList< label > labelUList
A UList of labels.
Definition UList.H:75