fvPatchMapper.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::fvPatchMapper
28
29Description
30 Mapping class for a fvPatchField.
31
32SourceFiles
33 fvPatchMapper.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef fvPatchMapper_H
38#define fvPatchMapper_H
39
40#include "fvPatchFieldMapper.H"
41#include "faceMapper.H"
42#include "fvPatch.H"
43#include "primitiveFields.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward declaration of classes
51class fvPatch;
52class mapPolyMesh;
53
54/*---------------------------------------------------------------------------*\
55 Class fvPatchMapper Declaration
56\*---------------------------------------------------------------------------*/
58class fvPatchMapper
59:
61{
62 // Private data
63
64 //- Reference to patch
65 const fvPatch& patch_;
66
67 //- Reference to face mapper
68 const faceMapper& faceMap_;
69
70 //- Size before mapping
71 const label sizeBeforeMapping_;
72
73
74 // Demand-driven private data
75
76 mutable bool hasUnmapped_;
77
78 //- Direct addressing (only one for of addressing is used)
79 mutable labelList* directAddrPtr_;
80
81 //- Interpolated addressing (only one for of addressing is used)
82 mutable labelListList* interpolationAddrPtr_;
83
84 //- Interpolation weights
85 mutable scalarListList* weightsPtr_;
86
87
88 // Private Member Functions
89
90 //- No copy construct
91 fvPatchMapper(const fvPatchMapper&) = delete;
92
93 //- No copy assignment
94 void operator=(const fvPatchMapper&) = delete;
95
96
97 //- Calculate addressing for mapping with inserted cells
98 void calcAddressing() const;
99
100 //- Clear out local storage
101 void clearOut();
102
103
104public:
105
106 // Static data members
107
108 // Constructors
109
110 //- Construct from mappers
112 (
113 const fvPatch& patch,
114 const faceMapper& faceMap
115 );
116
117
118 //- Destructor
119 virtual ~fvPatchMapper();
120
121
122 // Member Functions
123
124 //- Return size
125 virtual label size() const
126 {
127 return patch_.size();
128 }
129
130 //- Return size of field before mapping
131 virtual label sizeBeforeMapping() const
132 {
133 return sizeBeforeMapping_;
134 }
135
136 //- Is the mapping direct
137 virtual bool direct() const
138 {
139 return faceMap_.direct();
140 }
142 virtual bool hasUnmapped() const
143 {
144 return hasUnmapped_;
145 }
146
147 //- Return direct addressing
148 virtual const labelUList& directAddressing() const;
149
150 //- Return interpolated addressing
151 virtual const labelListList& addressing() const;
152
153 //- Return interpolation weights
154 virtual const scalarListList& weights() const;
155
156};
157
158
159// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160
161} // End namespace Foam
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165#endif
166
167// ************************************************************************* //
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition: faceMapper.H:60
virtual bool direct() const
Is the mapping direct.
Definition: faceMapper.H:133
A FieldMapper for finite-volume patch fields.
Mapping class for a fvPatchField.
Definition: fvPatchMapper.H:60
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
Any unmapped values?
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual bool direct() const
Is the mapping direct.
virtual ~fvPatchMapper()
Destructor.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
virtual label size() const
Return size.
Definition: fvPatch.H:185
Namespace for OpenFOAM.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Specialisations of Field<T> for scalar, vector and tensor.