initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / OpenFOAM / meshes / polyMesh / mapPolyMesh / faceMapper / faceMapper.H
blob34d5c72bcec00747fc994fe888542b4e7f593089
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
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 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
19     for more details.
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
25 Class
26     Foam::faceMapper
28 Description
29     This object provides mapping and fill-in information for face data
30     between the two meshes after the topological change.  It is
31     constructed from mapPolyMesh.
33 SourceFiles
34     faceMapper.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef faceMapper_H
39 #define faceMapper_H
41 #include "morphFieldMapper.H"
42 #include "labelHashSet.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 // Forward declaration of classes
50 class polyMesh;
51 class mapPolyMesh;
53 /*---------------------------------------------------------------------------*\
54                            Class faceMapper Declaration
55 \*---------------------------------------------------------------------------*/
57 class faceMapper
59     public morphFieldMapper
61     // Private data
63         //- Reference to polyMesh
64         const polyMesh& mesh_;
66         //- Reference to mapPolyMesh
67         const mapPolyMesh& mpm_;
69         //- Are there any inserted (unmapped) faces
70         bool insertedFaces_;
72         //- Is the mapping direct
73         bool direct_;
76     // Demand-driven private data
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_;
87         //- Inserted faces
88         mutable labelList* insertedFaceLabelsPtr_;
91     // Private Member Functions
93         //- Disallow default bitwise copy construct
94         faceMapper(const faceMapper&);
96         //- Disallow default bitwise assignment
97         void operator=(const faceMapper&);
100         //- Calculate addressing for mapping with inserted faces
101         void calcAddressing() const;
103         //- Clear out local storage
104         void clearOut();
107 public:
109     // Static data members
111     // Constructors
113         //- Construct from mapPolyMesh
114         faceMapper(const mapPolyMesh& mpm);
117     // Destructor
119         virtual ~faceMapper();
122     // Member Functions
124         //- Return size
125         virtual label size() const;
127         //- Return size of field before mapping
128         virtual label sizeBeforeMapping() const;
130         //- Return number of internal faces before mapping
131         virtual label internalSizeBeforeMapping() const;
133         //- Is the mapping direct
134         virtual bool direct() const
135         {
136             return direct_;
137         }
139         //- Return direct addressing
140         virtual const unallocLabelList& directAddressing() const;
142         //- Return interpolated addressing
143         virtual const labelListList& addressing() const;
145         //- Return interpolaion weights
146         virtual const scalarListList& weights() const;
148         //- Return flux flip map
149         virtual const labelHashSet& flipFaceFlux() const;
151         //- Return number of old internalFaces
152         virtual label nOldInternalFaces() const;
154         //- Return old patch starts
155         virtual const labelList& oldPatchStarts() const;
157         //- Return old patch sizes
158         virtual const labelList& oldPatchSizes() const;
160         //- Are there any inserted faces
161         virtual bool insertedObjects() const
162         {
163             return insertedFaces_;
164         }
166         //- Return list of inserted faces
167         virtual const labelList& insertedObjectLabels() const;
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #endif
179 // ************************************************************************* //