1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 \*---------------------------------------------------------------------------*/
36 #ifndef fvSurfaceMapper_H
37 #define fvSurfaceMapper_H
39 #include "morphFieldMapper.H"
41 #include "faceMapper.H"
43 #include "mapPolyMesh.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of classes
52 /*---------------------------------------------------------------------------*\
53 Class fvSurfaceMapper Declaration
54 \*---------------------------------------------------------------------------*/
58 public morphFieldMapper
65 //- Reference to face mapper
66 const faceMapper& faceMap_;
69 // Demand-driven private data
71 //- Direct addressing (only one for of addressing is used)
72 mutable labelList* directAddrPtr_;
74 //- Interpolated addressing (only one for of addressing is used)
75 mutable labelListList* interpolationAddrPtr_;
77 //- Interpolation weights
78 mutable scalarListList* weightsPtr_;
81 mutable labelList* insertedObjectLabelsPtr_;
85 // Private Member Functions
87 //- Disallow default bitwise copy construct
88 fvSurfaceMapper(const fvSurfaceMapper&);
90 //- Disallow default bitwise assignment
91 void operator=(const fvSurfaceMapper&);
94 //- Calculate addressing
95 void calcAddressing() const;
97 //- Clear out local storage
105 //- Construct from components
109 const faceMapper& fMapper
115 virtual ~fvSurfaceMapper();
121 virtual label size() const
123 return mesh_.nInternalFaces();
126 //- Return size of field before mapping
127 virtual label sizeBeforeMapping() const
129 return faceMap_.internalSizeBeforeMapping();
132 //- Is the mapping direct
133 virtual bool direct() const
135 return faceMap_.direct();
138 //- Return direct addressing
139 virtual const unallocLabelList& directAddressing() const;
141 //- Return interpolated addressing
142 virtual const labelListList& addressing() const;
144 //- Return interpolaion weights
145 virtual const scalarListList& weights() const;
147 //- Are there any inserted faces
148 virtual bool insertedObjects() const
150 return faceMap_.insertedObjects();
153 //- Return list of inserted faces
154 virtual const labelList& insertedObjectLabels() const;
156 //- Return flux flip map
157 const labelHashSet& flipFaceFlux() const
159 return faceMap_.flipFaceFlux();
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 } // End namespace Foam
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 // ************************************************************************* //