BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / finiteVolume / fvMesh / fvMeshMapper / fvPatchMapper.H
blobaa169fa082a6d5364ff47c199c5caf88fe545ed7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Class
25     Foam::fvPatchMapper
27 Description
28     Mapping class for a fvPatchField.
30 SourceFiles
31     fvPatchMapper.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef fvPatchMapper_H
36 #define fvPatchMapper_H
38 #include "fvPatchFieldMapper.H"
39 #include "faceMapper.H"
40 #include "fvPatch.H"
41 #include "primitiveFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 // Forward declaration of classes
49 class fvPatch;
50 class mapPolyMesh;
52 /*---------------------------------------------------------------------------*\
53                        Class fvPatchMapper Declaration
54 \*---------------------------------------------------------------------------*/
56 class fvPatchMapper
58     public fvPatchFieldMapper
60     // Private data
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
87         fvPatchMapper
88         (
89             const fvPatchMapper&
90         );
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
100         void clearOut();
103 public:
105     // Static data members
107     // Constructors
109         //- Construct from mappers
110         fvPatchMapper
111         (
112             const fvPatch& patch,
113             const faceMapper& faceMap
114         );
117     //- Destructor
118     virtual ~fvPatchMapper();
121     // Member Functions
123         //- Return size
124         virtual label size() const
125         {
126             return patch_.size();
127         }
129         //- Return size of field before mapping
130         virtual label sizeBeforeMapping() const
131         {
132             return sizeBeforeMapping_;
133         }
135         //- Is the mapping direct
136         virtual bool direct() const
137         {
138             return faceMap_.direct();
139         }
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 #endif
161 // ************************************************************************* //