1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
33 \*---------------------------------------------------------------------------*/
35 #ifndef fvSurfaceMapper_H
36 #define fvSurfaceMapper_H
38 #include "morphFieldMapper.H"
40 #include "faceMapper.H"
42 #include "mapPolyMesh.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of classes
51 /*---------------------------------------------------------------------------*\
52 Class fvSurfaceMapper Declaration
53 \*---------------------------------------------------------------------------*/
57 public morphFieldMapper
64 //- Reference to face mapper
65 const faceMapper& faceMap_;
68 // Demand-driven private data
70 //- Direct addressing (only one for of addressing is used)
71 mutable labelList* directAddrPtr_;
73 //- Interpolated addressing (only one for of addressing is used)
74 mutable labelListList* interpolationAddrPtr_;
76 //- Interpolation weights
77 mutable scalarListList* weightsPtr_;
80 mutable labelList* insertedObjectLabelsPtr_;
84 // Private Member Functions
86 //- Disallow default bitwise copy construct
87 fvSurfaceMapper(const fvSurfaceMapper&);
89 //- Disallow default bitwise assignment
90 void operator=(const fvSurfaceMapper&);
93 //- Calculate addressing
94 void calcAddressing() const;
96 //- Clear out local storage
104 //- Construct from components
108 const faceMapper& fMapper
113 virtual ~fvSurfaceMapper();
119 virtual label size() const
121 return mesh_.nInternalFaces();
124 //- Return size of field before mapping
125 virtual label sizeBeforeMapping() const
127 return faceMap_.internalSizeBeforeMapping();
130 //- Is the mapping direct
131 virtual bool direct() const
133 return faceMap_.direct();
136 //- Return direct addressing
137 virtual const labelUList& directAddressing() const;
139 //- Return interpolated addressing
140 virtual const labelListList& addressing() const;
142 //- Return interpolaion weights
143 virtual const scalarListList& weights() const;
145 //- Are there any inserted faces
146 virtual bool insertedObjects() const
148 return faceMap_.insertedObjects();
151 //- Return list of inserted faces
152 virtual const labelList& insertedObjectLabels() const;
154 //- Return flux flip map
155 const labelHashSet& flipFaceFlux() const
157 return faceMap_.flipFaceFlux();
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace Foam
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 // ************************************************************************* //