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
29 Mapping class for a fvPatchField.
34 \*---------------------------------------------------------------------------*/
36 #ifndef fvPatchMapper_H
37 #define fvPatchMapper_H
39 #include "fvPatchFieldMapper.H"
40 #include "faceMapper.H"
42 #include "primitiveFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of classes
53 /*---------------------------------------------------------------------------*\
54 Class fvPatchMapper Declaration
55 \*---------------------------------------------------------------------------*/
59 public fvPatchFieldMapper
63 //- Reference to patch
64 const fvPatch& patch_;
66 //- Reference to face mapper
67 const faceMapper& faceMap_;
69 //- Size before mapping
70 const label sizeBeforeMapping_;
73 // Demand-driven private data
75 //- Is the mapping direct
76 mutable bool* directPtr_;
78 //- Direct addressing (only one for of addressing is used)
79 mutable labelList* directAddrPtr_;
81 //- Interpolated addressing (only one for of addressing is used)
82 mutable labelListList* interpolationAddrPtr_;
84 //- Interpolation weights
85 mutable scalarListList* weightsPtr_;
88 // Private Member Functions
90 //- Disallow default bitwise copy construct
96 //- Disallow default bitwise assignment
97 void operator=(const fvPatchMapper&);
100 //- Calculate addressing for mapping with inserted cells
101 void calcAddressing() const;
103 //- Clear out local storage
109 // Static data members
113 //- Construct from mappers
116 const fvPatch& patch,
117 const faceMapper& faceMap
123 virtual ~fvPatchMapper();
129 virtual label size() const
131 return patch_.size();
134 //- Return size of field before mapping
135 virtual label sizeBeforeMapping() const
137 return sizeBeforeMapping_;
140 //- Is the mapping direct
141 virtual bool direct() const
143 return faceMap_.direct();
146 //- Return direct addressing
147 virtual const unallocLabelList& directAddressing() const;
149 //- Return interpolated addressing
150 virtual const labelListList& addressing() const;
152 //- Return interpolaion weights
153 virtual const scalarListList& weights() const;
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 // ************************************************************************* //