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/>.
28 Mapping class for a fvPatchField.
33 \*---------------------------------------------------------------------------*/
35 #ifndef fvPatchMapper_H
36 #define fvPatchMapper_H
38 #include "fvPatchFieldMapper.H"
39 #include "faceMapper.H"
41 #include "primitiveFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of classes
52 /*---------------------------------------------------------------------------*\
53 Class fvPatchMapper Declaration
54 \*---------------------------------------------------------------------------*/
58 public fvPatchFieldMapper
62 //- Reference to patch
63 const fvPatch& patch_;
65 //- Reference to face mapper
66 const faceMapper& faceMap_;
68 //- Size before mapping
69 const label sizeBeforeMapping_;
72 // Demand-driven private data
74 //- Direct addressing (only one for of addressing is used)
75 mutable labelList* directAddrPtr_;
77 //- Interpolated addressing (only one for of addressing is used)
78 mutable labelListList* interpolationAddrPtr_;
80 //- Interpolation weights
81 mutable scalarListList* weightsPtr_;
84 // Private Member Functions
86 //- Disallow default bitwise copy construct
92 //- Disallow default bitwise assignment
93 void operator=(const fvPatchMapper&);
96 //- Calculate addressing for mapping with inserted cells
97 void calcAddressing() const;
99 //- Clear out local storage
105 // Static data members
109 //- Construct from mappers
112 const fvPatch& patch,
113 const faceMapper& faceMap
118 virtual ~fvPatchMapper();
124 virtual label size() const
126 return patch_.size();
129 //- Return size of field before mapping
130 virtual label sizeBeforeMapping() const
132 return sizeBeforeMapping_;
135 //- Is the mapping direct
136 virtual bool direct() const
138 return faceMap_.direct();
141 //- Return direct addressing
142 virtual const labelUList& directAddressing() const;
144 //- Return interpolated addressing
145 virtual const labelListList& addressing() const;
147 //- Return interpolaion weights
148 virtual const scalarListList& weights() const;
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //