initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / polyMesh / mapPolyMesh / cellMapper / cellMapper.H
blob6d4ece16b2c09c10fe2b83a7f594373cd9e37e6a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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::cellMapper
28 Description
29     This object provides mapping and fill-in information for cell data
30     between the two meshes after the topological change.  It is
31     constructed from mapPolyMesh.
33 SourceFiles
34     cellMapper.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef cellMapper_H
39 #define cellMapper_H
41 #include "morphFieldMapper.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 // Forward declaration of classes
49 class polyMesh;
50 class mapPolyMesh;
52 /*---------------------------------------------------------------------------*\
53                            Class cellMapper Declaration
54 \*---------------------------------------------------------------------------*/
56 class cellMapper
58     public morphFieldMapper
60     // Private data
62         //- Reference to polyMesh
63         const polyMesh& mesh_;
65         //- Reference to mapPolyMesh
66         const mapPolyMesh& mpm_;
68         //- Are there any inserted (unmapped) cells
69         bool insertedCells_;
71         //- Is the mapping direct
72         bool direct_;
75     // Demand-driven private data
77         //- Direct addressing (only one for of addressing is used)
78         mutable labelList* directAddrPtr_;
80         //- Interpolated addressing (only one for of addressing is used)
81         mutable labelListList* interpolationAddrPtr_;
83         //- Interpolation weights
84         mutable scalarListList* weightsPtr_;
86         //- Inserted cells
87         mutable labelList* insertedCellLabelsPtr_;
90     // Private Member Functions
92         //- Disallow default bitwise copy construct
93         cellMapper(const cellMapper&);
95         //- Disallow default bitwise assignment
96         void operator=(const cellMapper&);
99         //- Calculate addressing for mapping with inserted cells
100         void calcAddressing() const;
102         //- Clear out local storage
103         void clearOut();
106 public:
108     // Static data members
110     // Constructors
112         //- Construct from mapPolyMesh
113         cellMapper(const mapPolyMesh& mpm);
116     // Destructor
118         virtual ~cellMapper();
121     // Member Functions
123         //- Return size
124         virtual label size() const;
126         //- Return size before mapping
127         virtual label sizeBeforeMapping() const;
129         //- Is the mapping direct
130         virtual bool direct() const
131         {
132             return direct_;
133         }
135         //- Return direct addressing
136         virtual const unallocLabelList& directAddressing() const;
138         //- Return interpolated addressing
139         virtual const labelListList& addressing() const;
141         //- Return interpolaion weights
142         virtual const scalarListList& weights() const;
144         //- Are there any inserted cells
145         bool insertedObjects() const
146         {
147             return insertedCells_;
148         }
150         //- Return list of inserted cells
151         const labelList& insertedObjectLabels() const;
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 #endif
163 // ************************************************************************* //