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